Skip to content

Instantly share code, notes, and snippets.

@jawspeak
jawspeak / things_app_sqlite_reverse_engineered_schema.md
Last active August 29, 2015 14:26 — forked from RaVbaker/readme.md
Reverse engineering Things SQLite tasks database

To open SQLite Things.app database run this command in Terminal.app:

$ sqlite3 ~/Library/Containers/com.culturedcode.things/Data/Library/Application\ Support/Cultured\ Code/Things/ThingsLibrary.db

In SQLite command-line type this query to get your tasks stats:

sqlite> .mode column
sqlite> .header on
sqlite> select zscheduler, zstatus, ztrashed, count(*) from ZTHING where z_ent = 13 group by  zstatus,ztrashed order by Z_pk desc;

ZSCHEDULER ZSTATUS ZTRASHED count(*)

@jawspeak
jawspeak / upgrade server ree 1.8.7 to ruby 1.9.3.sh
Last active December 10, 2015 05:18 — forked from anonymous/upgrade server ree 1.8.7 to ruby 1.9.3.sh
upgrade server ree 1.8.7 to ruby 1.9.3. - install rvm with ruby 1.9.3 - install passenger for the new ruby - update passenger to use the new ruby - uninstall the old ruby
# prereqs
sudo apt-get update
sudo /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# multiuser rvm
$ \curl -L https://get.rvm.io | sudo bash -s stable --ruby=ruby-1.9.3-p362
# add user to rvm group
sudo usermod -a -G rvm ubuntu
$ logout and log back in
@jawspeak
jawspeak / mysql_db_and_table_size_queries.sql
Created September 27, 2012 00:41 — forked from chrisk/mysql_db_and_table_size_queries.sql
MySQL queries to show the size of databases and tables reported by information_schema
-- Check the total size of each database
SELECT
tables.TABLE_SCHEMA AS database_name,
ROUND(SUM(tables.DATA_LENGTH + tables.INDEX_LENGTH) / POWER(2, 30), 3) AS database_size_in_gb
FROM information_schema.TABLES AS tables
GROUP BY tables.TABLE_SCHEMA
ORDER BY database_size_in_gb DESC;
-- List all tables larger than 1 GB
SELECT
@jawspeak
jawspeak / c10k-test-client.c
Created December 19, 2011 16:32 — forked from rsms/c10k-test-client.c
C binary to drive heavy load on a web server. 10K+ requests / second. Seems roughly equivalent to 'ab', and heaver load than httperf.
// HTTP client for testing high connection concurrency
// Authors: Richard Jones and Rasmus Andersson
// Released in the public domain. No restrictions, no support.
// SEE:
// http://rsms.me/2009/10/05/10k-comet-connections.html
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>