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
apt-get install -y build-essential libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make | |
cd /tmp | |
wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz | |
tar xzvf UnixBench5.1.3.tgz | |
cd UnixBench | |
./Run | |
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
// Data inserted | |
r.db('test').table('multi').insert({ | |
id:1, | |
field: [ | |
{key1: 1}, {key1: 2}, {key1: 3} | |
] | |
}) | |
r.db('test').table('multi').insert({ | |
id:2, | |
field: [ |
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
r.table('lexi2').insert([ | |
{net:{lo:{tx:1, rx:2}, eth0:{tx:2, rx:4}}}, | |
{net:{lo:{tx:4, rx:6}, wl0ps4:{tx:7, rx:1}}}, | |
{net:{lo:{tx:14, rx:8}, eth0:{tx:1, rx:5}}}]) | |
r.table('lexi2').reduce( | |
function(left, right){ | |
return { net: | |
left('net').keys().setUnion(right('net').keys()).map( | |
function(iface){ |
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 | |
# Splits a given table into n evenly-spaced shards. | |
# call with ./split-table <tablename> <numshards> | |
table=$1 | |
shards=$2 | |
cluster="localhost:29015" | |
splits=`seq 0 $((16**4/$shards)) $((16**4+1)) \ |
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
jQuery(function($) { | |
$('form[data-async]').live('submit', function(event) { | |
var $form = $(this); | |
var $target = $($form.attr('data-target')); | |
$.ajax({ | |
type: $form.attr('method'), | |
url: $form.attr('action'), | |
data: $form.serialize(), |
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
import httplib | |
import urllib2 | |
import ssl | |
import certifi | |
from backports.ssl_match_hostname import match_hostname | |
class CertValidatingHTTPSConnection(httplib.HTTPConnection): | |
default_port = httplib.HTTPS_PORT |
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/sh | |
# | |
# chkconfig: 2345 55 25 | |
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx | |
# For Debian, run: update-rc.d -f nginx defaults | |
# For CentOS, run: chkconfig --add nginx | |
# | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $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
#!/bin/sh | |
# | |
# openresty adapted script to start and stop the openresty compiled | |
# nginx daemon | |
# --- original nginx comment --- | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ |
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
MongoDB upstart scripts for Ubuntu. | |
Run following commands after installing upstart scripts: | |
ln -s /lib/init/upstart-job /etc/init.d/mongoconf | |
ln -s /lib/init/upstart-job /etc/init.d/mongodb | |
ln -s /lib/init/upstart-job /etc/init.d/mongos | |
To start services use: |
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
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \ | |
libssl-dev perl make build-essential | |
wget https://github.com/openresty/stream-lua-nginx-module/archive/v0.0.1.tar.gz \ | |
-O /tmp/stream-lua-nginx-module-0.0.1.tar.gz | |
mkdir /tmp/stream-lua-nginx-module-0.0.1 | |
tar xzvf /tmp/stream-lua-nginx-module-0.0.1.tar.gz -C /tmp/stream-lua-nginx-module-0.0.1 |
OlderNewer