-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.aliases
73 lines (58 loc) · 3.09 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# 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="[email protected]" \;'
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 $(which 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 $(which 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'
# 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'
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'