Mercurial > index.cgi > dotfiles
changeset 51:44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
the CentOS 5.5 hosts but fail on Macs. Without the quotes they work
properly everywhere tested.
* Added tests for Intel compiler paths already existing, as well as Condor
* New aliases: pine, ldm, lds, ldsloop, hostmaster
author | huston@80426f53-59d1-405d-934b-f07cd76f4a1a |
---|---|
date | Fri, 03 Jun 2011 18:56:35 +0000 |
parents | 407b3bac9cb0 |
children | 3f489fba24de |
files | .bash_aliases .bashrc |
diffstat | 2 files changed, 42 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/.bash_aliases Sat May 21 14:46:13 2011 +0000 +++ b/.bash_aliases Fri Jun 03 18:56:35 2011 +0000 @@ -71,6 +71,7 @@ alias base64='openssl enc -a' alias bsr='bigscreen -raAx' alias irssi-test='irssi --home=$HOME/irssi-test/' +alias pine='alpine' alias ret='screen -raAx' alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'" alias stendhal="java -jar $HOME/Installs/stendhal/stendhal-*.jar" @@ -85,11 +86,23 @@ alias ssy="sshfs -oreconnect${DARWIN:+,volname=Syrinx} syrinx.astro.princeton.edu: $HOME/syrinx" alias sx="sshfs -oreconnect${DARWIN:+,volname=Xanadu} xanadu.astro.princeton.edu: $HOME/xanadu" +# LDAP/host tools +alias ldm="ldapmodify -Z -x -W -c -D 'cn=DrAdmin,dc=astro,dc=princeton,dc=edu'" +alias ldsloop='while true; do read; clear; lds "$REPLY"; done' +alias hostmaster='ssh -x -a huston@arizona.princeton.edu /usr/oit/bin/hostinfo' + # Other alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog /scr/chimera0/condor/hosts/*/log/MasterLog" alias slurp="wget -r -l1 -np -nd -A.mp3" -# Functions +# Other Functions + +lds() { + QUERY="$1" + shift + ldapsearch -LLL -x "($QUERY)" $@ +} + update_toodledo() { case `hostname -s` in xanadu|syrinx)
--- a/.bashrc Sat May 21 14:46:13 2011 +0000 +++ b/.bashrc Fri Jun 03 18:56:35 2011 +0000 @@ -26,7 +26,7 @@ export GEM_HOME=$HOME/Installs/rubygems/gems # If this is an xterm set the title to user@host:dir -case "$TERM" in +case $TERM in xterm*|rxvt*) PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' ;; @@ -42,14 +42,14 @@ for P in /sbin /usr/sbin /usr/local/bin /usr/local/sbin \ /opt/local/bin /opt/local/sbin /usr/X11R6/bin; do if [ -d $P ]; then - [[ "$PATH" =~ "(^|:)$P($|:)" ]] || \ + [[ $PATH =~ (^|:)$P($|:) ]] || \ export PATH=${P}${PATH:+:$PATH} fi done for M in /usr/local/share/man /usr/local/man /opt/local/share/man ; do if [ -d $M ]; then - [[ "$MANPATH" =~ "(^|:)$M($|:)" ]] || \ + [[ $MANPATH =~ (^|:)$M($|:) ]] || \ export MANPATH=${M}${MANPATH:+:$MANPATH} fi done @@ -57,32 +57,32 @@ # Local Perl install if [ -d $HOME/perl ]; then if [ -d $HOME/perl/lib/perl5 ]; then - [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib/perl5($|:)" ]] || \ + [[ $PERL5LIB =~ (^|:)$HOME/perl/lib/perl5($|:) ]] || \ export PERL5LIB=$HOME/perl/lib/perl5${PERL5LIB:+:$PERL5LIB} fi if [ -d $HOME/perl/lib64/perl5 ]; then - [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib64/perl5($|:)" ]] || \ + [[ $PERL5LIB =~ (^|:)$HOME/perl/lib64/perl5($|:) ]] || \ export PERL5LIB=$HOME/perl/lib64/perl5${PERL5LIB:+:$PERL5LIB} fi if [ -d $HOME/perl/lib/perl5/site_perl ]; then - [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib/perl5/site_perl($|:)" ]] || \ + [[ $PERL5LIB =~ (^|:)$HOME/perl/lib/perl5/site_perl($|:) ]] || \ export PERL5LIB=$HOME/perl/lib/perl5/site_perl${PERL5LIB:+:$PERL5LIB} fi if [ -d $HOME/perl/lib64/perl5/site_perl ]; then - [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib64/perl5/site_perl($|:)" ]] || \ + [[ $PERL5LIB =~ (^|:)$HOME/perl/lib64/perl5/site_perl($|:) ]] || \ export PERL5LIB=$HOME/perl/lib64/perl5/site_perl${PERL5LIB:+:$PERL5LIB} fi if [ -d $HOME/perl/share/man ]; then - [[ "$MANPATH" =~ "(^|:)$HOME/perl/share/man($|:)" ]] || \ + [[ $MANPATH =~ (^|:)$HOME/perl/share/man($|:) ]] || \ export MANPATH=$HOME/perl/share/man:${MANPATH:+$MANPATH} fi if [ -d $HOME/perl/bin ]; then - [[ "$PATH" =~ "(^|:)$HOME/perl/bin($|:)" ]] || \ + [[ $PATH =~ (^|:)$HOME/perl/bin($|:) ]] || \ export PATH=$HOME/perl/bin${PATH:+:$PATH} fi fi @@ -93,17 +93,17 @@ # './configure --prefix=$HOME/Installs' for D in $HOME/Installs/* ; do if [ -d $D/bin ]; then - [[ "$PATH" =~ "(^|:)$D/bin($|:)" ]] || \ + [[ $PATH =~ (^|:)$D/bin($|:) ]] || \ export PATH=$D/bin${PATH:+:$PATH} fi if [ -d $D/share/man ]; then - [[ "$MANPATH" =~ "(^|:)$D/share/man($|:)" ]] || \ + [[ $MANPATH =~ (^|:)$D/share/man($|:) ]] || \ export MANPATH=$D/share/man:${MANPATH:+$MANPATH} fi if [ -d $D/man ]; then - [[ "$MANPATH" =~ "(^|:)$D/man($|:)" ]] || \ + [[ $MANPATH =~ (^|:)$D/man($|:) ]] || \ export MANPATH=$D/man:${MANPATH:+$MANPATH} fi done @@ -120,37 +120,41 @@ ;; esac [[ "$INTEL_ARCH" ]] && { - [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \ - . /usr/peyton/intel/11.0/bin/iccvars.sh $INTEL_ARCH - [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \ - . /usr/peyton/intel/11.0/bin/ifortvars.sh $INTEL_ARCH + [[ $PATH =~ (^|:)/usr/peyton/intel ]] || { + [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \ + . /usr/peyton/intel/11.0/bin/iccvars.sh $INTEL_ARCH + [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \ + . /usr/peyton/intel/11.0/bin/ifortvars.sh $INTEL_ARCH + } } -[[ -f /u/condor/condor-setup.sh ]] && { - export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin - . /u/condor/condor-setup.sh -} +if [ -f /u/condor/condor-setup.sh ]; then + [[ $PATH =~ (^|:)/u/condor/hosts/`hostname -s`/sbin($|:) ]] || { + export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin + . /u/condor/condor-setup.sh + } +fi # Now make sure $HOME/bin is top of the list (or at least present) if [ -d $HOME/bin ]; then - [[ "$PATH" =~ "(^|:)$HOME/bin($|:)" ]] || \ + [[ $PATH =~ (^|:)$HOME/bin($|:) ]] || \ export PATH=$HOME/bin${PATH:+:$PATH} fi # Last, make sure to end MANPATH with a ':' to force include of system paths # (some versions of man take care of this, but it doesn't hurt to have it # anyway) -[[ "$MANPATH" =~ ":$" ]] || export MANPATH=$MANPATH: +[[ $MANPATH =~ :$ ]] || export MANPATH=$MANPATH: # Store MIBs in ~/mibs and they'll be added here. Can nest directories # (they'll be searched). if [ -d $HOME/mibs ]; then for D in `find $HOME/mibs -type d` ; do - [[ "$MIBDIRS" =~ "(^\+|:)$D($|:)" ]] || \ + [[ $MIBDIRS =~ (^\+|:)$D($|:) ]] || \ export MIBDIRS=${MIBDIRS:+$MIBDIRS:}$D done - [[ "$MIBDIRS" =~ "^\+" ]] || export MIBDIRS=+$MIBDIRS + [[ $MIBDIRS =~ ^\+ ]] || export MIBDIRS=+$MIBDIRS export MIBS=ALL fi