-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zsh_alias
210 lines (164 loc) · 5.82 KB
/
.zsh_alias
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
# Ubuntu Shortcuts
# ###################################################
# Setup Exports
export EDITOR='nano'
# Setup Paths
# export WS="$HOME/workspace/"
export CB="$HOME/code/"
NPM_PACKAGES="${HOME}/.npm-packages"
PATH="$NPM_PACKAGES/bin:$PATH"
# Ubuntu
#
# Disable three finger tapping
# http://askubuntu.com/questions/133207/how-can-i-disable-the-multitouch-gestures-in-ubuntu
# http://askubuntu.com/questions/557577/disable-trackpad-two-fingers-double-tap-with-third-finger-bringing-up-alt-tab
#
# synclient ClickFinger3=0
# synclient TapButton3=0
# LS
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
# alias ls='ls -atr --color=always'
# alias _='cd -'
# Grep!
alias grep='grep --color=auto'
GREP_OPTIONS='--exclude-dir={\.git,\.svn} --exclude={*.exe, *.log}'
export GREP_OPTIONS
# Shortcuts for System Processes
alias s='source'
alias e='echo'
# alias o="nautilus"
# alias open="nautilus"
# Browsers
alias chrome="/opt/google/chrome/chrome"
alias ff="/usr/bin/firefox"
# Xampp Shortcuts
#-------------------------------------------------
# export LAMPP='/opt/lampp'
# alias php='$LAMPP/bin/php'
# alias xampp="sudo $LAMPP/lampp"
# alias xampp.conf="sudo $EDITOR $LAMPP/etc/httpd.conf"
# alias xampp.custom="sudo $EDITOR $LAMPP/etc/extra/httpd-custom.conf"
# alias xampp.hosts="pushd /opt/lampp/etc/extra/hosts"
# alias xampp.restart="sudo $LAMPP/lampp restart"
# alias xampp.start="sudo $LAMPP/lampp start"
# alias xampp.stop="sudo $LAMPP/lampp stop"
# alias mysql='$LAMPP/bin/mysql'
# alias mysqladmin='$LAMPP/bin/mysqladmin'
# alias mysqldump='$LAMPP/bin/mysqldump'
# export DRUSH='~/.drush/'
# Apache2 Shortcuts
#-------------------------------------------------
alias apache="sudo /etc/init.d/apache2"
alias a2="sudo /etc/init.d/apache2"
# Apache: Site Paths
alias a2sa="pushd /etc/apache2/sites-available/"
alias a2se="pushd /etc/apache2/sites-enabled/"
# Apache: Log Shortcuts
alias a2log='tail /var/log/apache2/error.log'
alias a2alog='tail /var/log/apache2/access.log'
# Apache: Log Clearing
alias a2clearlog='echo "" | sudo tee /var/log/apache2/error.log > /dev/null'
alias a2clearalog='echo "" | sudo tee /var/log/apache2/access.log > /dev/null'
# Apache: Apachectl
alias a2c='apachectl'
alias a2ctl='apachectl'
alias a2cdb='apachectl -S'
# nginx shortcuts
#-------------------------------------------------
alias nx='sudo service nginx'
alias nxsa='pushd /etc/nginx/sites-available'
alias nxensite='/usr/sbin/nginx_ensite'
alias nxdissite='/usr/sbin/nginx_dissite'
# nginx: Logs
alias nxlogs='sudo tail /var/log/nginx/error.log'
alias nxalogs='sudo tail /var/log/nginx/access.log'
alias nxclogs='echo "" | sudo tee /var/log/nginx/error.log'
alias nxcalogs='echo "" | sudo tee /var/log/nginx/access.log'
# phpfpm
alias phpfpm="sudo /etc/init.d/php5-fpm"
alias mysql='/usr/bin/mysql'
# alias php.ini="sudo $EDITOR /etc/php5/"
# Application Shortcuts
#-------------------------------------------------
# alias aptana="/opt/Aptana_Studio_3/AptanaStudio3"
# Ubuntu Shortcuts
#-------------------------------------------------
# alias update="sudo aptitude update"
# alias install="sudo aptitude install"
# alias upgrade="sudo aptitude safe-upgrade"
# alias remove="sudo aptitude remove"
# Display memory usage:
# ps aux | awk '{print $3"\t"$6"\t"$11;sum+=$6;cpu+=$3} END {print "Total RSS", sum, "\nTotal CPU", cpu}'
# Compass
#------------------------------------------------
# alias cw='compass watch --debug-info'
#
# Drush Shortcuts
#------------------------------------------------
# if [ -f "/home/$USER/.drush/drush/drushrc.php" ]; then
# alias drushrc="sudo $EDITOR /home/$USER/.drush/drush/drushrc.php"
# fi
# Users
#-----------------------------------------------
alias userlist="awk -F':' '{ print $1}' /etc/passwd"
# Custom
#----------------------------------------------
alias ws='pushd $WS'
alias hosts='sudo $EDITOR /etc/hosts'
# Git
#----------------------------------------------
alias gpom='git pull origin master'
alias gpum='git push origin master'
alias gbra='git branch | grep -v "master" | xargs git branch -D'
# PHP
#----------------------------------------------
# alias get.composer='curl -s http://getcomposer.org/installer | php'
# alias get.symfony='php composer.phar create-project symfony/framework-standard-edition'
# Ubuntu: Hardware Settings
#----------------------------------------------
# alias amd='gksudo amdcccle'
# alias hw='sudo lshw'
# Gems
#----------------------------------------------
# alias gemu='sudo gem update'
# alias geml='sudo gem list'
alias cw="compass watch --debug-info"
## Autoloading
#----------------------------------------------
. ~/.nvm/nvm.sh
## Docker
#----------------------------------------------
# Get latest container ID
alias dl="docker ps -l -q"
# Get container process
alias dps="docker ps"
# Get process included stop container
alias dpa="docker ps -a"
# Get images
alias di="docker images"
# Get container IP
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
# Run deamonized container, e.g., $dkd base /bin/echo hello
alias dkd="docker run -d -P"
# Run interactive container, e.g., $dki base /bin/bash
alias dki="docker run -i -t -P"
# Execute interactive container, e.g., $dex base /bin/bash
alias dex="docker exec -i -t"
# Stop all containers
dstop() { docker stop $(docker ps -a -q); }
# Remove all containers
drm() { docker rm $(docker ps -a -q); }
# Stop and Remove all containers
alias drmf='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'
# Remove all images
dri() { docker rmi $(docker images -q); }
# Dockerfile build, e.g., $dbu tcnksm/test
dbu() { docker build -t=$1 .; }
# Show all alias related docker
dalias() { alias | grep 'docker' | sed "s/^\([^=]*\)=\(.*\)/\1 => \2/"| sed "s/['|\']//g" | sort; }
# Bash into running container
dbash() { docker exec -it $(docker ps -aqf "name=$1") bash; }