Skip to content

Instantly share code, notes, and snippets.

View allenxuyb's full-sized avatar

allen.xu allenxuyb

View GitHub Profile
public class PooledRedisClient {
protected final Logger logger = LoggerFactory.getLogger(getClass());
private static final int DEFAULT_RETRY_TIME = 3;
private static final int MIN_RETRY_TIME = 0;
private static final int MAX_RETRY_TIME = 5;
@allenxuyb
allenxuyb / main.conf
Created July 15, 2016 02:59
Config for surge.app
# This config file was created for myself (@shanskc). You may want to add or remove some rules to make efficient use of the Internet.
# Update: Rules and configuration tuning
# 此配置仅供参考适用于 Surge 1.2 最新版本(包含 Proxy Group、URL Rewrite->可根据需要在底部自己启用)
[General]
# warning, notify, info, verbose
loglevel = warning
# all-tcp-mode = false
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, e.crashlytics.com, apple.cn
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114, 8.8.8.8
@allenxuyb
allenxuyb / System Design.md
Created April 18, 2016 11:54 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@allenxuyb
allenxuyb / installing_supervisor_macosx.md
Created December 3, 2015 09:23 — forked from fadhlirahim/installing_supervisor_macosx.md
Setting up supervisord in Mac OS X

Installation

Installing Supervisor on OS X is simple:

sudo pip install supervisor

This assumes you have pip. If you don't:

@allenxuyb
allenxuyb / wall.action
Created November 11, 2015 13:34 — forked from alex-1q84/wall.action
privoxy rule
#append the "actionsfile wall.action" to the config
#and save this file as wall.action into the same dir as config file
#restart the privoxy to see if these configuration actived
{{alias}}
direct = +forward-override{forward .}
ssh = +forward-override{forward-socks5 127.0.0.1:7070 .}
default = direct
#gappproxy = +forward-override{forward localhost
{default}
@allenxuyb
allenxuyb / surge.conf
Created October 28, 2015 01:55 — forked from soffchen/surge.conf
surge.conf
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0/9, 119.0.
@allenxuyb
allenxuyb / rules.conf
Created October 28, 2015 01:54 — forked from janlay/README.md
Yet another config for Surge.app (build 245+)
# This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet.
# This file depends on the main.conf which defines your own proxy.
# Your main.conf will look like this:
# ---- START ----
# #!PROXY-OVERRIDE:rules.conf
# [Proxy]
# Proxy = https,server.address,port,username,password
# ---- END ----
#
@allenxuyb
allenxuyb / nginx.conf
Created October 23, 2015 04:56 — 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