Skip to content

Instantly share code, notes, and snippets.

View ryunhe's full-sized avatar

Jiachen He ryunhe

View GitHub Profile
@ryunhe
ryunhe / haproxy.cfg
Created March 31, 2018 14:01
nonda aliyun haproxy config
global
ulimit-n 51200
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
user haproxy
group haproxy
daemon
defaults
@ryunhe
ryunhe / migrate.rb
Created November 13, 2014 03:34
avos migrate script
#!/usr/bin/env ruby
# This is a script provided to the users for painless migrate to new keywords.
# To be extra careful, we explicitly replace each exact keyword.
keywords = [
/\bParse\b/,
/\bParseACL\b/,
/\bParseAnalytics\b/,
/\bParseAnonymousUtils\b/,
import qiniu.conf
qiniu.conf.ACCESS_KEY = "<AKEY>"
qiniu.conf.SECRET_KEY = "<SKEY>"
import qiniu.rs
import qiniu.rsf
import datetime
def list_all(bucket_name, prefix=None, limit=100, days=30):
d = datetime.datetime.now() - datetime.timedelta(days)
# Usage:
#
# $ tornado.options.py -port=7777
# listen: 7777
#
# $ tornado.options.py -help
# --port Run on the given port (default 8888)
from tornado.options import define, options, parse_command_line
@ryunhe
ryunhe / git-workflow.sh
Created May 17, 2013 02:42
New feature workflow on git.
# 1. 开始任务,创建一个新的分支
bw start <feature>
git checkout master
git fetch origin -v
git fetch upstream -v
git checkout -B <feature>
# 1.1 编码中
git commit
@ryunhe
ryunhe / pretty-json.sh
Last active December 10, 2015 16:18
Using json.tool from the shell to validate and pretty-print
cat data.json | python -mjson.tool > data_pretty.json