#pikkunen funktio tekemään pientä jälkeä
function pieni
{
iso="$*"
iso=`echo $iso | tr [:upper:] [:lower:]`
echo $iso
}

alias torrent='screen -S torrent btlaunchmanycurses.bittornado ~/Torrentit --minport 44001 --maxport 45000 --saveas ~/Lataukset --max_upload_rate 80 --max_download_rate 80 --max_uploads 6'
alias auttaja='screen -S auttaja /bin/sh -c "cd $HOME/Desktop/auttaja && './FAH504-Linux.exe'"'

alias tänään='LC_ALL=fi_FI.UTF-8 date +"%A, %-d %Bta, %Y"'

alias lsf='ls -F --color=tty' #regular ls
alias l.='ls -dF .[a-zA-Z0-9]* --color=tty' #only show dotfiles
alias ll='ls -lhF --color=tty' #long listing
alias lsd='ls -d */ | xargs -l basename' #dir

alias rmi="rm -i"
alias cpi="cp -i"
alias mvi="mv -i"

alias du="du -h"
alias df="df -h"

alias bzip2='bzip2 -v'
alias j=jobs
alias cd..="cd .." #work around a common typo

#Automatically do an ls after each cd
cd() {
  if [ -n "$1" ]; then
    builtin cd "$@" && ls
  else
    builtin cd ~ && ls
  fi
}

alias hist='history | grep $1' #Requires one input
alias vkeybd='vkeybd --octave 9'
alias cxoffice='$HOME/Ohjelmat/cxoffice/bin/wine'
alias cxrun='$HOME/Ohjelmat/cxoffice/bin/cxrun'
alias sää='zenity --name=saa --title=Sää --width=300 --height=250 --window-icon=$HOME/Projektit/saa.png --text-info --filename $HOME/Projektit/saa.txt'
alias resoluutio='gvidm'
alias lordgame='telnet lord.nuklear.org 10240'

alias kaantofeisty='dchroot -c feisty.i386 -d'
alias dhmakejuttu='dh_make -c gpl -b'
alias dosbox='dosbox -conf ~/.dosbox/dosbox.conf'
alias funkki='telnet the-funk.net 7000'
alias starwarssi='telnet towel.blinkenlights.nl'

service () {
sudo /etc/init.d/$*
}

etsi () {
	## if i want to remove those millions debug packages
	if [ "`pieni $1`" = "d" ]; then
		apt-cache search $* | grep -v dbgsym
	else
		apt-cache search $*
	fi
}

#alias etsi='apt-cache search'
alias asenna='sudo apt-get install'
alias poista='sudo apt-get remove'
alias poista-kokonaan='sudo apt-get --purge remove'
alias nayta='apt-cache show'
alias policy='apt-cache policy'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get update && sudo apt-get upgrade'
alias dist-upgrade='sudo apt-get update && sudo apt-get dist-upgrade'

alias starttaacompiz='compiz --replace ccp & emerald --replace&'
alias kaantopaiva='LC_ALL=en_US.UTF-8 date +"%a, %-d %b %Y %H:%M:%S %z"'
