Mercurial > index.cgi > dotfiles
annotate .bash_aliases @ 205:16fdb3931af6
Many changes to proxy setup, probably more to come eventually
| author | Steve Huston <huston@astro.princeton.edu> | 
|---|---|
| date | Tue, 24 Nov 2020 17:30:54 -0500 | 
| parents | 7d3fe7399566 | 
| children | 3b8b613c4d7a | 
| rev | line source | 
|---|---|
| 19 
f65964738bab
Added Id tag to files, and svn propset svn:keywords as appropriate
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
15diff
changeset | 1 # 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: 
15diff
changeset | 2 # for readability. | 
| 
f65964738bab
Added Id tag to files, and svn propset svn:keywords as appropriate
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
15diff
changeset | 3 | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 4 # Some settings which are architecture dependent | 
| 15 
fe83d9892ee3
Replaced tests with a 'case' in .bash_aliases
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
13diff
changeset | 5 case `uname` in | 
| 30 
ca6c77fe843b
* Whitespace (ugh)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
26diff
changeset | 6 Darwin) | 
| 
ca6c77fe843b
* Whitespace (ugh)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
26diff
changeset | 7 # DARWIN is used for the SSHFS mounts below | 
| 
ca6c77fe843b
* Whitespace (ugh)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
26diff
changeset | 8 DARWIN="yes" | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 9 | 
| 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 10 # The 'stat' and 'date' commands are here since the syntax of the commands | 
| 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 11 # 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: 
30diff
changeset | 12 # 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: 
30diff
changeset | 13 # bother checking for zero-length variables on the test - it just won't | 
| 82 
0b67280c980c
Reword comment (no more svn)
 Steve Huston <huston@srhuston.net> parents: 
75diff
changeset | 14 # run the hg incoming, so you won't be prompted if there's newer files | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 15 # available in your repository. These are safe to export since they're | 
| 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 16 # 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: 
30diff
changeset | 17 # the answer, not the answer itself. | 
| 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 18 | 
| 41 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 19 # Also note, the full paths are stored since GNU coreutils might be | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 20 # installed; while that would tend to make things "easier" since the GNU | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 21 # one is the same as the Linux ones below, it can't be guaranteed. | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 22 # Instead of checking for the presence of /opt/local/bin/ls (or gls) it's | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 23 # easier to point directly to the one you know *is* installed. | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 24 | 
| 41 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 25 DFSTAT="/usr/bin/stat -f %m -t %s $HOME/.dotfilets" | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 26 MDATE="/bin/date -v -1m +%s" | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 27 | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 28 alias ls='/bin/ls -FG' | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 29 | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 30 VNCVIEWER="open vnc://" | 
| 30 
ca6c77fe843b
* Whitespace (ugh)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
26diff
changeset | 31 ;; | 
| 8 
aa5e55aa62ef
Moved specific section to top of .bash_aliases, so other bits can be set based
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
3diff
changeset | 32 | 
| 30 
ca6c77fe843b
* Whitespace (ugh)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
26diff
changeset | 33 Linux) | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 34 # See above for a description of these four | 
| 41 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 35 DFSTAT="/usr/bin/stat -c %Y $HOME/.dotfilets" | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 36 MDATE="/bin/date -d \"1 month ago\" +%s" | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 37 | 
| 41 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 38 alias ls='/bin/ls --color=auto -F' | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 39 | 
| 
2bea356b1032
* Added default screenrc from Linux (and the Screen installation) to .screenrc
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
40diff
changeset | 40 VNCVIEWER="vncviewer Shared=1 Fullcolor=1 " | 
| 30 
ca6c77fe843b
* Whitespace (ugh)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
26diff
changeset | 41 ;; | 
| 15 
fe83d9892ee3
Replaced tests with a 'case' in .bash_aliases
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
13diff
changeset | 42 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: 
3diff
changeset | 43 | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 44 # Export some of those above for the benefit of future shells | 
| 197 
954d25f20123
Removing toodledo stuff (no longer used)
 Steve Huston <huston@srhuston.net> parents: 
196diff
changeset | 45 export DFSTAT MDATE | 
| 33 
f59f847377d7
* Added toodledo interfacing
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
30diff
changeset | 46 | 
| 1 
7e33b3191cf7
Merged in settings from home, and at the same time edited some of the
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
0diff
changeset | 47 # SSH aliases | 
| 177 
ce4f783c13d8
csesbh -> csesbh2 for aliases too
 Steve Huston <huston@astro.princeton.edu> parents: 
