Skip to content

Instantly share code, notes, and snippets.

@0xAB41
0xAB41 / exim-gpg.sh
Created March 8, 2021 04:32
Exporting and Importing all gpg keys
# export all
gpg --export-secret-keys > keys.key
# on another machine
gpg --import keys.key
# <Optional> import changes the trust status to unknown
# You can
# 1. export and impor the trust db
gpg --export-ownertrust > trust.db
@0xAB41
0xAB41 / img.html
Created May 31, 2022 14:19
Hugo img partial
{{ $src := .Page.Resources.GetMatch (printf "images/%s" (.Get "src")) }}
{{ $quality := default "q75" (.Get "quality") }}
{{ $sizes := slice "400" "600" "800" "1200" }}
{{ $jpgSrcSet := slice }}
{{ $webpSrcSet := slice }}
{{ range $i, $size := $sizes }}
{{ $jpgImage := ($src.Resize (printf "%sx %s jpg" $size $quality)) }}