Skip to content

Instantly share code, notes, and snippets.

View ninehills's full-sized avatar

Tao Yang ninehills

View GitHub Profile
@ninehills
ninehills / baidupan-offline-dl.sh
Created September 13, 2013 08:35
Submit offline download tasks to Baidu Pan.
#!/bin/sh
# by Jakukyo Friel <weakish@gmail.com>
# under Apache License, Version 2.0, <http://www.apache.org/licenses/LICENSE-2.0.html>
### Submit offline download tasks to Baidu Pan.
## Requires:
#
# - [jq](http://stedolan.github.io/jq/)
@ninehills
ninehills / mactype_win8.md
Last active June 19, 2016 02:26
win8使用MacType
@ninehills
ninehills / CandyTypeSharpFixGBK.ini
Last active May 23, 2018 01:59
Candy MacType Config for GBK
[General]
Icon=Candy.ico,0
DirectWrite=1
HintSmallFont=1
HintingMode=1
AntiAliasMode=2
NormalWeight=10
BoldWeight=1
ItalicSlant=-2
EnableKerning=0
@ninehills
ninehills / nginx.conf
Created September 7, 2013 11:05
nginx.conf for pypi/npm reverse proxy config
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
<?php
$tel_no = $_GET['hm'];
$c = $_GET['c']?$_GET['c']:0;
$c++;
?>
<!DOCTYPE html>
<html>
<head>
<title>迷你轰炸台 - 短信炸弹 - BETA!</title>
<?php
@ninehills
ninehills / .bashrc
Last active December 19, 2015 08:29
bash history set
# unlimit history
export HISTFILESIZE=
export HISTSIZE=
# color history out
export HISTTIMEFORMAT="[$(tput setaf 6)%F %T$(tput sgr0)]: "
# append to the history file, don't overwrite it
shopt -s histappend
@ninehills
ninehills / zerorpc.md
Created June 18, 2013 12:17
ZeroRPC简介 - 轻量级分布式通信框架

ZeroRPC简介 - 轻量级分布式通信框架

概述

分布式系统的核心是分布式通信,而传统上开发一套支持上千台规模集群,可靠性非常高的分布式通信框架,需要不少的精力投入。而在多数情景下,我们(特别是时间宝贵的OP)并不是非常关注技术实现的细节,而是希望有一套成熟、轻量、可靠性高、使用方便而且易于调试的分布式通信框架,可以直接使用,从而把时间放在具体业务逻辑上。

在PyCon 2012大会上,dotcloud公司开源了一套基于ZeroMQ和MessagePack的分布式通信框架(或者说是协议+Python实现)。该框架因为基于ZeroMQ,使用方法是RPC,所以被命名为ZeroRPC。ZeroRPC的特点在其官网的介绍中一目了然[1]:

ZeroRPC is a light-weight, reliable and language-agnostic library for distributed communication between server-side processes.

Python Number Conversion Chart

From To Expression
@ninehills
ninehills / crx_downloader.sh
Last active December 16, 2015 18:59
Dowload crx file from chrome store.
#!/bin/bash
#Usage: sh $0 <app_id>
if [[ $? != 1 ]];then
echo "Usage: sh $0 <extension_id>" >&2
echo "Output: <extension_id>.crx (zip file)"
exit 1
fi
app_id=$1
text