linux 字数统计
echo "djdjjd"|wc -c
wc -l //count line
echo "djdjjd"|wc -c
wc -l //count line
echo $((0x41FE))
printf %d\\n 0x41FE
echo 'ibase=16;obase=10; 41FE'|bc //need upper case
on linux obase=10; need to change to obase=A; or leave space echo 'ibase=16; 41FE'|bc
test on mac and gentoo
1. “.”: 匹配除"\n"之外的任何单个字符,若要匹配包括"\n"在内的任意字符,需使用诸如"[\s\S]"之类的模式;
2. “^”:匹配输入字符串的开始位置,不匹配任何字符,要匹配”^”字符本身,需使用”\^”;
3. “$”:匹配输入字符串结尾的位置,不匹配任何字符,要匹配”$”字符本身,需使用”\$”;
4. “*”: 零次或多次匹配前面的字符或子表达式,”*”等效于”{0,}”,如”\^*b”可以匹配”b”、”^b”、”^^b”、…;
5. “+”: 一次或多次匹配前面的字符或子表达式,等效于”{1,}”,如”a+b”可以匹配”ab”、”aab”、”aaab”、…;
6. “?”: 零次或一次匹配前面的字符或子表达式,等效于”{0,1}”,如”a[cd]?”可以匹配”a”、”ac”、”ad”; 当此字符紧随任何其他限定符”*”、”+”、”?”、”{n}”、”{n,}”、”{n,m}”之后时,匹配模式是"非贪心的"。"非贪心的"模式匹配搜索到的、尽可能短的字符串,而默认的"贪心的"模式匹配搜索到的、尽可能长的字符串。如,在字符串"oooo"中,"o+?"只匹配单个"o",而"o+"匹配所有"o";
Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
add args --skip-grant-tables to /etc/conf.d/mysql MY_ARGS=""
run /etc/init.d/mysql restart
run mysql_upgrade
remove args --skip-grant-tables
/etc/init.d/mysql restart
a. `netstat -nat | grep <端口号>` , 如命令 `netstat -nat | grep 3306`
b. `netstat -nat |grep LISTEN`
c lsof -n -P -i TCP -s TCP:LISTEN
d lsof -i:port
by default boost has build with cxx11 support on mac 10.13 high sierra with xcode 9.4
to avoid link errors with c++14,it should build with c++14 support
./bootstrap.sh --prefix=path
./b2 link=static cxxflags="-std=c++14" -d+2 stage
// ./b2 .....
//./b2 install
//on gentoo may has error: "none" is not a known value of feature
//this because boost installed and the file /usr/share/boost-build/site-config.jam
//add this --ignore-site-config
###connect to unbutu strongswan xl2tpd
emerge libreswan xl2tpd
/etc/ipsec.d/xxx.conf
conn xxx
authby=secret
pfs=no
rekey=no
keyingtries=3
type=transport
left=%defaultroute
leftprotoport=udp/l2tp
leftid=@vpn.l2tp
right=8.8.9.9 # internet ip
rightid=10.0.1.2 #
rightprotoport=udp/l2tp
auto=add
/etc/ipsec.d/xxx.secrets
@vpn.l2tp %any : PSK "******"
/etc/xl2tpd/xl2tpd.conf
sudo apt-get install strongswan xl2tpd ppp
/etc/ipsec.conf
conn L2TP-PSK
type=transport
authby=psk
keyexchange=ikev1
keyingtries=3
rekey=no
left=192.168.5.105 use local ip
right=%any
auto=add
/etc/ipsec.secrets
: PSK "12345678"
/etc/xl2tpd/xl2tpd.conf
[lns default] ; Our fallthrough LNS definition
ip range = 192.168.2.2-192.168.2.20 ; * Allocate from this IP range
local ip = 192.168.2.1 ; * Our local IP to use
register write pc jumpValue
[self kkk:arg1 bbb:arg2]
self=po $rdi
_cmd=po (char *)$rsi
arg1=po (id)(int64_t)$rdx
rcx ...
可能因為 Backdoor.MAC.Eleanor 的出現,Apple 取消了System Preferences > Security & Privacy 中 Gatekeeper 允許執行任何來源應用程式,但是 Gatekeep 是可以用 terminal 來關閉,達到容許執行任何來源應用程式(也包括病毒),請小心使用。
打開 Terminal
輸入 sudo spctl --master-disable
回復 Gatekeeper 功能:
打開 Terminal
輸入 sudo spctl --master-enable
To check whether Mail.app is allowed to run on the local system:
spctl -a /Applications/Mail.app
To allow Frobozz.app to run on the local system:
spctl --add --label "My Stuff" /Applications/Frobozz.app