Skip to content

Instantly share code, notes, and snippets.

View njh's full-sized avatar

Nicholas Humfrey njh

View GitHub Profile
@njh
njh / auto_select_certificate.json
Created December 22, 2015 11:06
Policy file to configure Chrome/Chromium to automatically select a client certificate (useful for Kiosk mode)
{
"AutoSelectCertificateForUrls": ["{\"pattern\":\"*\",\"filter\":{}}"]
}
@njh
njh / start-ipv6-tcp-ppp-server.sh
Last active May 2, 2024 21:09
Start an IPv6-only PPP server, that accepts connections over TCP
#!/bin/bash
#
#
pppd='pppd'
pppd+=' debug'
pppd+=' logfd 2'
pppd+=' nodetach'
pppd+=' noauth'
pppd+=' noip'
@njh
njh / aes67_wishlist.md
Last active February 19, 2024 16:54
AES67 Open Source Software Wishlist

AES67 (an open standard for high quality audio over IP) is becoming mainstream in the world of broadcast and professional audio industries, however there is a very limited amount of open source software available to interoperate with it. As a result we are often just replacing XLRs with Ethernet, without taking advantage of the possibilites the software give. While Virtual Soundcards enable some of this, native network implementations would allow greater flexibility.

This is my wishlist of things that would help change that. Hopefully one day it can be turned into a AES67 Awesome List.

As open source has resulted in very rapid evolution of the web, I believe the same is possible for professional/broadcast audio.

It is possible that some of this already exists and I just havn't found it yet. Please add a comment below if you know of something!

@njh
njh / house.example.net.conf
Created January 21, 2016 13:09
Proxying Node-Red through Nginx
server {
server_name house.example.net;
listen 1.2.3.4:80 default_server;
listen [2001:1234:ffff::1]:80 default_server;
add_header Cache-Control "public,max-age=31536000";
return 301 https://$server_name$request_uri;
}
map $ssl_client_s_dn $ssl_username {
@njh
njh / extract-daily-temperature.rb
Created January 18, 2024 09:37
Get one year of historical daily temperatures for a single location from Meteosource
#!/usr/bin/env ruby
require 'date'
require 'json'
today = Date.today
start = today - 365
(start...today).each do |date|
json = File.read("weather/#{date}.json")
data = JSON.parse(json, :symbolize_names => true)
@njh
njh / _README.md
Last active October 7, 2023 20:25
Dual-stack VyOS Zone based Firewall Generator

Dual-stack VyOS Zone based Firewall Generator

A ruby script to generate the boilerplate for a dual-stack VyOS zone based firewall.

Zones:

  • PRIVATE: contains the LAN and WAN modem admin interface
  • PUBLIC: The Internet - contains the PPPoE interface
@njh
njh / sunrise.rb
Created September 11, 2011 22:45
Ruby Code to calculate sunrise and sunset times where I live
#!/usr/bin/env ruby
require 'rubygems'
require 'solareventcalculator'
solar = SolarEventCalculator.new(Date.today, BigDecimal.new('51.563'), BigDecimal.new('-0.499'))
puts "Sunrise: #{solar.compute_utc_civil_sunrise.getlocal}"
puts "Sunset: #{solar.compute_utc_civil_sunset.getlocal}"
@njh
njh / backup-github-repos.pl
Created August 23, 2017 21:24
Script to download/clone all of your Github repos
#!/usr/bin/perl
#
# Script to download/clone all of your Github repos
#
# Copyright Nicholas Humfrey, 22nd August 2017
#
# License: http://unlicense.org
#
use JSON;
@njh
njh / parse-nationaltrust.rb
Last active July 31, 2023 22:19
Convert the National Trust list of properties into a CSV file
#!/usr/bin/env ruby
require 'open-uri'
require 'csv'
require 'json'
json = open('https://www.nationaltrust.org.uk/api/search/places?query=&lat=52&lon=0&milesRadius=1000&maxPlaceResults=1000').read
CSV.open("nationaltrust.csv", "wb") do |csv|
csv << ['id', 'name', 'town', 'county', 'lat', 'long', 'description', 'url']
@njh
njh / dante-aes67-1.sdp
Last active June 21, 2023 03:14
Sample SDP description for AES67 multicast stream generated by Dante Ultimo X4
v=0
o=- 1423986 1423994 IN IP4 169.254.98.63
s=AOIP44-serial-1614 : 2
c=IN IP4 239.65.45.154/32
t=0 0
a=keywds:Dante
m=audio 5004 RTP/AVP 97
i=2 channels: TxChan 0, TxChan 1
a=recvonly
a=rtpmap:97 L24/48000/2