175diff
changeset | 48 alias bh='ssh csesbh2.princeton.edu' | 
| 167 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 49 cert() { | 
| 198 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 50 # SSH key signing with Vault for administration | 
| 167 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 51 export VAULT_ADDR='https://ajax.rc.princeton.edu:8200' | 
| 193 
5d0e1adee7e0
Modifying cert alias for different key
 Steve Huston <huston@astro.princeton.edu> parents: 
192diff
changeset | 52 ssh-add -d $HOME/.ssh/rc_vault_key-cert.pub > /dev/null 2>&1 | 
| 167 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 53 if vault login -method=radius username=vi-srh; then | 
| 193 
5d0e1adee7e0
Modifying cert alias for different key
 Steve Huston <huston@astro.princeton.edu> parents: 
192diff
changeset | 54 vault write -field=signed_key ssh-client-signer/sign/root public_key=@$HOME/.ssh/rc_vault_key.pub > $HOME/.ssh/rc_vault_key-cert.pub | 
| 194 
bb1c927125a5
Add a timeout to the key & cert
 Steve Huston <huston@astro.princeton.edu> parents: 
193diff
changeset | 55 ssh-add -t 36000 $HOME/.ssh/rc_vault_key | 
| 167 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 56 else | 
| 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 57 echo Failed to login to vault, aborting | 
| 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 58 fi | 
| 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 59 } | 
| 198 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 60 alias dh='ssh srhuston.net' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 61 alias j='ssh joshua.srhuston.net' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 62 alias keys='ssh-add $HOME/.ssh/*.pvt' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 63 alias r='ssh -l root' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 64 alias rf='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -l root' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 65 alias rbh='ssh -t csesbh2.princeton.edu screen -raAx csesbh2' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 66 alias rj='ssh -t joshua.srhuston.net screen -raAx' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 67 alias rx='ssh -t xanadu.astro.princeton.edu screen -raAx' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 68 alias s=ssh | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 69 alias sf='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 70 t() { | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 71 # Tunneling SSH - a simple 't hostname' will tunnel to xanadu and then | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 72 # connect to hostname, while 't hostname tunnelhost' will connect to | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 73 # tunnelhost and then hostname | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 74 T_HOST=xanadu.astro.princeton.edu | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 75 if [ -n "$2" ] ; then | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 76 T_HOST=$2 | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 77 fi | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 78 ssh -t $T_HOST "ssh $1" | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 79 } | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 80 alias x='ssh xanadu.astro.princeton.edu' | 
| 
6e7913283c7a
Removed a lot of cruft that's no longer needed, cleaned up some comments & syntax
 Steve Huston <huston@srhuston.net> parents: 
197diff
changeset | 81 | 
| 205 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 82 # Notes for the process: | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 83 # * Do I want $1 to specify which proxy I'm trying to load? Or have it check | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 84 # some things and try to determine automatically what to do? Latter could | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 85 # be nice but will make it more complex, maybe starting with the explicit | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 86 # first would be wise... | 
| 167 
88ed01a1094f
SSH Certificate signing
 Steve Huston <huston@astro.princeton.edu> parents: 
165diff
changeset | 87 | 
| 165 
ab0fb2057b88
Proxy function for starting a proxy server & Chrome
 Steve Huston <huston@astro.princeton.edu> parents: 
164diff
changeset | 88 # Proxying/tunneling - predominantly for my Mac laptop | 
| 
ab0fb2057b88
Proxy function for starting a proxy server & Chrome
 Steve Huston <huston@astro.princeton.edu> parents: 
