Skip to content

Instantly share code, notes, and snippets.

View JonnyJD's full-sized avatar

Johannes Dewender JonnyJD

View GitHub Profile
@JonnyJD
JonnyJD / Makefile
Created July 31, 2013 22:16
traversing the I/O registry on Mac OS X (iokit)
traverse_io_registry: traverse_io_registry.c
${CC} $^ -framework CoreFoundation -framework IOKit -o $@
@JonnyJD
JonnyJD / showrelease.py
Last active December 24, 2015 13:09
This shows a disc in a drive on musicbrainz.org
#!/usr/bin/python
# Copyright 2009-2013 Johannes Dewender ( brainz at JonnyJD.net )
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@JonnyJD
JonnyJD / Makefile
Last active December 24, 2015 03:59
Disc ID calculation with gstreamer
CFLAGS=`pkg-config --cflags gstreamer-plugins-base-1.0`
LIBS=`pkg-config --libs gstreamer-plugins-base-1.0`
discid: discid.c
gcc -Wall $^ -o $@ $(CFLAGS) $(LIBS)
@JonnyJD
JonnyJD / Makefile
Last active December 20, 2015 09:09
Preliminary tests to implement drutil's optical disc drive numbering in C
disc_drive_numbers: disc_drive_numbers.c
${CC} $^ -framework CoreFoundation -framework IOKit -o $@
@JonnyJD
JonnyJD / password_test.py
Last active December 16, 2015 11:39
A test script intended to test authentication with a non-ascii password using python-musicbrainzngs. The code is inherited from isrcsubmit.py. Only parts irrelevant for this test are taken out.
#!/usr/bin/env python
agent_name = "password_test.py"
agent_version = "0.1"
# this script doesn't submit anything (empty dict)
# so testing this on live server (with live passwords) is okay.
musicbrainz_server = "test.musicbrainz.org"
#musicbrainz_server = "musicbrainz.org"
import sys
@JonnyJD
JonnyJD / PKGBUILD
Created April 5, 2013 17:41
python2-discid-local PKGBUILD to use a local git repository as "package"
# Maintainer: Johannes Dewender arch at JonnyJD dot net
pkgname=python2-discid-local
_pkgname=discid
_python=python2
pkgver=0.2.1
pkgrel=1
pkgdesc="Python binding of Libdiscid"
arch=('any')
url="https://python-discid.readthedocs.org/"
license=('LGPL3')
@JonnyJD
JonnyJD / contributors.sh
Created April 19, 2012 02:11
list new contributors for a git branch (given a previous list)
#!/bin/sh
aliases=(aheadley Andrew "Two Words" "<mail@example.com>")
if [ $# -gt 0 ]; then
branch=$1
else
branch=master
fi
@JonnyJD
JonnyJD / querytest.py
Created March 22, 2012 13:23
python-musicbrain-ngs ad-hoc tests
import sys
import musicbrainzngs as m
def main():
m.set_useragent("application", "0.01", "http://example.com")
#print m.get_artist_by_id("952a4205-023d-4235-897c-6fdb6f58dfaa", [])
#print m.get_label_by_id("aab2e720-bdd2-4565-afc2-460743585f16")
#print m.get_release_by_id("e94757ff-2655-4690-b369-4012beba6114")
#print m.get_release_group_by_id("9377d65d-ffd5-35d6-b64d-43f86ef9188d")
#print m.get_recording_by_id("cb4d4d70-930c-4d1a-a157-776de18be66a")
@JonnyJD
JonnyJD / pacman_20150809.log
Created August 9, 2015 23:19
Pacman update on 2015-08-09, breaking lib32-libx264
[2015-08-09 16:33] [ALPM] transaction started
[2015-08-09 16:33] [ALPM] removed gcc-fortran-multilib (5.1.0-5)
[2015-08-09 16:33] [ALPM] transaction completed
[2015-08-09 16:33] [PACMAN] Running 'pacman -U gcc-libs-multilib-5.2.0-1-x86_64.pkg.tar.xz binutils-2.25.1-1-x86_64.pkg.tar.xz gcc-multilib-5.2.0-1-x86_64.pkg.tar.xz lib32-gcc-libs-5.2.0-1-x86_64.pkg.tar.xz'
[2015-08-09 18:28] [ALPM] transaction started
[2015-08-09 18:28] [ALPM] upgraded lib32-gcc-libs (5.1.0-5 -> 5.2.0-1)
[2015-08-09 18:28] [ALPM] upgraded gcc-libs-multilib (5.1.0-5 -> 5.2.0-1)
[2015-08-09 18:28] [ALPM] upgraded binutils (2.25-5 -> 2.25.1-1)
[2015-08-09 18:28] [ALPM] upgraded gcc-multilib (5.1.0-5 -> 5.2.0-1)
[2015-08-09 18:29] [ALPM] transaction completed
==> Making package: lib32-libx264 148.20150725-3 (Mon Aug 10 01:20:04 CEST 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating x264 git repo...
Fetching origin
==> Validating source files with md5sums...
x264 ... Skipped
==> Extracting sources...
-> Creating working copy of x264 git repo...