Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (61 sloc) 3.21 KB
# Youtube downloader
alias youtube-mp3='youtube-dl -x --audio-format mp3 --audio-quality 0'
# Django Stuff
alias djrun='find . -maxdepth 2 -name 'manage.py' -exec python "{}" runserver \;'
alias djsu='find . -maxdepth 2 -name 'manage.py' -exec python "{}" createsuperuser --email="admin@localhost.com" \;'
alias djmm='find . -maxdepth 2 -name 'manage.py' -exec python "{}" makemigrations \;'
alias djmig='find . -maxdepth 2 -name 'manage.py' -exec python "{}" migrate \;'
alias pepfix='autopep8 --max-line-length=120 -i'
# Virtualenv
alias sv='if [[ ! -d "venv" && ! -L "venv" ]] ; then; virtualenv -p $(command -v python3) venv; touch requirements.txt; fi; source venv/bin/activate; export PS1="(${${PWD##*/}:0:5}…/venv)$_OLD_VIRTUAL_PS1"'
alias sv2='if [[ ! -d "venv" && ! -L "venv" ]] ; then; virtualenv -p $(command -v python2) venv; touch requirements.txt; fi; source venv/bin/activate; export PS1="(${${PWD##*/}:0:5}…/venv)$_OLD_VIRTUAL_PS1"'
alias sv3=sv
# ------------------------------------------------------------------------------
# | Git Commands |
# ------------------------------------------------------------------------------
# Undo a `git push`
alias undopush="git push -f origin HEAD^:master"
alias gp='git push origin HEAD'
alias gpf='git push origin HEAD -f'
alias gd='git diff'
alias gds='git diff --staged'
alias gl='git log'
# Go back to the last branch
alias gc='git checkout -'
alias gs='git status'
alias gcl='git clone'
alias gcm='git commit -m'
alias gaa='git add :/; git status -sb'
# Updates master of upstream project and falls back to your patch branch
# so that you can start rebasing/merging
alias gsync='git checkout master;git pull upstream master;git push origin master; git checkout -'
# ------------------------------------------------------------------------------
# | Network |
# ------------------------------------------------------------------------------
# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# IP addresses
alias ip="curl ipinfo.io/ip"
alias localip='python -c "import socket; print(socket.gethostbyname(socket.gethostname()));"'
# Copy my public key to my clipboard
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
# View HTTP traffic
alias sniff="sudo ngrep -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'"
alias httpdump="sudo tcpdump -i en0 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
# Gzip-enabled `curl`
alias gurl="curl --compressed"
# Recursively delete `.DS_Store` files
alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
alias pycclean='find . -name \*.pyc -type f -ls -delete'
# Remove unlinked packages + stale links on MacOS
alias cleanmac="brew cleanup -s; brew prune"
alias df='df -h'
alias du='du -hs'
alias halt='sudo shutdown -h now'
alias reboot='sudo reboot'
# ------------------------------------------------------------------------------
# | Other |
# ------------------------------------------------------------------------------
alias path='echo -e ${PATH//:/\\n}'
alias now='date +"%T"'
alias week='date +%V'