This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- virtualbox_4_1.rb.orig 2012-09-09 01:24:56.000000000 +0800 | |
+++ virtualbox_4_1.rb 2012-09-09 01:39:32.000000000 +0800 | |
@@ -135,15 +135,22 @@ | |
def forward_ports(ports) | |
args = [] | |
ports.each do |options| | |
- pf_builder = [options[:name], | |
- options[:protocol] || "tcp", | |
- "", | |
- options[:hostport], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
from simplejson import loads | |
from simplejson.decoder import JSONDecodeError | |
from betterprint import pprint | |
from os import path | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias vmlive="VBoxManage list runningvms" | |
function vmstart () { | |
if [ -e $1 ]; then | |
echo 'No VirualMachine specified. All available machines:' | |
VBoxManage list vms | cut -d'"' -f2 | sed -E 's/(.*)/> \1/' | |
return | |
fi | |
local _EXISTS=`VBoxManage list vms | grep $1 | wc -l | awk '{print $1}'` | |
if [ ! $_EXISTS -eq 1 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
from itertools import imap | |
from functools import partial | |
import types | |
""" | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git clone -q git://github.com/shibukawa/lightpng.git | |
pushd lightpng | |
wget -nv "http://nchc.dl.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.bz2" | |
tar xjf boost_1_53_0.tar.bz2 | |
git submodule update --init | |
which scons || sudo brew install scons | |
./build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
import sys | |
import logging | |
logging.basicConfig(level=logging.DEBUG, | |
stream=sys.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from contextlib import contextmanager | |
# | |
# Helpers | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
def retriable(retry_counts=3, before_retry=None, final=None, noexc=False): | |
is_callable = lambda x: x is not None and hasattr(x, "__call__") | |
if not is_callable(before_retry): | |
before_retry = lambda err, c: c | |
if not is_callable(final): | |
final = lambda err, c: c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
cat <<EOF | |
Usage: $(basename $0) [options] | |
This shell script is a simple wrapper around the openssl binary. It uses | |
s_client to get certificate information from remote hosts, or x509 for local | |
certificate files. It can parse out some of the openssl output or just dump all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from os import environ, path, makedirs | |
import imghdr | |
from datetime import datetime, timedelta | |
from concurrent.futures import ThreadPoolExecutor | |
from tornado import gen | |
from tornado.concurrent import run_on_executor |