Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View coder-chenzhi's full-sized avatar
🎓
Academic

ZhiChen coder-chenzhi

🎓
Academic
  • Hangzhou, China
View GitHub Profile
import os
import ast
PROJECTS_HOME = r"E:\OSS\ansible_collections"
SENSITIVE_KEYS = "passw"
def get_key_from_dict(tree, key):
"""
@coder-chenzhi
coder-chenzhi / update-dnsmasq-from-gfwlist.py
Created September 16, 2017 16:13 — forked from rambolee/update-dnsmasq-from-gfwlist.py
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
#!/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
@coder-chenzhi
coder-chenzhi / expand.js
Last active April 13, 2017 02:21
expand acm proceedings automatically
// take the Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering as example
// http://dl.acm.org/citation.cfm?id=2950290&CFID=749075976&CFTOKEN=83437356
num = 152 // last index of tag need to expand
for(i = 1; i < num + 1; i++){
try {
expandcollapse('expcoll'+i, i)
}
catch (err) {
// some index is missing, so will throw exception
}
@coder-chenzhi
coder-chenzhi / service-checklist.md
Created November 21, 2016 01:11 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

@coder-chenzhi
coder-chenzhi / Monitorama PDX 2014
Created April 7, 2016 05:56
All Monitorama PDX 2014 talks with slides links
Main Talks:
-----------
Please, no More Minutes, Milliseconds, Monoliths... or Monitoring Tools!
Adrian Cockcroft
http://vimeo.com/95064249
http://www.slideshare.net/adriancockcroft/monitorama-please-no-more
Computers are a Sadness, I am the Cure
James Mickens
http://vimeo.com/95066828
@coder-chenzhi
coder-chenzhi / gist:f131411eb68250b377ef
Created November 14, 2015 04:30 — forked from observerss/gist:3798922
Google Keyword Tool Scraper(casperjs version)
// EDIT: 2013/10/20
// google has updated its kwt UI, this script doesn't work any more!
// may be I will update this script when I have time to investigate their new Interface.
// requires
var utils = require('utils');
var casper = require('casper').create()
var casper = require('casper').create({
verbose: true,
public class AgentInstaller {
/** The created agent jar file name */
protected static final AtomicReference<String> agentJar = new AtomicReference<String>(null);
/**
* Self installs the agent, then runs a person sayHello in a loop
* @param args None
*/
public static void main(String[] args) {