a.k.a. what to do when your ISP starts blocking sites :(
Set the SOCKS proxy to local SSH tunnel
networksetup -setsocksfirewallproxy "Ethernet" localhost 8080
To clear the domain and port
| 方法一: | |
| strings /proc/<PID>/environ | |
| 方法二: | |
| ps eww -o command <PID> | tr ' ' '\n' | |
| 方法三: | |
| cat /proc/25023/environ | tr ‘\0’ ‘\n’ |
| #!/usr/bin/perl | |
| ###################################################################### | |
| # killcx : | |
| # | |
| # Close a TCP connection under Linux. | |
| # | |
| # (c) Jerome Bruandet - <floodmon@spamcleaner.org> | |
| # | |
| # version 1.0.3 - 18-May-2011 | |
| # |
| #!/bin/bash | |
| # 定义颜色 | |
| red(){ | |
| echo -e "\033[31m$*\033[0m" | |
| } | |
| green(){ | |
| echo -e "\033[32m$*\033[0m" | |
| } |
| #终端git分支着色 | |
| function git_branch { | |
| branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`" | |
| if [ "${branch}" != "" ];then | |
| if [ "${branch}" = "(no branch)" ];then | |
| branch="(`git rev-parse --short HEAD`...)" | |
| fi | |
| echo " ($branch)" | |
| fi | |
| } |
| import org.apache.commons.codec.DecoderException; | |
| import org.apache.commons.codec.binary.Hex; | |
| import javax.crypto.*; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import java.io.UnsupportedEncodingException; | |
| import java.security.InvalidKeyException; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.util.Arrays; |
| /** | |
| * @param $lPort 本地端口 | |
| * @param $rHost 远程主机 | |
| * @param $rPort 远程端口 | |
| */ | |
| function actionProxy2($lPort, $rHost, $rPort) | |
| { | |
| $recvTimeoutSec = 5; | |
| $localServer = stream_socket_server("tcp://0.0.0.0:$lPort", $lErrno, $lErrstr); | |
| if ($localServer === FALSE) |
| #!/usr/bin/stap | |
| global connections | |
| global filter_port = 80 | |
| // | |
| global report | |
| global spend_time | |
| global active_count | |
| global have_spend_time = 0 |
| # 主要是用到了nginx的error_page指令 | |
| server{ | |
| server_name 10.21.200.75; | |
| listen 6666; | |
| error_page 404 @404; | |
| location @404 { | |
| root /home/fey6779; | |
| try_files /404.html =404; | |
| } | |
| error_page 500 @500; |
| #!/bin/sh | |
| # create self-signed server certificate: | |
| read -p "Enter your domain [www.example.com]: " DOMAIN | |
| echo "Create server key..." | |
| openssl genrsa -des3 -out $DOMAIN.key 1024 |