Published on

linux 代理设置

Authors
~/.bashrc
proxy () {
  export ALL_PROXY="socks5://127.0.0.1:10808"
  export all_proxy="socks5://127.0.0.1:10808"
  echo -e "Acquire::http::Proxy \"http://127.0.0.1:10809\";" | sudo tee -a /etc/apt/apt.conf > /dev/null
  echo -e "Acquire::https::Proxy \"http://127.0.0.1:10809\";" | sudo tee -a /etc/apt/apt.conf > /dev/null
  curl ipinfo.io
}
noproxy () {
  unset ALL_PROXY
  unset all_proxy
  sudo sed -i -e '/Acquire::http::Proxy/d' /etc/apt/apt.conf
  sudo sed -i -e '/Acquire::https::Proxy/d' /etc/apt/apt.conf
  curl ipinfo.io
}