Thursday, June 7. 2007
http://project-run.com/index.php?serendipity[subpage]=Downloadbereich
#Based on http://www.michael-prokop.at/computer/config/.zshrc + others
PROMPT=$'%n@%m %0(3c,%c,%~) %0(?,%{\e[0;32m%}:%),%{\e[0;31m%}:(%s)%b %# '
type compinit &>/dev/null || { autoload -U compinit && compinit }
export COLORTERM="yes"
(( ${+BROWSER} )) || export BROWSER="firefox"
(( ${+PAGER} )) || export PAGER="less"
alias -g C='|wc -l'
alias -g M='| more'
alias -g G='| grep'
alias -g dt='dmesg | tail'
alias -g T='| tail'
alias -g N='&>/dev/null'
alias -g nanihil='ssh -X -Y -L1431:localhost:143 -L1432:localhost:25 -L8080:localhost:8080 mkeeper@213.239.217.213'
# Xterm resizing-fu.
# Based on http://svn.kitenet.net/trunk/home-full/.zshrc?rev=11710&view=log (by Joey Hess)
alias hide='echo -en "\033]50;nil2\007"'
alias tiny='echo -en "\033]50;-misc-fixed-medium-r-normal-*--80-*--c-*-iso8859-15\007"'
alias small='echo -en "\033]50;6x10\007"'
alias medium='echo -en "\033]50;-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-15\007"'
alias default='echo -e "\033]50;-misc-fixed-medium-r-normal-*--140-*--c-*-iso8859-15\007"'
alias large='echo -en "\033]50;-misc-fixed-medium-r-normal-*--150-*--c-*-iso8859-15\007"'
alias huge='echo -en "\033]50;-misc-fixed-medium-r-normal-*--210-*--c-*-iso8859-15\007"'
alias smartfont='echo -en "\033]50;-artwiz-smoothansi-*--*--*--*--*--*-\007"'
alias semifont='echo -en "\033]50;-misc-fixed-medium-r-semicondensed-*--120-*--*--iso8859-15\007"'
# listing stuff
alias dir="ls -lSrah"
alias lad='ls -d .*(/)' # only show dot-directories
alias lsa='ls -a .*(.)' # only show dot-files
alias lss='ls -l (s,S,t)' # only files with setgid/setuid/sticky flag
alias lsl='ls -l (@[1,10])' # only symlinks
alias lsx='ls -l (*[1,10])' # only executables
alias lsw='ls -ld (R,W,X.^ND/)' # world-{readable,writable,executable} files
alias lsbig="ls -flh (.OL[1,10])" # display the biggest files
alias lsd='ls -d (/)' # only show directories
alias lse='ls -d (/^F)' # only show empty directories
alias lsnew="ls -rl (D.om[1,10])" # display the newest files
alias lsold="ls -rtlh (D.om[1,10])" # display the oldest files
alias lssmall="ls -Srl (.oL[1,10])" # display the smallest files
dwicti() { ${=BROWSER} http://de.wiktionary.org/wiki/${(C)1// /_} }
ewicti() { ${=BROWSER} http://en.wiktionary.org/wiki/${(C)1// /_} }
wikide () { ${=BROWSER} http://de.wikipedia.org/wiki/"${(C)*}" }
wikien() { ${=BROWSER} http://en.wikipedia.org/wiki/"$*" }
google() { ${=BROWSER} "http://www.google.at/search?hl=de&num=100&q=$*" }
mdiff() { diff -udrP "$1" "$2" > diff.`date "+%Y-%m-%d"`."$1" }
memusage(){ ps aux | awk '{if (NR > 1) print $5; if (NR > 2) print "+"} END { print "p" }' | dc }
oleo() { ${=BROWSER} "http://dict.leo.org/?search=$*" }
shtar() { gunzip -c $1 | tar -tf - -- | $PAGER }
shtgz() { tar -ztf $1 | $PAGER }
shzip() { unzip -l $1 | $PAGER }
swiki() { ${=BROWSER} http://de.wikipedia.org/wiki/Spezial:Search/${(C)1} }
# list files which have been modified within the last x days
new() { print -l (m-$1) }
# ogg2mp3 with bitrate of 192
ogg2mp3_192() {
oggdec -o - ${1} | lame -b 192 - ${1:r}.mp3
}
# UTF-8 change
isutfenv () {
case "$LANG $CHARSET $LANGUAGE" in
(*utf*) return 0 ;;
(*UTF*) return 0 ;;
(*) return 1 ;;
esac
}
alias term2iso="echo 'Setting terminal to iso mode' ; echo -e '^[%@'"
alias term2utf="echo 'Setting terminal to utf-8 mode'; echo -e '^[%G'"
alias utf2iso=`if isutfenv ; then
for ENV in 'env | grep UTF' ; do
eval export "$(echo $ENV | sed 's/UTF-8/iso885915/')"
done
fi`
alias iso2utf=`if isutfenv ; then
for ENV in 'env | grep "\.iso"' ; do
eval export "$(echo $ENV | sed 's/iso.*/UTF-8/')"
done
fi`
#if [[ "$TERM" == screen ]]; then
bindkey "\e[1~" beginning-of-line # home
bindkey "^[[4~" end-of-line # End
bindkey "^[[A" up-line-or-search # cursor up
bindkey "^[[B" down-line-or-search # -
bindkey '^x' history-beginning-search-backward # alternative ways of searching the shell history
# bindkey '\e[7~' beginning-of-line # home
# bindkey '\e[8~' end-of-line # end
#fi
# Startx - if x is not already started
# case `/usr/bin/tty` in /dev/tty[0-9]*)
XPID=$(/sbin/pidof xinit)
if [ -z "$XPID" ] ; then
startx ; exit
fi
# esac
if [ ! `/sbin/pidof skippy` ] ; then
skippy &
fi
if [ ! `/sbin/pidof esd` ] ; then
esd -nobeeps &
fi
if [ $(/sbin/ifconfig | /usr/bin/grep "inet addr" | cut -f 2 -d: | cut -f 1 --delimiter=" " | /usr/bin/grep 192 | cut -f 1 --delimiter=".") = "192" -a ! `/sbin/pidof synergys` ] ; then
synergys -c synergy.conf
fi
if [ ! `/sbin/pidof ssh` ] ; then
sshfs -o gid=1000,uid=1000 mkeeper@nanihil.com: nanihil/
ssh -X -Y -L1431:localhost:143 -L1432:localhost:25 -L8080:localhost:8080 mkeeper@213.239.217.213
fi
if [ ! `/sbin/pidof sshfs` ] ; then
sshfs -o gid=1000,uid=1000 mkeeper@nanihil.com: nanihil/
fi
#sb_filter=`ps aux | grep sb_imapfilter | grep -v grep`
#if [ $? = "1" -a `/sbin/pidof ssh` ] ; then
#python /usr/bin/sb_imapfilter.py -c -t -l 30 &
#fi
|