Skip to content

Instantly share code, notes, and snippets.

View Rabattkarte's full-sized avatar
👓

Nils Fahldieck Rabattkarte

👓
View GitHub Profile

Enable KMIP (Guide for HCP Vault)

Set the right env variables, VAULT_ADDR, VAULT_TOKEN, VAULT_NAMESPACE=admin

vault secrets enable kmip
vault write kmip/config listen_addrs=0.0.0.0:5696 server_hostnames=$(echo ${VAULT_ADDR:8} | rev | cut -c6- | rev)
vault write -f kmip/scope/my-service 
vault write kmip/scope/my-service/role/admin operation_all=true # can limit the operations
vault write -f -format=json kmip/scope/my-service/role/admin/credential/generate | tee kmip.json
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@DzeryCZ
DzeryCZ / ReadingHelmResources.md
Last active April 22, 2024 16:09
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@TravelingTechGuy
TravelingTechGuy / get_history.sh
Created May 9, 2016 14:10
Get your Chrome history as a CSV file
#!/bin/bash
# Locate the history file in your profile, and copy it to the same folder as this script.
# On Mac: ~/Library/Application\ Support/Google/Chrome/Default/History
# On Windows: C:\Users\YOUR USER NAME\AppData\Local\Google\Chrome\User Data\Default\History
sqlite3 History <<!
.headers on
.mode csv
.output out.csv
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten