Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Webb arachsys

View GitHub Profile
@arachsys
arachsys / README
Created May 8, 2012
Play raw 16-bit signed little-endian audio to a Motif XF
View README
To play audio through the Motif, connect to it on TCP port 5556 and send a
continuous stream of audio chunks, each consisting of the eight bytes
‘W’, ‘A’, ‘V’, ‘E’, 0xLL, 0xHH, 0x00, 0x00
followed by 0xHHLL bytes of stereo, 16-bit, signed, little-endian audio data.
0x8000 works well as a chunk size, and matches that used by the instrument
when recording.
The Motif has a playback buffer of size 0x180000 bytes, and will only start
@arachsys
arachsys / README
Created May 8, 2012
Record raw 16-bit signed little-endian audio from a Motif XF
View README
To record audio from the Motif, connect to it on TCP port 5555 and you will
receive a continuous stream of audio chunks, each consisting of the eight
bytes
‘W’, ‘A’, ‘V’, ‘E’, 0xLL, 0xHH, 0x00, 0x00
followed by 0xHHLL bytes of stereo, 16-bit, signed, little-endian audio data.
The instrument always uses a chunk size of 0x8000 when recording, even though
it seems to support other chunk sizes on playback.
@arachsys
arachsys / airfilter
Created Jun 10, 2012
Filter out OpenAir airspace above specified flight level
View airfilter
#!/bin/perl -w
use strict;
sub emit($$) {
my ($ceiling, $stanza) = @_;
if ($stanza =~ /^AL (.*)/im and $1 =~ /^FL\s*(\d+)$/i) {
return if $1 >= $ceiling;
}
print $stanza;
@arachsys
arachsys / dmrollback.c
Created Jun 12, 2012
Roll back an LVM2 logical volume to match an earlier snapshot
View dmrollback.c
#define _GNU_SOURCE
#include <byteswap.h>
#include <endian.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define BLOCK_SIZE 512
@arachsys
arachsys / djbdns-1.05-getpeername.patch
Created Jun 12, 2012
Fix djbdns-1.05 to run correctly under inetd/skd/socat instead of daemontools
View djbdns-1.05-getpeername.patch
diff --git a/axfrdns.c b/axfrdns.c
index 7079850..b63cb58 100644
--- a/axfrdns.c
+++ b/axfrdns.c
@@ -1,3 +1,5 @@
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <unistd.h>
#include "droproot.h"
#include "exit.h"
@arachsys
arachsys / mutt-draft-msgid.patch
Created Jun 16, 2012
Fix Mutt's draft handling for git imap-send
View mutt-draft-msgid.patch
From 416eb783cf8b294f87f242ebfbf9aaa87a849763 Mon Sep 17 00:00:00 2001
Message-Id: <416eb783cf8b294f87f242ebfbf9aaa87a849763.1339836856.git.chris@arachsys.com>
From: Chris Webb <chris@arachsys.com>
Date: Sat, 16 Jun 2012 09:46:51 +0100
Subject: [PATCH] Fix draft handling for git imap-send
git format-patch generates a thread by setting Message-ID: on the first
message and References: & In-Reply-To: on subsequent messages. git imap-send
allows this thread to be appended to the Mutt drafts folder, ready to review,
edit and send. Unfortunately, Mutt strips Message-ID: when retrieving
@arachsys
arachsys / despotify.patch
Created Jun 16, 2012
Miscellaneous Despotify fixes
View despotify.patch
From 37075ed12045c9a45526799d3bf7e564c2536711 Mon Sep 17 00:00:00 2001
Message-Id: <37075ed12045c9a45526799d3bf7e564c2536711.1338408558.git.chris@arachsys.com>
From: Chris Webb <chris@arachsys.com>
Date: Mon, 21 May 2012 10:54:06 +0100
Subject: [PATCH 1/5] Simple handling of multi-disc albums
We append the tracks from any additional discs to treat multi-disc albums
as though they were one large disc.
Signed-off-by: Chris Webb <chris@arachsys.com>
@arachsys
arachsys / local.patch
Created Jun 18, 2012
Local git patches, not suitable for upstream
View local.patch
From 689d73b1f07425ce778362377f8f1bc0371033b1 Tue Jul 31 06:35:55 2012
Message-Id: <689d73b1f07425ce778362377f8f1bc0371033b1.1343719228.git.chris@arachsys.com>
From: Chris Webb <chris@arachsys.com>
Date: Thu, 15 Apr 2010 15:31:15 +0100
Subject: [PATCH 1/2] format-patch: use commit date in mbox 'From COMMIT DATE'
header line
Put the commit date in the 'From COMMIT DATE' header line instead of using
the fixed date 'Mon Sep 17 00:00:00 2001'. A DATE_UTC mode for show_date() is
introduced so we can easily generate this line in the correct format, and
@arachsys
arachsys / chris.asc
Created Jun 19, 2012
GnuPG public key
View chris.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
mQINBE/V3aEBEADj4c9vkisq/lndiwAc/awV+uXh9KhdZhoZ6M/H2lGOWVcUYfiO
l7hYlrqBhgRFu/i+kuffoQWKAgH02ufw2L5VrL4/kE63CImQqqzzcWet/8QBqCMe
WMa7ugy8z7MKyc9NV9u7W219pR0m3yIwn83HdAUJA6tF5fBINnIybiLIXlHK3FCI
B6DxMzdA9ogBV91t9pkET63NrWX9OUE4OZxk9qYo0fpT1lXRWhlGiSBSiArtqoJ1
NYtoMT61G5LOwa2+xPBVEP7BxkQpfGunFBuwrH0F0zSWzlVDJlmipPvyA1AyKs7D
nHuPHY7GAAjCAQq0qK/hbAWnhDQ5RnEjvf7Cmhqcm+C3YQDVk9H9M33aYphwQHsN
8gjTZqxl4n5L/amoQ86HOD3Qa1EysnE3CJeYHkcDXDEbzIW8WZCKkQbpLFjeuOyT
@arachsys
arachsys / siginfo.patch
Created Jul 6, 2012
Fix gdb to use siginfo_t instead of struct siginfo
View siginfo.patch
From 0bcbef9314d6679d1fbbb0114683d06de0196623 Mon Sep 17 00:00:00 2001
Message-Id: <0bcbef9314d6679d1fbbb0114683d06de0196623.1341578007.git.chris@arachsys.com>
From: Chris Webb <chris@arachsys.com>
Date: Fri, 6 Jul 2012 13:18:58 +0100
Subject: [PATCH] Replace struct siginfo with siginfo_t
Glibc 2.16.0 removes the undocumented definition of 'struct siginfo' from
<bits/siginfo.h>. This struct is also available as the POSIX-defined
siginfo_t, so replace all uses of struct siginfo with siginfo_t.