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
// 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) |
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 | |
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" |
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 | |
if [ ! "$1" ]; then | |
cat << EOF | |
$0 -- Watch a directory and run a command on changes | |
$0 cmd options | |
Environmental vars: |