Skip to content

Instantly share code, notes, and snippets.

@vadakattu
Last active November 1, 2017 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadakattu/1db4176dfd5dae645a9d09f51b108f41 to your computer and use it in GitHub Desktop.
Save vadakattu/1db4176dfd5dae645a9d09f51b108f41 to your computer and use it in GitHub Desktop.
Frequently used commands
# create virtualenv with specific python
virtualenv -p /usr/local/bin/python2 xxx2
virtualenv -p /usr/local/bin/python3 xxx3
# Upgrade all packages with pip
pip list --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U
pip2 list --outdated | cut -d ' ' -f1 | xargs -n1 pip2 install -U
pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U
# Git shortcuts
alias gcam='git commit -am"'
alias gs='git status'
alias gd='git diff'
alias gpl='git pull'
alias gps='git push'
# scp shortcut to copy from a remote server to local
export copyfromserver='scp kvadakattu@0.0.0.0:'
# quickly source virtualenv
alias py3='source ~/py3/bin/activate'
alias py2='source ~/py2/bin/activate'
# Forward ports and connect to a remote server
export nbport='-L 8888:localhost:8888'
export tboard='-L 6006:localhost:6006'
alias server='ssh $nbport $tboard username@1.2.3.4'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment