-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrcorgainzed
290 lines (154 loc) · 6.96 KB
/
bashrcorgainzed
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
# ..............................................................................................Walmart Deve......................................................................................
alias port='ps -ef|grep catalina'
alias killprocee='sudo kill "sudo lsof -t -i:$1"'
alias kill='sudo kill -9 $1'
# ..............................................................................................Maven......................................................................................
alias mci='mvn clean install'
alias c1='cd C:/Development_Base/maxcox/maxcox-master'
# ..............................................................................................Directory......................................................................................
alias mc='cd /Users/vn0xrjh/projects/merchant_center'
alias gescrules='cd /Users/vn0xrjh/projects/gesc-rules'
alias dse="cd /Users/vn0xrjh/app/utils/dsc-cassandra-3.0.8/bin"
alias cassandrastart='sudo /Users/vn0xrjh/app/utils/dsc-cassandra-2.1.14/bin/cassandra'
alias sc='cd /Users/vn0xrjh/projects/sc_automation'
alias sc1='cd /Users/vn0xrjh/projects1/sc_automation'
alias solrd='cd /Users/vn0xrjh/app/utils/solr-6.2.1/bin'
alias cdp="cd ~/projects/gesc-services"
# ..............................................................................................Backup......................................................................................
# copy adn fuplica thte bashrc file to my c1comehere project
cp ~/.bashrc /Users/vn0xrjh/daniel/14_GUIcopymacosx/c1comehere/bashrc
cp ~/.bashrc /Users/lujinglin/l/bashr2017
cp -r /Users/vn0xrjh/app/utils/dsc-cassandra-2.1.14/data/data /Users/vn0xrjh/daniel/14_GUIcopymacosx/c1comehere/backupcanssandra/data
cp -r /Users/vn0xrjh/app/utils/solr-6.2.1/server/solr /Users/vn0xrjh/daniel/14_GUIcopymacosx/c1comehere/solrbkpbackup
# ..............................................................................................GIT......................................................................................
# git rest restet
alias r='git reset $1'
# git add
alias ad='git add $1'
# git checkout master
alias gitm='git checkout master'
# git commiti and push to daneiel
alias gitcp='git commit -m "$1" && git push daniel'
# git commit
alias gitco='git commit -m "$1"'
alias c='git checkout $1'
# git branch and check out
alias new='git branch $1'
function l() {
git add .
git commit -a -m "1"
git push d
}
alias ck="git checkout $1"
alias gitb="git branch"
alias pull="git pull upstream master"
alias gits="git status"
# long listing, human-readable, sort by extension, do not show group info
git()
{
if [ $# -gt 0 ] && [ "$1" == "diff" ] ; then
shift
/usr/bin/git diff --color "$@"
else
/usr/bin/git "$@"
fi
}
# ..............................................................................................Folder Navigation......................................................................................
#Opens current directory in a file explorer
alias explore='open .'
#Opens current directory in a file explorer with super user privileges
alias suexplore='sudo open .'
#self explanatory
alias ...='cd ../../'
#earch subcategories
alias find='sudo find . -print | grep -i $1'
#We can find files in our current directory easily by setting this alias:
alias fhere="find . -name "
alias search="ps aux | grep $1"
alias ..="cd .."
alias delete='sudo rm -rf $1'
alias remove='sudo rm -rf $1'
alias del='sudo rm rf $1'
alias rm='sudo rm -rf $1'
#insert a string to the file
alias back='cd "$OLDPWD"'
# ..............................................................................................Internet......................................................................................
function g() {
/usr/bin/open -a "/Applications/Google Chrome.app" "https://www.google.com/search?q=${*}"
}
export -f g
function iaf() {
str=
for i in "$@"; do
str="$str $i"
done
/usr/bin/open -a "/Applications/Google Chrome.app" "https://www.google.com/search?q=${str}"
}
export -f iaf
function fm() {
/usr/bin/open -a "/Applications/Google Chrome.app" "https://www.google.com/search?q=maven%20repository%20${*}"
}
export -f fm
function gg() {
/usr/bin/open -a "/Applications/Google Chrome.app" "https://gecgithub01.walmart.com/search?q=${*}&type=Code&utf8=✓"
}
export -f gg
# ..............................................................................................Terminal......................................................................................
alias b="vim ~/.bashrc"
alias s="source ~/.bashrc"
alias install="sudo tar -xzf $1"
alias h="history | grep $1"
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
function ida() {
str=
while read -r line;
do
#str=printf "%s\n%s\n" "$str" "$line"
#printf -v "%s\n%s" "$str" "$line" $str
#printf -v "${str}${line} %s\n" $str
str=$(printf "${str}\n\n${line}" $str)
# str="${str}"$'\n'$'\n'$'\n'$'\n'"${line}"
done
# for i in "$@"; do
# str="$str $i"
# done
echo ${str}$'\n'$'\n'$'\n'$'\n' | cat - todo.txt.bak > temp && mv temp todo.txt.bak
}
export -f ida
#Cycle between three different prompts. Usage: dp N
dp () {
if [[ $1 -eq "1" || $# -eq "0" ]]; then
PS1="\033[01;32m$\033[00m "
elif [[ $1 -eq "2" ]]; then
PS1="${debian_chroot:+($debian_chroot)}\w\033[01;32m$\033[00m "
elif [[ $1 -eq "3" ]]; then
PS1="\033[01;32m\u@\H:${debian_chroot:+($debian_chroot)}\w\033[01;32m$\033[00m "
fi
return;
}
#Use it as dp N, where N is 1, 2 or 3.
alias lsh='ls -lhXG'
#Opens current directory in Ubuntu's Disk Usage Analyzer GUI with super user privileges in the background
alias analyze='gksudo baobab . &'
#Opens a GUI text editor in the background. Can obviously be replaced with your favorite editor
alias text='gedit &'
#Same as above with super user privileges
alias sutext='gksudo gedit &'
#Opens a file with whatever program would open by double clicking on it in a GUI file explorer
#Usage: try someDocument.doc
alias try='gnome-open'
#lists contents of current directory with file permisions
alias ll='ls -l -sort'
#list all directories in current directories
alias ldir='ls -l | grep ^d'
#show aliases
alias a='echo "------------Your aliases------------";alias'
#Apply changes to aliases
alias sa='source ~/.bash_aliases;echo "Bash aliases sourced."'
#Edit Aliases
alias via='gksudo gedit ~/.bash_aliases &'
# ..............................................................................................C1 setup......................................................................................
alias solrstart='sudo /Users/vn0xrjh/app/utils/solr-6.2.1/bin/solr start'
# ..............................................................................................Automatic run......................................................................................
export PATH="~/dse/bin:$PATH"
export PATH="/Users/vn0xrjh/app/utils/dse/bin/cqlsh:$PATH"