Skip to content

Instantly share code, notes, and snippets.

View saumas's full-sized avatar

Saulius Mašnauskas saumas

  • Vilnius, Lithuania
  • 06:10 (UTC +03:00)
View GitHub Profile
@saumas
saumas / gpg.sh
Last active January 6, 2025 09:19
Configure a new GPG key for signing your commits
# Generate a new key. Suggestion is to use RSA 4096. Enter your name and email when prompted.
gpg --full-gen-key
# Get the ID of the generated key
GPG_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG "[email protected]" | awk '/^sec/ {split($2, a, "/"); print a[2]}')
# Export the key which you will need to copy to your user settings in your repository (GitHub, GitLab, etc.)
gpg --armor --export $GPG_KEY_ID
# Tell git you want to sign all of your commits from now on. If you always use the same user, then use `--global` instead of `--local`.
@saumas
saumas / gist:a0a9303f0e941bf33f1e49beab5fc0d2
Created August 7, 2023 14:22
Make zsh expand dynamic Makefile targets when pressing Tab
# Append .zshrc with
zstyle ':completion:*:make:*:targets' call-command true
zstyle ':completion:*:*:make:*' tag-order 'targets'
@saumas
saumas / create.sh
Last active February 11, 2025 03:34
Create an admin kubeconfig
#!/usr/bin/env bash
set -ex
NAMESPACE="default"
NAME="admin"
SECRET_NAME="admin-secret"
kubectl create serviceaccount -n $NAMESPACE $NAME
kubectl create clusterrolebinding $NAMESPACE-$NAME --clusterrole=cluster-admin --serviceaccount=$NAMESPACE:$NAME