Skip to content

Instantly share code, notes, and snippets.

View trallnag's full-sized avatar
🤡

Tim Schwenke trallnag

🤡
  • Bayer AG
  • Wuppertal, Deutschland
View GitHub Profile
@voron
voron / cache-eks-token.sh
Last active October 6, 2024 19:08 — forked from tyzbit/cache-eks-token.sh
Cache EKS tokens for kubectl
#!/bin/bash
# usage mimics aws execution to replace just the command, not args
function usage() {
echo "Usage: $0 --region eu-west-2 eks get-token --cluster-name prod"
}
if [ -z "$1" ]; then
usage
exit 1
@Speedy37
Speedy37 / gpg-agent-relay.sh
Created July 10, 2020 11:02
WSL2 gpg agent relay (Yubikey)
#!/bin/bash
# Launches socat+npiperelay to relay the gpg-agent socket file for use in WSL
# See https://justyn.io/blog/using-a-yubikey-for-gpg-in-windows-10-wsl-windows-subsystem-for-linux/ for details
GPGDIR="${HOME}/.gnupg"
USERNAME=Vincent
# I use the same username for wsl and windows, but feel free to modify the paths below if that isn't the case
WIN_GPGDIR="C:/Users/${USERNAME}/AppData/Roaming/gnupg"
NPIPERELAY="${HOME}/npiperelay.exe"
@ejhayes
ejhayes / cached-aws-iam-authenticator
Created December 12, 2019 18:19
Cached STS token for Kubectl on AWS EKS
#!/usr/bin/env bash
CACHE_FILE=${HOME}/.kube/cache/aws-${AWS_PROFILE}.cache
MAXTIME=800
if [ -f $CACHE_FILE ]; then
TS_DB=$(stat -t "%s" ${CACHE_FILE} | cut -d' ' -f10 | tr -d '"')
AGE=$(( `date +%s` - $TS_DB ))
if [[ $AGE -le $MAXTIME ]]; then
cat ${CACHE_FILE}
else
aws "$@" | tee $CACHE_FILE
@skwashd
skwashd / pre-commit
Last active February 28, 2024 11:11
Git pre-commit hook that blocks commits for files that contain swear words.
#!/bin/bash -e
#
# Git pre-commit hook that blocks commits for files that contain swear words.
#
# Created by Dave Hall - http://davehall.com.au
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/
#
# Please don't use this fucking script, it is shit!
#