Skip to content

Instantly share code, notes, and snippets.

David Moreno Montero davidmoreno

Block or report user

Report or block davidmoreno

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidmoreno
davidmoreno / sqlite_rename_column.py
Last active Oct 28, 2018
Script to change database column names on Sqlite3 databases.
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
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)
You can’t perform that action at this time.