Skip to content

Instantly share code, notes, and snippets.

@jn7163
jn7163 / main.conf
Created April 21, 2016 14:37
Surge是推特网友开发的软件,支持ios9以上,基本可以替代原来的APN代理,一定程度替代AnyConnect,国内外分流体验做得比较好。支持SSL和SS等协议。
# Required Surge 1.2.0 Build 478 or above
# Add below line to merge a basic configuration file
#!PROXY-OVERRIDE:main.conf
# Surge will support updating conf sometime in the future
#!UPDATE-URL:https://gist.githubusercontent.com/raw/2e27c124af2f7a4f0d5a/main.conf
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.0.0.0/8, localhost, *.local, e.crashlytics.com
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# 规则配置仅供参考,适用于 Surge Mac (1.3.0) 及其后续版本;
# 包含 Proxy Group、URL Rewrite 特性;
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计;
# 屏蔽 Hao123、百度搜索,放行百度地图、百度外卖、百度音乐、百度云盘、百度百科。
# Surge for Mac 简明指南 http://bit.ly/1TATRaG
[General]
# warning, notify, info, verbose
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
@jn7163
jn7163 / cron.sh
Created May 2, 2016 12:15 — forked from qxj/cron.sh
墙认证的域名和IP收集,用来避免DNS污染和自定义路由规则。
#!/bin/sh
single_instance() {
LOCKFILE=$1
[ -f $LOCKFILE ] && echo "Another instance is running." && exit 1
trap "{ rm -f $LOCKFILE; exit 0; }" EXIT SIGTERM SIGINT
touch $LOCKFILE
}
single_instance /tmp/fix_vpn.lck
@jn7163
jn7163 / proxy_command.js
Created September 14, 2016 07:37 — forked from eagletmt/proxy_command.js
a Vimperator plugin which provides commandline interface for proxy settings
/*
* Commandline interface for proxy settings.
* This requires revision >= 4430 for subCommands.
*
* examples:
* - display current proxy type
* :proxy
* - do not use proxy
* :proxy direct
* - manual proxy configuration
#!/usr/bin/bash
DIR=/path/to/www/public
DATA=/path/to/pms5003.rrd
TIME=$1
time=$(date '+%H\:%M\:%S')
rrdtool graph $DIR/pm-$TIME.svg \
--imgformat SVG \
@jn7163
jn7163 / ss-redir 透明代理.md
Created November 13, 2016 15:01 — forked from Tai7sy/ss-redir 透明代理.md
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@jn7163
jn7163 / ss-redir 透明代理.md
Created November 13, 2016 15:10 — forked from wen-long/ss-redir 透明代理.md
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@jn7163
jn7163 / router.pi-2.md
Created December 31, 2016 14:01 — forked from snakevil/router.pi-2.md
使用树莓派3B打造超强路由之二:初成

使用树莓派3B打造超强路由之二:初成

通过第一篇《使用树莓派3B打造超强路由之一:初装》的努力,树莓派3B已经可以作为一台超低能耗、随身携带的开发用服务器来使用了。但这对于目标——打造超强路由而言,才刚刚开始。接下来,我们需要将其打磨成一台基本的无线路由器。

WARNING 本文所有指令均仅供参考,切勿无脑复制粘贴!

#
# <PythonProxy.py>
#
#Copyright (c) <2009> <Fabio Domingues - fnds3000 in gmail.com>
#
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation
#files (the "Software"), to deal in the Software without
#restriction, including without limitation the rights to use,
#copy, modify, merge, publish, distribute, sublicense, and/or sell
@jn7163
jn7163 / OpenWrt-Package-Downloader.py
Created August 7, 2017 08:17 — forked from lanceliao/OpenWrt-Package-Downloader.py
Cache all packages from OpenWrt trunk repository
#!/usr/bin/env python
#coding=utf-8
#
# Openwrt Package Grabber
#
# Copyright (C) 2014 http://www.shuyz.com
#
import urllib2
import re