Skip to content

Instantly share code, notes, and snippets.

@AhmedSakrr
Forked from jctosta/setProxyEnv.sh
Created October 21, 2021 20:52
Show Gist options
  • Select an option

  • Save AhmedSakrr/d25ce55e86b21a7dbfff0797e4e3aae7 to your computer and use it in GitHub Desktop.

Select an option

Save AhmedSakrr/d25ce55e86b21a7dbfff0797e4e3aae7 to your computer and use it in GitHub Desktop.
Script para configuração automática de proxy em sistemas Linux
# Terminal Settings (WGET, Apt e etc.)
export http_proxy=http://localhost:3128
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com,10.*
# Configurações para proxy automático em ambientes Gnome
if hash gsettings 2>/dev/null; then
gsettings set org.gnome.system.proxy autoconfig-url '<pac_file_location>'
gsettings set org.gnome.system.proxy mode 'auto'
fi
# Git
if hash git 2>/dev/null; then
git config --global http.proxy $http_proxy
git config --global https.proxy $http_proxy
git config --global url."https://".insteadOf git://
fi
# Configurações de Proxy do NPM
if hash npm 2>/dev/null; then
npm config set https-proxy $http_proxy
npm config set http-proxy $http_proxy
fi
# Configurações de Proxy do Editor ATOM
if hash apm 2>/dev/null; then
apm config set https-proxy $http_proxy
apm config set http-proxy $http_proxy
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment