Skip to content

Instantly share code, notes, and snippets.

@wolfhammer
Forked from kvnneff/gist:b6e6e03904654dc1f61f
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfhammer/e64ebf1138caffce8fa2 to your computer and use it in GitHub Desktop.
Save wolfhammer/e64ebf1138caffce8fa2 to your computer and use it in GitHub Desktop.
#
# "Wi-Fi" is the name of your internet service. View your OS X
# network settings to see a list of your services.
#
work-proxy () {
if [ "$1" == 'off' ]; then
networksetup -setsocksfirewallproxystate "Wi-Fi" off
kill $(ps aux | grep '[s]sh -Nf -D 7070 user@proxy.work.com' | awk '{print $2}')
else
ssh -Nf -D 7070 user@proxy.work.com
networksetup -setsocksfirewallproxy "Wi-Fi" 127.0.0.1 7070
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment