Skip to content

Instantly share code, notes, and snippets.

View fireball2018's full-sized avatar
🎯
Focusing

fireball2018

🎯
Focusing
View GitHub Profile
@fireball2018
fireball2018 / __init__.py
Created August 23, 2012 10:27 — forked from ipconfiger/__init__.py
OAuth包,实现了sina,QQ,网易,搜狐的OAuth认证
# -*- Encoding: utf-8 -*-
import base64
import binascii
import cgi
import hashlib
import hmac
import logging
import time
import urllib
import urlparse
@fireball2018
fireball2018 / gist:3719551
Created September 14, 2012 02:57 — forked from cuimuxi/gist:3719516
gevent crawler
import gevent
from gevent import monkey, queue
monkey.patch_all()
import urllib2
from time import sleep
import traceback
import logging
- (void)viewDidLoad
{
[super viewDidLoad];
// init VPN manager
self.vpnManager = [NEVPNManager sharedManager];
// load config from perference
[_vpnManager loadFromPreferencesWithCompletionHandler:^(NSError *error) {
@fireball2018
fireball2018 / ocserv
Last active August 29, 2015 14:10 — forked from kevinzhow/ocserv
#!/bin/sh
### BEGIN INIT INFO
# Provides: ocserv
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
# Copyright Rene Mayrhofer, Gibraltar, 1999
# This script is distibuted under the GPL
@fireball2018
fireball2018 / ElasticSearch.sh
Created October 30, 2015 06:58 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@fireball2018
fireball2018 / readme.txt
Created May 17, 2016 03:33 — forked from fqrouter/readme.txt
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@fireball2018
fireball2018 / install_ocserv.sh
Created July 3, 2016 15:40 — forked from lj0014/install_ocserv.sh
install ocserv in ubuntu
#install deps
apt-get update
apt-get install -y gnutls-bin iptables libnl-route-3-200 libseccomp2 libwrap0 openssl curl --no-install-recommends
buildDeps=" \
autoconf \
autogen \
ca-certificates \
gcc \
gperf \
libgnutls28-dev \