Skip to content

Instantly share code, notes, and snippets.

@happypeter
Last active July 3, 2016 06:03

Revisions

  1. happypeter revised this gist Sep 8, 2013. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion mac_fuck_gfw.sh
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,9 @@ networksetup -setsocksfirewallproxy "Ethernet 2" 127.0.0.1 7070 off
    sshpass -pvT45kde5Y9r ssh -N -D 7070 [email protected] #s1....s9, all available
    # ssh -N -D 7070 root@linode_us

    # the below to commands equals to click the proxy GUI
    # 注意:有时候 linode_us 的 ssh 口如果被墙了,那么这个脚本执行的时候,看起来也是正常的,只不过
    # 到浏览器中是不能看墙外的景色的。解决方法就是更换主机 IP

    the below to commands equals to click the proxy GUI
    # peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" off
    # peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" on
  2. happypeter revised this gist Oct 26, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mac_fuck_gfw.sh
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ trap "on_die" SIGINT
    trap "on_die" SIGHUP

    networksetup -setsocksfirewallproxy "Ethernet 2" 127.0.0.1 7070 off
    sshpass -pvT45ku5Y9r ssh -N -D 7070 [email protected] #s1....s9, all available
    sshpass -pvT45kde5Y9r ssh -N -D 7070 [email protected] #s1....s9, all available
    # ssh -N -D 7070 root@linode_us

    # the below to commands equals to click the proxy GUI
  3. happypeter revised this gist Aug 24, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mac_fuck_gfw.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ on_die() {
    echo byebye proxy
    echo
    networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy
    # the name can be "wifi" or "Ethernet 1", just what you see in "network preference"
    # the name can be "wifi" or "Ethernet 1", just see what is listed in "network preference"
    }

    trap "on_die" SIGTERM
  4. happypeter revised this gist Aug 24, 2012. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions mac_fuck_gfw.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    #!/bin/bash

    #!/user/bin/env bash

    on_die() {
    echo
    @@ -15,8 +14,8 @@ trap "on_die" SIGHUP

    networksetup -setsocksfirewallproxy "Ethernet 2" 127.0.0.1 7070 off
    sshpass -pvT45ku5Y9r ssh -N -D 7070 [email protected] #s1....s9, all available
    #ssh -N -D 7070 root@linode_us
    # ssh -N -D 7070 root@linode_us

    # the below to commands equals to click the proxy GUI
    #peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" off
    #peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" on
    # peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" off
    # peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" on
  5. happypeter renamed this gist Aug 24, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. happypeter revised this gist Aug 24, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion fuck gfw--ethernet
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    #!/usr/bin/env bash
    #!/bin/bash


    on_die() {
    echo
    echo byebye proxy
    echo
    networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy
    # the name can be "wifi" or "Ethernet 1", just what you see in "network preference"
    }

    trap "on_die" SIGTERM
  7. happypeter created this gist Aug 24, 2012.
    21 changes: 21 additions & 0 deletions fuck gfw--ethernet
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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 [email protected] #s1....s9, all available
    #ssh -N -D 7070 root@linode_us

    # the below to commands equals to click the proxy GUI
    #peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" off
    #peter:~/bin$ networksetup -setsocksfirewallproxystate "Ethernet 2" on