为了科学上网,访问github之类的快一些,总要在命令行工具下用代理,于是就有了如下设定
# Setup commandline proxy _proxy="http://127.0.0.1:16888" _noproxy="localhost,.sina.com.cn,.weibo.com" alias proxyon="export http_proxy=${_proxy} https_proxy=${_proxy} no_proxy=${_noproxy}" alias proxyoff="unset http_proxy https_proxy no_proxy"
这个no_proxy是为了让本地内网的repo不要走代理.sina.com.cn
代表了该域名下的内容都不走代理。
在sudoers
里写上环境变量的保持,
Defaults env_keep += "http_proxy https_proxy no_proxy"