-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_aliases
240 lines (180 loc) · 5.93 KB
/
.bash_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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#!/usr/bin/env bash
# ========================================
# Directory Navigation
# ========================================
# lists all defined aliases
alias aa='compgen -a'
alias c='clear'
alias q='exit'
alias ll="ls -l"
alias la="ls -al"
alias lp="ls -p"
alias l1='ls -1'
alias h="cd ~"
alias dotfiles="cd ~/.dotfiles"
# Directory
alias md="mkdir"
alias rd='rmdir'
# Go Up
alias cd..="cd .."
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -="cd -" # Go back
alias hy=history
# sudo enviroment
alias sudo='A=`alias` sudo env '
# the "kp" alias ("que pasa"), in honor of tony p.
alias kp="ps auxwww"
# Screen saver
alias ss="/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background &"
# Django Stuff
# ============
alias run="python manage.py runserver --nothreading"
# shell_plus with python command history support
alias shell_plus="python manage.py shell_plus --use-pythonrc"
# TERMRC: https://github.com/briangonzalez/termrc
# ============
alias start="mert start"
alias st=start
# Redis
# ============
alias rs="redis-server ~/.redis/redis.conf"
# MySql Start & Stop
alias mysql_start="sudo /Library/StartupItems/MySQLCOM/MySQLCOM start"
alias mysql_stop="sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop"
# Apache, Servers & php
alias lh=localhost # it launchs the localhost function that I've defined
# Net ip
alias localip="ipconfig getifaddr en1"
alias remoteip="curl -s http://checkip.dyndns.com/ | sed 's/[^0-9\.]//g'"
# pretty print all paths
alias path='echo -e ${PATH//:/\\n}'
# Alias for bashmarks
# alias k='g'
# if [ $(uname) = "Linux" ]
# then
# alias ls="ls --color=auto"
# fi
# Archery, gives info about this mac
# ============
# alias mac="archey"
# ========================================
# File Management
# ========================================
# Delete *.DS_Store files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
alias emptytrash="sudo rm -rfv ~/.Trash;"
# Clear Apple’s System Logs to improve shell startup speed
alias emptylogs="sudo rm -rfv /private/var/log/asl/*.asl"
# Empty the Trash on all mounted volumes and the main HDD and Apple’s System Logs
alias emptyalltrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
# http://blogs.adobe.com/cantrell/archives/2012/03/stop-using-rm-on-the-command-line-before-its-too-late.html
# alias rm="echo 'Use trash instead: trash my-file.txt'"
# ========================================
# Git
# ========================================
# alias gi='git'
# __git_complete gi __git_main
alias gb='git branch'
alias gci='git commit -m'
alias gco='git checkout'
alias gfo='git fetch origin'
alias gp='git push'
alias gr='git rebase'
alias grc='git rebase --continue'
alias guci='git reset --soft HEAD^' # undo last commit
alias ggs='git status'
alias gd='git diff'
alias ga='git add'
alias gl="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
alias glog="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
alias gis="git status -s"
# ========================================
# Heroku
# ========================================
alias hp='heroku ps'
alias hps='heroku ps:scale'
# heroku
alias hk='heroku'
alias hl='heroku list'
alias hi='heroku info'
alias ho='heroku open'
# dynos and workers
alias hd='heroku dynos'
alias hw='heroku workers'
# rake console
alias hr='heroku rake'
alias hcon='heroku console'
# new and restart
alias hnew='heroku create'
alias hrestart='heroku restart'
# logs
alias hlog='heroku logs'
alias hlogs='heroku logs'
# maint
alias hon='heroku maintenance:on'
alias hoff='heroku maintenance:off'
# heroku configs
alias hc='heroku config'
alias hca='heroku config:add'
alias hcr='heroku config:remove'
alias hcc='heroku config:clear'
# ========================================
# Quicklook
# ========================================
# Examples
#
# ql -p '~/Music/file.mp3'
# # => The -p option generates a preview, as if you'd tapped the Spacebar in Finder.
#
# ql -p '~/Music/file.mp3' '~/Documents/Notes.txt'
# # => You can specify multiple files and the window will allow you to switch between files.
#
# ql -t '~/Music/file.mp3'
# # => The -t option generates thumbnails, like in Coverflow or Info For.
#
alias ql='qlmanage -p "$@" >& /dev/null'
# ========================================
# Applications
# ========================================
# Examples
#
# iawriter ~/Documents/Notes.txt
#
alias iawriter='open -b jp.informationarchitects.WriterForMacOSX'
alias vlc='/Applications/Audio\&Video/VLC.app/Contents/MacOS/VLC -I ncurses'
alias safari="open -a safari"
alias firefox="open -a firefox"
if [ -s /usr/bin/firefox ] ; then
unalias firefox
fi
alias chrome="open -a google\ chrome"
alias filemerge="open -a '/Applications/Xcode.app/Contents/Applications/FileMerge.app'"
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
alias piano='pianobar'
# brew cask
alias cask='brew cask'
alias caskinstall='brew cask install'
# ========================================
# bashmarks g aliases
# ========================================
alias ds=g
alias xs=g
# ========================================
# Node and Npm
# ========================================
# To get rid of the errors when using "npm list --depth=n" prior to npm 2
alias npmls0="npm ls --depth=0 "$@" 2>/dev/null"
alias npmls="npm ls "$@" 2>/dev/null"
if [ $ZSH_VERSION ]; then
compctl -K _compzsh ds
compctl -K _compzsh xs
else
shopt -s progcomp
complete -F _comp ds
complete -F _comp xs
fi
# Print the pwd (escaped) while also copying it to the clipboard
# https://apple.stackexchange.com/a/52485/76578
alias cwd='printf "%q\n" "$(pwd)" | tee >(pbcopy)'