Skip to content

Instantly share code, notes, and snippets.

@ftao
ftao / flatten_json.py
Created June 17, 2015 02:22
flatten json
import sys
import json
def flatten(data):
for key, value in data.iteritems():
if type(value) is dict:
for k,v in flatten(value):
yield (key + '.' + k, v)
else:
yield (key, value.encode("utf-8"))
--- strongswan-5.2.1/debian/rules 2014-10-27 14:36:53.659872404 +0300
+++ strongswan-5.2.1/debian/rules 2014-10-27 15:10:07.003054721 +0300
@@ -15,7 +15,7 @@
--enable-ha \
--enable-led --enable-gcrypt \
--enable-test-vectors \
- --enable-xauth-eap --enable-xauth-pam \
+ --enable-xauth-eap --enable-xauth-pam --enable-xauth-noauth \
--enable-cmd \
--enable-certexpire \
@ftao
ftao / strongswan5.2.1-openvz.patch
Created December 9, 2015 16:09
strongswan debian package openvz patch
--- rules.origin 2015-12-09 06:13:45.756687865 -0500
+++ strongswan-5.2.1/debian/rules 2015-12-09 09:43:52.992183631 -0500
@@ -50,7 +50,7 @@
--with-capabilities=libcap \
--enable-farp \
--enable-dhcp \
- --enable-af-alg
+ --enable-kernel-libipsec
endif
@ftao
ftao / make_nghttp2_deb.sh
Created December 14, 2015 11:19
make_nghttp2_deb.sh
#/bin/sh
FAKEROOT=/home/vagrant/workspace/nghttpx/dist
PYTHONPATH=$FAKEROOT/usr/local/lib/python2.7/site-packages
mkdir -p $PYTHONPATH
PYTHONPATH=$PYTHONPATH make DESTDIR=$FAKEROOT install
fpm -s dir -t deb -n nghttp2 -v 1.5.0 -C $FAKEROOT -p nghttp2_VERSION_ARCH.deb \
-d "libssl1.0.0 >= 1.0.1" \
-d "libev4 >= 4.15" \
-d "zlib1g >= 1.2.3" \
@ftao
ftao / introrx-cn.md
Last active February 19, 2016 09:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ftao
ftao / mongo-aggregate-in-pandas.md
Last active April 2, 2016 08:52
express-mongo-aggregate-operation-in-pandas