Skip to content

Instantly share code, notes, and snippets.

View kmpm's full-sized avatar

Peter Magnusson kmpm

View GitHub Profile
kmpm /
Created February 18, 2024 18:02
Incus inventory for ansible
#!/usr/bin/env python3
import json
import httpx
target_host = "localhost"
socket_path = "/var/lib/incus/unix.socket"
transport = httpx.HTTPTransport(uds=socket_path)
kmpm / lock.go
Created March 29, 2023 14:24
Using NATS KV for creating locks.
package lock
import (
kmpm /
Last active March 10, 2023 15:19
install various tools on linux
# curl -fsSL | bash
export DEBIAN_FRONTEND=noninteractive
apt-get install -y unzip curl
echo "Downloading nsc install script"
curl -fsSL -o /tmp/
echo "Running nsc install script"
kmpm / nats-setup-win.ps1
Last active March 20, 2023 19:17
A skeleton of a PowerShell Script that install the lates tools on windows
$ErrorActionPreference = 'Stop'
kmpm / lowrance_sl2.hexpat
Last active February 17, 2023 15:12
imhex pattern file for parsing lowrance .sl2 files
#include <std/mem.pat>
#include <std/io.pat>
#include <std/math.pat>
#pragma endian little
#define MAX_RECORDS 1024
#define POLAR_EARTH_RADIUS 6356752.3142
kmpm /
Last active March 23, 2023 00:21
Small file that installes ad uses weasyprint instead of wkhtmltopdf on linuxserver bookstack containers..
# SPDX-FileCopyrightText: 2022 Peter Magnusson <>
# SPDX-License-Identifier: CC0-1.0
# This file installs weasyprint and creates a script that
# tries to proxy calls from bookstack to what it believe is
# wkhtmltopdf.
# put this file in /custom-cont-init.d and restart the container
kmpm / main.go
Last active July 27, 2022 05:31
bun-check for has-many relations with composite keys
package main
import (
_ ""

openSuSE Tryout

This document is my personal notes from getting back into SuSE again from years using debian and ubuntu.

Replacement for build-essential

SuSE/Zypper uses something called patterns to group packages together. The deb equivalent to patters would be meta-packages I guess. There is a pattern called devel_basis that sort of matches build-essential.

kmpm /
Last active August 12, 2021 09:04
Difference between Caddy and dig DNS Lookup

Attached to this will be a pcap with 2 different request/response sequences. The first is the one that Caddy does and the second comes from dig.

kmpm /
Last active March 15, 2021 07:51
Gitea Swedish

Gitea Swedish

Detta dokument beskriver hur olika termer har översatts till svenska i Gitea. Rubrikerna innehåller det engelska ordet sen kan det komma förklaringar, översättningar exempel med mera.



  • repo:issues.reference_issue.body > Innehåll