Skip to content

Instantly share code, notes, and snippets.

View proppy's full-sized avatar

Johan Euphrosine proppy

View GitHub Profile
set -e
cleanup() {
kill -9 $pincaster_pid
rm /tmp/pincaster.db
}
trap 'cleanup' 0
HOST=localhost
./src/pincaster pincaster.conf &
simplejson.dumps([dict([(k.replace('PLAYGROUND_', '').lower(), v)for k, v in imp.load_source('localsettings', os.path.join(BASE_DIR, f,'geodjango', 'localsettings.py')).__dict__.items() if k.startswith('PLAYGROUND_')]) for f in os.listdir(BASE_DIR) if os.path.isdir(f)])
proppy@powerminer:~/Documents$ ledger -f proppy.ledger xml | xsltproc stripnamespace.xsl - | xsltproc xmltojsonv1.xsl - | sed s@,,@,@g | sed s@,}@}@g | python -mjson.tool | python -c 'import sys; import json; import couchdb; print [couchdb.Server("http://localhost:8000")["ledger"].create(e) for e in json.loads(sys.stdin.read())[0]["ledger"]["entry"]]'
['e673c7ad3f1c35d7226f6a5f9a89a410', '425bf48875ec51665515a9445bd5142c', '9bc1e3e2ac1fd898d1402edda4148e52', 'ca9718d6ed6b3ed25b53868254e035ce', 'df1858cda314f14e2ed151e17e44508e']