-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_profile.conf
182 lines (155 loc) · 8.35 KB
/
bash_profile.conf
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
# -----------------------------------------#
# ENVIRONMENT CONFIGURATION #
#------------------------------------------#
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# GIT bash prompt
# ---------------
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
# GIT auto completion
# -------------------
test -f ~/.git-completion.bash && . $_
# set paths
#----------
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH=$HOME/local/bin:$PATH
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export GOROOT=/usr/local/go
export GOPATH=$HOME/gopath
export GOPROJECT=$GOPATH/src/gitlab.myteksi.net/gophers/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
export PATH=$PATH:$GOPATH/src/gitlab.myteksi.net/gophers/go/scripts
source $GOPATH/src/gitlab.myteksi.net/gophers/go/scripts/set-env.sh ci > /dev/null 2>&1 # Setting env-vars on each bash startup
export DOCKER_HOST=tcp://192.168.99.100:2376
export DOCKER_CERT_PATH=/Users/vikash.kumar/.docker/machine/machines/dinghy
export DOCKER_TLS_VERIFY=1
export DOCKER_MACHINE_NAME=dinghy
# Using Non-System Ruby
export RBENV_ROOT="$(brew --prefix rbenv)"
export GEM_HOME="$(brew --prefix)/opt/gems"
export GEM_PATH="$(brew --prefix)/opt/gems"
if which rbenv > /dev/null;
then eval "$(rbenv init -)";
fi
export PATH="$PATH:$REPO_DIR/arcanist/arcanist/bin"
export PATH=$GEM_PATH/bin:$PATH
source $GOPROJECT/scripts/env-vars.sh $GOPROJECT -ci
export PROTO_PATH=/usr/local/protoc
# -----------------------------------------#
# alias #
#------------------------------------------#
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias less='less -FSRXc' # Preferred 'less' implementation
# cd() { builtin cd "$@"; ll; } # Always list directory contents upon 'cd'
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
alias .4='cd ../../../../' # Go back 4 directory levels
alias .5='cd ../../../../../' # Go back 5 directory levels
alias .6='cd ../../../../../../' # Go back 6 directory levels
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder
alias ~="cd ~" # ~: Go Home
alias c='clear' # c: Clear terminal display
alias which='type -all' # which: Find executables
alias path='echo -e ${PATH//:/\\n}' # path: Echo all executable Paths
alias cic='set completion-ignore-case On' # cic: Make tab-completion case-insensitive
mcd () { mkdir -p "$1" && cd "$1"; } # mcd: Makes new Dir and jumps inside
trash () { command mv "$@" ~/.Trash ; } # trash: Moves a file to the MacOS trash
ql () { qlmanage -p "$*" >& /dev/null; } # ql: Opens any file in MacOS Quicklook Preview
alias bash-edit='vim ~/.bash_profile' # edit bash profile
alias bash-reload='source ~/.bash_profile' # reload bash profile
# mans: Search manpage given in agument '1' for term given in argument '2' (case insensitive)
# displays paginated result with colored search terms and two lines surrounding each hit. Example: mans mplayer codec
# --------------------------------------------------------------------
mans () {
man $1 | grep -iC2 --color=always $2 | less
}
zipf () { zip -r "$1".zip "$1" ; } # zipf: To create a ZIP archive of a folder
# extract: Extract most know archives with one command
# ---------------------------------------------------------
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# ---------------------------
# 4. SEARCHING
# ---------------------------
alias qfind="find . -name " # qfind: Quickly search for file
ff () { /usr/bin/find . -name "$@" | fpp ; } # ff: Find file under the current directory
ffs () { /usr/bin/find . -name "$@"'*' | fpp ; } # ffs: Find file whose name starts with a given string
ffe () { /usr/bin/find . -name '*'"$@" | fpp ; } # ffe: Find file whose name ends with a given string
# ---------------------------
# 6. NETWORKING
# ---------------------------
alias myip='curl ip.appspot.com' # myip: Public facing IP Address
alias netCons='lsof -i' # netCons: Show all open TCP/IP sockets
alias flushDNS='dscacheutil -flushcache' # flushDNS: Flush out the DNS Cache
alias lsock='sudo /usr/sbin/lsof -i -P' # lsock: Display open sockets
alias lsockU='sudo /usr/sbin/lsof -nP | grep UDP' # lsockU: Display only open UDP sockets
alias lsockT='sudo /usr/sbin/lsof -nP | grep TCP' # lsockT: Display only open TCP sockets
alias ipInfo0='ipconfig getpacket en0' # ipInfo0: Get info on connections for en0
alias ipInfo1='ipconfig getpacket en1' # ipInfo1: Get info on connections for en1
alias openPorts='sudo lsof -i | grep LISTEN' # openPorts: All listening connections
alias showBlocked='sudo ipfw list' # showBlocked: All ipfw rules inc/ blocked IPs
# ii: display useful host related informaton
# -------------------------------------------------------------------
ii() {
echo -e "\nYou are logged on ${RED}$HOST"
echo -e "\nAdditionnal information:$NC " ; uname -a
echo -e "\n${RED}Users logged on:$NC " ; w -h
echo -e "\n${RED}Current date :$NC " ; date
echo -e "\n${RED}Machine stats :$NC " ; uptime
echo -e "\n${RED}Current network location :$NC " ; scselect
echo -e "\n${RED}Public facing IP Address :$NC " ;myip
#echo -e "\n${RED}DNS Configuration:$NC " ; scutil --dns
echo
}
# ----------------
# Grab related alias
#-----------------
alias gk='grab-kit'
alias gks='grab-kit start'
alias gkg='grab-kit gen'
alias gk-test-folder='go test -v -run Test'
alias gwb-start='WEB_APP_PORT=8000 ./wapp start webbooking'
alias gwb-test='./wapp test webbooking'
alias gwb-lint='./wapp lint webbooking'
alias grab='cd $GOPROJECT'
alias grab-frontend='cd ~/Grab/web-kit/'
alias webbooking='cd $GOPROJECT/enterprise/webbooking'
alias webbooking-frontend='cd ~/Grab/web-kit/web-app/packages/webbooking'
alias enterprise='cd $GOPROJECT/enterprise'
alias grabdoc='cd ~/Grab/grabdocs'
alias gandalf-webbooking='gandalf generate new-http-client webbooking http://localhost:8080/api/public/enterprise-web-booking/STG/api.json'
alias grabdoc-start="grabdoc && ./build.rb && node index.js"
alias gandalf-run-webbooking="go test -v -tags gandalf_tests gitlab.myteksi.net/gophers/go/enterprise/webbooking/gandalftests/functional"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/vikash.kumar/google-cloud-sdk/path.bash.inc' ]; then . '/Users/vikash.kumar/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/vikash.kumar/google-cloud-sdk/completion.bash.inc' ]; then . '/Users/vikash.kumar/google-cloud-sdk/completion.bash.inc'; fi