164diff
changeset | 89 proxy() { | 
| 205 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 90 case $1 in | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 91 home) | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 92 PROXY_HOST=${PROXY_HOST:-joshua.srhuston.net} | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 93 PROXY_PORT=${PROXY_PORT:-8889} | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 94 PROXY_PATH="/Volumes/Chrome-Personal" | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 95 PROXY_UMOUNT="hdiutil detach -quiet ${PROXY_PATH}" | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 96 if [ ! -e ${PROXY_PATH}/.profile-exists ] ; then | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 97 hdiutil attach -stdinpass -nobrowse -quiet ~/Documents/Chrome-Personal.dmg | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 98 if [ ! $? ] ; then | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 99 echo Disk image failed to mount, aborting | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 100 return | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 101 fi | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 102 fi | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 103 ;; | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 104 work) | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 105 PROXY_HOST=${PROXY_HOST:-xanadu.astro.princeton.edu} | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 106 PROXY_PORT=${PROXY_PORT:-8888} | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 107 PROXY_PATH="/Users/huston/Library/Application Support/Google/Chrome" | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 108 ;; | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 109 rc) | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 110 PROXY_HOST=${PROXY_HOST:-csesbh2.princeton.edu} | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 111 PROXY_PORT=${PROXY_PORT:-8887} | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 112 PROXY_PATH="/Users/huston/Library/Application Support/Google/Proxied_Chrome" | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 113 ;; | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 114 *) | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 115 ;; | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 116 esac | 
| 200 
7d3fe7399566
SSH isn't working as I expected, but this seems to still do the trick
 Steve Huston <huston@srhuston.net> parents: 
198diff
changeset | 117 ssh -D $PROXY_PORT -f -C -q $PROXY_HOST 'hostname' | 
| 205 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 118 ( | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 119 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 120 --proxy-server="socks5://127.0.0.1:$PROXY_PORT" \ | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 121 --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" \ | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 122 --user-data-dir="${PROXY_PATH}" > /dev/null 2>&1 | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 123 $PROXY_UMOUNT | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 124 # Maybe leave this off, so what if the port is left open if there's no | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 125 # conflicts... | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 126 # ssh -O cancel -D $PROXY_PORT $PROXY_HOST | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 127 ) & | 
| 
16fdb3931af6
Many changes to proxy setup, probably more to come eventually
 Steve Huston <huston@astro.princeton.edu> parents: 
200diff
changeset | 128 disown %+ | 
| 165 
ab0fb2057b88
Proxy function for starting a proxy server & Chrome
 Steve Huston <huston@astro.princeton.edu> parents: 
164diff
changeset | 129 } | 
| 
ab0fb2057b88
Proxy function for starting a proxy server & Chrome
 Steve Huston <huston@astro.princeton.edu> parents: 
164diff
changeset | 130 | 
| 12 
08bf77c6174f
Added bynarr alias (rdesktop)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
10diff
changeset | 131 # Remote desktop/VNC | 
| 155 
5ab127dd2d89
Fixing up aliases for VNC connections
 Steve Huston <huston@astro.princeton.edu> parents: 
154diff
changeset | 132 eval "alias milton='ssh -L9930:milton:5900 -f joshua.srhuston.net \"sleep 5\"; ${VNCVIEWER}localhost:9930 &'" | 
| 12 
08bf77c6174f
Added bynarr alias (rdesktop)
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
10diff
changeset | 133 | 
| 1 
7e33b3191cf7
Merged in settings from home, and at the same time edited some of the
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
0diff
changeset | 134 # Programs | 
| 3 
072b183989e0
Merged in changes for the Mac, including the beginnings of platform
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
2diff
changeset | 135 alias atari='atari800 -height 800 -width 600' | 
| 2 
2b4dcc885071
Alphabetized aliases for easier sorting
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
1diff
changeset | 136 alias base64='openssl enc -a' | 
| 26 
e14a0b4fab30
* Rename private keys in ~/.ssh/ to <name>.pvt so the keys alias can just add
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
25diff
changeset | 137 alias irssi-test='irssi --home=$HOME/irssi-test/' | 
| 51 
44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
50diff
changeset | 138 alias pine='alpine' | 
| 2 
2b4dcc885071
Alphabetized aliases for easier sorting
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
1diff
changeset | 139 alias ret='screen -raAx' | 
| 
2b4dcc885071
Alphabetized aliases for easier sorting
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
1diff
changeset | 140 alias rot13="tr 'a-zA-Z' 'n-za-mN-ZA-M'" | 
| 160 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 141 tt () { | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 142 OPTS="-G" | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 143 if [ -e ${HOME}/.tt/${1}.tin ] ; then | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 144 OPTS="${OPTS} ${HOME}/.tt/${1}.tin" | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 145 shift | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 146 fi | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 147 tt++ ${OPTS} $@ | 
| 
fd42244e9413
Adding 'tt' alias, commenting out some services on joshua
 Steve Huston <huston@srhuston.net> parents: 
156diff
changeset | 148 } | 
| 2 
2b4dcc885071
Alphabetized aliases for easier sorting
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
1diff
changeset | 149 alias vi='vim' | 
| 0 | 150 | 
| 1 
7e33b3191cf7
Merged in settings from home, and at the same time edited some of the
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
0diff
changeset | 151 # 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: 
3diff
changeset | 152 # 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: 
25diff
changeset | 153 alias junkpile="sshfs -oreconnect${DARWIN:+,volname=Junkpile} srhuston.net:junkpile $HOME/junkpile" | 
| 91 
9d5fcbb36232
Reordering some alises for completeness
 Steve Huston <huston@astro.princeton.edu> parents: 
