Mercurial > index.cgi > dotfiles
comparison .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 |
comparison
equal
deleted
inserted
replaced
204:49ce64b810a2 | 205:16fdb3931af6 |
---|---|
77 fi | 77 fi |
78 ssh -t $T_HOST "ssh $1" | 78 ssh -t $T_HOST "ssh $1" |
79 } | 79 } |
80 alias x='ssh xanadu.astro.princeton.edu' | 80 alias x='ssh xanadu.astro.princeton.edu' |
81 | 81 |
82 # Notes for the process: | |
83 # * Do I want $1 to specify which proxy I'm trying to load? Or have it check | |
84 # some things and try to determine automatically what to do? Latter could | |
85 # be nice but will make it more complex, maybe starting with the explicit | |
86 # first would be wise... | |
82 | 87 |
83 # Proxying/tunneling - predominantly for my Mac laptop | 88 # Proxying/tunneling - predominantly for my Mac laptop |
84 proxy() { | 89 proxy() { |
85 PROXY_HOST=${PROXY_HOST:-xanadu.astro.princeton.edu} | 90 case $1 in |
86 PROXY_PORT=${PROXY_PORT:-8888} | 91 home) |
92 PROXY_HOST=${PROXY_HOST:-joshua.srhuston.net} | |
93 PROXY_PORT=${PROXY_PORT:-8889} | |
94 PROXY_PATH="/Volumes/Chrome-Personal" | |
95 PROXY_UMOUNT="hdiutil detach -quiet ${PROXY_PATH}" | |
96 if [ ! -e ${PROXY_PATH}/.profile-exists ] ; then | |
97 hdiutil attach -stdinpass -nobrowse -quiet ~/Documents/Chrome-Personal.dmg | |
98 if [ ! $? ] ; then | |
99 echo Disk image failed to mount, aborting | |
100 return | |
101 fi | |
102 fi | |
103 ;; | |
104 work) | |
105 PROXY_HOST=${PROXY_HOST:-xanadu.astro.princeton.edu} | |
106 PROXY_PORT=${PROXY_PORT:-8888} | |
107 PROXY_PATH="/Users/huston/Library/Application Support/Google/Chrome" | |
108 ;; | |
109 rc) | |
110 PROXY_HOST=${PROXY_HOST:-csesbh2.princeton.edu} | |
111 PROXY_PORT=${PROXY_PORT:-8887} | |
112 PROXY_PATH="/Users/huston/Library/Application Support/Google/Proxied_Chrome" | |
113 ;; | |
114 *) | |
115 ;; | |
116 esac | |
87 ssh -D $PROXY_PORT -f -C -q $PROXY_HOST 'hostname' | 117 ssh -D $PROXY_PORT -f -C -q $PROXY_HOST 'hostname' |
88 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ | 118 ( |
89 --proxy-server="socks5://127.0.0.1:$PROXY_PORT" \ | 119 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ |
90 --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" \ | 120 --proxy-server="socks5://127.0.0.1:$PROXY_PORT" \ |
91 --user-data-dir="/Users/huston/Library/Application Support/Google/Chrome/ProxiedProfile" > /dev/null 2>&1 & | 121 --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost" \ |
92 history -s ssh -O cancel -D $PROXY_PORT $PROXY_HOST | 122 --user-data-dir="${PROXY_PATH}" > /dev/null 2>&1 |
93 echo Cancel command added to history | 123 $PROXY_UMOUNT |
124 # Maybe leave this off, so what if the port is left open if there's no | |
125 # conflicts... | |
126 # ssh -O cancel -D $PROXY_PORT $PROXY_HOST | |
127 ) & | |
128 disown %+ | |
94 } | 129 } |
95 | 130 |
96 # Remote desktop/VNC | 131 # Remote desktop/VNC |
97 eval "alias milton='ssh -L9930:milton:5900 -f joshua.srhuston.net \"sleep 5\"; ${VNCVIEWER}localhost:9930 &'" | 132 eval "alias milton='ssh -L9930:milton:5900 -f joshua.srhuston.net \"sleep 5\"; ${VNCVIEWER}localhost:9930 &'" |
98 | 133 |