Skip to content

Instantly share code, notes, and snippets.


Nicholas Humfrey njh

View GitHub Profile
njh / ppg.xml
Last active March 7, 2023 12:48
An old XML database of BBC Podcasts
View ppg.xml
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<ppg xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="0.1" createdDate="2007-09-27T12:30:19+01:00" modifiedDate="2015-06-02T22:15:04+01:00" ownerName="BBC" ownerEmail="">
<program xmlns="" language="en-gb" typicalDuration="PT76M" active="true" public="true" bbcFlavour="Multi Programme" region="all" wwpid="0" launchDate="2009-01-21" frequency="daily" daysLive="7" liveItems="1">
<title>606 Football Phone-in</title>
<description>The UK's biggest football phone-in, broadcast on Saturdays, Sundays and midweek on BBC Radio 5 live. Fans take part in a lively debate about the latest matches and talking points.</description>
<network id="5live" name="BBC Radio 5 live" />
<image use="itunes" url="" />
<link target="homepage" url="
njh / gb-level6-admins.overpassql
Created February 9, 2023 11:07
Query for all Level 6 Administrative Boundaries in the UK
View gb-level6-admins.overpassql
Query for all Level 6 Administrative Boundaries in the UK
England: Two-tier non-metropolitan counties, Metropolitan counties, Unitary authorities
Scotland: council areas
Wales: principal areas
njh /
Last active February 1, 2023 22:22
Linux Hello World machine code for 32-bit ARM, formatted in the binmark format
## 32-bit ARM ELF machine code
# Compile this to a binary using:
# binmark > helloworld-arm32
# readelf -a ./helloworld-arm32
# chmod a+rx helloworld-arm32
# ./helloworld-arm32
## ELF File header
njh /
Created January 7, 2023 22:55
lsusb for Linksys Gigabit Ethernet Adapter USB3GIGV1
njh / generate-insecure-token.js
Created September 21, 2022 10:27
Generate Insecure JWT tokens in JavaScript
View generate-insecure-token.js
function base64urlencode(obj) {
if (obj instanceof Buffer) {
buf = obj
} else if (typeof obj === 'string') {
buf = Buffer.from(obj)
} else {
json = JSON.stringify(obj, null, 0)
buf = Buffer.from(json)
njh / 20220826174908622.xml
Created August 27, 2022 19:29
DAB EPG File for BBC Radio 4 on Sunday 28th August 2022
View 20220826174908622.xml
<defaultContentIDElement contentID="0.E1.CE15.C224.">
<schedule version="5">
<programme shortId="794099">
Midnight News
Midnight News - 28/08/2022
njh / PyQt5-5.14.2.log
Created December 31, 2021 10:37
Building PyQt5 v5.14.2 on Raspberry Pi OS (Debian 11.2)
View PyQt5-5.14.2.log
This file has been truncated, but you can view the full file.
pi@raspberrypi:~/tasmotizer $ pip3 install -r requirements.txt
Looking in indexes:,
Requirement already satisfied: pyserial>=3.5 in /home/pi/.local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (3.5)
Collecting PyQt5==5.14.2
Downloading PyQt5-5.14.2.tar.gz (3.2 MB)
|████████████████████████████████| 3.2 MB 1.5 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
njh / FlashStringTest.ino
Last active September 7, 2021 12:20
Experimental sketch, testing storing a MAC address in program memory and casting to __FlashStringHelper
View FlashStringTest.ino
// Experimental sketch, testing storing a MAC address in program memory and casting to __FlashStringHelper
// By Nicholas Humfrey
// This Macro isn't available for AVR architecture in the Arduino IDE
#ifndef FPSTR
#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
const static byte mymac[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };
const static byte myprogmac[] PROGMEM = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };
njh / combined.xsd
Created May 27, 2021 15:37
Validate an RadioDNS (ETSI TS 102 818) SI.xml file offline using xmllint
View combined.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema elementFormDefault="qualified" xmlns="">
<import namespace="" schemaLocation="xml.xsd"/>
<import namespace="" schemaLocation="spi_33.xsd"/>
njh / gist:437713988b108880a8fe23ed10168c0c
Created February 15, 2021 00:15
Test 0001-pppd-Allow-for-a-zero-interface-identifier-in-ConfRe.patch
View gist:437713988b108880a8fe23ed10168c0c
./pppd/pppd file ~/ppp-options ipv6 ::, ipv6cp-accept-local /dev/ttyAMA0 115200
using channel 115
Using interface ppp0
Connect: ppp0 <--> /dev/ttyAMA0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x278163d5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x278163d5>]
rcvd [LCP ConfReq id=0x3d <asyncmap 0x0> <magic 0xef10eb70>]
sent [LCP ConfAck id=0x3d <asyncmap 0x0> <magic 0xef10eb70>]
sent [LCP EchoReq id=0x0 magic=0x278163d5]
sent [IPV6CP ConfReq id=0x1 <addr fe80::0000:0000:0000:0000>]