view .bash_aliases @ 40:21cf7b5fa0d6

DVRA host moved, updating alias
author huston@80426f53-59d1-405d-934b-f07cd76f4a1a
date Thu, 11 Mar 2010 18:31:31 +0000
parents fe60c9191e79
children 2bea356b1032
line wrap: on
line source

# $Id$

# Aliases are read from this file; no real reason to separate them out except
# for readability.

# Some settings which are architecture dependent
case `uname` in
  Darwin)
    # DARWIN is used for the SSHFS mounts below
    DARWIN="yes"

    # The 'stat' and 'date' commands are here since the syntax of the commands
    # is different between Linux and Mac OS X.  If this is run elsewhere, the
    # eval will be false and the test not done below, so it's safe to not
    # bother checking for zero-length variables on the test - it just won't
    # run the svn status, so you won't be prompted if there's newer files
    # available in your repository.  These are safe to export since they're
    # the commands to be evaulated, not the output - you're storing how to get
    # the answer, not the answer itself.

    DFSTAT="stat -f %m -t %s $HOME/.dotfilets"
    MDATE="date -v -1m +%s"
    TDSTAT="stat -f %m -t %s $HOME/.todo"
    HDATE="date -v -1H +%s"

    alias ls='ls -FG'
    ;;

  Linux)
    # See above for a description of these four
    DFSTAT="stat -c %Y $HOME/.dotfilets"
    MDATE="date -d \"1 month ago\" +%s"
    TDSTAT="stat -c %Y $HOME/.todo"
    HDATE="date -d \"1 hour ago\" +%s"

    alias ls='ls --color=auto -F'
    ;;
esac

# Export some of those above for the benefit of future shells
export DFSTAT MDATE TDSTAT HDATE

# SSH aliases
alias dh='ssh srhuston.net'
alias dvra='ssh dvra@w2zq.com'
alias j='ssh joshua.srhuston.net'
alias keys='ssh-add $HOME/.ssh/*.pvt'
alias r='ssh -l root'
alias roc='ssh zenoss@rocinante'
alias s=ssh
alias x='ssh xanadu.astro.princeton.edu'

# Remote desktop/VNC
alias bynarr='rdesktop -a 16 bynarr.astro.princeton.edu -g 1593x1109'
alias demeter='ssh -L9909:demeter:3389 -f joshua.srhuston.net "/sbin/ether-wake 00:0c:f1:a4:b6:c7 ; sleep 30"; sleep 10; rdesktop -a 16 localhost:9909 -g 1593x1109 &'
alias harmonic='ssh -L9910:harmonic:5900 -f joshua.srhuston.net "/sbin/ether-wake 00:11:24:3c:3a:e8 ; sleep 30"; sleep 10; vncviewer Shared=1 FullColour=1 localhost:9910 &'
alias milton='ssh -L9930:milton:5900 -f joshua.srhuston.net "/sbin/ether-wake 00:17:f2:01:d2:3c ; sleep 30"; sleep 10; vncviewer Shared=1 FullColour=1 localhost:9930 &'

# Programs
alias atari='atari800 -height 800 -width 600'
alias base64='openssl enc -a'
alias bsr='bigscreen -raAx'
alias irssi-test='irssi --home=$HOME/irssi-test/'
alias ret='screen -raAx'
alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'"
alias stendhal="java -jar $HOME/Installs/stendhal/stendhal-*.jar"
alias vi='vim'

# SSHFS mounts
# The $DARWIN check fills in a nice volname if this is a Mac
alias junkpile="sshfs -oreconnect${DARWIN:+,volname=Junkpile} srhuston.net:junkpile $HOME/junkpile"
alias sharm="sshfs -oreconnect${DARWIN:+,volname=Harmonic} harmonic.srhuston.net: $HOME/harmonic"
alias sj="sshfs -oreconnect${DARWIN:+,volname=Joshua} joshua.srhuston.net: $HOME/joshua"
alias sdh="sshfs -oreconnect${DARWIN:+,volname=srhuston.net} srhuston.net: $HOME/srhuston.net"
alias sx="sshfs -oreconnect${DARWIN:+,volname=Xanadu} xanadu.astro.princeton.edu: $HOME/xanadu"

# Other
alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog /scr/chimera0/condor/hosts/*/log/MasterLog"

# Functions
update_toodledo() {
  case `hostname -s` in
   xanadu|rapture)
     TOODLEDO_CMDS="toodledo tasks *Work; toodledo tasks *Personal"
     ;;

   milton)
     TOODLEDO_CMDS="toodledo tasks *Home; toodledo tasks *Personal"
     ;;
  esac

  [[ -e $HOME/.todo.$$ ]] && return

  eval $TOODLEDO_CMDS >> $HOME/.todo.$$
  [[ $? -eq 255 ]] && { 
    # Update failed; clean up & don't do it again.
    rm $HOME/.todo.$$
    touch $HOME/.todo
    return
  }
  echo "To-do list as of `date`" > $HOME/.todo
  echo "---------------------------------------------" >> $HOME/.todo
  egrep '^<[0-9]+>' $HOME/.todo.$$ | egrep '#\[[0-9]+/[0-9]+/[0-9]+' | sort -k 5.3 >> $HOME/.todo
  egrep '^<[0-9]+>' $HOME/.todo.$$ | egrep -v '(#\[[0-9]+/[0-9]+/[0-9]+|status\[\])' >> $HOME/.todo
  rm $HOME/.todo.$$
}

# vim: set filetype=sh :