1.获取当前Shell脚本文件所在目录
1 | PREFIX=$(cd `dirname $0`; pwd) |
2.SSH开启密钥登录
1 | ssh user@host 'mkdir -p .ssh && cat >> .ssh/authorized_keys' < ~/.ssh/id_rsa.pub |
3.SSH端口转发
1 | nohup /usr/bin/ssh -N -L 0.0.0.0:8000:10.10.10.10:12000 sa.demo.com & |
4.iOS证书转换
1 | openssl pkcs12 -in demo.p12 -out demo.pem -nodes |
5.统计代码行数
1 | ls *.py|xargs -n 1 wc -l|awk 'BEGIN{total=0}{$total+=$1}END{print "total lines:\t"$total}' |