90diff
changeset | 154 alias sdh="sshfs -oreconnect${DARWIN:+,volname=srhuston.net} srhuston.net: $HOME/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: 
25diff
changeset | 155 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: 
25diff
changeset | 156 alias sx="sshfs -oreconnect${DARWIN:+,volname=Xanadu} xanadu.astro.princeton.edu: $HOME/xanadu" | 
| 107 
b955aa106b9a
Added 'vw' alias for sshfs
 Steve Huston <huston@astro.princeton.edu> parents: 
102diff
changeset | 157 alias vw="sshfs -oreconnect${DARWIN:+,volname=VW} vw.math.princeton.edu: $HOME/vw" | 
| 173 | 158 alias tmu="sshfs -oreconnect${DARWIN:+,volname=tomenet-user} joshua.srhuston.net:Installs/tomenet/lib/user $HOME/Installs/tomenet/lib/user" | 
| 13 
dacbbae5965c
Added Ruby setup variables
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
12diff
changeset | 159 | 
| 51 
44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
50diff
changeset | 160 # LDAP/host tools | 
| 156 
5dfc68e01309
New ldm/lds, and a quick way to know when is now
 Steve Huston <huston@astro.princeton.edu> parents: 
155diff
changeset | 161 alias ldm="ldapmodify -Q -Y GSSAPI -c" | 
| 51 
44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
50diff
changeset | 162 alias ldsloop='while true; do read; clear; lds "$REPLY"; done' | 
| 
44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
50diff
changeset | 163 | 
| 90 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 164 lds () { | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 165 QUERY="$1" | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 166 shift | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 167 OPTS="" | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 168 [[ "$1" =~ ^- ]] && { | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 169 OPTS="$1" | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 170 shift | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 171 } | 
| 156 
5dfc68e01309
New ldm/lds, and a quick way to know when is now
 Steve Huston <huston@astro.princeton.edu> parents: 
155diff
changeset | 172 ldapsearch -Q -Y GSSAPI -LLL $OPTS "($QUERY)" $@ | 
| 90 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 173 } | 
| 
cdfa42697eec
Updated lds, added ldsauth and ldapsync
 Steve Huston <huston@astro.princeton.edu> parents: 
82diff
changeset | 174 | 
| 13 
dacbbae5965c
Added Ruby setup variables
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
12diff
changeset | 175 # Other | 
| 60 
c27db9abf42c
* Removed 'sy' alias - syrinx is no more
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
56diff
changeset | 176 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog" | 
| 50 
407b3bac9cb0
Added 'slurp' alias for pulling content from a web directory
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
49diff
changeset | 177 alias slurp="wget -r -l1 -np -nd -A.mp3" | 
| 156 
5dfc68e01309
New ldm/lds, and a quick way to know when is now
 Steve Huston <huston@astro.princeton.edu> parents: 
