Skip to content

Instantly share code, notes, and snippets.

public class test {
public static int fib(int n) {
if (n < 2) {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}
}
public static void main(String[] args) {
$ ./server -p 8388 -k foobar &
2013-01-04 16:34:01 INFO: Shadowsocks Version:0.1 libuv(0.9) Written by Dndx(idndx.com)
2013-01-04 16:34:01 INFO: Encrypt and decrypt table generated
2013-01-04 16:34:01 INFO: Listening on 0.0.0.0:8388
$ python local.py -k foobar &
2013-01-04 16:34:13 INFO starting server at port 1080 ...
$ curl -v www.baidu.com --socks5-hostname 127.0.0.1:1080
2013-01-04 16:34:37 INFO: Accepted connection from 127.0.0.1
2013-01-04 16:34:37 INFO: addrtype unknown, closing
var net = require('net');
var data = Array(1024).join(' ');
function go() {
var s = null;
s = net.connect(8000, '127.0.0.1', function() {
setInterval(function() {
console.log(s.write(data));
}, 1000);
});
@clowwindy
clowwindy / gist:5909629
Created July 2, 2013 14:10
test server
{
"server":"209.141.36.62",
"server_port":8348,
"local_port":1080,
"password":"$#HAL9000!",
"timeout":600,
"method":"aes-256-cfb"
}
#!/bin/bash
#
# /etc/rc.d/init.d/supervisord
# supervisord This shell script takes care of starting and stopping
# supervisord. Tested on CentOS 5.
#
# Author: Brian Bouterse bmbouter@gmail.com
# Modified: @clowwindy
#
# chkconfig: 345 80 80
@clowwindy
clowwindy / tornado_http_proxy
Created July 8, 2013 09:05
HTTP CONNECT proxy
#!/usr/bin/python
# -*- coding: utf-8 -*-
import tornado.httpserver
import tornado.ioloop
import tornado.iostream
import socket
class ProxyHandler(object):
@clowwindy
clowwindy / ssl.md
Last active May 11, 2024 03:22
为什么不应该用 SSL 翻墙

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
});
});
});
});
});
@clowwindy
clowwindy / gist:7889692
Last active August 19, 2021 11:46
Create 100 Linodes from Stackscript
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import json
# Linode API Key
key = 'API_KEY'
# set your VPS root password
root_pass = 'AWESOME_PASSWORD'
var a = 'SOCKS5 127.0.0.1:1080;SOCKS 127.0.0.1:1080;DIRECT';
function FindProxyForURL(url, host) {
var b = a;
a = 'DIRECT';
return b;
}