Видео смотреть бесплатно

Смотреть красивое видео

Официальный сайт ruskorinfo 24/7/365

Смотреть видео бесплатно

warchief 21.04.2010 21:41

Мой конфиг.vimrc ну и .bashrc

Внутри ;)

vimrc

  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
" forget being compatible with good ol' vi
set nocompatible
" get that filetype stuff happening
filetype on
filetype plugin on
filetype indent on
" turn on that syntax highlighting
syntax on
" why is this not default
set hidden
" don't update the display while executing macros
set lazyredraw
"at least let yourself know what mode you're in
set showmode
" enable enchanced command-line completion. presumes you have compiled
" with +wildmenu. See :help 'wildmenu'
set wildmenu
" let's make it easy to edit this file(mnemonic for the key sequence is
" 'e'dit 'v'imrc)
nmap <silent> ,ev :e $MYVIMRC<cr>
" set the search scan to wrap around the file
set wrapscan
" make command line two lines high
set ch=2
" allow backward over indent, eol and the start of an insert
set backspace=2
" Set the status line the way I like it
set statusline=%=%f\ \"%F\"\ %m%R\ <%4l(%3p%%):%3c-(0x%2B,\0%2b),%Y,%{&encoding;}>
" set vim to put a status line in, even if there is only one window
set laststatus=2
nmap <silent> ,ev :e $MYVIMRC<cr>
nmap <silent> ,sv :so $MYVIMRC<cr>
" set up rettabing on a source file
nmap ,rr :1,$retab
" cd to the directory containing the file in the buffer
nmap ,cd :1cd %:h
" make the directory that contains the file in the current buffer.
" this is useful when you edit a file in a directory that doesn't
" (yet) exist
nmap ,md :!mkdir -p %:p:h
" move the cursor to the left, below, above, right
noremap <silent> ,h :wincmd h<cr>
noremap <silent> ,j :wincmd j<cr>
noremap <silent> ,k :wincmd k<cr>
noremap <silent> ,l :wincmd l<cr>
noremap <silent> ,cc :close<cr>
" keep some stuff in the history
set history=100
" these commands open folds
set foldopen=block,insert,jump,mark,percent,quickfix,search,tag,undo
" when the page starts to scroll, keep the cursor 8 lines from
" the top and 8 lines from the bottom
set scrolloff=8
" allow the cursor to go in to "invalid" places
set virtualedit=all
set complete=.,w,b,t
set incsearch
set ignorecase
colorscheme molokai
scriptencoding utf-8
set ruler
set showcmd
set autochdir
set backup
set backupdir=~/.vim/backup
set clipboard+=unnamed " share windows clipboard
set directory=~/.vim/tmp " swap files goes there
set hidden " change buffers without saving
set iskeyword+=_,$,@,%,# " are not worddividers
" wait 500 mls for calling eg. v instead of ,ev
set timeoutlen=500
set tabstop=8
set smarttab
set expandtab
set autoindent
set whichwrap=b,s,h,l,<,>,~,<,> " everything wraps
" | | | | | | | | |
" | | | | | | | | +-- ">" Insert and Replace
" | | | | | | | +-- "<" Insert and Replace
" | | | | | | +-- "~" Normal
" | | | | | +-- <Right> Normal and Visual
" | | | | +-- <Left> Normal and Visual
" | | | +-- "l" Normal and Visual (not recommended)
" | | +-- "h" Normal and Visual (not recommended)
" | +-- <Space> Normal and Visual
" +-- <BS> Normal and Visual
set cursorline
set matchtime=5 " how long to blink on brackets match
set nowrap
set shiftround
set smartcase
set matchpairs+=<:> "these tokens belong together
set autowrite " on critical commands auto write
set autoread
set smartcase

compiler gcc
" compiler mappings. save all and compile
map <F7> :wall \| make<Cr>
" go to the error
map <F4> :cn<Cr>zz:cc<Cr>
nmap <F2> :w!<Cr>
set showfulltag
set number
" C-d - дублирование текущей строки
imap <C-d> <esc>yypi
set expandtab
" F3 - просмотр ошибок
nmap <F3> :copen<cr>
vmap <F3> <esc>:copen<cr>
imap <F3> <esc>:copen<cr>
" F5 - просмотр списка буферов
nmap <F5> <Esc>:BufExplorer<cr>
vmap <F5> <esc>:BufExplorer<cr>
imap <F5> <esc><esc>:BufExplorer<cr>
" F11 - показать окно Taglist
map <F11> :TlistToggle<cr>
vmap <F11> <esc>:TlistToggle<cr>
imap <F11> <esc>:TlistToggle<cr>
map <down> <ESC>:bn<Return>
map <up> <ESC>:bp<Return>
map <left> <ESC>:NERDTreeToggle<Return>
" some regex patterns for C/C++
set include=\"^#\\s*include\" " match include directives
set define=\"^\\(#\\s*define\\|<a-z>*\\s*const\\s*</a-z><a-z>*\\)\" "recognize #define macros
set display=lastline " display as much as possible from the last line
set report=0
set copyindent
set numberwidth=5

au BufNewFile,BufRead *.cu set ft=cu
</a-z>





.bashrc - часть функций написана мной, часть найдена на просторах интернета

  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
< -z "$PS1" > && return
if << $- != *i* >> ; then
return
fi
if < -f /etc/bash_completion.d/ >; then
. /etc/bash_completion.d/
fi
if < -f ~/.dir_colors >; then
eval `dircolors ~/.dir_colors`
fi



#export LANG=ru_RU.UTF-8
export HISTSIZE=1000
export EDITOR=vim
export HISTIGNORE="&:ls:<bf>g:exit:bash:<cxh>:a\ "
export HISTCONTROL=ignoredupsuname
export HISTCONTROL=ignoreboth
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
shopt -s checkwinsize
shopt -s cdspell
shopt -s histappend
shopt -s dotglob
< -x /usr/bin/lesspipe > && eval "$(lesspipe)"
LOCALHOST='whoamilin'

if < -z "$debian_chroot" > && < -r /etc/debian_chroot >; then
debian_chroot=`cat /etc/debian_chroot`
fi

GRP=$(groups |sed 's/ .*//')
if < "$GRP" != "$USER" >; then
prompt_group=$GRP
fi

if < $(hostname) = $LOCALHOST >; then
# set a green prompt for my pc
prompt_color=$BGREEN
else
# set a red prompt everywhere else
prompt_color=$BRED
fi


# append to the history file, don't overwrite it
shopt -s histappend
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
BGREEN='\<\033<1;32m\>'
GREEN='\<\033<0;32m\>'
BRED='\<\033<1;31m\>'
RED='\<\033<0;31m\>'
BBLUE='\<\033<1;34m\>'
BLUE='\<\033<0;34m\>'
NORMAL='\<\033<00m\>'
SEAWAVE='\<\033<36m\>'
GREY='\<\033<30;1m\>'
YELLOW='\<\033<1;33m\>'
LYELLOW='\<\033<0;33m\>'

#PS1="${BBLUE} \$(smiley) ${BGREEN}\u ${SEAWAVE}\w ${BGREEN}\$ ${NORMAL}"
PS1="\n${BGREEN}(${BRED}\$(smiley)${BGREEN})(\u|\H)-(\j)-(\T)-(\w)-(\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files, \$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b)\n${BRED}>${YELLOW}>${BGREEN}> ${NORMAL}"


clear
echo -ne "\n"
echo -ne ""; uname -vrn;
echo -ne "\033<1;32muptime:\033<0m"; uptime;
echo -ne "\033<1;32mDate: \033<0m"; date;
echo -ne "\033<1;31mAlert: console is owned by "; whoami
echo -ne "\n";

function ebrc() {
vim ~/.bashrc
bash
}
ext () {
if < -f $1 > ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $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
}
pk () {
if < $1 > ; then
case $1 in
tbz) tar cjvf $2.tar.bz2 $2 ;;
tgz) tar czvf $2.tar.gz $2 ;;
tar) tar cpvf $2.tar $2 ;;
bz2) bzip $2 ;;
gz) gzip -c -9 -n $2 > $2.gz ;;
zip) zip -r $2.zip $2 ;;
7z) 7z a $2.7z $2 ;;
*) echo "'$1' cannot be packed via pk()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}

psgrep() {
if < ! -z $1 > ; then
echo "Grepping for processes matching $1..."
ps aux | grep $1 | grep -v grep
else
echo "!! Need name to grep for"
fi
}
bcalc() {
echo "${1}"|bc -l;
}
fscp() {
file="${1}"
endfile=`echo $file | sed "s/\//\n /g" | sed "s/ //" | tail -1`
scp $file user@host:/path/to/public_html
echo "http://host/$endfile" | xclip -i -l 1

}

screenshot() {
name=`date +%Y%m%I%M%S%N`
file=$name.png
scrot $file -e 'mv $f /home/lib/shots/' -d 5
url="http://host/$file"
echo "$url" | xclip -i -l 1
scp /home/user/shots/$file user@host:/path/to/public_html
}

genpass()
{
cat /dev/urandom | tr -d -c 'a-zA-Z0-9' | fold -w 8 | head -1
}

function start() {
sudo /etc/init.d/$1 start
}

function stop() {
sudo /etc/init.d/$1 stop
}

function restart() {
sudo /etc/init.d/$1 restart
}

function sleep() {
if < $1 >; then
if < $1 = "standby" > || < $1 = "suspend" > || < $1 = "off" >; then
$XSET dpms force $1
else
echo "Usage: $0 standby|suspend|off"
exit
fi
else
echo "$0 usage: $0 standby|suspend|off"
exit
fi
}
p_cpu() {
ps -e -o pcpu,args --sort pcpu | sed '/^ 0.0 /d'
}

myip() {
lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/
}



function to_iso () {
if < $# = 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Converts raw, bin, cue, ccd, img, mdf, nrg cd/dvd image files to ISO image file. Usage ${RED_FG}'to_iso file1 file2...'$NC"
fi
for i in $*; do
if < ! -f "$i" >; then
echo "'$i' is not a valid file; jumping it"
else
echo -n "converting $i..."
OUT=`echo $i | cut -d '.' -f 1`
case $i in
*.raw) bchunk -v $i $OUT.iso;; #raw=bin #*.cue #*.bin
*.bin|*.cue) bin2iso $i $OUT.iso;;
*.ccd|*.img) ccd2iso $i $OUT.iso;; #Clone CD images
*.mdf) mdf2iso $i $OUT.iso;; #Alcohol images
*.nrg) nrg2iso $i $OUT.iso;; #nero images
*) echo "to_iso don't know de extension of '$i'";;
esac
if < $? != 0 >; then
echo -e "${RED_FG}ERROR!$NC"
else
echo -e "${GREEN_FG}done!$NC"
fi
fi
done
}



function mount_iso () {
local MOUNT_DIR=$HOME/mounted_iso

if < $# = 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Mount ISO files in '$MOUNT_DIR' folder . Usage ${RED_FG}'mount_iso isofile'$NC"
return
fi

mkdir $MOUNT_DIR
echo "mount directory $MOUNT_DIR created, mounting image..."
sudo mount -o loop -t iso9660 $1 $MOUNT_DIR

if < $? != 0 >; then
echo -e "${RED_FG}ERROR!$NC deleting $MOUNT_DIR"
rm -rfv $MOUNT_DIR
else
echo -e "${GREEN_FG}done!$NC for unmount type 'umount $MOUNT_DIR'"
fi
}

function rnm () {
if < $# -eq 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Rename file or folder. Changes in the name; spaces with '_', substrings ' - ' with '-', and delete non printable characters. Usage ${RED_FG}'rnm file'$NC or ${RED_FG}'rnm folder'$NC"
return
fi
if < ! -d "$1" > && < ! -f "$1" >; then
echo "'$1' is not a valid file or folder"
return
fi
# first delete blank spaces using sed, later tr delete non printable characters
local NEW=`echo $1 | sed s/' '/_/g | tr -cd '\11\12\40-\176'`
# others adjust for best renaming
NEW=`echo $NEW | sed s/'_-_'/-/g`
mv "$1" $NEW
echo "renamed as '$NEW'"
}


function rmtabs () {
if < $# -eq 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Remove the tabulators in files and replace each by 4 spaces. Usage ${RED_FG}'rmtabs file1 file2...'$NC"
return
fi

for file in $*; do
if < -f "$file" >; then
sed s/'\t'/' '/g < $file > modified
mv modified $file
else
echo "'$file' is not a valid file; jumping it"
fi
done
}


function rmnpc () {
if < $# -eq 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Remove non printable characters from a files. Usage ${RED_FG}'rmnpc file1 file2...'$NC"
return
fi

for file in $*; do
if < -f "$file" >; then
tr -cd '\11\12\40-\176' < $file > modified
mv modified $file
else
echo "'$file' is not a valid file; jumping it"
fi
done
}


function my_ps () {
if < "$1" = "--help" > || < "$1" = "-h" >; then
echo "Shows all the process of the current user. Usage ${RED_FG}'my_ps'$NC or ${RED_FG}'my_ps process1 process2...'$NC"
return
fi
ps $@ -u $USER -o stat,pid,%cpu,%mem,bsdtime,command ;
}



alias rm="rm -i"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias ncmpc='ncmpc -c'
alias ping='ping -c 5'
alias aptinstall='sudo apt-get install'
alias aptbuild-dep='sudo apt-get build-dep'
alias aptsearch='aptitude search'
# проверка правописания - настоятельно рекомендую :-)
alias xs='cd'
alias vf='cd'
alias moer='more'
alias moew='more'
alias kk='ll'
alias back='cd $OLDPWD'
alias cd..='cd ..'
alias du='du -h -c'
alias mkdir='mkdir -p -v'
alias ..='cd ..'
alias duh='du -h --max-depth=1'
alias bones='gre -vE "^#|^$"'
alias make='make -j4'
alias cp='wrap cp -iv'
alias mv='wrap mv-iv'
alias wget='wrap wget'
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
alias futurama='curl -Is slashdot.org | egrep "^X-(F|B)" | cut -d \- -f 2'
alias grep="grep -i"


function screencast()
{
if which ffmpeg &&gt;/dev/null; then
if < $# -ne 1 >;
then echo -e "usage: sreencast resolutionWIDTHxresolustionHEIGHT"
echo -e "no resolution given using screen resolution instead"
resolution=$(xdpyinfo | grep -o '<0-9>\{4\}x<0-9>\{4\}')
echo "$resolution"
ffmpeg -f x11grab -b 300k -r 24 -s $resolution -i :0.0 ~/screencast.mpg
else
regex=<0-9>\{4\}x<0-9>\{4\}
if < $1 =~ $regex >; then
ffmpeg -f x11grab -r 24 -s $1 -i :0.0 ~/screencast.mpg
else
echo -e "could not approve resolution"
fi
fi
fi
}


function toiso()
{

if which mkisofs &&gt;/dev/null; then
if < $# -ne 2 >;
then echo -e "usage: toiso outputname inputfolder"
else mkisofs -r -o $1 $2
fi
fi
}


function swap() # меняет 2 файла местами
{
local TMPFILE=tmp.$$
mv "$1" $TMPFILE
mv "$2" "$1"
mv $TMPFILE "$2"
}

function ii() # Дополнительные сведения о системе
{
echo -e "\nВы находитесь на " ; uname -n
echo -e "\nДополнительная информация:$NC " ; uname -a
echo -e "\nВ системе работают пользователи:$NC " ; w -h
echo -e "\nДата:$NC " ; date
echo -e "\nВремя, прошедшее с момента последней перезагрузки :$NC " ; uptime
echo -e "\nПамять :$NC " ; free
echo -e "\n"; myip ;
echo
}
function up {
< "${1/<^0-9>/}" == "$1" > && {
local ups=""
for i in $(seq 1 $1)
do
ups=$ups"../"
done
cd $ups
} || echo "usage: up INTEGER"
}
alias mktempdir='tdir=`mktemp -d` && cd $tdir'

# list contents right after changing directories
cd() {
if < "$1" >
then builtin cd "$1" && ls
else builtin cd && ls
fi
}

# make a directory, then immediately cd into it
mkcd() {
if < "$1" >
then mkdir -p "$1" && cd "$1"
fi
}
# i use this function in PS1 to represent if the command that was running before exited with 0 code
smiley() {
err=$?
if < "$UID" == 0 >; then
user=root;
if < $err == 0 >
then echo "$user :-)"
else echo "$user -.- $err"
fi
else
if < $err == 0 >
then echo ':-)'
else echo "-.- $err"
fi
fi
}

#small functions
alias path='echo -e ${PATH//:/\\n}'


