View watch-dir-do.sh
#!/bin/bash | |
if [ ! "$2" ]; then | |
cat << EOF | |
$0 -- Watch a directory and run a command on changes | |
$0 [path] [cmd] [options...] | |
Example: |
View sqlite_rename_column.py
#!/usr/bin/env python | |
import os, sys, subprocess, re | |
if len(sys.argv)==1: | |
print "Usage:" | |
print " %s <databasefile> <tablename,tablename2,...> <origcolumn> <destcolumn> [--apply]"%sys.argv[0] | |
print "Options (must appear at the end):" | |
print " --apply Apply the changes directly to database file" |
View gist:5264730
// Compile it with: | |
// $ gcc -o bench bench.c -lonion -Wall -O2 -lsqlite3 | |
// $ export ONION_LOG=noinfo # To properly test, you may need some control over logging. Here almost disabled. | |
// $ ./bench | |
// It listens to localhost:8080, known addresses: http://localhost:8080/ , http://localhost:8080/db , http://localhost:8080/db20 | |
// Test it with ab: | |
// $ ab -k -t 10 -c 20 http://localhost:8080/ | |
// It gave me (Intel(R) Core(TM) i7-2677M CPU @ 1.80GHz): | |
// Requests per second: 58288.10 [#/sec] (mean) |