# .bashrc -- Bash loads this file at startup, after ".bash_profile". # Yes, Bash syntax allows "export FOO=BAR", but sh syntax requires # "FOO=BAR; export FOO", so that's what we do to remain /bin/sh # compatible. # My .xinitrc (and, indirectly, my .twmrc) use this: HOST=`hostname`; export HOST # default to local CVSROOT=:ext:kfogel@cvs.red-bean.com:/usr/local/cvs export CVSROOT # Hosts we care about prefer SSH: CVS_RSH=ssh export CVS_RSH # I hate typing that pa$$phrase over and over. # Leave this out until understand it! # eval `ssh-agent` # Nicely ask the beta not to expire yet. export OVERRIDE_PGP_TIMEBOMB=true # See that file for more info: HOSTALIASES=${HOME}/.hostaliases; export HOSTALIASES # I don't normally use this anywhere, but it might be handy to have it # hardcoded on remote machines in case of massive DNS failure: FLOSS_IP_ADDRESS=132.162.30.13; export FLOSS_IP_ADDRESS # Many programs use an $EDITOR variable; "emacsclient" says to connect # with a running emacs if one exists, else just use emacs: # EDITOR=emacsclient; # export EDITOR EDITOR=emacsclient export EDITOR # For printing from floss (moot now that I'm not in the Bloomington # office where the printer is): NENSCRIPT="-Gr2"; export NENSCRIPT # Apparently due to some weird Debian decision. export LIBTOOL_M4=/usr/local/share/aclocal/libtool.m4 # For the TeX text-formatting system: TEXINPUTS=.:/usr/lib/texinfo:${TEXINPUTS}; export TEXINPUTS # The PATH variable is searched to execute programs which have been # invoked with a non-absolute pathname; i.e., if you run "ls" instead # of "/bin/ls". # `gnusoft' and `public' are Oberlin things. PATH=${HOME}/private/bin:${HOME}/src/bzr/bzr.dev:${HOME}/bin:\ /usr/local/bin:/bin:/usr/bin:/usr/local/netscape:/sbin:\ /usr/sbin:/usr/local/java/bin:/usr/ucb:/usr/etc:/usr/gnusoft/bin:\ /usr/public/bin:/usr/games:/usr/local/gallery/bin:/usr/local/postgres/bin:\ /usr/local/j2sdk1.4.1/bin/:/usr/local/jdk/bin export PATH # Postgres stuff. PGHOME=/usr/local/postgres export PGLIB=${PGHOME}/lib export PGDATA=${PGHOME}/data PATH=$PATH:${PGHOME}/bin LD_LIBRARY_PATH=.:${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/apache2/lib export LD_LIBRARY_PATH # `hostname` at Oberlin doesn't seem to include the domain if [ ${HOST} = "eniac" \ -o ${HOST} = "edvac" \ -o ${HOST} = "mark1" \ -o ${HOST} = "abc" \ -o ${HOST} = "csxt" \ -o ${HOST} = "cssun" \ -o ${HOST} = "occs" \ -o ${HOST} = "ocds" \ -o ${HOST} = "eniac" ] then HOST=${HOST}.cs.oberlin.edu export HOST fi # Totoro is kind of anarchic -- let's leave things that way: if [ ${HOST} = "totoro.red-bean.com" ] then umask 000 else umask 022 fi # Don't clutter command history with duplicates history_control=ignoredups export history_control # Oh, apparently it's "HISTCONTROL" nowadays. Fine, whatever. HISTCONTROL=ignoredups export HISTCONTROL # I like to be able to use C-d to log out. unset ignoreeof # Make second-level prompt show the hostname: PS2="\h... " export PS2 # I'm not sure what this was about, so I've commented it out: # stty -lcase crt crterase crtkill # My standard aliases alias m="${HOME}/bin/maltron.sh" alias ls="ls -CF" alias os="ls -CF" alias ll="ls -l" alias lh="ls -lh" alias lr="ls -lh ${HOME}/src/random/random.out" alias ol="ls -l" alias la="ls -a" alias oa="ls -a" alias rr="rm -r" alias sa="source ~/agent" alias sqlspam="defaults write NSGlobalDomain EOAdaptorDebugEnabled YES" alias sqlspamon="defaults write NSGlobalDomain EOAdaptorDebugEnabled YES" alias sqlspamoff="defaults write NSGlobalDomain EOAdaptorDebugEnabled NO" alias spam="defaults write NSGlobalDomain EOAdaptorDebugEnabled YES" alias spamon="defaults write NSGlobalDomain EOAdaptorDebugEnabled YES" alias spamoff="defaults write NSGlobalDomain EOAdaptorDebugEnabled NO" alias run="./Admin.woa/Admin" alias fg1="fg %1" alias fg2="fg %2" alias fg3="fg %3" alias fg4="fg %4" alias fg5="fg %5" alias fg6="fg %6" alias fg7="fg %7" alias fg8="fg %8" alias fg9="fg %9" alias os=/usr/local/bin/svn alias ns=/home/kfogel/src/subversion/subversion/svn/svn alias record="arecord -f cd -t wav -D iec958 foo.wav" alias tf="telnet floss.red-bean.com" alias to="telnet cs.oberlin.edu" alias ta="telnet juju.mcs.anl.gov" alias tg="telnet wombat.gnu.ai.mit.edu" alias tw="telnet wookumz.gnu.ai.mit.edu" alias bx="BitchX" # onshore internal IRC alias mroe="more" alias moer="more" alias email="emacs -nw -f vm" alias pu=pushd alias po=popd alias b="~/.b" alias ds=dirs alias ro=cleanemacs alias md="mkdir" alias whom="who" alias wh="w" alias fm="fetchmail" alias slog="LC_CTYPE=en_US.UTF-8 svn log http://svn.apache.org/repos/asf/subversion/" alias svlog="LC_CTYPE=en_US.UTF-8 svn log -v http://svn.apache.org/repos/asf/subversion/" alias bvlog="bzr log -v -n0 --show-ids > log-vn0.out &" alias blog="bzr log -n0 --show-ids > log-n0.out" alias cdc="cd ${HOME}/private/work/canonical/lp/lp-branches" # See https://lists.launchpad.net/launchpad-dev/msg02780.html LP_PERSISTENT_TEST_SERVICES=1 export LP_PERSISTENT_TEST_SERVICES # Prepend to existing svn log output in a file "log.out". # Pass "-v" to get verbose log data, in which case file is "logv.out". function quicklog { PATH_TO_WD=`pwd` if [ `basename ${PATH_TO_WD}` != "subversion" ]; then echo "You must be in '${HOME}/[local]src/subversion' to run this." return 1 fi URL="http://svn.apache.org/repos/asf/subversion/" FILE=log.out if [ "${1}" = "-v" -o "${1}" = "-v" ]; then FILE=logv.out; fi LASTREV=`grep -E "^r[0-9]+" ${FILE} | head -1 | cut -d " " -f 1 | cut -b2-` REV=`dc -e "${LASTREV} 1 + p"` svn log ${1} --incremental -rHEAD:${REV} ${URL} trunk branches > ql.tmp cat ${FILE} >> ql.tmp mv ql.tmp ${FILE} } alias shlog="quicklog" alias shvlog="quicklog -v" # Quick Fix for terminal terminals function termfix { TERM=vt100 export TERM stty rows 24 cols 80 } ## I like my prompt to show me who I am if [ ${UID} = 0 ] then PROMPTEND='# ' else PROMPTEND='>' fi export PROMPTEND ## And I like my prompt to show me where I am: # for when prompt gets overly long: function shortprompt { PS1="@\W\$PROMPTEND" export PS1 } alias shortp=shortprompt # for when prompt gets underly short: function longprompt { PS1="@\$PWD\$PROMPTEND" export PS1 } alias longp=longprompt # prompt used in book examples (so I can paste directly from my shell buffer) function bookprompt { PS1="\h$ " export PS1 } # The short form is usually what I want: shortprompt function cleanemacs { # Remove all emacs junk files in specified directory (default: current # directory) and subtrees. Any files that are removed are printed to # the screen. Does not ask. DIR=${1-`pwd`} find ${DIR} \ \( -name '.[BC]*' \ -o -name '.emacs_[0-9]*' \ -o -name '.*~' \ -o -name '*~' \ -o -name '#*#' \) \ -print -exec rm -f {} \; } function uplog { # Update an existing subversion log.out file LOGFILE=${HOME}/src/subversion/log.out # Clean up from before rm -f ${LOGFILE}.tmp if [ -f ${LOGFILE} ]; then lastrev=`head -3 ${LOGFILE} | grep rev | cut -d " " -f 2 | cut -b 1-4` else lastrev=0 fi echo "NOT WORKING YET" # svn log -rHEAD:${lastrev} https://svn.apache.org/repos/asf/subversion/ >> ${LOGFILE}.tmp # # logsize=`ls -l ${LOGFILE}.tmp | cut -d " " -f 5` # echo "first logsize is ${logsize}" # logsize=`echo ${logsize} 72 - p | dc` # echo "next logsize ${logsize}" # echo "file: ${LOGFILE}.tmp" # cat ${LOGFILE}.tmp | cut -b 73- } function svncount { # Show commit activity. I don't anticipate running this, I just # wanted to save that awesome command line so I don't have to make # it up again next time. svn log https://svn.apache.org/repos/asf/subversion/ \ | grep -E "^r[0-9]+ \|" | cut -d "|" -f 2 | cut -d " " -f 2 \ | sort | uniq -c | sort -rn } # I believe this has something to do with mail... if [ -z "${USER}" ]; then USER=${LOGNAME} fi export PATH=${PATH}:/usr/openwin/bin if [ -f ${HOME}/private/work/.bashrc ]; then source ${HOME}/private/work/.bashrc fi #### If there is an ssh agent running on this machine, set up the #### environment accordingly. This writes the agent info to a file #### named $HOME/.ssh-HOSTNAME, checks if the agent is still alive, #### and restarts a new one otherwise. # function ssh-find-agent { # local agentfile="$HOME/.ssh-`hostname`" # [ -f $agentfile ] && . $agentfile > /dev/null # ## Is the agent process still alive? # ( ssh-add -l > /dev/null 2>&1 ) || { # ## No, start a new one. # ssh-agent > $agentfile # . $agentfile > /dev/null # } # }