Skip to content

Instantly share code, notes, and snippets.

jordansissel / main.js
Created December 9, 2022 08:01
Napster URL conversion to Sonos UPnP -- Using node-songs to play music.
const { DeviceDiscovery } = require('sonos');
DeviceDiscovery((device) => {
//console.log('found device at ' + + " - " + device.friendlyName)
device.deviceDescription().then(descr => {
// look for a sonos named "Sonos Roam"
if (descr.friendlyName.match(/Sonos Roam/)) {
// Coheed - Vaxis II - first track
jordansissel /
Last active May 28, 2022 06:43
Reading nested tar files.


Sometimes tar files have tar files, and it might be nice to read the contents of some files several layers deep. Here's how we can do it with Ruby and Python3 with no external dependencies.

Podman save

We can create a layered tar file (a tar file containing other tar files) using docker save or podman save

% podman save fpm-ubuntu-18.04 -o test.tar
jordansissel / conf
Last active May 19, 2022 08:17
Parsing flags from a file in Clamp in Ruby
jordansissel / OUTPUT
Created November 9, 2021 04:37
pleaserun systemd service extraction with jq
Description=no description given
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
Display *dpy;
// Below here, Copilot generated the rest.
dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
jordansissel /
Last active October 18, 2021 05:46
Climate controllers with local network access, according to Home Assistant
% git clone --depth 1

Find "climate" support, then look for components with iot_class matching "local"

% grep -l climate */ | awk -F/ '{print $1}' | xargs -n1 sh -c 'jq .iot_class $1/manifest.json | grep -q local && echo "*$1"' -
jordansissel / OUTPUT
Created May 27, 2021 06:30
xinput list devices showing pointer locations
% gcc main.c $(pkg-config --libs x11 xi --cflags) -o xinput-example
% ./xinput-example
Pointer id:2 at location 1011,756
jordansissel /
Last active February 2, 2021 21:13
Arch Linux setup


Partitioning is something I do once a year and never remember. Arch's docs have great reference guides, but I just want to move on with my life without reading too much docs. This aims to simplify my partitioning experience.

fdisk /dev/<disk device>

g # new gpt disk label
jordansissel /
Created September 24, 2020 06:35
Home Assistant on Raspberry Pi OS
jordansissel / main.go
Created November 21, 2019 17:35
go-elasticsearch w/ setting custom trusted CA certs and custom headers
package main
import (