Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function workremote -d "Set up the necessary remote tunnels"
  2. echo Setting up SOCKS Proxy
  3. sudo networksetup -setproxybypassdomains Wi-Fi 169.254/16 *.com *.org *.co
  4. sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 5000 off
  5. sudo networksetup -setsocksfirewallproxystate Wi-Fi on
  6. echo Tunneling to Work
  7. ssh -L 5222:hipchat.internal:5222 -L 5223:hipchat.internal:5223 remote_host -N -D 5000 &
  8. read -p 'set_color green; echo read; set_color normal; echo "enter to quit> "'
  9. echo Closing Tunnel
  10. kill -9 %ssh\ -L\ 5222:hipchat.internal:5222\ -L\ 5223:hipchat.internal:5223\ remote_host\ -N\ -D\ 5000\ \&
  11. echo Turning off SOCKS Proxy
  12. sudo networksetup -setsocksfirewallproxystate Wi-Fi off
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement