Skip to content

Instantly share code, notes, and snippets.

@billie66
Last active August 29, 2015 14:08
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 billie66/79e968292e29be5dac07 to your computer and use it in GitHub Desktop.
Save billie66/79e968292e29be5dac07 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
on_die() {
echo+
echo byebye proxy
echo+
networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy+
}
trap "on_die" SIGTERM
trap "on_die" SIGINT
trap "on_die" SIGHUP
networksetup -setsocksfirewallproxy "Ethernet 2" 127.0.0.1 7070 off
#sshpass -pvT45ku5Y9r ssh -N -D 7070 aybeeacu@s7.moonssh.com #s1....s9, all available
ssh -N -D 7070 peter@106.186.22.54
# the below to commands equals to click the proxy GUI
#peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" off+
#peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" on
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment