Created
January 29, 2019 21:27
-
-
Save mshytikov/a162ad53db02ad3f3eb5d3ce9f9aedc1 to your computer and use it in GitHub Desktop.
Shortcut script to bypass the firewall
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
#!/usr/bin/env bash -e | |
# | |
# Shortcut script to bypass the firewall | |
# | |
# It requires manual pre configuration of proxy in network settings. | |
# Or just run once: | |
# sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 1985 | |
# sudo networksetup -setsocksfirewallproxystate Wi-Fi off | |
disable_proxy_cmd="sudo networksetup -setsocksfirewallproxystate Wi-Fi off" | |
trap "$disable_proxy_cmd" EXIT | |
# Enable proxy | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi on | |
# Run SOCKS proxy | |
# ssh -ND 1985 [user]@hostname | |
gcloud compute ssh proxy --zone europe-west1-b --ssh-flag='-ND 1985' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment