четверг, 26 марта 2009 г.

My .screenrc

###############
# Screen config
# #############
setenv LC_LANG ru_RU.UTF-8
setenv LC_LANGUAGE ru_RU.UTF-8
defutf8 on

altscreen on
autodetach on # default: on
deflogin on
defmonitor on

# No bell at all
vbell off # default: off
vbell_msg " — Ring, Ring!! — " # default: "Wuff,Wuff!!"

# Don't display the copyright page
startup_message off # default: on

# Affects the copying of text regions
crlf off # default: off

multiuser on

# Change default scrollback value for new windows
defscrollback 1000 # default: 100

# Define the time that all windows monitored for silence should
# wait before displaying a message. Default 30 seconds.
silencewait 15 # default: 30

shell -$SHELL

# emulate .logout message
pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."

# Pretty status bar at the bottom.
caption always "%m/%d/%y %0c%{=b kg} %l %{=r gk}%-w%{=b wb}%50>%n%f* %t%{-}%+Lw%<%{- Wk}"
# caption always ' %{-b dd}%-w%{cd}%n* %t%{-}%+w %{cd}%-=(%l) %d/%m %c%{-} '

# caption always "%{=}%{r} %L=%{+b}%?%{b}%-Lw%47L>%?%{w}%n*%f %t %?%{b}%+Lw%?%{g}%-31= %D %d %M %c:%s"

# Time a message is displayed if screen is not disturbed by
# other activity. The dafault is 5 seconds:
msgwait 15

termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
defhstatus "screen: ^En (^Et)"

#
## Toggle ‘fullscreen’ or not.
#
bind f eval “caption splitonly” “hardstatus ignore”
bind F eval “caption always” “hardstatus alwayslastline”

# tell screen that you term can scroll
termcapinfo xterm ti@:te@
# bind Shift+PgUp/PgDn
bindkey -m "^[[5;2~" stuff ^b
bindkey -m "^[[6;2~" stuff ^f
bind k
bind ^k
bind .
bind ^\
bind \\
bind ^h
bind h
#make them better
bind 'K' kill
bind 'I' login on
bind 'O' login off
bind '}' history

My conky.conf

# Xft font when Xft is enabled
use_xft
xftfont LiberationMono-Bold:size=13
# Text alpha when using Xft
xftalpha 0.8

alignment top_right
background no
border_width 1
cpu_avg_samples 2
default_color green
default_outline_color lightblue
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
gap_x 5
gap_y 60
minimum_size 5 5
net_avg_samples 2
no_buffers yes
out_to_console no
own_window no
own_window_class Conky
own_window_type desktop
stippled_borders 0
update_interval 3.0
uppercase no
use_spacer no

TEXT
$nodename - $sysname $kernel
Current Time: $color ${time %k:%M:%S} Uptime:$color $uptime Load:$color $loadavg
$hr
${color green}Frequency:$color $freq_g GHz
${color green}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}
${color green}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}
${color green}CPU Usage:$color $cpu% ${cpubar 4}
${color green}Processes:$color $processes ${color grey}Running:$color $running_processes
$hr
${color green}File systems:
/ $color${fs_free /}/${fs_size /} ${fs_bar 6 /}
/home $color${fs_free /home}/${fs_size /home} ${fs_bar 6 /home}
/var $color${fs_free /var}/${fs_size /var} ${fs_bar 6 /var}
$hr
${color green}Networking:
eth0 Up:$color ${upspeed eth0} k/s${color red} - Down:$color ${downspeed eth0} k/s
wlan0 Up:$color ${upspeed wlan0} k/s${color red} - Down:$color ${downspeed wlan0} k/s
$hr
${color green}Name PID CPU% MEM%
${color lightgreen} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgreen} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgreen} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color lightgreen} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color lightgreen} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
$hr
${color green}Port(s):${alignr}
$color Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count}${alignr}ALL: ${tcp_portmon 1 65535 count}
${color #ddaa00}Inbound Connection ${alignr} Local Service/Port$color
${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
${color #ddaa00}Outbound Connection ${alignr} Remote Service/Port$color
${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}

среда, 25 марта 2009 г.

My .vimrc

"--------------------------
" Settings
"--------------------------

autocmd!
filetype indent on " Включить отступы
filetype plugin on

syntax on " turn syntax highlighting on
set autoindent
set autowriteall " write before chanfes
set background=dark
set backspace=indent,eol,start
set backup
set backupdir=$HOME/.vim/backups
" set directory=$HOME/.vim/temp
set backspace=indent,eol,start
set encoding=utf-8
set termencoding=utf-8
set expandtab
set fo+=cr
set foldlevel=25
set foldmethod=indent
set hidden " Не выгружать буфер, когда переключаемся на другой
set history=50 " keep 50 lines in command history
set ignorecase " ingore lower/UPPER case on search
set incsearch " on search instantly go to found text when typing
set laststatus=2 " Always show status-line
set lbr
set mouse=a " enable mouse support
set mousehide " Hide mouse cursor when typing
set mousemodel=popup
set nocompatible
set nohlsearch
set novisualbell
set nowrap " не разрывать строку
set number
set ruler
set scrolljump=7
set scrolloff=7
set sessionoptions=curdir,buffers,tabpages
set shiftwidth=4
set showcmd " show partial command in status line
set showmatch " Показывать совпадающую скобку
set sidescroll=5 " left/right scroll
set smartindent
set softtabstop=4
set tabstop=4
set termencoding=utf-8
set ts=4
set wildmenu
set wcm=
menu Encoding.koi8-r :e ++enc=koi8-r
menu Encoding.windows-1251 :e ++enc=cp1251
menu Encoding.cp866 :e ++enc=cp866
menu Encoding.utf-8 :e ++enc=utf8

highlight Comment ctermfg=Blue " Цвет комментариев

nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap gj
nnoremap gk
vnoremap gj
vnoremap gk
inoremap gj
inoremap gk

if &term =~ "xterm"
let &t_SI = "\]12;green\x7"
let &t_EI = "\]12;blue\x7"
endif

" Making executable files, starting with #!/bin/enterpreter
function ModeChange()
if getline(1) =~ "^#!"
if getline(1) =~ "/bin/"
silent !chmod a+x
endif
endif
endfunction
au BufWritePost * call ModeChange()

"-------------------------
" Hotkeys
"-------------------------

nmap " Пробел в нормальном режиме перелистывает страницы

" CTRL-F для omni completion
"imap

" C-c and C-v - Copy/Paste в global clipboard'
vmap "+yi
imap "+gPi

" Shift-Insert works like in Xterm
map

" C-y - current line deletion
nmap dd
imap ddi

" C-d - current line dublicate
imap yypi

nmap :w
vmap :wi
imap :wi
nmap :q!
vmap :q!i
imap :q!i
map :tabprevious
nmap :tabprevious
imap :tabpreviousi
map :tabnext
nmap :tabnext
imap :tabnexti
nmap :tabnew
imap :tabnew

" Exit on F10
imap :qa
nmap :qa

" On/off line numbers by F11
imap :setnu!a
nmap :setnu!

" Редко когда надо [ без пары =)
imap [ []
" Аналогично и для {
imap { {}O

" С-q - выход из Vim БЕЗ СОХРАНЕНИЯ!
map :q!

" Usefull commands & Hotkeys:
" Ctrl-Y вставит символ, который находится на строке выше на той же позиции, что и курсор.
" Ctrl-E — соответственно на строке ниже.

My .zshrc

####################
# My Options
####################

zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' matcher-list '' '' '' 'r:|[._-]=** r:|=**'
zstyle ':completion:*' menu yes select
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle :compinstall filename '/home/hj/.zshrc'

host=(changeme1 ya.ru yandex.ru www.opennet.ru)
zstyle '*' hosts $hosts

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/games:~/bin:~/bin/scripts
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'

autoload colors && colors
autoload -U zcalc
autoload -U compinit
compinit
autoload promptinit
promptinit
prompt elite2

HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000

# Get keys working
if [[ $TERM = "linux" ]];then
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
elif [[ $TERM = "xterm" || $TERM = "rxvt" ]];then
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
bindkey "^[[5~" up-line-or-history
bindkey "^[8~" end-of-line
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
fi

# My Options:

bindkey -v
eval `dircolors`

# mp3 tags 2 UTF-8 encoding:
mp32utf() { find -iname '*.mp3' -print0 | xargs -0 mid3iconv -eCP1251 --remove-v1 }

calc() {echo "${1}"|bc -l;}

export EDITOR vim

setopt APPEND_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt NO_BEEP
setopt AUTO_CD
setopt CORRECT_ALL
setopt SH_WORD_SPLIT
setopt histexpiredupsfirst histfindnodups
setopt IGNORE_EOF

setopt autocd
setopt extended_glob
setopt correct

case $TERN in
xterm*|rxvt)
precmd () { print -Pn "\e]0;%n@%m: %~\a" }
preexec () { print -Pn "\e]0;%n@%m: $1\a" }
;;
screen)
precmd () { print -Pn "\033k%~\033\\" }
preexec () { print -Pn "\033k$1\033\\" }
;;
esac

#if [ -d ~/bin ] ; then
# PATH=~/bin:${PATH}"
#fi

# Aliases:
alias bmp="ping -c4 changeme"
alias cl="clear"
alias cp="nocorrect cp -iR"
alias df="df -h"
alias du="du -h"
alias duck="du -cksh *|sort -rn | head -10"
alias v="vim"
alias g="grep --color=auto"
alias gcpc='g++ -Wall -g -o'
alias h='history'
alias hlt='sudo shutdown -h now'
#alias ls="ls --color=auto"
alias l="ls -l --color=auto"
alias la="ls -al --color=auto"
alias lf="ls -alF --color=auto"
alias mc="mc -a"
alias mkd="nocorrect mkdir"
alias mlp="ping -c4 changeme"
alias mv="nocorrect mv -i"
alias rbt='sudo shutdown -r now'
alias rm="nocorrect rm -i"
alias rmf="nocorrect rm -f"
alias rmr="nocorrect -rm -Rf"
alias p="less"
alias user='ssh user@changeme'
alias ping='ping -c4'
alias psg="ps aux | grep"
alias re="reset"
alias sdr="screen -aAdr"
alias stp="ping -c4 changeme"

[[ -f /usr/bin/grc ]] && {
alias ping="grc --colour=auto ping -c4"
alias traceroute="grc --colour=auto traceroute"
alias make="grc --colour=auto make"
alias diff="grc --colour=auto diff"
alias cvs="grc --colour=auto cvs"
alias netstat="grc --colour=auto netstat"
}

#program starting:
alias -s {avi,mpeg,mpg,mov,m2v,flv}=mplayer
alias -s {fb2}=fbless
alias -s txt=$PAGER
alias -s py=python
alias -s {ogg,mp3,wav,wma}=mplayer
alias -s {png,gif,jpg,jpeg}=feh
alias -s {pdf,djvu}=evince

[[ -z $DISPLAY ]] && {
alias -s {odt,doc,sxw,xls,doc,rtf}=catdoc
alias -s {png,gif,jpg,jpeg}="fbi -a"
alias -s {pdf,djvu}=evince
}

fortune

# fortune | zenity --text-info

# Global aliases:
alias -g H="| head"
alias -g T="| tail"
alias -g G="| grep"
alias -g L="| less"
alias -g M="| most"
alias -g B="&|"
alias -g HL="--help"
alias -g LL="2>&1 | less"
alias -g CA="2>&1 | cat -A"
alias -g NE="2> /dev/null"
alias -g NUL="> /dev/null 2>&1"
# EOF

fluxbox keys

OnDesktop Mouse1 :HideMenus
OnDesktop Mouse2 :WorkspaceMenu
OnDesktop Mouse3 :RootMenu
OnDesktop Mouse4 :NextWorkspace
OnDesktop Mouse5 :PrevWorkspace

Mod1 Tab :NextWindow
Mod1 Shift Tab :PrevWindow
Mod1 F1 :RootMenu
Mod1 F2 :ExecCommand fbrun
Mod1 F3 :Workspace 3
Mod1 F4 :Close
Mod1 F5 :Workspace 5
Mod1 F6 :Workspace 6
Mod1 F7 :Workspace 7
Mod1 F8 :Workspace 8
Mod1 F9 :Workspace 9
Mod1 F10 :Workspace 10
Mod1 F11 :Workspace 11
Mod1 F12 :Workspace 12

Mod1 o :ExecCommand opera
Mod4 l :ExecCommand xtrlock

понедельник, 23 марта 2009 г.

Internet Is Over

http://www-over.ru/

tnx to http://fatroom.blogspot.com/

Linus

http://a-gura.livejournal.com/120127.html