function kll () {
if < $# = 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo "Giving a percentage of maximum load, kills every process of the current user that takes a load of CPU greater or equal to that given percentage."
echo -e "It kills every process that produces a load on the CPU greater or equal than the percentage user defined. Usage ${RED_FG}'kll cpu_percentage_usage'$NC"
return
fi
if < "$1" -le "50" >; then
echo "Is dangerous to kill processes that use less than 50% of the CPU. It's not allowed."
return
fi


local PROCS=`ps -u $USER -o %cpu,pid | tr -d '%CPU' | tr -d 'ID' | tr -d '.'`

local LOAD_TARGET=`expr $1 \* 10`
local FLAG=0
for i in $PROCS; do

# inform at user and kill process
if < $FLAG -eq 1 >; then
local CMD=`ps -u $USER -o pid,command | tr -d 'ID' | grep "$i" | head -n 1`
echo "pid, program: $CMD"
echo -n "killing... "

# first try SIGTERM if, fails try SIGKILL
if kill $i; then
echo -e "${GREEN_FG}done!$NC\n"
else
if kill -9 $i; then echo -e "${GREEN_FG}done!$NC\n"
else echo -e "${RED_FG}ERROR!$NC\n"; fi
fi
FLAG=0
fi
# look the % cpu load of all processes
if < "$i" -le "1000" > && < "$i" -gt "$LOAD_TARGET" >; then
local LOAD=`expr $i / 10`
echo "found process using $LOAD% of cpu"
FLAG=1
fi
done
}


function swapfiles () {
if < $# -ne 2 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Swap two files. Usage ${RED_FG}'swapfiles file1 file2'$NC"
return
fi
if < -f "$1" > && < -f "$2" >; then
local TMPFILE=tmp.$$
cp "$1" $TMPFILE
cp "$2" "$1"
cp $TMPFILE "$2"
rm $TMPFILE
else
echo "'$1' or '$2', are not valid files"
fi
}

function compilegl()
{
if < -z "$1" > || < -z "$2" > ; then
echo -e "usage: compilegl path_to_file_to_compile outputname"
return

else
g++ -O2 -lglut -IGL -IGLU $1 -o $2
fi
}



function srch () {
if < $# = 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Find a word in files under the current directory ignoring .svn, log files and backups. Usage ${RED_FG}'srch word'$NC"
return
fi
grep -n -R $1 * | grep -v "\.svn" | grep -v "\.log" | grep -v "*~"
}


function restartd () {
SRVDIR=/etc/init.d

if < $# = 0 > || < "$1" = "--help" > || < "$1" = "-h" >; then
echo -e "Restart all the services passed. Usage ${RED_FG}'restart service1 service2...'$NC"
echo -e "The services must be in '$SRVDIR' folder, if not, adjust ${YELLOW_FG}SRVDIR$NC variable with the services path; sshd, httpd, ftpd..."
return
fi
if < -d "$SRVDIR" > && < -f "$SRVDIR/$@" >; then
$SRVDIR/$@ restart
else
echo -e "folder '$SRVDIR' or file '$SRVDIR/$1' don't exists. Check ${YELLOW_FG}SRVDIR$NC variable value"
fi
}

# Fortune is fun
if which fortune &&gt;/dev/null; then
# echo "----------------------------------- FORTUNE ----------------------------------"
# fortune -a linux linuxcookie humorists computers ascii-art bofh-excuses debian-hints debian translate-me
fortune -a bofh-excuses
# echo "------------------------------------------------------------------------------"
fi

#BAUSTELLE
#
#
#
#

#converts all .ape to .flac in directory.it needs an integer argument to go.
#this argument stands for the search depth for .ape's
function apetoflac(){
if which ffmpeg &&gt;/dev/null; then
COUNTER=$(find . -maxdepth $1 -iname "*.ape" | sed -n '$=')
until < $COUNTER -lt 0 >; do
export IFS=""
APEFILE=$(find . -maxdepth $1 -iname "*.ape" | head -n 1 | sed "s/^<. />*//")
if < "$APEFILE" >; then
FLACFILE=$(echo "$APEFILE" | sed -e "s/.ape/.flac/" )
echo "-------------------strating conversion----------------------------"
echo $APEFILE
echo $FLACFILE
ffmpeg -i $APEFILE $FLACFILE &&gt;/dev/null
echo "Converting complete"
rm -f $APEFILE
export IFS=" "
let COUNTER-=1
echo "Only " "$COUNTER" " files left"
notify-send "Files to be done: " "$COUNTER"
else
echo "no .ape found"
let COUNTER-=1
export IFS=" "
fi
done
else
echo "ffmeg is not on your system. aborting."
notify-send "ffmeg is not on your system. aborting."
fi
}

function rnmall(){
#search in current dir for files/dirs with " " in their names
#and rename it with rnm(). rnm() is defined above!
IFS=$'\n'
COUNTER=$(ls | grep " " | sed -n '$=')
until < $COUNTER -lt 0 >; do
APEFILE=$(ls | grep " " | head -n 1 )
if < "$APEFILE" >; then
rnm $APEFILE
else
echo "no file to rename"
export IFS=""
fi
done
unset IFS
}



#downloas from deposit
down_deposit()
{
wget -O- -q --post-data 'gateway_result=1' "http://depositfiles.com/ru/files/$(basename ${1})" |
sed -n -r -e 's/.*<form action=\"(<a-z0-9a-z>+)\" method=\"get\" onSubmit=\"download_started.*/wget -c \"\1\"/gp; s/\t+(<0-9>{1,3}) минут\(ы\)\./echo Спим \1 минут/gp' | sh
}

function wrap()
{
SUCCESS_SOUND=/home/whoami/.quad.wav
if < $# -gt 0 >; then
"$@"
EXIT_CODE=$?
if < $EXIT_CODE -eq 0 >; then
notify-send -i gtk-apply "$*" "successed" && aplay -q $SUCCESS_SOUND
else
notify-send -i gtk-dialog-error "$*" "failed" && aplay -q $SUCCESS_SOUND
fi
fi
return $EXIT_CODE
}



## complete section
complete -cf sudo



</a-z0-9a-z></cxh></bf>






Тэги: bashrc vimrc конфиг
+ 3 -
Похожие Поделиться

ner_uto 21.04.2010 22:01 #
+ 0 -
Бедный мой телефон. Выкладывайте вы под кат, а не под спойлер:) лучше и то, и то. В рсс падают без спойлера, развернутые.
warchief 21.04.2010 22:08 #
+ 0 -
Вроде исправил
ner_uto 21.04.2010 22:51 #
+ 0 -
За .bashrc спасибо, утяну кое-что:)
digiwhite 21.04.2010 22:57 #
+ 0 -
.bashrc чоткий :)
exelens 21.04.2010 23:23 #
+ 0 -
Галочку плиз в след раз ставь если публикуешь в этом блоге
h0rr0rr_drag0n 22.04.2010 01:08 #
+ 0 -
Вместо psgrep можно использовать уже готовую утилиту pgrep
vvorth 22.04.2010 09:28 #
+ 0 -
.bashrc хорош(сам стащу пару функций), но для меня - лишнего многовато

PS
SUCCESS_SOUND=/home/whoami/.quad.wav <<<< а вот тут whoami надо бы в `` заключить
Born2Crawl 22.04.2010 13:04 #
+ 0 -
Вот это .bashrc! Его можно изучать годами :D
vvorth 22.04.2010 14:26 #
+ 0 -
лучше заранее прочитать man bash - время сократится минут до 15 =.)))
Brun 23.04.2010 11:47 #
+ 0 -
Почему Вы не напишите приимущества своего конфига над дефолтным например. Или Вы думаете, что все нечего делать а конфиги пробывать?
Краткого описания было бы достаточно.
warchief 23.04.2010 23:52 #
+ 0 -
можно было бы конечно описать, но я думаю, что в данном случае это было бы лишним, т.к. каждая ф-ция описана в самом конфиге. И не так их там много ;)
dieformetal 27.04.2010 14:52 #
+ 0 -
bashrc - зачетен. Перетащил себе кучу вкусняшек))

В хорошем качестве hd видео

Онлайн видео бесплатно


Смотреть русское с разговорами видео

Online video HD

Видео скачать на телефон

Русские фильмы бесплатно

Full HD video online

Смотреть видео онлайн

Смотреть HD видео бесплатно

School смотреть онлайн