Skip to content

Instantly share code, notes, and snippets.


Alice wheresalice

  • 02:13 (UTC +01:00)
View GitHub Profile
wheresalice / gist:468c89b85051ea369d1e
Created May 20, 2014 15:01
check a crc file matches a datafile
View gist:468c89b85051ea369d1e
def check_crc(crc_file, datafile)
expected_crc =' ')
actual_crc = `cksum #{datafile}`.split(' ')
unless File.exist?(crc_file)
puts 'crc file missing'
return false
unless File.exist?(datafile)
puts 'datafile missing'
return false
View gist:b7e3e77a99b98cc21f03

Piratebox on a cloud VM

Piratebox on a cloud VM gives you a really quick setup to see what you get out of the box. We strip away the networking stack that it offers, and run the web frontend.

First of all we need a basic Debian 7.x VM. I've opted for Digital Ocean because it's cheap and simple to use, other providers are available.

Once the VM is built (60 seconds) we log in and ensure the package lists are up to date:

apt-get update

wheresalice / gist:f0b2180d082a3e2ce501
Last active August 29, 2015 14:20
Used what we learned at SparkCamp to play with some of Leeds City Council 2014 road traffic accident data
View gist:f0b2180d082a3e2ce501
// Download 2014 Road traffic accidents from Leeds City Council
// Remove the header line in an editor because we've not figured out how to do this in Spark yet
// Register the data
val data = sc.textFile("/home/akaerast/downloads/accidents2014.csv")
# Describe the class
case class Accident(reference: String,
wheresalice / gist:112195
Created May 15, 2009 12:42
Display open Trac tickets modified in the past 10 days
View gist:112195
SELECT p.value AS __color__,
id AS ticket, summary, component, version, t.type AS type,
owner, status,
time AS created,
changetime AS _changetime, description AS _description,
reporter AS _reporter
FROM ticket t, enum p
WHERE status <> 'closed'
AND unix_timestamp(date_sub(now(), interval 10 day)) < changetime
AND = t.priority AND p.type = 'priority'
wheresalice / gist:112197
Created May 15, 2009 12:44
redacted code which goes through a Drupal database subscribing all new users to a Mailman list on a separate server. Relies upon Drupal Drush module and Mailman XMLRPC2 patch.
View gist:112197
import os
import xmlrpclib
proxy = xmlrpclib.ServerProxy("")
def nicepass(alpha=6,numeric=2):
returns a human-readble password (say rol86din instead of
a difficult to remember K8Yn9muL )
wheresalice / gist:112198
Created May 15, 2009 12:45
Training Bogofilter with virtual imap users
View gist:112198
#Version 2.0 - free for all
#kaerast at qvox - modifications, free for all
# - formail
# - bogofilter
View in-out_status.php
$couch_dsn = "http://localhost:5984/";
$couch_db = "inout";
require_once "../lib/couch.php";
require_once "../lib/couchClient.php";
require_once "../lib/couchDocument.php";
$client = new couchClient($couch_dsn,$couch_db);
wheresalice / in-out_gui.php
Created January 3, 2010 17:33
PHP-GTK/CouchDB PoC code to set status of an in/out board
View in-out_gui.php
$couch_dsn = "http://localhost:5984/";
$couch_db = "inout";
// libraries come from
require_once "../lib/couch.php";
require_once "../lib/couchClient.php";
require_once "../lib/couchDocument.php";
$client = new couchClient($couch_dsn,$couch_db);
wheresalice / gist:271161
Created January 7, 2010 10:54
Select somebody's name or email address, then use this bookmarklet to search for them on Facebook. It can probably be refactored, but I'm not Javascript expert
View gist:271161