Skip to content

Instantly share code, notes, and snippets.

View vext01's full-sized avatar
🏠
Working from home

Edd Barrett vext01

🏠
Working from home
View GitHub Profile
@vext01
vext01 / gist:1437651
Created December 6, 2011 10:12
"image file is not of type 15"
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 0.8.7 ] */
/* [wxMaxima: input start ] */
kill(all);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
chull(z, a, b) := (a+b)*z - (a*b);
/* [wxMaxima: input end ] */
@vext01
vext01 / gist:1481180
Created December 15, 2011 13:59
Pub selection script
import random
pubs = [ "millers", "unicorn", "phoenix", "cricketers", "cherry tree", "foundry" ]
rand = random.randint(0, len(pubs) -1)
print("We will drink at the %s" % pubs[rand])
@vext01
vext01 / nctest.c
Created January 13, 2012 11:31
Window flicker test case
#include <stdlib.h>
#include <curses.h>
int
main(void)
{
WINDOW *lwin; /* large window */
WINDOW *bwin; /* bar window */
WINDOW *owin; /* other window - overlaps largewin */
int i = 0;
@vext01
vext01 / print.py
Created January 18, 2012 15:32
Quick script to print student's assignments fr marking
#!/usr/bin/env python
import os
import os.path
tree = os.walk(".")
for root, dirs, files in tree:
if ("Doodle.java" not in files):
@vext01
vext01 / gist:1682992
Created January 26, 2012 14:23
s3 save ram bindiffs
% radiff2 Sonic\ the\ Hedgehog\ 3-END-Z1 Sonic\ the\ Hedgehog\ 3-BEGIN-Z2
0x0000016e 00 => 01 0x0000016e
0x00000176 10 => 00 0x00000176
0x000001cc a4 => 93 0x000001cc
0x000001ce a9 => 7a 0x000001ce
0x000001fa 00 => 01 0x000001fa
0x00000202 10 => 00 0x00000202
0x00000258 a4 => 93 0x00000258
0x0000025a a9 => 7a 0x0000025a
% radiff2 Sonic\ the\ Hedgehog\ 3-END-Z2 Sonic\ the\ Hedgehog\ 3-BEGIN-Z3
What we did here was:
Start the game as sonic and tails, dump the ram.
Start the game as sonic only, dump the ram.
Start the game as tails only, dump the ram.
We did two bindiffs:
Sonic -> Tails
Sonic -> Sonic + tails
@vext01
vext01 / gist:1870935
Created February 20, 2012 19:38
Part of the sonic 3 checksum code
0x0000b766: 3a 1e bb 47: move.w (A6)+, D5
0x0000b76a: e2 4f 64 04: lsr.w #1, D7
0x0000b76e: 0a 47 88 10: eori.w #$8810, D7
0x0000b772: 51 ce ff f2: dbra D6, b766
0x0000b776: 4e 75 2c 4a: rts
0x0000b77a: 3c 00 53 46: move.w D0, D6
0x0000b77e: 61 e4 3c 87: bsr b764
0x0000b782: 26 4a 32 00: movea.l A2, A3
0x0000b786: 34 1a 05 88: move.w (A2)+, D2
@vext01
vext01 / gist:1932078
Created February 28, 2012 11:44
joystick test on amd64
Hardware looks like this:
------------------------
uhidev2 at uhub8 port 1 configuration 1 interface 1 "Dell Dell Multimedia Pro Keyboard" rev 1.10/59.00 addr 3
uhidev2: iclass 3/0, 3 report ids
uhid0 at uhidev2 reportid 1: input=1, output=0, feature=0
uhid1 at uhidev2 reportid 2: input=1, output=0, feature=0
uhid2 at uhidev2 reportid 3: input=3, output=0, feature=0
uhidev3 at uhub5 port 2 configuration 1 interface 0 "vendor 0x0810 Twin USB Gamepad" rev 1.00/1.06 addr 2
@vext01
vext01 / gist:2043332
Created March 15, 2012 09:46
fgetln test
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char *
somefunc(FILE* file)
{
char *copy;
size_t size = 0;
char *line = NULL;
@vext01
vext01 / AutoTune_SomaFM_MPD.rb
Created April 18, 2012 00:28 — forked from rtlong/AutoTune_SomaFM_MPD.rb
Use this simple ruby script to automate grabbing all the SomaFM stations and saving each as a playlist into MPD.
# Make sure you can use mpc from your command line before running this.
soma = { "Groove Salad (ambient/electronica)" => 'groovesalad',
"Suburbs of Goa (world)" => 'suburbsofgoa',
"Lush (electronica)" => 'lush',
'Digitalis (electronica/alternative)' => 'digitalis',
'480 Minutes (alternative)' => '480min',
'Indie Pop Rocks! (alternative)' => 'indiepop',
'PopTron (alternative)' => 'poptron',
'Black Rock FM (eclectic)' => 'brfm',