Skip to content

Instantly share code, notes, and snippets.

View jinwyp's full-sized avatar

Jin jinwyp

View GitHub Profile
Binxing Fang, http://en.wikipedia.org/wiki/Fang_Binxing
方滨兴,中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网 络方向首席科学家。
Gang Xiong, http://rd.springer.com/search?facet-author=%22Gang+Xiong%22
熊刚, 高级工程师, 研究方向为信息安全。E-mail: xionggang@ict.ac.cn。
Weili Han, http://crypto.fudan.edu.cn/people/weili/
韩伟力, http://homepage.fudan.edu.cn/wlhan/en
This is just my personal gist clip.

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@jinwyp
jinwyp / firewall.sh
Created December 12, 2013 05:14 — forked from x1a0/firewall.sh
#! /bin/bash
# Set the default policies to allow everything while we set up new rules.
# Prevents cutting yourself off when running from remote SSH.
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush any existing rules, leaving just the defaults
iptables -F

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

##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 可用,但端口一致,就设置这个
@jinwyp
jinwyp / urlparser.js
Last active August 29, 2015 14:12 — forked from sofish/urlparser.js
var parser = function(url) {
var a = document.createElement('a');
a.href = url;
var search = function(search) {
if(!search) return {};
var ret = {};
search = search.slice(1).split('&');
for(var i = 0, arr; i < search.length; i++) {
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@jinwyp
jinwyp / git-branch.md
Last active August 29, 2015 14:15 — forked from yisibl/git-branch.md

在Mac、Linux 终端显示 Git 当前所在分支

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件
@jinwyp
jinwyp / nginx.conf
Last active September 7, 2015 04:55 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048