Neurohazard
暮雲煙月,皓首窮經;森羅萬象,如是我聞。

【DailyScript】shadowsocks+proxychains4

wpadmin~September 6, 2018 /System Management

【DailyScript】shadowsocks+proxychains4

Contents

对终端进行代理

方法1 临时配置 shell 的环境变量, http_proxy,https_proxyALL_PROXY.
方法2 修改 .bashrc 之类的文件
方法3 关于修改 apt 之类的 package manager 的代理配置
方法4 proxychains 在终端使用socks5代理

推荐配置一些 alias 别名

alias setproxy="export ALL_PROXY=socks5://127.0.0.1:1080"
alias unsetproxy="unset ALL_PROXY"
alias ip="curl -i http://ip.cn"
alias dailyscript="cd /home/team/develop/daily-script"

daily script

# shell-proxy-start.sh
export ALL_PROXY=socks5://127.0.0.1:1080

# shell-proxy-show.sh
curl -i http://ip.cn

# shell-proxy-stop.sh
unset ALL_PROXY

# start_ss_tk.sh
sslocal -c /etc/shadowsocks/tk.json
# 后代运行
nohup sslocal -c /etc/shadowsocks/tk.json &

# git-proxy-start.sh
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

# git-proxy-show.sh
git config --global --get-regexp "http.*"

# git-proxy-stop.sh
git config --global --unset http.proxy

apt package manager 修改代理

# sudo vim /etc/apt/apt.conf
# 在文件末尾添加
Acquire::http::Proxy "http://username:password@proxy_address:port"

其他工具

DNS 缓存污染缓解
https://github.com/chengr28/Pcap_DNSProxy/blob/master/README.zh-Hans.md

参考资料

1 让终端走代理的几种方法 link

2 利用 proxychains 在终端使用 socks5 代理 link

3 用 shadowsocks 加速 git clone link

4 Shadowsocks Arch Wiki
https://wiki.archlinux.org/index.php/Shadowsocks_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#.E5.AE.A2.E6.88.B7.E7.AB.AF

5 syntax for SOCKS proxy in apt.conf
https://askubuntu.com/questions/35223/syntax-for-socks-proxy-in-apt-conf

Leave a Reply

Your email address will not be published. Required fields are marked *