-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalias.bash
More file actions
390 lines (351 loc) · 12.3 KB
/
Copy pathalias.bash
File metadata and controls
390 lines (351 loc) · 12.3 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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# Directories
alias cde='cd ~/Dropbox/Projects/VG/Engineering; ls'
alias cdd='cd ~/Downloads; ls'
alias cdp='cd ~/Dropbox/Projects; ls'
alias cdD='cd ~/Desktop; ls'
alias cdr='cd ~/Dropbox/Projects/VG/Engineering/rails_cookbook3; ls'
alias cdr3='cd ~/Dropbox/Projects/VG/Engineering/rails_cookbook3; ls'
alias cda='cd ~/Dropbox/Projects/VG/Engineering/Archives; ls'
alias cdx='cd ~/Dropbox; ls'
alias cdhd='cd ~/Library/VirtualBox/HardDisks; ls'
alias cdm='cd ~/Library/VirtualBox/Machines; ls'
alias cdg='cd ~/Dropbox/Projects/VG/Engineering/Gems; ls'
alias cdb='cd ~/Dropbox/Projects/VG/Engineering/vg-builder; ls'
alias cdvgsh='cd ~/.vg-sh; ls'
alias cdpro='cd ~/.vg-sh; ls'
alias oe='open ~/Dropbox/Projects/VG/Engineering'
alias oa='open ~/Dropbox/Projects/VG/Engineering/Archives'
alias oo='open ~/Dropbox/Projects/VG/Engineering/opscode1'
alias ooc='open ~/Dropbox/Projects/VG/Engineering/opscode1/cookbooks'
alias oor='open ~/Dropbox/Projects/VG/Engineering/opscode1/roles'
alias cdo='cd ~/Dropbox/Projects/VG/Engineering/opscode1; ls'
alias cdoc='cd ~/Dropbox/Projects/VG/Engineering/opscode1/cookbooks; ls'
alias cdor='cd ~/Dropbox/Projects/VG/Engineering/opscode1/roles; ls'
alias cdorvm='cd ~/Dropbox/Projects/VG/Engineering/opscode1/cookbooks/rvm; ls'
alias cdmac='cd ~/Dropbox/Projects/VGTMACCLIENT/Engineering/VGTracker; ls'
alias ..='cd ../'
alias ...='cd ../..'
alias ....='cd ../../..'
#-----------------------------------------------
# Capistrano
alias capr='cap deploy:restart'
alias caprestart='cap deploy:restart'
alias capstop='cap deploy:stop'
alias capstart='cap deploy:start'
#-----------------------------------------------
# Thor
alias tud='thor update Dick'
alias tl='thor list'
alias tda='thor dick:app1'
alias tka1='thor dick:killapp1'
alias tdka1='thor dick:killapp1'
alias tdk='thor dick:killapp1'
alias tka='thor dick:killapp1'
#-----------------------------------------------
# Generic
alias ls='LC_COLLATE=C ls -alGh'
alias cl='clear'
alias space='du -hc *'
#alias space='du -Psckx * | sort -nr'
alias eh='sudo vim /etc/hosts'
alias rd='rm -rf'
alias tail='tail -f -n 200'
# Need a comment here
di ()
{
du -hs $1
}
# Get the total space used by a directory
totalspace ()
{
du -hc $1 | grep total
}
# cd into a directory and show contents
cc ()
{
builtin cd $1
ls -al
}
function rbenvsudo()
{
executable=$1
shift 1
sudo $(rbenv which $executable) $*
}
#-----------------------------------------------
# Vim
alias v='vim'
alias ep='vim ~/.vg-sh/alias.bash'
alias sp='source ~/.vg-sh/alias.bash'
alias vimcheat='vim ~/Dropbox/Tmp/vim_cheatsheet.txt'
alias evim='vim ~/.vimrc'
#-----------------------------------------------
# Servers
alias sdev='ssh ahmadvaroqua@vgdev'
alias vgdev='ssh -t amata@varoquagroup.com "cd /home/amata/varoquagroup.com/current/public/tmp/; bash"'
alias vgb='ssh -t amata@varoquagroup.com "cd /home/amata/varoquagroup.com/current/public/tmp/; vim vg_builder_template_7.rb"'
alias sshvg='ssh -t amata@varoquagroup.com "cd /home/amata/varoquagroup.com/current/public/tmp/; bash"'
alias gemdev='ssh -t amata@varoquagroup.com "cd /home/amata/gems.varoquagroup.com/; bash"'
alias ppndev='ssh -t amata@ppn.varoquagroup.com "cd /home/amata/ppn.varoquagroup.com/current/; bash"'
alias lnmdev='ssh ahmadvaroqua@xp507'
alias rockrack='ssh ahmadvaroqua@50.56.29.18'
#-----------------------------------------------
# Vagrant
alias vs='vagrant status'
alias vsus='vagrant suspend'
alias vr='vagrant resume'
alias vres='vagrant resume'
alias vu='vagrant up'
alias vh='vagrant halt'
alias vp='vagrant provision'
alias vssh='vagrant ssh'
alias vd='vagrant destroy'
alias k='knife'
alias kcu='knife cookbook upload'
alias kcd='knife cookbook delete'
alias ev='vim ~/Dropbox/Projects/VG/Engineering/vg-builder/Vagrantfile'
alias eb='vim ~/Dropbox/Projects/VG/Engineering/vg-builder/vg_builder_template.rb'
# Useful for basic vagrant testing
vt ()
{
mkdir $1
cd $1
cp ~/Dropbox/Projects/VG/Engineering/vg-builder/Vagrantfile .
}
# Vagrant testing Sinatra Redis build
vsr ()
{
mkdir $1
cd $1
cp ~/Dropbox/Projects/VG/Engineering/vg-builder/VagrantfileSinatraRedis Vagrantfile
}
#-----------------------------------------------
# Git
alias gpom='git push origin master'
alias gpush='git push origin master'
alias gpull='git pull origin master'
alias gs='git status'
alias ga='git add .'
alias gcm='git commit -m'
alias gl='git log'
## Gets the current task from Time Tracker
#get_current_task ()
#{
# curl http://tracker-old.liquidphire.com/index.php?current_task=true
#}
#
## Adds and commits code but does not push up
#gc ()
#{
# git add .
# git commit -m "$(get_current_task)"
#}
#
## Adds, commits and pushes up code
#gcp ()
#{
# git add .
# git commit -m "$(get_current_task)"
# git push origin master
#}
#-----------------------------------------------
# Rails
alias bi='bundle install'
alias r='rails'
alias rdb='rake db:migrate'
alias zdb='zeus rake db:migrate'
alias scaf='rails generate scaffold'
alias scaff='rails generate scaffold'
alias rgs='rails generate scaffold'
alias rgm='rails generate model'
alias cdcurrent='cd /apps/*/current'
alias cdcur='cd /apps/*/current'
alias ejs='v /apps/ELLIEKAI/current/app/assets/javascripts/active_admin_global.js'
alias ecss='v /apps/ELLIEKAI/current/app/assets/stylesheets/active_admin.css.sass'
alias ecss2='v /apps/ELLIEKAI/current/app/assets/stylesheets/labels.css.sass'
alias cdrake='cd /apps/ELLIEKAI/current/lib/tasks/'
alias cdadmin='cd /apps/ELLIEKAI/current/app/admin/'
alias cdad='cd /apps/ELLIEKAI/current/app/admin/'
alias cdmodels='cd /apps/ELLIEKAI/current/app/models/'
alias cdmodel='cd /apps/ELLIEKAI/current/app/models/'
alias cdmod='cd /apps/ELLIEKAI/current/app/models/'
alias ehelper='v /apps/ELLIEKAI/current/app/helpers/application_helper.rb'
alias ehelp='v /apps/ELLIEKAI/current/app/helpers/application_helper.rb'
alias taildev='tail -f -n 200 /apps/ELLIEKAI/current/log/development.log'
alias tailside='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/sidekiq-1.log'
alias tailuni='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/unicorn-1.log'
alias tailunicorn='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/unicorn-1.log'
alias tailnginx='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/nginx-1.log'
alias tailred='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/redis-1.log'
alias tailredis='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/redis-1.log'
alias tailfaye='tail -f -n 200 /apps/ELLIEKAI/current/log/foreman/faye-1.log'
alias econfig='v /apps/ELLIEKAI/current/config/initializers/active_admin.rb'
alias zc='zeus console'
alias zdb='zeus dbconsole'
alias zr='zeus rake'
alias zs='zeus start'
alias rmg='rm /apps/ELLIEKAI/current/Gemfile.lock'
alias showprocess='ps -ef | grep'
alias showproc='ps -ef | grep'
alias process='ps -ef | grep'
alias proc='ps -ef | grep'
alias cdpid='cd /tmp'
alias cdwork='cd /apps/ELLIEKAI/current/app/workers/'
#-----------------------------------------------
# Temporary project shit
alias rsf='rake seed_fake_data'
alias rsfd='rake seed_fake_data'
#-----------------------------------------------
# VG Builder
vgr ()
{
# rails new $1 --builder=http://varoquagroup.com/tmp/vg_builder_template_7.rb --skip-prototype --database=mysql
rails new $1 --builder=~/Dropbox/Projects/VG/Engineering/vg-builder/vg_builder_template.rb --skip-prototype --database=mysql
}
vgc ()
{
rails new $1 --builder=~/Dropbox/Projects/VG/Engineering/vg-builder/vg_builder_template_canned.rb --skip-prototype --database=mysql
}
kbrs ()
{
# knife rackspace server create 'role[base]' --server-name server01 --image 49 --flavor 2
knife rackspace server create "role[$1]" --server-name server01 --image 49 --flavor 2
}
kbas ()
{
knife ec2 server create "role[$1]" -S amazon -I ~/.ssh/amazon.pem -x ubuntu -G default -i ami-6407f20d -f m1.small -Z us-east-1c
}
#-----------------------------------------------
# Gems
# Push gems up to gems.varoquagroup.com
pg ()
{
scp $1 amata@gems.varoquagroup.com:/home/amata/gems.varoquagroup.com/public/gems/
ssh -t amata@gems.varoquagroup.com "cd /home/amata/; gem generate_index -d gems.varoquagroup.com/public/"
}
#-----------------------------------------------
# TimeStream
# Add new task
tsn ()
{
# Show response inline
# curl -F "password=demo" -F "task=$*" -F "source=bash" https://timestreamapp.com/demo.txt
# Show response on a new line
# paste -d " " <(curl -F "password=demo" -F "task=$*" -F "source=bash" https://timestreamapp.com/demo.txt)
# Use colorized output
color=$(tput setaf 6)
reset=$(tput op)
response=$(paste -d " " <(curl -s -F "password=demo" -F "task=$*" -F "source=bash" https://timestreamapp.com/demo.txt))
echo "${color}${response}${reset}"
}
# Get current task
# Sample response: This is my awesome task
tsc ()
{
# Show response inline
# curl -G -d "password=demo" https://timestreamapp.com/demo/current.txt
# Show response on a new line
# paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current.txt)
# Use colorized output
color=$(tput setaf 2)
reset=$(tput op)
response=$(paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current.txt))
echo "${color}${response}${reset}"
}
# Get current time + task
# Sample response: [00:02:31] This is my awesome task
tsc1 ()
{
# Show response inline
# curl -G -d "password=demo" https://timestreamapp.com/demo/current/time-task.txt
# Show response on a new line
# paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current/time-task.txt)
# Use colorized output
color=$(tput setaf 2)
reset=$(tput op)
response=$(paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current/time-task.txt))
echo "${color}${response}${reset}"
}
# Get current task + time
# Sample response: This is my awesome task [00:02:31]
tsc2 ()
{
# Show response inline
# curl -G -d "password=demo" https://timestreamapp.com/demo/current/task-time.txt
# Show response on a new line
# paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current/task-time.txt)
# Use colorized output
color=$(tput setaf 2)
reset=$(tput op)
response=$(paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current/task-time.txt))
echo "${color}${response}${reset}"
}
# Get current time
# Sample response: 00:02:31
tst ()
{
# Show response inline
# curl -G -d "password=demo" https://timestreamapp.com/demo/current/time.txt
# Show response on a new line
# paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current/time.txt)
# Use colorized output
color=$(tput setaf 2)
reset=$(tput op)
response=$(paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/current/time.txt))
echo "${color}${response}${reset}"
}
# Get today's tasks
# Sample response:
# 00:02:31 This is my awesome task
# 00:04:07 This is my other awesome task
tstoday ()
{
# Show response inline
# curl -G -d "password=demo" https://timestreamapp.com/demo.txt
# Show response on a new line
# paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo.txt)
# Use colorized output
color=$(tput setaf 2)
reset=$(tput op)
response=$(paste -d" " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo.txt))
echo "${color}${response}${reset}"
}
tssearch ()
{
# Show response inline
# curl -F "password=demo" -F "task=$*" -F "source=bash" https://timestreamapp.com/demo.txt
# Show response on a new line
# paste -d " " <(curl -F "password=demo" -F "task=$*" -F "source=bash" https://timestreamapp.com/demo.txt)
# Use colorized output
color=$(tput setaf 2)
reset=$(tput op)
response=$(paste -d " " <(curl -s -G -d "password=demo" https://timestreamapp.com/demo/search/$*.txt))
echo "${color}${response}${reset}"
}
get_current_task ()
{
# Show response inline
# curl -G -d "password=demo" https://timestreamapp.com/demo/current.txt
curl http://tracker-old.liquidphire.com/index.php?current_task=true
}
# Adds and commits code but does not push up
gc ()
{
git add .
git commit -m "$(get_current_task)"
}
# Adds, commits and pushes up code
gcp ()
{
git add .
git commit -m "$(get_current_task)"
git push origin master
}
#-----------------------------------------------
# Redis
alias redflush='redis-cli flushdb'
alias redflushall='redis-cli flushall'
alias redsize='redis-cli dbsize'
alias redcli='redis-cli'
alias redmon='redis-cli monitor'
alias redinfo='redis-cli info'