-
Notifications
You must be signed in to change notification settings - Fork 0
/
CFG.tar
698 lines (634 loc) · 23.5 KB
/
CFG.tar
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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
.bashrc 0000644 0000764 0001040 00000023655 12355467300 013053 0 ustar alex Administrators # DESCRIPTION: bash config file
# AUTHOR: [email protected]
# MAINTAINER: [email protected]
# NOTE: Please, use it at your own risk
# SET VARIABLES
# Terminal
# export TERM=xterm-256color
if [[ $HOSTNAME == VLN* ]]
then
export TERM=win32
export PATH=/c/Users/alex.LINAVA/Documents/My\ Programs/vim/vim73:$PATH
fi
export CLICOLOR=2
# Locale
export LC_CTYPE="en_US.UTF-8"
export LANG="en_US.UTF-8"
#export LC_CTYPE="ru_RU.UTF-8"
export LC_COLLATE="POSIX"
export LC_ALL="en_US.UTF-8"
# Dropbox
if [[ $HOSTNAME == *local ]]
then
export DROPBOX=~/Documents/.Backup/Dropbox
else
export DROPBOX=~/Dropbox
fi
# Helpers
export LSCOLORS=cxFxBxDxGxegedDxDxCxCx
export LS_COLORS='di=4;32;40:ln=95;40:pi=40;33:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;36:*.tar=92;40:*.tgz=92;40:*.arj=92;40:*.taz=92;40:*.lzh=92;40:*.lzma=92;40:*.tlz=92;40:*.txz=92;40:*.zip=92;40:*.z=92;40:*.Z=92;40:*.dz=92;40:*.gz=92;40:*.lz=92;40:*.xz=92;40:*.bz2=92;40:*.tbz=92;40:*.tbz2=92;40:*.bz=92;40:*.tz=92;40:*.deb=92;40:*.rpm=92;40:*.jar=92;40:*.war=92;40:*.ear=92;40:*.sar=92;40:*.rar=92;40:*.ace=92;40:*.zoo=92;40:*.cpio=92;40:*.7z=92;40:*.rz=92;40:*.jpg=31;40:*.jpeg=31;40:*.gif=31;40:*.bmp=31;40:*.pbm=31;40:*.pgm=31;40:*.ppm=31;40:*.tga=31;40:*.xbm=31;40:*.xpm=31;40:*.tif=31;40:*.tiff=31;40:*.png=31;40:*.svg=31;40:*.svgz=31;40:*.mng=31;40:*.pcx=31;40:*.mov=31;40:*.mpg=31;40:*.mpeg=31;40:*.m2v=31;40:*.mkv=31;40:*.ogm=31;40:*.mp4=31;40:*.m4v=31;40:*.mp4v=31;40:*.vob=31;40:*.qt=31;40:*.nuv=31;40:*.wmv=31;40:*.asf=31;40:*.rm=31;40:*.rmvb=31;40:*.flc=31;40:*.avi=31;40:*.fli=31;40:*.flv=31;40:*.gl=31;40:*.dl=31;40:*.xcf=31;40:*.xwd=31;40:*.yuv=31;40:*.cgm=31;40:*.emf=31;40:*.axv=31;40:*.anx=31;40:*.ogv=31;40:*.ogx=31;40:*.aac=31;40:*.au=31;40:*.flac=31;40:*.mid=31;40:*.midi=31;40:*.mka=31;40:*.mp3=31;40:*.mpc=31;40:*.ogg=31;40:*.ra=31;40:*.wav=31;40:*.axa=31;40:*.oga=31;40:*.spx=31;40:*.xspf=31;40:*.swp=91;40:*.bak=91;40:*.tmp=91;40:*.txt=33;40:*.doc=33;40:*.rtf=33;40:*.diz=33;40:*.ctl=33;40:*.me=33;40:*.ps=33;40:*.pdf=33;40:*.xml=33;40:*.xsd=33;40:*.xslt=33;40:*.dtd=33;40:*.html=33;40:*.shtml=33;40:*.htm=33;40:*.mail=33;40:*.msg=33;40:*.lsm=33;40:*.po=33;40:*.nroff=33;40:*.man=33;40:*.tex=33;40:*.sgml=33;40:*.css=33;40:*.text=33;40:*.letter=33;40:*.chm=33;40:*.docx=33;40:*.docm=33;40:*.xlsx=33;40:*.xlsm=33;40:*.pptx=33;40:*.pptm=33;40:*.md=33;40:*.mkd=33;40'
export GREP_OPTIONS="--colour=auto"
export PAGER=less
export EDITOR=vim
# DEFINE FUNCTIONS AND ALIASES
# Screen
alias scr.irc='screen -c ~/.config/screen/.screenrc.irc'
alias scr.lib='screen -c ~/.config/screen/.screenrc.lib'
if [[ $HOSTNAME == *local ]]
then
alias scr='screen -c ~/.config/screen/.screenrc.local'
alias scrm='screen -m -c ~/.config/screen/.screenrc.local'
else
alias scr='screen -c ~/.config/screen/.screenrc.remote'
alias scrm='screen -m -c ~/.config/screen/.screenrc.remote'
fi
function scr() {
if [[ `screen -ls | grep Sockets` ]]
then
scr
else
scr -r -d
fi
}
# Prompt
if [[ $HOSTNAME == *local ]]
then
function prompt() {
local WHITE="\[\033[0;37m\]"
local COLOR="\[\033[0;36m\]"
export PS1="${COLOR}\u on \h ${WHITE}@ ${COLOR}\w>${WHITE} "
}
prompt
elif [[ $HOSTNAME == VLN* ]]
then
export PS1="\[\033[1;33m\]\w>\[\033[0;37m\]"
else
function prompt() {
local WHITE="\[\033[1;37m\]"
local BLUE="\[\033[1;33m\]"
local GRAY="\[\033[0;37m\]"
export PS1="${BLUE}\u on \h: ${WHITE}\w>${GRAY} "
}
prompt
fi
function blk() {
local WHITE="\[\033[0;30m\]"
local COLOR="\[\033[0;36m\]"
export PS1="${COLOR}\u on \h ${WHITE}@ ${COLOR}\w>${WHITE}"
}
# System
alias free='df -kh'
alias sys='system_profiler SPSoftwareDataType'
alias cfg='vim ~/.bashrc'
alias src='source ~/.bashrc'
alias shut='sudo shutdown now'
alias rest='sudo shutdown -r now'
alias l='less -N -i -m'
alias m='more'
alias g='egrep -i'
# detailed grep
function grp() {
grep -i -A 5 -B 5 $1 *$2
}
# detailed and recursive grep
function grpr() {
grep -i -r -A 5 -B 5 $1 *$2
}
# 'man' to use 'help' database, too
function man() {
/usr/bin/man $@ || (help $@ 2> /dev/null && help $@ | less)
}
# list processes
alias j=jobs
# grep processes
function psg() {
FIRST=`echo $1 | sed -e 's/^\(.\).*/\1/'`
REST=`echo $1 | sed -e 's/^.\(.*\)/\1/'`
ps -A | grep -i "[$FIRST]$REST"
}
alias psm='ps -a -U s'
function mem() {
if [ -f /usr/bin/free ]
then
/usr/bin/free
else
top -l 1 | grep PhysMem | awk '{print "Used: "$8" ["$6"]\nFree: "$10}'
fi
}
# kill processes
alias kil='kill -15'
alias kis='kill -2'
alias kim='kill -1'
alias kid='kill -9'
# Filesystem: navigation
alias bd='. bd -s'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias t='cd ~/tmp/'
alias td='cd ~/tmp/devel/'
alias usr='cd /usr/local/'
alias usrs='cd ~/usr/local/'
alias drp='cd $DROPBOX'
alias d='cd ~/Downloads/'
alias docs='cd ~/Documents/'
alias desk='cd ~/Desktop/'
if [[ $HOSTNAME == *local ]]
then
alias p='cd ~/pub/'
alias pa='cd ~/pub/Applications'
alias lib='cd /Library/'
alias libs='cd ~/Library/'
alias vol='cd /Volumes/'
alias opt='cd /opt/local/'
else
alias w='cd /home/s/public_html/'
alias wp='cd /home/s/public_html/infornography/personal/s/'
alias wt='cd /home/s/public_html/infornography/personal/s/tmp/'
alias li='cd /home/s/public_html/lists/'
alias lt='cd /home/s/public_html/lists/tmp'
fi
if [[ $HOSTNAME == VLN* ]]
then
alias "t"="cd ~/Documents/TMP"
fi
alias nfo='touch 00.nfo ; vim 00.nfo'
alias lst='touch list ; vim list'
# Filesystem: management
alias md='mkdir'
function mdcd() {
mkdir -p "$*"
cd "$*"
}
alias del='rm -rf'
alias del-ds='find . -name ".DS_Store" -exec rm {} \;'
alias del-asl='sudo rm -f /private/var/log/asl/*.asl'
function rmv() {
for f in *.$1; do
newname=${f%.$1}.$2
mv -i "$f" "$newname"
done
}
# list directories and files
alias di='LC_COLLATE=C ls -laF --color --group-directories-first'
alias dir='ls -laAFovk'
# filter listings
alias dirg='ls -laAFovk | grep'
# sort by access time
alias dird='ls -laAFovkt'
# produce a tree
alias tree="ls -R | grep ':' | sed -e 's/://' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' | less"
# size directories and files
alias du='du -h'
# sort directories by access date (BSD-specific)
alias dud='du -hd 1 | sort -k 2'
# sort directories by size (BSD-specific)
alias dus='du -hd 1 | grep [0-9]K | sort -n -k 1 ; du -hd 1 | grep [0-9]M | sort -n -k 1 ; du -hd 1 | grep [0-9]G | sort -n -k 1'
# Filesystem: applications
# tasks
alias tasks='mvim ~/.config/tasks/tasks'
alias tsk='vim ~/.config/tasks/tasks'
# music
alias pls='ls -a1 *.[mM][pP]3 > 00.m3u'
alias play='open 00.m3u'
alias cog='open -a Cog.app *'
alias tags='mp3info -r a -x *.mp3'
alias tags-rus='java -jar ~/usr/local/Java/id3iconv-0.2.1.jar -e cp1251'
# pics
alias jpg='open *.[jJ][pP][gG]'
alias gif='open *.[gG][Ii][Ff]'
alias png='open *.[pP][nN][gG]'
alias tif='open *.[tT][iI][fF]*'
# movies
alias avi='open *.[aA][vV][iI]'
alias vlc='open -a VLC.app'
# Compression
alias tarc='tar cWvf'
alias tarx='tar xzvf'
alias rarx='unrar x'
alias paxx='pax -r -f'
alias zipx='unzip'
alias xarx='xar -xf'
alias xarl='xar -tf'
alias arcl='7za l'
alias boml="lsbom -p 'M/?sF'"
alias 7zc="7z a -t7z -r -mx9"
alias 7zp="7z a -t7z -r -mx9 -mhe=on -p"
alias 7zx="7z x"
alias xpic="7z a -tzip -r -mx9"
# Integration
function dmgc() {
read -p "Enter NAME: " NAME
read -p "Enter SIZE: " SIZE
read -p "Enter SOURCE: " SOURCE
hdiutil create -encryption -stdinpass -fs HFS+J -volname $NAME -size $SIZE -srcfolder $SOURCE $NAME -attach
}
alias dmgx='hdiutil attach -stdinpass'
# Ecryption
function ssl-enc() {
openssl aes-256-cbc -a -salt -in $1 -out $2
}
function ssl-dec() {
openssl aes-256-cbc -d -a -in $1 -out $2
}
# Hashing
function cfv() {
if [ -f 00.sfv ]
then
rm 00.sfv
fi
cksfv * > 00.sfv
}
alias sfv='find . -iname "*.sfv" -execdir cksfv -f {} \;'
# Development
# editors
alias mce='mcedit'
if [[ $HOSTNAME == VLN* ]]
then
alias vim="gvim"
fi
# environment
alias py='python'
# git
alias ga='git add -A'
alias gc='git commit -m'
alias gp='git push'
alias gu='git revert'
# Network
# speedtest
alias spd='~/usr/local/scripts/speedtest-cli --simple --share'
alias spd-srv-l='~/usr/local/scripts/speedtest-cli --list | grep -e Finland -e Sweden -e Germany | m'
alias spd-srv='~/usr/local/scripts/speedtest-cli --simple --share --server'
# Network: applications
# wget
alias wg='wget -c -nd --no-check-certificate'
# wget as mirror
alias mr='wget -m -np -c'
# wget to use list
alias wgi='wget -c -nd -i list'
# wget to use list and to go to background
alias wgib='wget -c -b -nd -i list'
# wget to use list in HTML-markup
alias wgf='wget -c -nd -F -i list'
# wget to use list in HTML-markup and to go to background
alias wgfb='wget -c -b -nd -F -i list'
# wget to check log
alias save='cat wget-log* | grep save'
# firefox
alias zorro='/Applications/Firefox.app/Contents/MacOS/firefox -P zorro >& /dev/null &'
alias clean='/Applications/Firefox.app/Contents/MacOS/firefox -P clean >& /dev/null &'
# Connections
alias plt='ssh -D 15000 pluto'
alias box='ssh -D 15000 boxer'
alias hid='ssh -D 15001 hidro'
# Proxies
alias prb='~/usr/local/scripts/proxy-boxer-on'
alias prp='~/usr/local/scripts/proxy-pluto-on'
alias prh='~/usr/local/scripts/proxy-hidro-on'
alias prf='~/usr/local/scripts/proxy-off'