-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_aliases.tmpl
177 lines (159 loc) · 4.54 KB
/
dot_aliases.tmpl
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# General
alias oo="open ."
alias home='cd ~' # the tilda is too hard to reach
alias wrk="cd ~/Projects/work"
alias ops="cd ~/Projects/open-source"
alias pers="cd ~/Projects/personal"
alias proj="cd ~/Projects"
alias h='history' # shortcut for history
alias c='clear' # shortcut to clear your terminal
alias gzip=pigz
alias search='find . -maxdepth 1 -type f | xargs grep -in --color=always '
alias wget='wget2'
alias top='htop'
# Head / Tail Shortcuts
alias H='| head'
alias T='| tail'
alias G='| grep'
alias L="| less"
alias M="| most"
alias LL="2>&1 | less"
alias CA="2>&1 | cat -A"
alias NE="2> /dev/null"
alias NUL="> /dev/null 2>&1"
# MongoDB
alias mtail='tail -f /data/db/current/mongod.log'
alias mongo='mongosh'
alias mongod='mongod --config /usr/local/etc/mongod.conf'
alias mongostop='mongo admin --eval "db.shutdownServer()"'
alias mongostart='mongod --config /usr/local/etc/mongod.conf --fork'
alias mongorestart='mongostop && mongostart'
alias mongostat='mongostat --rowcount 0'
alias mongotop='mongotop'
alias mongodump='mongodump --out /tmp/mongodump'
alias mongorestore='mongorestore /tmp/mongodump'
# GNU Overrides
alias awk="gawk"
alias find="gfind"
alias grep="ggrep"
alias make="gmake"
alias sed="gsed"
alias tar="gtar"
alias xargs="gxargs"
# directory movement
alias ..='cd ..'
alias ...='cd ../../'
alias ....='cd ../../../'
# ls
alias ls='eza --group-directories-first --icons'
alias ll='eza --group-directories-first --icons -lh'
alias la='eza --group-directories-first --icons -a'
alias lla='eza --group-directories-first --icons -lah'
alias lsa='eza --group-directories-first --icons -lah'
alias l='eza'
alias lt='eza --tree'
alias lm='eza --long --sort=modified'
alias lsize='eza --long --sort=size'
alias lext='eza --long --sort=extension'
alias ldot='eza -a | grep "^\."'
alias ldir='eza -D'
alias lfile='eza -f'
# IP addresses
alias ip='echo "\nLocal IPs:" && ifconfig | grep "inet " | awk '\''{printf "\t%s\n", $2}'\'' && echo "External IP:" && curl -s ipinfo.io/ip | awk '\''{printf "\t%s\n", $0}'\'';'
alias whois="whois -h whois-servers.net"
# Kubernetes
alias k="kubectl"
alias kgp="kubectl get pods"
alias kgs="kubectl get svc"
alias kgc="kubectl get componentstatuses"
alias kctx="kubectl config current-context"
alias kcon="kubectl config use-context"
alias kgc="kubectl config get-contexts"
alias kdelp="kubectl delete pods"
alias kdes="kubectl describe"
alias kaf="kubectl apply -f"
alias kgd="kubectl get deployments"
alias kgds="kubectl get ds" # Get daemonsets
alias kgn="kubectl get nodes"
alias klogs="kubectl logs"
# Tmux
alias t="tmux"
alias tn="tmux new-session -s"
alias ta="tmux attach-session -t"
alias tls="tmux list-sessions"
alias tk="tmux kill-session -t"
alias td="tmux detach"
# Ruby
alias rake='noglob rake'
alias bundle='noglob bundle'
# Bundler
alias bi='bundle install -j8'
alias bu='bundle update'
alias be='bundle exec'
alias bv='bundle viz'
# Python
alias python="python3"
alias pip="pip3"
alias pys="python3 -m http.server" # Start a simple HTTP server (Python 3)
alias ipy="ipython" # Start IPython shell
alias jn="jupyter notebook" # Start Jupyter notebook
# Pytorch
alias ptenv="source activate pytorch_env"
alias ptup="pip install torch torchvision"
alias ptrun="python my_pytorch_script.py"
# Virtualenv
alias venv="python3 -m venv" # Create a new virtual environment
alias vact="source bin/activate" # Activate a virtual environment
alias vdeact="deactivate" # Deactivate the current virtual environment
alias vrm="rm -rf bin include lib lib64 share pyvenv.cfg" # Remove a virtual environment
# NPM
alias ni="npm install"
alias ns="npm start"
alias nt="npm test"
alias nr="npm run"
alias nu="npm update"
alias nun="npm uninstall"
alias nin="npm init"
alias np="npm publish"
# Rust
alias ca="cargo add"
alias cb="cargo build"
alias cc="cargo check"
alias cf="cargo fmt"
alias cg="cargo generate"
alias ci="cargo install"
alias cl="cargo clippy"
alias cn="cargo new"
alias co="cargo outdated"
alias cr="cargo run"
alias cs="cargo search"
alias ct="cargo test"
alias cu="cargo update"
alias cv="cargo version"
alias cw="cargo watch"
# Go
alias g="go"
alias gb="go build"
alias gr="go run"
alias gt="go test"
alias gi="go install"
alias gf="go fmt"
alias gd="go doc"
alias gg="go get"
alias gm="go mod tidy"
# Make
alias m="make"
alias mc="make clean"
alias mi="make install"
alias mt="make test"
alias md="make dist"
alias mdcl="make distclean"
# Git
alias git=$(brew --prefix)/bin/hub
alias gb='git branch'
alias gbr='git branch --remote'
alias gba='git branch --all'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gd='git diff'
alias gs='git status'