Skip to content

Instantly share code, notes, and snippets.

@Bernardstanislas
Last active November 26, 2015 13:34
Show Gist options
  • Save Bernardstanislas/45002ec9368738be8975 to your computer and use it in GitHub Desktop.
Save Bernardstanislas/45002ec9368738be8975 to your computer and use it in GitHub Desktop.
Bash profile
# Home
HOME='/c/Users/sbernard/'
cd $HOME
# Variables
GATEWAY="$(ipconfig | grep -a Passerelle | grep -P -o -a '([0-9]+\.){3}[0-9]+' | head -n 1)"
PROXY="http://172.20.0.9:3128"
KLEE_GATEWAY_ETHERNET="172.20.108.1"
KLEE_GATEWAY_WIFI="172.20.231.1"
if [ "$GATEWAY" == "$KLEE_GATEWAY_ETHERNET" ] || [ "$GATEWAY" == "$KLEE_GATEWAY_WIFI" ] ;
then
# Define the proxy variables.
export HTTPS_PROXY=$PROXY
export HTTP_PROXY=$PROXY
export no_proxy=localhost,klee.lan.net
git config http.proxy $PROXY
git config https.proxy $PROXY
npm config set http_proxy $PROXY
npm config set https_proxy $PROXY
apm config set https-proxy $PROXY
apm config set proxy $PROXY
else
git config --unset http.proxy
git config --unset https.proxy
npm config delete http_proxy
npm config delete https_proxy
apm config delete https-proxy
apm config delete proxy
fi
# Environment variables
export ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
GIT="/c/Program Files/Git/bin;/c/Program Files/Git/mingw64/libexec/git-core"
PATH="$GIT;$PATH"
# Aliases
alias trackit='cd /d/Projets/Trackit/Main/ui'
alias focus='cd /d/Projets/focus'
alias focusc='cd /d/Projets/focus-components'
alias focuss='cd /d/Projets/focus-showcase'
alias focusd='cd /d/Projets/focus-docs'
alias push='git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
alias rebase='git fetch origin develop && git rebase origin/develop'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment