Necrotex /.bashrc

################################## ~/.bashrc modified Version of jessie's (www.geekosphere.org) .bashrc Just removed the Gentoo stuff and added some Debian Specific aliases and other maybe usefull stuff. Works fine, but's not final.
##################################
  # ~/.bashrc
  # modified Version of jessie's (www.geekosphere.org) .bashrc
  #
  ############
  #
  # Just removed the Gentoo stuff and added some Debian Specific aliases and
  # other maybe usefull stuff.
  #
  # Works fine, but's not final.
  #
  # modified by Andre Peiffer
  # last change: 18.11.2008
  ##################################


# screen/user fix
chmod -R 777 /dev/pts/*


# standard stuff
source /etc/profile
source /etc/bash_completion
export LANG="de_DE.utf8"
export PAGER="most"

# Editor is VIm
export EDITOR=vim
export VISUAL=$EDITOR

# teh fancy prompt -- I love it ;)
DARKBLUE='\033[0;34m'
BLUE='\033[1;34m'
WHITE='\033[0;39m'
WHITEB='\033[0;1;39m'
RED='\033[0;31m'
PS1="\n\[${DARKBLUE}\][\[${BLUE}\]\t\[${DARKBLUE}\]] \[${WHITE}\]\u\[${DARKBLUE}\][\[${BLUE}\]tty\l\[${DARKBLUE}\]]\[${WHITE}\]\w \[${RED}\]$\[${WHITEB}\] "


# pretty directory listings
alias d="ls --color -h"
alias ls="ls --color=auto -h"
alias ll="ls --color -l -h"
alias la="ls --color -a -h"
alias lal="ls --color -a -l -h"
alias lrt="ls -lrt"
alias lsd="ls -F | ls -d */"
alias l="dir"
alias csize="du -k | sort -r -n | more"

# other useful stuff
alias du="du -h"
alias df="pydf -h"
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"
alias cd..="cd .."
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias pwd="/bin/pwd"
alias n="nano -w"
alias mkdir="mkdir -p"
alias diff="colordiff"
alias x="clear && exit"
alias q="exit"
alias grep="grep --color=auto"
alias h="history"
alias rgrep="find . -name "*" | xargs grep"
alias sc="screen -x"

alias backupsql="mysqldump -u root -p --opt $1 > ~/$1.sql"
alias pcheck="fuser -n tcp"

#some apt aliases
alias get="apt-get install"
alias del="apt-get remove"
alias update="apt-get update"
alias upgrade="apt-get upgrade"


# grep for active process
function psgrep()
{
        ps aux | grep -e $1
}


# Change the window title of X terminals
case $TERM in
 xterm*|rxvt|Eterm|eterm)
  PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
  ;;
 screen)
  PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
  ;;
esac

# auto completion for sudo
SUDO_COMPLETE=( $(echo $PATH | sed 's/:/\n/g' | xargs ls 2>/dev/null) )
complete -o default -W "${SUDO_COMPLETE[*]}" sudo

# download end unpack
function wtar {
    wget $1 | tar xvf
}

#EOF