155diff
changeset | 178 alias zulu="date -u +%Y%m%d%H%M%SZ" | 
| 15 
fe83d9892ee3
Replaced tests with a 'case' in .bash_aliases
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
13diff
changeset | 179 | 
| 51 
44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
50diff
changeset | 180 # Other Functions | 
| 
44c36681ca0f
* Removed many double quotes from tests; they caused the tests to pass on
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
50diff
changeset | 181 | 
| 113 | 182 mc-backup() { | 
| 183 pushd ~/Dropbox/Saves/minecraft/saves; | |
| 184 if [ -d $1 ]; then | |
| 185 tar cvf - $1 | bzip2 > ../$1_`date +%Y%m%d%H%M%S`.tar.bz2; | |
| 186 fi; | |
| 187 popd | |
| 188 } | |
| 189 | |
| 63 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 190 TOhtml() { | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 191 OUTDIR=`mktemp -d TOHTML.XXXXXX` | 
| 75 
7d4e0869d09d
Use 'hg locate' instead of 'svn ls -R'
 Steve Huston <huston@srhuston.net> parents: 
73diff
changeset | 192 for F in `hg locate` ; do | 
| 63 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 193 if [ -d $F ] ; then | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 194 continue | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 195 fi | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 196 | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 197 # Files to ignore from the list | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 198 case $F in | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 199 .vim/plugin/gnupg.vim | \ | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 200 .vim/syntax/syslog.vim| \ | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 201 .vim/syntax/yum.vim \ | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 202 ) | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 203 continue | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 204 ;; | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 205 *) | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 206 ;; | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 207 esac | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 208 | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 209 OUT=`echo $F | sed -e 's/^\.//' -e 's,.*/,,'` | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 210 vim -e +TOhtml "+w ${OUTDIR}/${OUT}.html" +qa\! $F | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 211 done | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 212 echo Files stored in $OUTDIR | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 213 } | 
| 
590b4d17d933
* TOhtml function that makes pretty prints of all the dotfiles for display
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
62diff
changeset | 214 | 
| 125 
28c2ddd02e8f
Replace hgs alias with function
 Steve Huston <huston@astro.princeton.edu> parents: 
124diff
changeset | 215 hgs() { | 
| 154 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 216 # We assume here that if the host is a Mac, we're going to open the | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 217 # connection automatically, otherwise we echo the URL to the terminal to be | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 218 # opened | 
| 128 
4b397e94691a
Why didn't I know 'hg root' existed.. much cleaner.
 Steve Huston <huston@astro.princeton.edu> parents: 
125diff
changeset | 219 ROOT=`hg root` | 
| 
4b397e94691a
Why didn't I know 'hg root' existed.. much cleaner.
 Steve Huston <huston@astro.princeton.edu> parents: 
125diff
changeset | 220 if [ "$1" == "end" -a -e $ROOT/.hg/hgserve-PID ] ; then | 
| 
4b397e94691a
Why didn't I know 'hg root' existed.. much cleaner.
 Steve Huston <huston@astro.princeton.edu> parents: 
125diff
changeset | 221 kill `cat $ROOT/.hg/hgserve-PID` | 
| 
4b397e94691a
Why didn't I know 'hg root' existed.. much cleaner.
 Steve Huston <huston@astro.princeton.edu> parents: 
125diff
changeset | 222 rm $ROOT/.hg/hgserve-PID | 
| 125 
28c2ddd02e8f
Replace hgs alias with function
 Steve Huston <huston@astro.princeton.edu> parents: 
124diff
changeset | 223 else | 
| 154 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 224 if [ -e $ROOT/.hg/hgserve-PID ] ; then | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 225 P=`cat $ROOT/.hg/hgserve-PID` | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 226 URL=`lsof -n -p $P | grep LISTEN | awk '{print $9}'` | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 227 else | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 228 URL=`hg serve -a localhost -d -p 0 --pid-file $ROOT/.hg/hgserve-PID | sed 's#.*bound to \(.*\))#\1#'` | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 229 fi | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 230 if [ -z "$DARWIN" ] ; then | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 231 echo hg serve on http://$URL/ | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 232 else | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 233 open http://$URL/ | 
| 
cfbaaeb8b71d
This makes 'hgs' work nicer on Linux, still may be more tweaks to do
 Steve Huston <huston@astro.princeton.edu> parents: 
138diff
changeset | 234 fi | 
| 125 
28c2ddd02e8f
Replace hgs alias with function
 Steve Huston <huston@astro.princeton.edu> parents: 
124diff
changeset | 235 fi | 
| 
28c2ddd02e8f
Replace hgs alias with function
 Steve Huston <huston@astro.princeton.edu> parents: 
124diff
changeset | 236 } | 
| 
28c2ddd02e8f
Replace hgs alias with function
 Steve Huston <huston@astro.princeton.edu> parents: 
124diff
changeset | 237 | 
| 15 
fe83d9892ee3
Replaced tests with a 'case' in .bash_aliases
 huston@80426f53-59d1-405d-934b-f07cd76f4a1a parents: 
13diff
changeset | 238 # vim: set filetype=sh : | 
