Skip to content

Instantly share code, notes, and snippets.

% resume.tex
%
% (c) 2002 Matthew Boedicker <mboedick@mboedick.org> (original author) http://mboedick.org
% (c) 2003 David J. Grant <dgrant@ieee.org> http://www.davidgrant.ca
% (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com> http://www.courtesan.com/todd
% (c) 2009 Derek R. Hildreth <derek@derekhildreth.com> http://www.derekhildreth.com
% (c) 2011 Alice Kaerast <alice@kaerast.info> http://kaerast.info
%This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
@wheresalice
wheresalice / gist:949611
Created April 30, 2011 11:33
Sinatra Dropbox Oauth
require 'rubygems'
require 'erb'
require 'sinatra'
require 'dropbox'
configure do
enable :sessions
end
def authed?
@wheresalice
wheresalice / fib.io
Created May 3, 2011 12:01
Fibonacci series in Io language
#!/usr/bin/env io
fib := method(
a := 0
b := 1
for(i, 1, doMessage(call message argAt(0)) - 1, c := a + b; a := b; b := c)
)
fib(10) println
@wheresalice
wheresalice / redis.io
Created May 4, 2011 13:46
A basic Redis client in Io.
//metadoc Redis Alice Kaerast 2011
/*metadoc Redis description
redis is an open source, advanced key-value store
<br />An example:
<pre>
myredis := Redis clone connect("127.0.0.1:6379")
myredis send("rpush", "foo", "bar")
</pre>
*/
@wheresalice
wheresalice / AntiMalware.feature
Created May 17, 2011 14:16
What I want from an offline antimalware tool.
Feature: Offline system cleaning
We often come across Windows machines which have unknown malware installed.
There are relatively few entry points for such malware to run.
It should be possible to build an open source tool which scans these, even if the system is offline.
Background: Mount the offline system
Given I've mounted the hard disk
Scenario: The disk is scanned
@wheresalice
wheresalice / make.sh
Created May 20, 2011 14:49
Build scripts for Squidguard 1.4 with LDAP support
sgversion=`awk '/Version/ {print $2;}' squidguard.spec`
wget -c `awk '/Source/ {print $2;}' squidguard.spec | sed s/%{version}/$sgversion/g`
cp squidGuard-$sgversion.tar.gz ~/rpmbuild/SOURCES/squidGuard-$sgversion.tar.gz
rpmbuild -ba squidguard.spec
sgrelease=`awk '/Release/ {print $2;}' squidguard.spec | cut -c 1`
cp ~/rpmbuild/RPMS/*/squidguard-$sgversion-$sgrelease.*.rpm .
@wheresalice
wheresalice / ldap-account-manager.spec
Created May 26, 2011 13:14
Ldap Account Manager 3.4.0
# $Id: ldap-account-manager.spec 7981 2009-11-03 03:05:34Z dag $
# Authority: dag
# Tag: test
Summary: LDAP Account Manager
Name: ldap-account-manager
Version: 3.4.0
Release: 2%{?dist}
License: GPL
@wheresalice
wheresalice / gist:1129313
Created August 6, 2011 12:46
Regex to parse an ATCO CIF Bus Service
service = "QSNKDT E91F220080427300001010000010 696 0 I"
service_exception = "QE20100920201009240"
service_origin = "QO450024175 1725 T1F0"
service_destination = "QT25001940 1649 T1F0"
service_regex = /^QS([NDR])(.{4})(.{6})(\d{8})(\d{8})([01]{7})([SH ])([ ABX])(.{4})(.{6})(.{8})(.{8})(.)$/
service_exception_regex = /^QE(\d{8})(\d{8})([01])$/
service_note_regex = /^QN(.{5})(.{72})$/
service_origin_regex = /^QO(.{12})(\d{4})(.{3})(T[01])(F[01])$/
service_intermediary_stop_regex = /^QI(.{12})(\d{4})(\d{4})([BPSN])(.{3})(T[01])(F[01])/
@wheresalice
wheresalice / serialize.js
Created August 18, 2011 12:36
Serialize a javascript array into a string
// via: http://blog.stchur.com/2007/04/06/serializing-objects-in-javascript/
function serialize(_obj)
{
// Let Gecko browsers do this the easy way
if (typeof _obj.toSource !== 'undefined' && typeof _obj.callee === 'undefined')
{
return _obj.toSource();
}
// Other browsers must do it the hard way
switch (typeof _obj)
@wheresalice
wheresalice / img_to_map.rb
Created August 20, 2011 10:54
Create a game map in redis from a txt file which imagemagick has conerted from png to txt
require 'redis'
@redis = Redis.new
# width & height of the map
@x = @y = 0
grassdatafile = open('../resources/maps/land3g.txt')
grassdatafile.readlines.each { |line|