Skip to content

Instantly share code, notes, and snippets.

View ketralnis's full-sized avatar

david king ketralnis

View GitHub Profile
@ketralnis
ketralnis / gist:617397
Created October 8, 2010 19:40
pylibmc_testleak.py
#!/usr/bin/env python
import pylibmc
print pylibmc.__file__
from pylibmc import Client
import random
import sys
client = Client(['localhost:11211'])
client.behaviors.update({'cas': 1})
@ketralnis
ketralnis / lrucache.py
Created September 13, 2010 22:15
simplelrucache.py
"""
A simple LRU cache
"""
class NotFound(object):
pass
class LRUCacheEntry(object):
__slots__ = ('prev', # the next most recently used item
'next',
@ketralnis
ketralnis / defcon18ninjacrack.c
Created August 4, 2010 22:55
defcon badge bruteforce
#include <stdio.h>
#include <mach/std_types.h>
#include <stdlib.h>
#define TUMBLERS_PER_IMAGE 15
typedef enum {
DEFCON,
EIGHTEEN, // * 0xE38 + 16¢
BADGE,