Skip to content

Instantly share code, notes, and snippets.

View sjlongland's full-sized avatar

Stuart Longland sjlongland

View GitHub Profile
@sjlongland
sjlongland / README.md
Created May 26, 2024 08:11
Crude mDNS / Wireguard based point-to-point VPN

What is this?

It's a very crude script that allows two machines that share a possibly untrusted network (e.g. WiFi) to connect to each-other and establish a secure tunnel.

How does it work?

The assumption is both machines can see each-other via multicast DNS, and can send UDP traffic between each-other. If you're using a WiFi network that isolates its clients, you're out of luck.

@sjlongland
sjlongland / AX.25 BPQ connection.md
Last active May 6, 2024 23:56
Different AX.25 connected-mode dumps for analysis

KISS traffic dump between two connected BPQ32 stations

This is the raw hexdump obtained from socat from two station running LinBPQ32 (i386 and armv5) communicating via a virtual tunnelled serial link.

> 2024/05/05 16:16:28.000714544  length=20 from=0 to=19
 c0 01 1e c0 c0 02 40 c0 c0 03 0a c0 c0 04 03 c0 c0 05 00 c0
< 2024/05/05 16:16:28.000716883  length=9 from=0 to=8
 5e 43 c0 c0 5e 45 5e 40 c0
@sjlongland
sjlongland / Makefile
Created May 3, 2024 06:18
Generating a cross-product of images for SSTV from some stock images and layers
CALLSIGNS ?= vk4msl ax4msl
VARIANTS ?= empty cq-sstv morning-all afternoon-all evening-all 73-all 73-gotta-fly
CALLSIGN ?=
VARIANT ?=
ifeq ($(VARIANT),)
# VARIANT not set, iterate over VARIANTS
.PHONY: all
@sjlongland
sjlongland / portable_endian.h
Last active April 24, 2024 11:32 — forked from panzi/portable_endian.h
This provides the endian conversion functions form endian.h on Windows, Linux, *BSD, and Mac OS X. You still need to use -std=gnu99 instead of -std=c99 for gcc. The functions might actually be macros. Functions: htobe16, htole16, be16toh, le16toh, htobe32, htole32, be32toh, le32toh, htobe64, htole64, be64toh, le64toh. License: I hereby put "port…
// "License": Public Domain
// I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like.
// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to
// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it
// an example on how to get the endian conversion functions on different platforms.
#ifndef PORTABLE_ENDIAN_H__
#define PORTABLE_ENDIAN_H__
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
@sjlongland
sjlongland / dummyrigctld.py
Created March 20, 2024 05:59
Dummy rigctld implementation for GPIO control of radio PTT
#!/usr/bin/env python3
"""
Dummy rigctld implementation for controlling a radio PTT signal via a GPIO
pin.
This is intended for devices like the NWDR UDRC-II and DRAWS boards, which
attach to the top of a Raspberry Pi 2/3/4/5 single-board computer and provide
control signals for PTT and COS along with an audio interface for digital mode
operation.
@sjlongland
sjlongland / buttonbox.py
Last active March 8, 2024 07:33
Simplified widgets using tkinter.ttk.Treeview
#!/usr/bin/env python3
# Button box component, lays out buttons in a horizontal or vertical layout
# evenly.
# GUI stuff
import tkinter
from tkinter import ttk
@sjlongland
sjlongland / client.py
Created December 30, 2023 05:30
mpd music selection algorithm
#!/usr/bin/env python
# vim: ai ts=4 sw=4 sts=4 expandtab fileencoding=utf-8
from mpd import MPDClient
## SETTINGS
##
HOST = 'localhost'
PORT = '6600'
PASSWORD = False
@sjlongland
sjlongland / config-6.5.7-vk4msl-sb-57160-gc476bbdaa3d7
Created October 21, 2023 07:12
StarBook VI Kernel configuration for AMD Ryzen 7 laptop with AMI UEFI boot firmware
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.5.7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo Hardened 13.2.1_p20230826 p7) 13.2.1 20230826"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=130201
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24000
@sjlongland
sjlongland / socat-scrape.log
Created October 19, 2023 00:30
AX.25 connected-mode traffic between two Linux hosts
2023-10-19 10:29:38,098 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX25SetAsyncBalancedModeFrame]
header.destination = VK4MSL-4*
header.source = VK4MSL-5
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 63 (0x3f)
body.pf = True (0x1)
body.modifier = 47 (0x2f)