Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicholas Humfrey njh

View GitHub Profile
@njh
njh / FlashStringTest.ino
Last active Sep 7, 2021
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))
#endif
const static byte mymac[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };
const static byte myprogmac[] PROGMEM = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };
@njh
njh / combined.xsd
Created May 27, 2021
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="http://www.w3.org/2001/XMLSchema">
<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<import namespace="http://www.worlddab.org/schemas/spi/33" schemaLocation="spi_33.xsd"/>
</schema>
@njh
njh / gist:437713988b108880a8fe23ed10168c0c
Created Feb 15, 2021
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>]
@njh
njh / ppp-options-mini
Last active Feb 15, 2021
Attempting to get 'server' pppd to give IPv6 interface identifier to 'client' pppd - version 2.4.7
View ppp-options-mini
nodetach
noauth
debug
persist
local
noip
+ipv6
@njh
njh / vddl-status-2021-01-12.txt
Created Feb 8, 2021
Output of `vdsl status` on Draytek Vigor 130
View vddl-status-2021-01-12.txt
---------------------- ATU-R Info (hw: annex A, f/w: annex A/B/C) -----------
Running Mode : 17A State : SHOWTIME
DS Actual Rate : 32397000 bps US Actual Rate : 17000000 bps
DS Attainable Rate : 41041052 bps US Attainable Rate : 21214000 bps
DS Path Mode : Fast US Path Mode : Fast
DS Interleave Depth : 1 US Interleave Depth : 1
NE Current Attenuation : 11 dB Cur SNR Margin : 12 dB
DS actual PSD : 0. 6 dB US actual PSD : 12. 5 dB
NE CRC Count : 0 FE CRC Count : 63281
NE ES Count : 0 FE ES Count : 7557
@njh
njh / xml_parser_test.php
Created Oct 11, 2020
A PHP script to compare \EasyRdf\XMLParser with 'XML Parser' (expat)
View xml_parser_test.php
<?php
require_once realpath(__DIR__)."/vendor/autoload.php";
$xml = <<<'EOD'
<root>
<one a="1" b="2">one</one>
<two a="1" b="2">two</two>
<three />
</root>
@njh
njh / gist:ef9f36ffe9b67131023619da7da5230b
Created Jul 6, 2020
curl request for jsonldcontext.json
View gist:ef9f36ffe9b67131023619da7da5230b
$ curl -v https://schema.org/docs/jsonldcontext.json
* Trying 2a00:1450:4009:80f::200e...
* TCP_NODELAY set
* Connected to schema.org (2a00:1450:4009:80f::200e) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
@njh
njh / uk-ofcom-tv-transmitting-stations.csv
Last active Apr 15, 2020
A list of UK TV Transmitter Stations from Ofcom - Version 19 (6th June 2019)
View uk-ofcom-tv-transmitting-stations.csv
Station Name Grid Reference UHF Channel Aerial Height Power Comments
BORDERS
CALDBECK NY29954259 25 619.5 100000
Ainstable NY53914661 39 234.8 20
Bassenthwaite NY20633054 39 142 100
Bleach Green HP NX98431990 39 151 2
Bleach Green VP NX98431990 39 151 20
Crosby Ravensworth NY61881525 60 227 2
@njh
njh / bbc_tv_trasmitter_stations_2008.csv
Created Apr 14, 2020
A list of UK TV Transmitter Stations from the BBC
View bbc_tv_trasmitter_stations_2008.csv
Site Name Abbrev NGR Region PSB1 Channel PSB1 Power 1 PSB2 Channel PSB2 Power PSB3 Channel PSB3 Power
Addingham ABP SE07594921 Yorkshire 43 0.005 46 0.005 50 0.005
Aislaby AIS NZ86300870 Tyne Tees 45 0.008 49 0.008 42 0.008
Aldbourne ALB SU26207520 Meridian 21 0.002 24 0.002 27 0.002
Aldeburgh ADB TM44175960 Anglia 23 10 28 10 25 10
Alexandra Palace AP TQ29669006 London 54 0.013 58 0.013 61 0.013
Allenheads ALH NY84004690 Tyne Tees 21 0.002 24 0.002 27 0.002
Alston ALN NY73094785 Tyne Tees 42 0.08 45 0.08 49 0.08
Alton AN SU72223862 Meridian 53 0.002 57 0.002 60 0.002
Armagh AMH NV99230399 Ulster 45 0.024 49 0.024 42 0.024
@njh
njh / cloud.svg
Created Mar 4, 2020
A simple SVG of a cloud by Nicholas Humfrey. License: https://creativecommons.org/licenses/by/4.0/
View cloud.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.