Skip to content

Instantly share code, notes, and snippets.

@doevelopper
Last active January 9, 2019 13:24
Show Gist options
  • Save doevelopper/88ed9e8a57034245d05cfd92cfacc03a to your computer and use it in GitHub Desktop.
Save doevelopper/88ed9e8a57034245d05cfd92cfacc03a to your computer and use it in GitHub Desktop.
setting Proxies trought CLI

https proxy regex

    ^https?://([^:]*(:[^@]*)?@)?([^:]+)(:\d+)?/?$|^$

Setting proxy only for command

$> sudo {http,https,ftp}_proxy=http://USERNAME:PW@PROXY-HOST:PROXY-PORT/ apt-get update

Setting proxy for Shell

$> export http_proxy=http://USERNAME:P\@W@PROXY-HOST:PROXY-PORT/
$> export https_proxy=https//USERNAME:P\@W@PROXY-HOST:PROXY-PORT/
$> export ftp_proxy=http//USERNAME:P\@W@PROXY-HOST:PROXY-PORT/
$> export rsync_proxy=$http_proxy
$> export rsync_proxy=$http_proxy
$> export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com,3.*,192.168.*"

Setting proxy /etc/apt/aot.conf

$> Acquire::http::proxy "http://USERNAME:P\@W@PROXY-HOST:PROXY-PORT/";
$> Acquire::https::proxy "https://USERNAME:P\@W@PROXY-HOST:PROXY-PORT/";
$> Acquire::ftp::proxy "ftp://USERNAME:P\@W@PROXY-HOST:PROXY-PORT/";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment