# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples if [ -f /etc/bashrc ]; then . /etc/bashrc fi # personalize path export PATH=$HOME/bin:$HOME/script:$HOME/script/python:$HOME/script/lab:$HOME/lib/ruby/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games export LD_LIBRARY_PATH=~/lib # personalize latex path export TEXINPUTS=":.:$HOME/projects/latex/common/" # personalize python path PYTHON_VERSION=$(python -c 'import sys; print ".".join([str(i) for i in sys.version_info[:2]])') export PYTHONPATH=".:$HOME/lib/python:$HOME/lib/python$PYTHON_VERSION/site-packages:$HOME/.python" # append personal manpages to manpath export MANPATH=":$HOME/share/man" # personalize Java path (found by tracing from `which javac`) export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/ # personalize ruby and rubygems paths # from http://docs.rubygems.org/read/chapter/15 PREFIX=$HOME export GEM_HOME=$PREFIX/lib/ruby/gems/1.8 export RUBYLIB=$PREFIX/lib/ruby:$PREFIX/lib/site_ruby/1.8 # If not running interactively, don't do anything else [ -z "$PS1" ] && return # don't put duplicate line in the history and ignore lines starting # with a space. See bash(1). export HISTCONTROL=ignoreboth # 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 # adjust for Ubuntu not recognizing screen.* terms if [ "${TERM:0:7}" == "screen." ]; then export TERM="${TERM:7}" fi # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color) color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi if [ "$color_prompt" = yes ]; then # \[\033[XXm\] sets the color. XX = 00:default, 31:red, 33:yellow PS1='${debian_chroot:+($debian_chroot)}\[\033[31m\]\u@\h\[\033[00m\]:\[\033[33m\]\W\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\W\$ ' fi unset color_prompt force_color_prompt colorA colorB # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' ;; *) ;; esac # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. #if [ -f ~/.bash_aliases ]; then # . ~/.bash_aliases #fi # Make file system utilities friendlier alias rm='rm -iv' alias rmdir='rmdir -v' alias cp='cp -iv' alias mv='mv -iv' alias less='less -R' # Configure useful programs alias lp='/usr/bin/lp -o sides=two-sided-long-edge -o media=letter -o cpi=16 -o lpi=10' alias lpb='/usr/bin/lp -o sides=two-sided-long-edge -o media=letter -o cpi=12 -o lpi=6' alias lpi='/usr/bin/lp -o fitplot' alias emacs='emacs -nw' alias xterm='xterm -fg white -bg black' alias w3mg='w3m http://www.google.com' alias w3mh='w3m http://www.physics.drexel.edu/~wking/' alias calendar='calendar -A28' alias acroread='acroread -geometry 1270x950' alias graph='graph -TX -C' alias snownews='snownews -u' alias oggr='ogg123 -qb 500' # play ogg radio streams (quiet, big input buffer) # Alias useful one-liners & common commands alias findex='find . -perm -u+x ! -type d' alias sortdat='find . -printf "%TY-%Tm-%Td+%TH:%TM:%TS %h/%f\n" | sort -n' alias sortdirdat='find . -type d -printf "%TY-%Tm-%Td+%TH:%TM:%TS %h/%f\n" | sort -n' alias sshy='ssh wking@129.25.24.53' alias ssha='ssh sysadmin@129.25.7.55' alias sshxa='ssh -X sysadmin@129.25.7.55' # enable color support of ls and also add handy aliases if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then eval "`dircolors -b`" alias ls='ls --color=auto' #alias dir='ls --color=auto --format=vertical' #alias vdir='ls --color=auto --format=long' alias grep='grep --color=auto' #alias fgrep='fgrep --color=auto' #alias egrep='egrep --color=auto' fi # some more ls aliases alias ll='ls -l' alias la='ls -A' alias l='ls -CF' # 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 # define default programs export EDITOR="/usr/bin/emacs -nw" export PAGER="less" # colorize file listings (di was 34 (blue), swapped with 33 (yellow)) export LS_COLORS='no=00:fi=00:di=00;33:ln=00;36:pi=40;34:so=00;35:bd=40;34;01:cd=40;34;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:' # turn off terminal beep in X if [ $TERM == "xterm" ] && [ -n "$DISPLAY" ] then xset b off fi # turn of terminal beeps in the console, unless connecting via SSH if [ -z "$SSH_CLIENT" ]; then if [ ! -z "$TERM" ]; then setterm -blength 0 fi fi ### ---- begin .dotfiles section ---- (keep this magic comment) # Check for Git (versioning system) so we know how to get our .dotfiles GIT_PATH=`which git` if [ -n "$GIT_PATH" ];then GIT_INSTALLED="true" else GIT_INSTALLED="false" fi # If we don't have checked out copies of our dotfiles, get them if [ ! -d ~/.dotfiles/ ]; then http="http://einstein.physics.drexel.edu/~wking/code/git/dotfiles.git" ssh="http://einstein.physics.drexel.edu/~wking/code/git/dotfiles.git" tgz="http://einstein.physics.drexel.edu/~wking/code/tar/dotfiles.tgz" if [ $GIT_INSTALLED == "true" ]; then git clone $http ~/.dotfiles # setup to use ssh by default. sed -i "s/$http/$ssh/" ~/.dotfiles/.git/config else # fallback on wgetting the tarball pushd ~ wget --output-document dotfiles.tgz $tgz tar -xzvf dotfiles.tgz rm -rf dotfiles.tgz popd fi fi # If we have checked out copies of our dotfiles (i.e. clone successful) if [ -d ~/.dotfiles/ ]; then # Update once a week from our remote repository. if [ ! -e ~/.dotfiles/updated.`date +%U` ]; then rm -f ~/.dotfiles/updated.* 2>/dev/null touch ~/.dotfiles/updated.`date +%U` pushd ~/.dotfiles make fixup popd fi fi ### ---- end .dotfiles section ---- (keep this magic comment)