This file contains hidden or 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
#!/bin/bash | |
set -e | |
### === 配置区 === | |
PROXY_HOST="127.0.0.1" # 本机 SOCKS5 地址 | |
PROXY_PORT="1080" | |
DEV="utun123" # TUN 网卡名称 | |
TUNIP="198.18.0.1" # TUN 的 IP | |
IFACE="en0" # 物理出口网卡 (ifconfig 查看) | |
REMOTE_HOSTS=("xxx.com" "yyy.com") # 需要直连的上游主机,可填多个 |
This file contains hidden or 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
// Come from golang.org/x/crypto/ssh/session.go:353 | |
type F func(*Session) | |
for _, setupFd := range []F{(*Session).stdin, (*Session).stdout, (*Session).stderr} { | |
setupFd(s) | |
} |
This file contains hidden or 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
var m = function(){ | |
emit(this._id,this) | |
} | |
var r = function(k, value) { | |
// here is the process of update data | |
t = value.running_param.targets; | |
for (var i = 0; i < t.length; i++) { | |
var tmp = t[i].split("/")[1]; | |
if (tmp.indexOf(".") == -1) { |
This file contains hidden or 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 python | |
# coding=utf-8 | |
def switch(key): | |
return { | |
'keya': '123', | |
'keyb': '456', | |
'keyc': 'aaa' | |
}.get(key,'8888') |