Skip to content

Instantly share code, notes, and snippets.

andrewn / kill-port
Created May 16, 2022
Find out what's using those local TCP ports
View kill-port
# Kill process using the port
# Usage: kill-port <port-number>
# Example:
# $ kill-port 3000
# Killed 🔪
if [ $# -eq 0 ]
andrewn / espruino.js
Created Feb 14, 2021
Corona Ampel-Status for Espruino and LEDs
View espruino.js
var config = {
"ssid": "WIFI SSID",
"password": "WIFI PASSWORD",
"dataURL": "",
"timeoutMs": 60 * 1000,
"numLEDs": 3,
var errors = [];
var currentErrorIndex = 0;
View script.js
var Engine = Matter.Engine,
Render = Matter.Render,
Runner = Matter.Runner,
Events = Matter.Events,
MouseConstraint = Matter.MouseConstraint,
Mouse = Matter.Mouse,
World = Matter.World,
Bodies = Matter.Bodies;
// create engine
andrewn /
Last active Feb 27, 2018
[DO NOT USE] Local speech with neue radiodan

⚠️ These instruction are out-of-date, do not use ⚠️

To get local speech running, you should install simon-say which is an equivalent of speech-dispatcher that uses the macOS say command to speak.

npm install --global

Make sure you have the latest radiodan and run the radiodan manager:

cd ~/path/to/radiodan/services/manager

npm start

andrewn /
Last active Feb 13, 2018
Pi text-to-speech (TTS)

speechd is a wrapper around tts systems festival is the thing that speaks

sudo apt-get install speech-dispatcher festival -y

See which voices are available:

spd-say --list-synthesis-voices

Say something:

andrewn /
Last active Feb 26, 2018
Radiodan: Configure PulseAudio speaker and microphone
  • Raspbian Lite
  • Create /Volumes/boot/ssh
  • Write wi-fi config to /Volumes/boot/wpa_supplicant.conf

Shell into Pi:

sudo apt-get install git -y

git clone

cd seeed-voicecard

andrewn /
Last active Dec 11, 2017
Electronics kit


For a basic no-UI Radiodan you probably want:

  • microSD cards
  • some way of writing the microSD cards
  • Raspberry Pi 3
  • Micro USB (data + power)
  • PhatDAC or a good USB sound card
  • Powered speaker
andrewn /
Last active Jun 28, 2022
Testing SSL (LetsEncrypt certificate and loopback domain)

Testing SSL (LetsEncrypt certificate and loopback domain)

General approach

This sets up a publically-available domain that loops back to localhost IP address For example, this address could be if we controlled the domain. This relies on having a public domain name whose DNS records you can control. We can then generate LetsEncrypt certificates for this domain.

Our HTTP server runs on localhost:80 (default HTTP port). This lets us visit in a web browser and see the server running on localhost:80.

We then run an HTTPS proxy server on localhost:443 (default HTTPS port) that uses the LetsEncrypt certificates we generated for Visiting hits the proxy, which returns the correct certificates meaning the browser displays the "Secure" message. The proxy then passes the request through to the HTTP server.

andrewn /
Last active Jul 1, 2018
Testing SSL (self-signed cert)

Easy option (self-signed cert)

  1. Install local-ssl-proxy:

    npm install local-ssl-proxy

  2. Start local-ssl-proxy on port 443:

    sudo local-ssl-proxy --source 443 --target 80