-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.aliases
More file actions
159 lines (124 loc) · 4.72 KB
/
.aliases
File metadata and controls
159 lines (124 loc) · 4.72 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# 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 \;'
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
alias incognito='export HISTFILE=/dev/null'
alias rcopy="rsync -av --progress -h"
alias rmove="rsync -av --progress -h --remove-source-files"
alias rupdate="rsync -avu --progress -h"
alias rsynchronize="rsync -avu --delete --progress -h"
# Python
if hash ipython 2>/dev/null; then
alias py=ipython
else
alias py=python
fi
alias pepfix='autopep8 --max-line-length=120 -i'
alias pi='pip install'
alias pipfix='piprot --verbatim --latest'
alias pipgrep='pip freeze | grep '
alias pycclean='find . -name \*.pyc -type f -ls -delete'
# Virtualenv
alias sv='if [[ ! -d ".venv" && ! -L ".venv" ]] ; then; python3 -m venv .venv; fi; source .venv/bin/activate;'
alias sv2='if [[ ! -d "venv" && ! -L "venv" ]] ; then; virtualenv -p $(which python2) venv; fi; source venv/bin/activate;"'
alias sv3=sv
# `cat` with beautiful colors. requires Pygments installed.
# sudo easy_install Pygments
alias catn='cat -n'
alias etchost='sudo e /etc/hosts'
alias sshconfig="e ~/.ssh/config"
alias gitconfig="e ~/.gitconfig"
alias ports='sudo netstat -vatnp'
alias ez='e ~/.zshrc'
alias sz='source ~/.zshrc'
alias c='claude'
# ------------------------------------------------------------------------------
# | Shorter Commands |
# ------------------------------------------------------------------------------
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias w="cd ~/work"
alias g="git"
alias gg="lazygit"
alias s="cursor"
alias e="zed"
alias rf='rm -rf'
alias q="exit"
alias :q="exit"
alias dc="docker-compose"
alias d="docker"
alias lgd="lazydocker"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
colorflag="-G"
fi
# List directory contents
alias l='eza'
alias ll='eza -l'
alias la='eza -lA'
alias lst='eza -T'
# List only directories
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
# Always use color output for `ls`
alias ls="command ls ${colorflag}"
# ------------------------------------------------------------------------------
# | Git Commands |
# ------------------------------------------------------------------------------
# Undo a `git push`
alias undopush="git push -f origin HEAD^:master"
# git root
alias gr='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`'
alias gp='git push'
alias gap='git add -p; git commit -v; git status -sb'
alias gd='git diff'
alias gdc='git diff --cached'
alias gc='git commit -m'
alias gca='git commit -a'
alias ga='git add'
alias gco='git checkout'
alias gb='git branch -va'
alias gs='git status -sb' # upgrade your git if -sb breaks for you. it's fun.
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
alias gaa='git add :/; git status -sb'
# ------------------------------------------------------------------------------
# | Network |
# ------------------------------------------------------------------------------
# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# IP addresses
alias ip="curl ipinfo.io/ip"
alias localip='ipconfig getifaddr en0'
# Show active network interfaces
alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"
# 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 df='df -h'
alias du='du -hs'
alias halt='sudo shutdown -h now'
alias reboot='sudo reboot'
alias -g G='| grep'
alias -g L='| less'
alias -g H='| head'
alias -g T='| tail'
alias -g Y='| xclip && xclip -o | xclip -se c'
alias -g R='$(git rev-parse --show-toplevel 2> /dev/null)'
# ------------------------------------------------------------------------------
# | Other |
# ------------------------------------------------------------------------------
alias now='date +"%T"'
alias week='date +%V'
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'
# Fun
alias starwars="telnet towel.blinkenlights.nl"