Skip to content

Instantly share code, notes, and snippets.

@askinss
Forked from ikennaokpala/full_proxy_setup.sh
Created November 21, 2013 18:15
Show Gist options
  • Save askinss/7586685 to your computer and use it in GitHub Desktop.
Save askinss/7586685 to your computer and use it in GitHub Desktop.
Export your shell environment for http proxy use
export http_proxy="http://hostname:port" or save it to your shell profile. (i.e. ~/.bash_rc)
export http_proxy='http://example.proxy_name.com:80'
For multi-user installs, use sudo -E to preserve the proxy settings in your environment:
Setting git to use a proxy
Set your git tool to use the environment proxy inside you ~/.gitconfig
[http]
proxy = %http_proxy%
[url 'https://github.com/']
insteadOf = git://github.com
http://www.ubuntugeek.com/how-to-use-ssh-via-http-proxy-using-corkscrew-in-ubuntu.html
http://stackoverflow.com/questions/1040089/how-do-i-use-github-through-harsh-proxies
ProxyCommand /usr/bin/corkscrew 172.25.66.1 8080 %h %p ~/.corkscrew-auth
Host github.com
User git
Port 22
Hostname github.com
IdentityFile "~/ssh/id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes
Host ssh.github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile "~/ssh/id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes
Using RVM behind a proxy
There are a few ways to use RVM from behind a proxy.
--proxy
You can pass the proxy sever to use directly to RVM:
rvm install X --proxy $domain_or_ip:$port
Using CURL
Set the proxy inside your ~/.curlrc:
proxy = example.proxy_name.com:80
in /etc/apt/apt.conf
Acquire::http::proxy "http://user:password@localhost:8080/";
Acquire::https::proxy "https://user:password@localhost:8080/";
Acquire::ftp::proxy "ftp://user:password@localhost:8080/";
Acquire::socks::proxy "socks://user:password@localhost:8080/";
in bashrc
export http_proxy=http://user:password@locahost:8080
export https_proxy=http://user:password@locahost:8080
export HTTP_PROXY=http://user:password@locahost:8080
export HTTPS_PROXY=http://user:password@locahost:8080
In the /etc/wgetrc
http_proxy=http://user:password@locahost:8080
https_proxy=http://user:password@locahost:8080
HTTP_PROXY=http://user:password@locahost:8080
HTTPS_PROXY=http://user:password@locahost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment