annotate .bash_aliases @ 37:fe60c9191e79

* Changed logic for hiding deferred items
author huston@80426f53-59d1-405d-934b-f07cd76f4a1a
date Sat, 06 Mar 2010 23:57:02 +0000
parents 197cf5968322
children 21cf7b5fa0d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
f65964738bab Added Id tag to files, and svn propset svn:keywords as appropriate
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 15
diff changeset
1 # $Id$
f65964738bab Added Id tag to files, and svn propset svn:keywords as appropriate
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 15
diff changeset
2
f65964738bab Added Id tag to files, and svn propset svn:keywords as appropriate
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 15
diff changeset
3 # Aliases are read from this file; no real reason to separate them out except
f65964738bab Added Id tag to files, and svn propset svn:keywords as appropriate
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 15
diff changeset
4 # for readability.
f65964738bab Added Id tag to files, and svn propset svn:keywords as appropriate
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 15
diff changeset
5
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
6 # Some settings which are architecture dependent
15
fe83d9892ee3 Replaced tests with a 'case' in .bash_aliases
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 13
diff changeset
7 case `uname` in
30
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
8 Darwin)
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
9 # DARWIN is used for the SSHFS mounts below
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
10 DARWIN="yes"
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
11
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
12 # The 'stat' and 'date' commands are here since the syntax of the commands
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
13 # is different between Linux and Mac OS X. If this is run elsewhere, the
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
14 # eval will be false and the test not done below, so it's safe to not
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
15 # bother checking for zero-length variables on the test - it just won't
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
16 # run the svn status, so you won't be prompted if there's newer files
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
17 # available in your repository. These are safe to export since they're
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
18 # the commands to be evaulated, not the output - you're storing how to get
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
19 # the answer, not the answer itself.
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
20
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
21 DFSTAT="stat -f %m -t %s $HOME/.dotfilets"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
22 MDATE="date -v -1m +%s"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
23 TDSTAT="stat -f %m -t %s $HOME/.todo"
34
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
24 HDATE="date -v -1H +%s"
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
25
30
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
26 alias ls='ls -FG'
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
27 ;;
8
aa5e55aa62ef Moved specific section to top of .bash_aliases, so other bits can be set based
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 3
diff changeset
28
30
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
29 Linux)
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
30 # See above for a description of these four
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
31 DFSTAT="stat -c %Y $HOME/.dotfilets"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
32 MDATE="date -d \"1 month ago\" +%s"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
33 TDSTAT="stat -c %Y $HOME/.todo"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
34 HDATE="date -d \"1 hour ago\" +%s"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
35
30
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
36 alias ls='ls --color=auto -F'
ca6c77fe843b * Whitespace (ugh)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 26
diff changeset
37 ;;
15
fe83d9892ee3 Replaced tests with a 'case' in .bash_aliases
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 13
diff changeset
38 esac
8
aa5e55aa62ef Moved specific section to top of .bash_aliases, so other bits can be set based
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 3
diff changeset
39
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
40 # Export some of those above for the benefit of future shells
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
41 export DFSTAT MDATE TDSTAT HDATE
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
42
1
7e33b3191cf7 Merged in settings from home, and at the same time edited some of the
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 0
diff changeset
43 # SSH aliases
2
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
44 alias dh='ssh srhuston.net'
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
45 alias dvra='ssh dvra@laurel.dreamhost.com'
0
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
46 alias j='ssh joshua.srhuston.net'
26
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
47 alias keys='ssh-add $HOME/.ssh/*.pvt'
1
7e33b3191cf7 Merged in settings from home, and at the same time edited some of the
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 0
diff changeset
48 alias r='ssh -l root'
7e33b3191cf7 Merged in settings from home, and at the same time edited some of the
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 0
diff changeset
49 alias roc='ssh zenoss@rocinante'
2
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
50 alias s=ssh
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
51 alias x='ssh xanadu.astro.princeton.edu'
1
7e33b3191cf7 Merged in settings from home, and at the same time edited some of the
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 0
diff changeset
52
12
08bf77c6174f Added bynarr alias (rdesktop)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 10
diff changeset
53 # Remote desktop/VNC
25
23321498d5f7 Adding remote desktop aliases, refs #2
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
54 alias bynarr='rdesktop -a 16 bynarr.astro.princeton.edu -g 1593x1109'
23321498d5f7 Adding remote desktop aliases, refs #2
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
55 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 &'
23321498d5f7 Adding remote desktop aliases, refs #2
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
56 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 &'
23321498d5f7 Adding remote desktop aliases, refs #2
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 19
diff changeset
57 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 &'
12
08bf77c6174f Added bynarr alias (rdesktop)
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 10
diff changeset
58
1
7e33b3191cf7 Merged in settings from home, and at the same time edited some of the
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 0
diff changeset
59 # Programs
3
072b183989e0 Merged in changes for the Mac, including the beginnings of platform
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 2
diff changeset
60 alias atari='atari800 -height 800 -width 600'
2
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
61 alias base64='openssl enc -a'
0
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
62 alias bsr='bigscreen -raAx'
26
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
63 alias irssi-test='irssi --home=$HOME/irssi-test/'
2
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
64 alias ret='screen -raAx'
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
65 alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'"
26
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
66 alias stendhal="java -jar $HOME/Installs/stendhal/stendhal-*.jar"
2
2b4dcc885071 Alphabetized aliases for easier sorting
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 1
diff changeset
67 alias vi='vim'
0
c78481cfb082 Initial checkin:
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents:
diff changeset
68
1
7e33b3191cf7 Merged in settings from home, and at the same time edited some of the
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 0
diff changeset
69 # SSHFS mounts
8
aa5e55aa62ef Moved specific section to top of .bash_aliases, so other bits can be set based
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 3
diff changeset
70 # The $DARWIN check fills in a nice volname if this is a Mac
26
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
71 alias junkpile="sshfs -oreconnect${DARWIN:+,volname=Junkpile} srhuston.net:junkpile $HOME/junkpile"
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
72 alias sharm="sshfs -oreconnect${DARWIN:+,volname=Harmonic} harmonic.srhuston.net: $HOME/harmonic"
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
73 alias sj="sshfs -oreconnect${DARWIN:+,volname=Joshua} joshua.srhuston.net: $HOME/joshua"
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
74 alias sdh="sshfs -oreconnect${DARWIN:+,volname=srhuston.net} srhuston.net: $HOME/srhuston.net"
e14a0b4fab30 * Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 25
diff changeset
75 alias sx="sshfs -oreconnect${DARWIN:+,volname=Xanadu} xanadu.astro.princeton.edu: $HOME/xanadu"
13
dacbbae5965c Added Ruby setup variables
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 12
diff changeset
76
dacbbae5965c Added Ruby setup variables
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 12
diff changeset
77 # Other
dacbbae5965c Added Ruby setup variables
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 12
diff changeset
78 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog /scr/chimera0/condor/hosts/*/log/MasterLog"
15
fe83d9892ee3 Replaced tests with a 'case' in .bash_aliases
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 13
diff changeset
79
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
80 # Functions
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
81 update_toodledo() {
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
82 case `hostname -s` in
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
83 xanadu|rapture)
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
84 TOODLEDO_CMDS="toodledo tasks *Work; toodledo tasks *Personal"
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
85 ;;
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
86
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
87 milton)
35
a57fad86e03a * Added Home folder to todo list
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 34
diff changeset
88 TOODLEDO_CMDS="toodledo tasks *Home; toodledo tasks *Personal"
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
89 ;;
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
90 esac
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
91
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
92 [[ -e $HOME/.todo.$$ ]] && return
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
93
34
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
94 eval $TOODLEDO_CMDS >> $HOME/.todo.$$
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
95 [[ $? -eq 255 ]] && {
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
96 # Update failed; clean up & don't do it again.
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
97 rm $HOME/.todo.$$
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
98 touch $HOME/.todo
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
99 return
82fde4c9245c * Date option on Macs is -H, not -h
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 33
diff changeset
100 }
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
101 echo "To-do list as of `date`" > $HOME/.todo
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
102 echo "---------------------------------------------" >> $HOME/.todo
36
197cf5968322 * Fixed sort key
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 35
diff changeset
103 egrep '^<[0-9]+>' $HOME/.todo.$$ | egrep '#\[[0-9]+/[0-9]+/[0-9]+' | sort -k 5.3 >> $HOME/.todo
37
fe60c9191e79 * Changed logic for hiding deferred items
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 36
diff changeset
104 egrep '^<[0-9]+>' $HOME/.todo.$$ | egrep -v '(#\[[0-9]+/[0-9]+/[0-9]+|status\[\])' >> $HOME/.todo
33
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
105 rm $HOME/.todo.$$
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
106 }
f59f847377d7 * Added toodledo interfacing
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 30
diff changeset
107
15
fe83d9892ee3 Replaced tests with a 'case' in .bash_aliases
huston@80426f53-59d1-405d-934b-f07cd76f4a1a
parents: 13
diff changeset
108 # vim: set filetype=sh :