Skip to content

Instantly share code, notes, and snippets.


Arti Zirk artizirk

View GitHub Profile
artizirk /
Last active May 25, 2023 15:44
OpenPGP SSH access with Yubikey and GnuPG

OpenPGP SSH access with Yubikey and GnuPG

Yubikey, Smart Cards, OpenSC and GnuPG are pain in the ass to get working. Those snippets here sould help alleviate pain.

Notes written here should work on

  • Ubuntu 20.04 with Gnome
  • Debian 11 with Gnome
  • Linux Mint with Cinnamon (needs different environment setup, check comments)
  • Arch Linux with Gnome (pacman instead of apt)

This is not a step by step guide

View Arch Linux btrfs

Arch Linux btrfs install

0. Prerequisites

  1. Latest Arch Linux install iso because those have newer kernels and more bugfixes in btrfs.
  2. Have previous experience with installing Arch (like you can install arch with a blind fold).

1. Parititions

We will ne two of them, one for /boot and the other one will be a btrfs partition with subvolumes.

  1. /dev/sda1 - this will be /boot with vfat filesystem because UEFI or syslinux for legacy BIOS boot
artizirk /
Created January 22, 2019 18:57
git-instaweb with python simplehttpserver support
# Copyright (c) 2006 Eric Wong
git instaweb [options] (--start | --stop | --restart)
artizirk / id_rsa to pem
Last active April 27, 2023 17:09
Converting openssh private key format to pem
View id_rsa to pem

Converting openssh private key format to pem

man page says that you can use -e option to convert private and public keys to other formats, that seems to be wrong. Instead you can use -p option to request changing the password but not actually setting the password.

ssh-keygen -p -f id_rsa -m pem

Converting pem to OpenPGP

Monkeysphere project includes a pem2openpgp command that can be used to import ssh private keys to gnupg keyring.

artizirk /
Last active April 25, 2023 13:04
List SerialPort names in Windows

List COM ports in windows with names

    \Device\Serial0    REG_SZ    COM1
    \Device\Silabser0    REG_SZ    COM6
    \Device\VCP0    REG_SZ    COM3

Press any key to continue . . .
artizirk /
Last active March 29, 2023 11:24
Create a debian container on a zfs pool for usage with systemd-nspawn and machinectl
set -euo pipefail
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
artizirk / nginx.conf
Last active March 1, 2023 11:24
Nginx config for scaling matrix synapse server via workers
View nginx.conf
# Matrix Synapse workers example config
# backends
upstream synapse_master {
upstream synapse_federation {
artizirk /
Last active February 28, 2023 04:03
ISC dhclient IPv6 prefix delegation hook script
artizirk /
Created April 23, 2019 15:30
This script is useful for setting fallback mtime for isync/mbsync CopyArrivalDate option
#!/usr/bin/env python3
# This script is useful for setting fallback mtime for isync/mbsync CopyArrivalDate option
# If you use notmuch then you could do something like this to fix mtime on new mail
# notmuch search --output=files tag:new | xargs -P0 -i ~/code/mailutils/ {}
import email
import sys
import os
from email.utils import parsedate_tz, mktime_tz
artizirk /
Last active January 11, 2023 13:45
Debug WireGuard Linux kernel module