-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc.local
116 lines (98 loc) · 3.98 KB
/
bashrc.local
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
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
[[ -r $rvm_path/scripts/completion ]] && source $rvm_path/scripts/completion
[ -e "$DEV_DIR" ] || DEV_DIR="$HOME/Development"
export DEV_DIR
### Added by the Heroku Toolbelt
#export PATH="/usr/local/heroku/bin:$PATH"
# Tab completion
if [ -n "$BASH_VERSION" ]; then
_dc()
{
local cur projects
[ -r "$DEV_DIR" ] || return 0
eval 'COMPREPLY=()'
cur=${COMP_WORDS[COMP_CWORD]}
projects=$(\ls "$DEV_DIR")
if [ $COMP_CWORD -eq 1 ]; then
eval 'COMPREPLY=( $(compgen -o filenames -W "$projects" $cur) )'
fi
return 0
}
complete -F _dc dc
elif [ -n "$ZSH_VERSION" ]; then
compctl -/ -S '' -W "$DEV_DIR" scd
fi
dc() {
cd "$DEV_DIR/$1"
}
source /usr/local/etc/bash_completion.d/git-completion.bash
function merl() {
PWD=`pwd`
BASE=`basename $PWD`
echo "erl -pa ./apps/$BASE/ebin/ ./apps/$BASE/.eunit/ ./deps/emongo/ebin ./deps/monaco_erlang_utils/ebin ./deps/monaco_erlang_rabbit_utils/ebin ./deps/mochiweb/ebin ./deps/log4erl/ebin ./deps/gen_bunny/ebin ./deps/meck/ebin ./deps/amqp_cl ient/ebin ./deps/rabbit_common/ebin"
erl -pa ./apps/$BASE/ebin/ ./apps/$BASE/.eunit/ ./deps/emongo/ebin ./deps/monaco_erlang_utils/ebin ./deps/erlsom/ebin ./deps/monaco_erlang_rabbit_utils/ebin ./deps/mochiweb/ebin ./deps/log4erl/ebin ./deps/gen_bunny/ebin ./deps/meck/ebin . /deps/amqp_client/ebin ./deps/rabbit_common/ebin ./deps/erlsom/ebin
}
function gco() { git checkout -b $1 origin/$1; }
function gbco() { git checkout $1 origin/$1; }
function gclone() { git clone git@git.tandbergtv.lan:monaco/$1.git;}
function gdev() {
gclone $1
cd $1
gco dev
cd ..
}
function reset_branch() {
BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
git fetch --all
git reset --hard origin/$BRANCH
}
function gss() {
git stash show -p stash@{$1}
}
# Add the following to your ~/.bashrc or ~/.zshrc
hitch() {
command hitch "$@"
if [[ -s "$HOME/.hitch_export_authors" ]] ; then source "$HOME/.hitch_export_authors" ; fi
}
alias unhitch='hitch -u'
# Uncomment to persist pair info between terminal instances
# hitch
alias fspork='spork cucumber'
alias ts='date; time (rspec spec && flatware -w 4); date'
alias fw='date; time (flatware -w 4);date'
alias rw='rake jobs:work'
alias rc='rake jobs:clear; rw'
alias fwc='ps aux|grep flatware'
alias migrate='rake db:migrate; rake db:test:prepare; flatware fan rake db:test:prepare'
alias hconf='heroku config -a searchdiscovery'
alias hconfs='heroku config -a searchdiscovery-staging'
alias htail='heroku logs -n 1000 -t -a searchdiscovery'
alias htails='heroku logs -n 1000 -t -a searchdiscovery-staging'
alias hcon='heroku run console -a searchdiscovery'
alias hcons='heroku run console -a searchdiscovery-staging'
alias ls='ls -la'
function kfw() {
IDS=`ps aux|grep flatware|grep -v "grep" | awk '{print $2}' |tr "\\n" " "`
if [ -z "$IDS" ]; then
echo "No flatware processes running"
else
kill -9 $IDS
echo "Killed $IDS"
fi
}
function pull_to_dev() {
dropdb search_discovery_development &&
createdb search_discovery_development &&
curl -o tmp/sd_production.dump `heroku pgbackups:url -a searchdiscovery`
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d search_discovery_development tmp/sd_production.dump
mongodump -h candidate.7.mongolayer.com:10155 -d adobe-dtm-production -u <user> -p <password> -o tmp/mongodump/production &&
mongo search_discovery_development --eval "db.dropDatabase()" &&
mongorestore -h localhost:27017 --db search_discovery_development tmp/mongodump/production/satellite-production
}
function clone_to_dev() {
dropdb search_discovery_development &&
createdb search_discovery_development &&
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d search_discovery_development tmp/sd_production.dump
mongo search_discovery_development --eval "db.dropDatabase()" &&
mongorestore -h localhost:27017 --db search_discovery_development tmp/mongodump/production/satellite-production
}