Skip to content

Instantly share code, notes, and snippets.

@caiqiqi
caiqiqi / modify.sh
Last active March 26, 2018 17:21
同学有个文件,需要转换一下格式,正好学习了一下awk的用法
# 开辟新的战场
mkdir wkl && cd wkl
# 将发送过来的压缩文件解压
unrar x *.rar
# 对ls中的所有文件(都是txt)的内容,取第10行开始到最后的内容,
# 由于她的文件内容有8列(但是8列中列与列之间有的是tab有的是空格分割的),再把前8列打印出来,重定向到新的文件
for i in `ls`;do awk 'NR>=10{print}' $i|awk '{print $1,$2,$3,$4,$5,$6,$7,$8}' > $i.modified.txt;done
# 打包/压缩
zip modified.zip *.txt
# 发送之后,清理现场
@caiqiqi
caiqiqi / ntp_scanner.sh
Created July 1, 2017 11:48
扫描内网中的ntp服务器
nmap -sU -pU:123 -Pn -n 202.202.32.0/20 > ntp_server.txt
# -sU Udp scan(sU)
# -pU:123 -p是指定端口,-pU是指定UDP端口,-pU:123是指定UDP123端口
# -Pn 如果远程主机有防火墙,IDS和IPS系统,你可以使用-Pn命令来确保不ping远程主机,因为有时候防火墙会组织掉ping请求.
@caiqiqi
caiqiqi / cr0ss-the-wa11-u5ing-pac.md
Last active October 12, 2015 05:54
This is a dummy demonstration I found recently on how to bypass the GFW

Cross the Wall

This is a dummy demonstration I found recently on how to bypass the GFW ,i.e the censorship of government by using a Linux server that you could fully control.Note that the Linux machine must be able to visit the Internet freely with no censorship.You could rent a server on aliyun,which is a little expensive but anyway you could afford it(about 90 RMB/month but after I get my student info registered it'll be 10 RMB,looking forward to it).

server side

OK,let's talk about the machine we are using.The OS is ubuntu by default.After you've got that machine,you could modify some configuration.Type this in terminal line by line:

apt-get -y install squid
curl https://pac.itzmx.com/squid/ubuntu-squid.conf > /etc/squid3/squid.conf
service squid3 restart