Linux

YouCompleteMe can't find local header files

半城伤御伤魂 提交于 2021-02-19 07:43:30
问题 I currently have a project that is structured as so project | |----src/ | | | |----test.cpp | |----include/ | | | |----test.hpp | |----.ycm_extra_conf.py But I can't get YouCompleteMe to recognize test.hpp when it's include in test.cpp #include "test.hpp" This is the output of my :YcmDebugInfo Printing YouCompleteMe debug information... -- Client logfile: /tmp/ycm_tcrryhfo.log -- Server Python interpreter: /usr/bin/python2.7 -- Server Python version: 2.7.14 -- Server has Clang support

怎样通过互联网ssh访问家里电脑

半城伤御伤魂 提交于 2021-02-19 06:57:20
需求:用可以上网的公司windows电脑连接家里的manjaro linux电脑。。 环境情况:公司电脑为内网,通过登录出口服务器连接互联网。家里的电脑也为内网,通过连接无线路由器连接外网。路由器有公网IP。 解决办法:内网穿透,只需穿透家里内网环境即可。 内网穿透的方法见博客文章 https://blog.csdn.net/zbgjhy88/article/details/55289785/ Holer和动态DNS(DDNS)收费,最终通过设置路由器端口转发实现了内网穿透!路由器的公网IP是动态的,SSH连接的地址就不固定,此为局限,但是路由器不掉线重连,公网IP一般不会变化,相对固定,所以只设置端口转发来实现内网穿透是可行的。终极办法是采用DDNS(收费)+路由器端口转发,实现只用域名就可SSH。 实施步骤: 1、路由器设置端口转发 (1)、找到路由器公网IP,并记录下来 (2)、设置端口转发规则 规则名称:随便填 外部端口:路由器的转发端口(随便设置,不冲突就可) 服务器IP:要连接的那台Linux的内网IP 内部端口:linux电脑的端口,SSH连接此处必填22 协议:TCP/UDP 这样设置完成,就建立了 路由器公网IP+外部端口 → →内网服务器IP+内部端口 的映射。 2、linux开启SSH服务 Arch族linux开启ssh服务命令 systemctl

Cannot get QWindow::fromWinId to work properly

被刻印的时光 ゝ 提交于 2021-02-19 06:20:28
问题 My Qt 5.9 program (on X11 Linux) launches other applications, using QProcess . I would like to have control over windows these applications spawn, so I obtain their winId value and use QWindow::fromWinId to get a QWindow instance. The problem is these instances are invalid and do not represent the window they are supposed to. If I check the winId values using xwininfo , the correct information is returned, so I know they are good. What am I doing wrong? Edit: An example won't help much, but

execve() failing to launch program in C

ぃ、小莉子 提交于 2021-02-19 06:16:08
问题 I am trying to spawn a new process using execve() from unistd.h on Linux. I have tried passing it the following parameters execve("/bin/ls", "/bin/ls", NULL); but get no result. I do not get an error either, the program just exits. Is there a reason why this is happening? I have tried launching it as root and regular user. The reason I need to use execve() is because I am trying to get it to work in an assembly call like so program: db "/bin/ls",0 mov eax, 0xb mov ebx, program mov ecx,

execve() failing to launch program in C

余生颓废 提交于 2021-02-19 06:15:40
问题 I am trying to spawn a new process using execve() from unistd.h on Linux. I have tried passing it the following parameters execve("/bin/ls", "/bin/ls", NULL); but get no result. I do not get an error either, the program just exits. Is there a reason why this is happening? I have tried launching it as root and regular user. The reason I need to use execve() is because I am trying to get it to work in an assembly call like so program: db "/bin/ls",0 mov eax, 0xb mov ebx, program mov ecx,

Why cannot I directly compare 2 thread ids instead of using pthread_equal?

只谈情不闲聊 提交于 2021-02-19 06:04:37
问题 I know there is a system call pthread_equal in Linux for comparing 2 thread ids. But why cannot one directly compare 2 thread ids using '==' operator? 回答1: From the pthread_equal man page on Linux: The pthread_equal() function is necessary because thread IDs should be considered opaque: there is no portable way for applications to directly compare two pthread_t values. It might be a struct. It might be a pointer. It might be a pointer to a struct held somewhere. == might, or might not, return

Why cannot I directly compare 2 thread ids instead of using pthread_equal?

无人久伴 提交于 2021-02-19 06:03:14
问题 I know there is a system call pthread_equal in Linux for comparing 2 thread ids. But why cannot one directly compare 2 thread ids using '==' operator? 回答1: From the pthread_equal man page on Linux: The pthread_equal() function is necessary because thread IDs should be considered opaque: there is no portable way for applications to directly compare two pthread_t values. It might be a struct. It might be a pointer. It might be a pointer to a struct held somewhere. == might, or might not, return

Linux下ftp使用及nfs网络文件系统

拜拜、爱过 提交于 2021-02-19 05:50:29
ftp 是一个文件传输协议 ,是tcp/ip 文件传输协议的一种 ftp可以用与文件的共享也可以用于文件的固定IP的收集 Linux下使用说明: 首先我们需要安装ftp程序 yum - y install vsftpd #ftp在Linux里面的安装程序叫做vsftpd systemctl stop firewalld #关闭防火墙 setenforce 0 #将selinux设置为关闭状态 其共享文件夹为/var/ftp ftp如无特殊设置均可以访问和下载 下载方式说明: yum - y install lftpd #客户机在Linux下访问ftp服务器 需要安装lftp程序 lftp ftp: / / 192 . 168 . 88 . 134 # 通过lftp 访问ftp服务器 lftp 192 . 168 . 88 . 134:~> ls #可以查看当前共享文件 lftp 192 . 168 . 88 . 134:~> get cs01 . txt #get可以下载文件 下载到的目录为敲lftp命令时所在文件夹的目录 lftp 192 . 168 . 88 . 134:~> mirror cs #mirror可以下载文件夹 elinks ftp: / / 192 . 138 . 88 . 134 #也可以通过elinks访问ftp文件夹 wget ftp: / / 192 .

Convert JSON to CSV with jq

懵懂的女人 提交于 2021-02-19 05:50:08
问题 I'm trying to extract the sids, ll, state, name, smry values in my JSON file using jq and export to a csv. JSON File (out.json): { "data": [ { "meta": { "uid": 74529, "ll": [ -66.9333, 47.0667 ], "sids": [ "CA008102500 6" ], "state": "NB", "elev": 1250, "name": "LONG LAKE" }, "smry": [ [ "42", "1955-02-23" ] ] }, { "meta": { "uid": 74534, "ll": [ -67.2333, 45.9667 ], "sids": [ "CA008103425 6" ], "state": "NB", "elev": 150.9, "name": "NACKAWIC" }, "smry": [ [ "40", "1969-02-23" ] ] }, { "meta"

How does linux kernel switch between user-mode and kernel-mode stack?

拜拜、爱过 提交于 2021-02-19 05:45:07
问题 How does linux kernel switch between user-mode and kernel-mode stack when a system call or an interrupt appears? I mean what is the exact mechanism - what happens to user-mode stack pointer and where does kernel-mode stack pointer come from? What is done by hardware and what must be done by software? 回答1: All of the words below are about x86. I will just describe entire syscall path, and this answer will contain requested information. First of all, you need to understand what is interrupt