Skip to content

Instantly share code, notes, and snippets.

@m1cr0man
m1cr0man / README.md
Created June 27, 2021 15:05
Mailman 3 API Import/Export for migration

Mailman 3 Import/Export script

Useful for database backend migrations and/or backup and restore operations.

Requires Python 3.6+ and AIOHTTP 3.7.4+

Run it on your mailman server. You may need to edit the API credentials if you changed the defaults.

@m1cr0man
m1cr0man / acme2.nix
Created November 26, 2021 19:21
NixOS acme selfsigned CA service failure test
let
commonConfig = ./common/acme/client;
dnsServerIP = nodes: nodes.dnsserver.config.networking.primaryIPAddress;
dnsScript = {pkgs, nodes}: let
dnsAddress = dnsServerIP nodes;
in pkgs.writeShellScript "dns-hook.sh" ''
set -euo pipefail
echo '[INFO]' "[$2]" 'dns-hook.sh' $*
@m1cr0man
m1cr0man / flake.nix
Last active October 5, 2024 13:18
The simplest Nix Flake for nixos-rebuild
# This can be built with nixos-rebuild --flake .#myhost build
{
description = "the simplest flake for nixos-rebuild";
inputs = {
nixpkgs = {
# Using the nixos-unstable branch specifically, which is the
# closest you can get to following the equivalent channel with flakes.
url = "github:NixOS/nixpkgs/nixos-unstable";
};
@m1cr0man
m1cr0man / container_config.nix
Last active February 1, 2025 17:32
SSH to a nixos test container
# This gist pertains to entering test VMs within nixpkgs/nixos/tests
# They must be run with driverInteractive in order to keep them around
# Use this in your test VM node configuration to enable ssh and root login
{
services.openssh = {
enable = true;
settings.PermitRootLogin = "yes";
};
# Password will be "testingpain"
users.users.root.hashedPassword = "$6$LXJZIXCXOFNlhzc5$NYtb4ThIXAf4tcmIZB9D0b8r4Dj52JH0WU1ZwdVXdp0lQRZBU7I7dw.6ojLZY/bpxKTqYokIvqTZA.JGKXuVY/";