Skip to content

Instantly share code, notes, and snippets.

@agowa
agowa / ipsec-certs-gen.sh
Created August 9, 2026 21:02
ipsec generate ca and node certificates
#!/bin/sh
set -euo pipefail
umask 077
CA_DN="CN=IPsec Root CA"
NODE_ID="ipsecXXXXXX"
NODE_DN="CN=$NODE_ID"
CERT_SIG_TYPE="RSA"
@agowa
agowa / # virt-manager - 2026-04-10_12-40-31.txt
Created April 11, 2026 06:15
virt-manager on macOS 26 - Homebrew build logs
Homebrew build logs for virt-manager on macOS 26
Build date: 2026-04-10 12:40:31
@agowa
agowa / 01-prepare-aria2c-dl-list.ps1
Created January 5, 2025 18:00
mirror media.ccc.de using aria2c
#ps1
$index = (Invoke-WebRequest -Uri 'https://cdn.media.ccc.de/INDEX' -Verbose).Content -split "`n" | ForEach-Object {$_.Trim()} | Where-Object {-not [String]::IsNullOrEmpty($_)}
#$aria2cIndex = foreach($e in $index) { "https://cdn.media.ccc.de/$e"; " dir=./$(Split-Path -Parent $e)"; " out=$(Split-Path -Leaf $e)" }
$aria2cIndex = foreach($e in $index) {
"https://cdn.media.ccc.de/$e`thttps://berlin-ak.ftp.media.ccc.de/$e`thttps://mirror.selfnet.de/CCC/$e`thttps://ftp.fau.de/cdn.media.ccc.de/$e`thttps://mirror.eu.oneandone.net/projects/media.ccc.de/$e`thttps://mirrors.dotsrc.org/cdn.media.ccc.de/$e`thttps://koeln.ftp.media.ccc.de/$e`thttps://mirror.netcologne.de/CCC/$e"
" dir=./$(Split-Path -Parent $e)"
" out=$(Split-Path -Leaf $e)"
}
$aria2cIndex | Out-File -Encoding ascii -Path "./INDEX.aria2c.txt"
@agowa
agowa / mount_qcow2.md
Created July 13, 2023 16:22 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@agowa
agowa / .gitmodules
Last active August 30, 2022 06:44
Reproducible ansible init with pinned versions for dependencies
[submodule ".pyenv"]
path = .pyenv
url = https://github.com/pyenv/pyenv.git
branch = master
[submodule ".pyenv-doctor"]
path = .pyenv-doctor
url = https://github.com/pyenv/pyenv-doctor.git
branch = master
[submodule ".pyenv-installer"]
path = .pyenv-installer
@agowa
agowa / init-with-pyenv
Last active December 13, 2021 18:30
Git python venv and git submodule init script
#!/bin/bash
# Place this file in `ci/init.sh` within any Git repository.
: <<EOF
MIT License
Copyright (c) 2021 Klaus Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@agowa
agowa / localstack-docker-compose.yml
Created November 2, 2021 03:50
Nextcloud with S3 primary storage
version: '3.7'
services:
localstack:
image: localstack/localstack
container_name: localstack_service
ports:
- "4566-4584:4566-4584"
- "8055:8080"
environment:
- SERVICES=s3
@agowa
agowa / image.ps1
Last active August 1, 2021 19:23
Show image on windows server core desktop (like bginfo background image)
Add-Type -AssemblyName System.Windows.Forms
$file = "C:\bginfo\bginfo.png"
[System.Windows.Forms.Application]::EnableVisualStyles()
[System.Windows.Forms.Application]::SetCompatibleTextRenderingDefault($false)
$form = [System.Windows.Forms.Form]::new()
$form | Add-Member -Name pictureBox1 -MemberType NoteProperty -Value ([System.Windows.Forms.PictureBox]::new())
([System.ComponentModel.ISupportInitialize]$form.pictureBox1).BeginInit()
$form.SuspendLayout()
@agowa
agowa / gist:1abceb4e279b5c142c19a769d97609e3
Created September 7, 2020 02:13
Minecraft sugar cane farm design helper and brute forcing example
enum EnumBlock {
water
sand
}
enum EnumBlockShort {
w
s
}
function New-Board {
# This script uses this library: https://github.com/lduchosal/ipnetwork
# It needs to be imported using e.g. `Add-Type -AssemblyName ./System.Net.IPNetwork.dll`
# Not to be confused with IPNetwork from Microsoft.AspNetCore.HttpOverrides.dll
function Get-CIDRFromAddressByPrefixList {
[OutputType([System.Net.IPNetwork])]
param(
[Parameter(Mandatory)][System.Net.IPAddress]$address,
[Parameter(Mandatory)][System.Net.IPNetwork[]]$prefixes
)
$address6 = $address.MapToIPv6()