# -*-sh-*-

# Network:
# alias  sshg="ssh -p  2222 gvtk86@localhost"
alias sshm="ssh -Y -A michal@www.ruska.it"
alias sshmm="sshm -p 1022"

alias sshn="ssh -p 23 root@maruska.dyndns.org"


alias sshmount='sshfs maruska@core-bld-01:/home/maruska ~/core-server'


alias px='ping linux2'
alias pima='ping maruska.gotdns.org'
alias pinl='ping 192.168.2.60'
alias pim='ping www.ruska.it'



# email
alias mutt="mutt -m maildir -f ~/.maildir"
alias mutti="mutt -m maildir -f  imap://www.ruska.it/inbox"
alias muttil="mutt -m maildir -f  imap://localhost/inbox"


# Books:
alias queries="psql -U postgres -c \"SELECT current_query, date_trunc('second',  now() - query_start)     from pg_stat_activity;\""
alias books="find /ebooks|grep-multi.scm"
alias math='find ${MATHBOOKDIR}|grep-multi.scm'

alias OK='echo \"Bettina, fahtto\"| festival  --tts'



# Foto
export fotodir=/DATI/foto/
alias m_foto="mirrordir --nice  2 --verbose --exclude-glob .xvpics --exclude-glob ps --exclude-glob hp  --exclude-glob .thumbnails --exclude-glob .thumbnails2  $fotodir"
# alias p_foto="$fotodir/perm"

alias sy='foto-sync.scm'
alias imp='foto-import.scm'
alias impr='foto-import.scm -d -r -6'
alias f_process_doc="f_processfoto --action=a --name=d --cat=d "


#alias xf="guardafotox"
alias xf="show_foto"
alias sf="show_foto"
alias sp="show_person"

alias import_foto='for i in **/*.jpg; do  find $i  -printf "%p\t%s\t%a\n"; done | psql -h linux10 -c "copy foto_files from stdin;"'




# SSH
alias sshm="ssh -Y -A michal@www.ruska.it"
alias sshd="ssh -Y -A michal@maruska.dyndns.org"
alias scpm="scp michal@www.ruska.it:"

# for now I need it in emacs only.
# how to

## this makes a port forwarding to gain access to postgres server.
export pg_port_forward=5432
#1234
# todo: as beta or mmc
# linux6
alias sshmpf="ssh -L ${pg_port_forward}:localhost:5432 www.ruska.it"

alias sshr="ssh -p 2222 localhost -o StrictHostKeyChecking=no"
alias psqlf="psql -h localhost -p ${pg_port_forward}"
alias sshmrpf="ssh -R 2222:localhost:22 www.ruska.it"




### WTF?
#alias grep_clienti="grep -v --  \\\"- -\\\" access_log| cut -d\' \' -f 3|sort  -nu"
alias grep_clienti="cat access_log |grep '^[0-9.]*	[0-9]*	[-0-9]*	[0-9]\+' | cut -d'	' -f 4|sort -un"

alias grep_clienti_date="cat access_log|grep `LC_ALL_OLD=$LC_ALL && export LC_ALL=C && date +%d/%b/%Y && LC_ALL=$LC_ALL_OLD`| grep \'^[0-9.]*	[0-9]*	[-0-9]*	[0-9]\\\+\' | cut -d\'	\' -f 4|sort -un"

alias grep_emacs="grep  'comp/emacs/scan/scan.el' access_log| cut -d\' \' -f 1|sort  -u"
alias grep_quanti="cat access_log|grep  `LC_ALL_OLD=$LC_ALL && export LC_ALL=C && date +%d/%b/%Y && LC_ALL=$LC_ALL_OLD` | cut -d'	' -f 1|sort  -u|wc"
# alias grep_query='cat access_log|grep query | sed -f /linux/3/usr/local/ACTIVITY/SED/query'
alias grep_500="awk \\'\\\$2 ~ /500/ {print }\\' access_log | l"



alias find_tar="recursdir   --exclude-glob '*~'   --exclude-glob '*.gz'   -C 'printf (\"%s\n\", PATH);'  .  --tar-file \"|bzip2 >   .tar.bz2\""



alias gentoo="chroot /mnt/gentoo/ /bin/zsh -l"

alias br=run-browser.scm

# Sawfish
alias sfc="sawfish-client"

## SQL

if [ \! "$LOGNAME" = "root" ];
then
    alias s="psql"
    alias log="lg /postgres/log/server.log"
fi

alias pkahua='ps -C gosh  -o pid,pgid,egroup,stat,args'
