# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # If not running interactively, don't do anything [ -z "$PS1" ] && return # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi ##### if [ -n "$SSH_CLIENT" ]; then if [ -z "$STY" ]; then screen -r fi fi if [ -d $HOME/bin ]; then export PATH=$HOME/bin:$PATH fi export HISTSIZE=1000000 export HISTFILESIZE=1000000000 export HISTCONTROL=ignoredups # make it append, rather than overwrite the history shopt -s histappend # fix typos shopt -s cdspell export BROWSER=firefox export EDITOR=vim # make pilot-xfer go faster than 9600 export PILOTRATE=57600 . ~/dotfiles/conf.sh ##### ssh agent ##### SSH_ENV="$HOME/.ssh_env" function start_agent { /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" chmod 600 "${SSH_ENV}" . "${SSH_ENV}" > /dev/null /usr/bin/ssh-add ~/.ssh/id_dsa ~/.ssh/zeitin/id_rsa; } function keys { if [ -f "${SSH_ENV}" ]; then /bin/ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { start_agent; } else start_agent; fi ssh-add -l } alias k='keys' alias nk='ssh-add -D; killall ssh-agent' if [ -f "${SSH_ENV}" ]; then . "${SSH_ENV}" > /dev/null /bin/ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { echo ssh env is old, removing... rm ${SSH_ENV} } fi ##### ssh agent end ##### ################# # Custom Prompt # ################# BGREEN='\[\033[1;32m\]' GREEN='\[\033[0;32m\]' BRED='\[\033[1;31m\]' RED='\[\033[0;31m\]' BBLUE='\[\033[1;34m\]' BLUE='\[\033[0;34m\]' NORMAL='\[\033[00m\]' #TODO: last code flag not working delete it! PS_LAST_CODE_FLAG=false PS_LAST_CODE='$( r=$?; [ $r -ne 0 -a "$PS_LAST_CODE_FLAG" == "false" ] && (echo -n "|$r"; PS_LAST_CODE_FLAG="true"))' PS1="${GREEN}[${BGREEN}\u@\h${GREEN}|${BBLUE}\w${GREEN}|${BLUE}\t${RED}${PS_LAST_CODE}${GREEN}]${NORMAL} " function promptcmd () { #history -a echo } PROMPT_COMMAND=promptcmd ##################### # End Custom Prompt # #################### export homeip='85.96.176.134' export vpsip='209.20.87.58' LS_OPTIONS='-lh --color --group-directories-first' eval `dircolors` alias l='ls $LS_OPTIONS' #alias ls='ls $LS_OPTIONS -Ff --color' alias la='ls $LS_OPTIONS -af' alias ld='ls -d $LS_OPTIONS -af' # directories only! alias pgrep='pgrep -lf' alias df='df -h' alias du='du -h -c' alias ping='ping' alias mkdir='mkdir -p' alias grep='grep --colour' alias g="grep" alias v="vim" alias sv="sudo vim" alias e="emacs" alias sx="startx" function syslog() { sudo tail -f $(find /var/log/ -name '*.log') ~/unison.log | ccze -A } function vpslog() { ssh yayingac.com sudo tail -f $(find /var/log/ -name '*.log') | ccze -A } #alias pci_info="curl --silent -d 'check=Check&lspci=$(lspci -n)' http://kmuto.jp/debian/hcl/index.cgi | sed -n '/