Skip to content

Instantly share code, notes, and snippets.

View palfrey's full-sized avatar

Tom Parker-Shemilt palfrey

View GitHub Profile
@palfrey
palfrey / crossgrade-apt.py
Last active December 12, 2016 23:56
Cross-grade helper script
# Copyright 2016 Tom Parker/Oliver Wyman, opensource@lshift.net
# License: AGPLv3
import apt_pkg
import os
import subprocess
apt_pkg.init()
cache = apt_pkg.Cache()
sourcelist = apt_pkg.SourceList()
sourcelist.read_main_list()
@palfrey
palfrey / gist:5012c242958f1249ad168d9fc4b9eab1
Created September 13, 2016 20:43
Handbrake stacktrace
Thread 31 (Thread 0xa53f4b40 (LWP 18785)):
#0 0xb7fd8d40 in __kernel_vsyscall ()
No symbol table info available.
#1 0xb7784e35 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/i386/i686/../pthread_cond_timedwait.S:245
No locals.
#2 0x080c4f0e in hb_cond_timedwait (c=0xb5a00b70, lock=0xb5a00b18, msec=200) at ../libhb/ports.c:1143
ts = {tv_sec = 1473799109, tv_nsec = 608678000}
#3 0x08100449 in hb_fifo_get_wait (f=0xb5a00ae0) at ../libhb/fifo.c:1000
b = <optimized out>
#4 0x080e39d2 in filter_loop (_f=0xb5a014a0) at ../libhb/work.c:1926
(gdb) thread apply all bt
Thread 49 (Thread 0x98cf7b40 (LWP 23752)):
#0 0xb7fd8d40 in __kernel_vsyscall ()
#1 0xb600be35 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/i386/i686/../pthread_cond_timedwait.S:245
#2 0x0805ca9c in hb_cond_timedwait ()
#3 0x0806a059 in hb_fifo_get_wait ()
#4 0x0808c151 in work_loop ()
#5 0x0805c12e in hb_thread_func ()
#6 0xb600629a in start_thread (arg=0x98cf7b40) at pthread_create.c:333
@palfrey
palfrey / Cargo.toml
Created June 6, 2016 13:23
Breaking issue for Image
[package]
name = "break-image"
version = "0.1.0"
authors = ["Tom Parker <palfrey@tevp.net>"]
[dependencies]
image = { git = "https://github.com/PistonDevelopers/image.git" }
@palfrey
palfrey / docker-compose.yml
Created October 29, 2015 16:51
Kitling docker-compose
imager:
image: kitling/imager
comparer:
image: kitling/comparer
links:
- postgres
- imager
environment:
- DATABASE_URL=postgres://postgres:mysecretpassword@postgres/postgres
frontend:
@palfrey
palfrey / dalek.js
Created June 25, 2015 22:38
Dalek Video files
"use strict";
var selfEasyrtcid = "";
var otherClients = [];
var state = "observer";
var calling = false;
function getClient(rtcid) {
if (!_.has(otherClients, rtcid)) {
otherClients[rtcid] = {"contacted" : null, state : null, id: rtcid, feed: null};
console.log("OtherClients (after add): " + _.keys(otherClients));
palfrey@mruppity:[~/src/docker.ubuntu] vagrant up ubuntu-1404 <=====
Bringing machine 'ubuntu-1404' up with 'virtualbox' provider...
==> ubuntu-1404: Importing base box 'ubuntu/trusty64'...
==> ubuntu-1404: Matching MAC address for NAT networking...
==> ubuntu-1404: Checking if box 'ubuntu/trusty64' is up to date...
==> ubuntu-1404: Setting the name of the VM: dockerubuntu_ubuntu-1404_1430132322706_97353
==> ubuntu-1404: Clearing any previously set forwarded ports...
==> ubuntu-1404: Fixed port collision for 22 => 2222. Now on port 2206.
==> ubuntu-1404: Clearing any previously set network interfaces...
==> ubuntu-1404: Preparing network interfaces based on configuration...
@palfrey
palfrey / controls.html
Last active August 29, 2015 14:19
Dalek Controls
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!--skip-->
<title>Dalek Controls</title>
<script type="text/javascript" src="controls.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="http://underscorejs.org/underscore-min.js"></script>
@palfrey
palfrey / gist:7512273
Created November 17, 2013 11:37
The Night watch
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<h2>The Night Watch</h2>
<h3>James mickens</h3>
As a highly trained academic researcher, I spend a lot of time trying
to advance the frontiers of human knowledge. However, as someone who was born in the South, I secretly believe that true progress is
@palfrey
palfrey / gist:7021931
Created October 17, 2013 09:32
Broken CloudFormation setup
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Test servers",
"Parameters" : {
"Environment" : {
"Type" : "String",
"Default" : "dev",
"Description" : "Environment name",