show follow-fork-mode Debugger response to a program call of fork or vfork is "parent".set follow-fork-mode mode parent The original process is debugged after a fork. The child process runs unimpeded. This is the default. child The new process is debugged after a fork. The parent process runs unimpeded.show detach-on-fork Whether gdb will detach the child of a fork is on.set detach-on-fork mode on The child process (or parent process, depending on the value of follow-fork-mode) will be detached and allowed to run independently.
Read More →
#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <set>#include <sys/wait.h> using namespace std; int main(int argc, char const *argv[]) { int num = 5; set<int> pid_set; int seq = 0; pid_t temp_pid; for (int i=0; i < num; i++) { temp_pid = fork(); if (temp_pid ==0 || temp_pid == -1) break; pid_set.insert(temp_pid); seq++; } if (temp_pid == 0) { for (int j=0; j < 10; j++) { printf("%d---%d---%d\n", getpid(), j, seq); if (seq == 0) { char *p = NULL; printf("%c", *p); } sleep(seq); } return 0; } else { int stat = 0; int ret = 0; while(true){ ret = waitpid(0, &stat, WNOHANG); if (ret > 0) { set<int>::iterator position = pid_set.
Read More →
Example 1 directories $ ll -a total 22 drwxr-xr-x 1 alons 197609 0 2月 18 19:56 ./ drwxr-xr-x 1 alons 197609 0 2月 18 19:53 ../ drwxr-xr-x 1 alons 197609 0 2月 18 20:04 .git/ -rw-r--r-- 1 alons 197609 7 2月 18 19:53 .gitignore -rw-r--r-- 1 alons 197609 116 2月 18 19:53 .gitmodules drwxr-xr-x 1 alons 197609 0 2月 18 19:53 archetypes/ -rw-r--r-- 1 alons 197609 2381 2月 18 19:53 config.
Read More →
set @range_id := 90000000; update TB_Category set RangeID = ( select @range_id := @range_id + 1 ) order by Id;
1. install Lua5.2 2. install rsync-3.1 3. install lsyncd-2.1.6 2.2.3版本在readhat7.1编译失败 cmake -DCMAKE_C_FLAGS=-ldl . make make install 参考github
PS: example文件夹下有配置文件
setting{ statusFile="/tmp/lsyncd.stat", statusInterval = 1, logfile="/var/log/lsyncd-status.log", } sync{ default.rsyncssh, source="/root/zx", targetdir="/root/zx", exclude={'*.csv', '*.log', 'build', 'nbproject'}, host="172.30.241.210", delay=2, rsync = { archive=true, compress=false, whole_file=false, }, ssh = { port=22, --identityFile="/root/.ssh/id_rsa.pub", binary="/usr/bin/ssh", }, } sync{ default.rsyncssh, source="/root/zx", targetdir="/cffex/zx", exclude={'*.swx', '*.swp', '*.csv', '*.log', 'build', 'nbproject'}, host="zhx@172.31.197.10", delay=2, rsync = { --rsh="/usr/bin/ssh -l zhx -i /root/.
Read More →
CRLF: Windows \r\n
LF: Unix and OSX \n
CR: Classic Mac \r
Linux下查看格式:
vi filename :set ff 或者 :set fileformat 修改 - sed -i 's/\r//g' filename - sed -i 's/^M//g' filename - vi filename 然后 set ff=unix 保存 PS:
注意\^M在linux下写法,按^M是回车换行符,输入方法是按住CTRL+v,松开v,按m
1. add second adapter to virtual machine 2. find out network device name, here is ens33 and ens38 ip a 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:53:2f:a9 brd ff:ff:ff:ff:ff:ff inet 192.168.1.150/24 brd 192.168.1.255 scope global dynamic ens33 valid_lft 27719sec preferred_lft 27719sec inet6 fe80::20c:29ff:fe53:2fa9/64 scope link valid_lft forever preferred_lft forever 3: ens38: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:53:2f:b3 brd ff:ff:ff:ff:ff:ff 3.
Read More →