Created
March 11, 2015 23:26
-
-
Save tebriel/d2f781af4435dc5bec1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function workremote -d "Set up the necessary remote tunnels" | |
echo Setting up SOCKS Proxy | |
sudo networksetup -setproxybypassdomains Wi-Fi 169.254/16 *.com *.org *.co | |
sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 5000 off | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi on | |
echo Tunneling to Work | |
ssh -L 5222:hipchat.internal:5222 -L 5223:hipchat.internal:5223 remote_host -N -D 5000 & | |
read -p 'set_color green; echo read; set_color normal; echo "enter to quit> "' | |
echo Closing Tunnel | |
kill -9 %ssh\ -L\ 5222:hipchat.internal:5222\ -L\ 5223:hipchat.internal:5223\ remote_host\ -N\ -D\ 5000\ \& | |
echo Turning off SOCKS Proxy | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi off | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment