Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
logger WAN up script executing
if test -s /tmp/dnsmasq.ads
then
rm /tmp/dnsmasq.ads
fi
logger Downloading China Lazy List
wget -O - http://adblock-chinalist.googlecode.com/svn/trunk/adblock-lazy.txt |
grep ^\|\|[^\*]*\^$ |
@Weeker
Weeker / Squid.conf
Created July 30, 2013 09:26
Squid.conf
cache_peer localhost parent 7777 0 no-query
connect_timeout 2 seconds
prefer_direct on
acl gfw dstdom_regex -i "/usr/local/etc/squid/gfwed.txt"
never_direct allow gfw
@Weeker
Weeker / Squid.conf
Created July 30, 2013 09:26
Squid.conf
cache_peer localhost parent 7777 0 no-query
connect_timeout 2 seconds
prefer_direct on
acl gfw dstdom_regex -i "/usr/local/etc/squid/gfwed.txt"
never_direct allow gfw
@Weeker
Weeker / gist:6111542
Created July 30, 2013 09:26
Squid.conf
cache_peer localhost parent 7777 0 no-query
connect_timeout 2 seconds
prefer_direct on
acl gfw dstdom_regex -i "/usr/local/etc/squid/gfwed.txt"
never_direct allow gfw
@Weeker
Weeker / digest_passwd.sh
Created July 30, 2013 05:54
digest_passwd.sh # Make /etc/squid/digest_password this way: ## First get a script... ## wget http://dl.dropbox.com/u/52078/digest_passwd.sh (contents below) ## Execute something similar to the following ### sh ./digest_passwd.sh your_username_here your_password_here 'Squid proxy-caching web server' > /etc/squid/digest_passwd # need to execute a…
#!/bin/sh
user=$1
pass=$2
realm=$3
if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
echo "Usage: $0 user password 'realm'";
exit 1
fi
@Weeker
Weeker / gfwlist2regex.py
Created July 29, 2013 08:13
Download and convert GFWList to url regex which compatible with Squid. https://gist.github.com/BlueN/5577181
#!/usr/bin/env python
#encoding: utf-8
import urllib2
from base64 import b64decode
LIST_URL = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt'
BLACK_FILE = 'gfw.url_regex.lst'
WHITE_FILE = 'cn.url_regex.lst'
@Weeker
Weeker / gist:5778837
Created June 14, 2013 01:42
3Proxy 3proxy.cfg
#nserver 202.99.96.68
#nserver 8.26.56.26
#nserver 8.20.247.20
nscache 65536
timeouts 1 5 30 60 180 1800 15 60
service
daemon
#pidfile /var/run/3proxy.pid
log 3proxy.log D
logformat "- +_L%t.%. %N.%p %E %U %C:%c %R:%r %O %I %h %T"
@Weeker
Weeker / gist:5778711
Created June 14, 2013 01:06
COW rc.txt
# 代理服务器监听地址,用逗号分隔多个地址
# 0.0.0.0 表示监听本机所有 IP 地址
# PAC url 为 http://<listen>/pac,其中的代理服务器地址会根据 client 访问 ip 正确生成
# 如果使用端口映射来将 COW 的服务提供到外网,请参考高级选项中的 addrInPAC 选项
listen = 127.0.0.1:7777
# 日志文件路径,如不指定则输出到 stdout
logFile = logFile.txt
# COW 默认仅对被墙网站使用二级代理
@Weeker
Weeker / gist:5778698
Last active December 18, 2015 11:49
Stunnel stunne.conf
client=yes
compression=zlib
;session = 1800
verify = 0
;pid = /var/run/stunnel.pid
;debug = 7
;output = stunnel.log
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
socket = l:SO_LINGER=1:1