Skip to content

Instantly share code, notes, and snippets.

View troglobit's full-sized avatar

Joachim Wiberg troglobit

View GitHub Profile
@troglobit
troglobit / ubuntu-server-setup-netplan.md
Created March 15, 2026 14:56 — forked from plembo/ubuntu-server-setup-netplan.md
Ubuntu Server Setup - with netplan

Ubuntu Server Setup - with netplan

Introduction

The assumption here is that you're now starting with a Ubuntu 22.04 LTS Server or newer, rather than Desktop, base (Ubuntu Desktop deploys NetworkManager rather than systemd-networkd by default). This box has an AMD Ryzen CPU.

The goal is networking configured for static addressing using systemd-networkd and netplan. Note that punctuation (including hypens, '-') and indentation are significant when working with netplan YAML files.

There are a lot good arguments against using netplan. I have tried NetworkManager (packages named "network-manager", but the service is "NetworkManager.service" -- go figure) on Ubuntu Server, and was

@troglobit
troglobit / ssdp_scan.py
Created September 12, 2025 06:52
SSDP scanner
#!/usr/bin/env python3
import socket
import time
import threading
class SsdpClient(threading.Thread):
""" Simple SSDP client probe """
SEARCH_INTERVAL = 5
BCAST_IP = '239.255.255.250'
@troglobit
troglobit / markdown.md
Last active November 16, 2025 12:46
Gist syntax

Testing GFM

Heading 1

Starting test 0005-operational_all2024-10-10 22:42:17 # Starting (2024-10-10 22:42:17) 2024-10-10 22:42:17 # host: monza 2024-10-10 22:42:17 # tgt: swp1 2024-10-10 22:42:17 # target: alder1 2024-10-10 22:42:17 # mgmt: x10
@troglobit
troglobit / gcc-checkers.md
Created August 3, 2024 10:02
Useful GCC checkers to enable

CFLAGS="-Wall -Werror -Wextra -Wno-unused-parameter -Wformat=2 -Wformat-overflow=2 -Winit-self -Wstrict-overflow=4 -Wno-format-truncation -Wno-format-nonliteral -Wimplicit-function-declaration"

@troglobit
troglobit / linux-leds.md
Created October 19, 2023 16:22
Blinking LEDs in Linux

Blinking LEDs in Linux

First check you have the timer trigger loaded:

root@gimli:~# lsmod |grep led
snd_ctl_led            24576  0
input_leds             16384  0
snd                   135168  45 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_hda_codec_realtek,snd_sof,snd_timer,snd_compress,thinkpad_acpi,snd_soc_core,snd_pcm,snd_rawmidi
soundcore              16384  2 snd_ctl_led,snd
@troglobit
troglobit / shell-script-tips.md
Last active May 12, 2023 14:17
Shell Scripting Tips

Debug a script callback to console

exec >/dev/console 2>&1
set -x

Ignore error on a particular line in set -e

possibly-failing-command ||:

Redirect STDERR to STDOUT

@troglobit
troglobit / unicode-in-emacs.md
Created December 19, 2022 16:24
Unicode in Emacs
grep Vm /proc/$(ps aux | grep inadyn |head -1 |awk '{print $2}')/status
@troglobit
troglobit / mping-howto.md
Created May 23, 2022 08:10
Using mping to script multicast switching/routing verification

HowTo: using mping for (fun and) profit

Ever since I started working with multicast back in the early 2000's, I've had to make my own tools. There weren't that many useful ones available, at least not in the Open Source space where I worked.

The first tool made, mcjoin, was based on an example an IBM'er had made public. I used that, the standard ping(1) tool, and tcpdump(1), to check my multicast flows.

@troglobit
troglobit / libnl-debug.md
Last active April 22, 2022 14:10
Developing and debugging libnl

Developing & debugging libnl

When I started out learning about libnl, around 10 years ago, I did not fully understand it. Mostly because I didn't (want to) understand Netlink. A great way to learn something is to try to fix a bug, or develop a new feature, because then you will want to write both tests and demo applications, which you may end up having to debug! Debuggers give you backtraces, which will help you understand how your program works.

Note: for debugging embedded systems using gdb-server, see the following blog post I wrote