This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
original: http://code.activestate.com/recipes/65287/ | |
Put this in python module dir, on mac: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 | |
Run your script this way: | |
>> python -m autopdb /path/script.py | |
''' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from Crypto.Cipher import AES | |
from Crypto import Random | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[:-ord(s[len(s)-1:])] | |
class AESCipher: | |
'''AES |
安装https://github.com/clowwindy/gfwlist2pac, 下载https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt,执行:
gfwlist2pac -i Downloads/gfwlist.txt -f x.pac -p "SOCKS5 127.0.0.1:19998"
在goagentx中,代理设置-pac-使用自定义pac文件
,选择生成的pac文件
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/ | |
tar xzvf ~/jdk-7u80-linux-x64.tar.gz | |
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_80/bin/java 1 | |
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_80/bin/javac 1 | |
# vi ~/.bashrc | |
export JAVA_HOME=/opt/jdk1.7.0_80 |
先安装lua5.1, luajit v2.1, luarocks
vagrant@precise64:~$ lua -v
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
vagrant@precise64:~$ luajit -v
LuaJIT 2.1.0-alpha -- Copyright (C) 2005-2015 Mike Pall. http://luajit.org/
vagrant@precise64:~$ luarocks --version
/usr/local/bin/luarocks 2.2.2
LuaRocks main command-line interface
vagrant@precise64:~$ luarocks|grep "Lua version"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function escapeNonePrintable(_) | |
local fmt = string.format | |
return string.gsub(_, "[%z\1-\31,\127-\255]", function (x) | |
return fmt("\\%d",string.byte(x)) | |
end) | |
end | |
print(escapeNonePrintable("a\tb\10c")) |