Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# DESCRIPTION
# This script migrates from "apt-key" managed keys to "[signed-by=/usr/share/keyrings/...]":
# - loop through all lists in /etc/apt/sources.list.d
# - read all lines with "deb..." that do not contain "[signed-by=]"
# - download the GPG signature from the URL
# - read the key ID from the signature
# - download and saves the key using gpg
# - add "[signed-by=/usr/share/keyrings/...]" to the "deb..." line
@maxhq
maxhq / parse-yaml.sh
Created September 21, 2021 09:45
Perl YAML parser embedded in Bash
#!/usr/bin/env bash
set -e
function parse_yaml {
local source="$1"
local prefix="$2"
cat "$source" | perl -MCPAN::Meta::YAML <(cat <<'EOF'
$yaml_str = do { local $/; <STDIN> };
@maxhq
maxhq / keybase.md
Created May 26, 2018 08:22
Keybase identity proof

Keybase proof

I hereby claim:

  • I am maxhq on github.
  • I am maxhq (https://keybase.io/maxhq) on keybase.
  • I have a public key ASAhD8X30dAEbAX1Ufohv16FsVWuiV7iEw5xNl-wcx-DIQo

To claim this, I am signing this object:

@maxhq
maxhq / db-layer-new.md
Last active September 8, 2016 15:26
New DB layer

Wishlist

Provide abstractions for

Conclusion / Summary