This is a curated collection of secure file synchronization, cloud infrastructure utilities, and secret management recipes compiled from my public GitHub Gists, representing some sweet shortcuts from a DevOps life.


🔑 keyring, secrets management and CLI

Published: 2026-04-01T05:44:09Z | Original Link: Gist Link

# gopass
EDITOR=vi gopass insert me/api/xyz_api_key
XYZ_API_KEY="$(gopass -o me/api/xyz_api_key)"


# python
python -m keyring set XYZ_API_KEY <username>
python -m keyring get XYZ_API_KEY <username>


# MacOS
get_secret() {
    security find-generic-password -a "$USER" -s "$1" -w
}
export XYZ_API_KEY=$(get_secret XYZ_API_KEY)

🔑 gcr.io image statistics

Published: 2024-08-22T08:14:27Z | Original Link: Gist Link

for REPO in $(gcloud alpha container images list --repository=gcr.io/volterraio --sort-by="~TIMESTAMP"|grep -Ev '^NAME'); do \
  gcloud container images list-tags $REPO --format="table[no-heading](DIGEST,TIMESTAMP)"|\
    grep 2024-08 | xargs -I% echo $(basename $REPO) %; done |\
clipivot count --rows=0 --val=3 |sort -g -t, -k2 -r |head -n 50

🔑 Small script that re-encrypts GPG-encrypted files with a new key

Published: 2023-04-28T11:30:17Z | Original Link: Gist Link

#!/bin/bash


checkusage() {
  [[ $# -lt 2 ]] && err_exit 'Usage: reencrypt.sh KEY_ID FILE...'
}


err() { echo -e "$@" >&2; }


err_exit() {
  err "$@"
  exit 1
}


reencrypt() {
  local key_id="$1"
  local file="$2"
  mv ${file} ${file}.bak
  gpg --decrypt ${file}.bak \
    | gpg --recipient ${key_id} --encrypt --output ${file}
}


main() {
  checkusage "$@"
  local key_id=$1
  shift
  local files="$@"
  for file in $files; do
    reencrypt "${key_id}" "${file}"
  done
}


main "$@"


# Local Variables:
# indent-tabs-mode: nil
# sh-indentation: 2
# sh-basic-offset: 2
# End:

🔑 croc, age - sync files

Published: 2023-03-17T11:30:28Z | Original Link: Gist Link

tar cvJ /etc/vpm/ | age -r $(curl -qsSL https://f.apealive.net/pub/$USER.age.pub) | croc send


Receiving side
# cat croc-stdin-2310548854 | age -d -i <(pass show age-$USER-public) | tar xvJ

🔑 prometheus metrics

Published: 2023-03-15T12:19:16Z | Original Link: Gist Link

{name=".+",site="gc1-iad-01",pod=~"(keycloak-s1-).*"}


🔑 network debug api siege performance

Published: 2023-01-21T14:19:28Z | Original Link: Gist Link

apt install siege -y siege -c 255 -t 5m https://my.tls.host/api/status


🔑 QR Code generation and instant preview from the command line

Published: 2022-06-15T14:12:18Z | Original Link: Gist Link

#!/bin/sh


# Generates a temporary QR code and opens it in preview
# Requires qrencode from homebrew / other package manager
# Usage:   qr-code TEXT
# Example: qr-code http://www.google.com


qrencode  -o - $1 | open -f -a preview
# Generating throwaway QR codes from the command line for shunting URLS to mobile devices


brew install qrencode


qrencode  -o - http://www.google.com | open -f -a preview

🔑 gcloud with zsh

Published: 2020-12-06T11:28:43Z | Original Link: Gist Link

# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc


# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc
script_link="$( readlink "$0" )" || script_link="$0"
apparent_sdk_dir="${script_link%/*}"
if [ "$apparent_sdk_dir" == "$script_link" ]; then
  apparent_sdk_dir=.
fi
sdk_dir="$( cd -P "$apparent_sdk_dir" && pwd -P )"
bin_path="$sdk_dir/bin"
export PATH=$bin_path:$PATH

🔑 imap sync

Published: 2020-10-26T07:22:10Z | Original Link: Gist Link

* https://imapsync.lamiral.info/
* https://imapsync.lamiral.info/doc/TUTORIAL_Unix.html
* https://linux.die.net/man/1/imapsync
* https://wtf.roflcopter.fr/archive/?publicget=2013-07-11-06-05-15

imapsync \
  --host1 mail.web4ce.cz --user1 info@acme.com --password1 '***' --port1 993 --ssl1 \
  --host2 imap.seznam.cz --user2 info@acme.com --password2 '***' --port2 993 --ssl2 \
  --split1 100 --split2 100 --allowsizemismatch --useheader Message-ID --exclude "Junk|Trash" \
  --automap --tmpdir /Users/dummy2/tmp --errorsmax 5000 --folderfirst INBOX
  
  # --dry
  # --prefix1 INBOX