Skip to content

Instantly share code, notes, and snippets.

View 111a5ab1's full-sized avatar

ワサビ (Wasabi) 111a5ab1

View GitHub Profile

!! INSECURE - DO NOT USE THIS IN PRODUCTION !!

An EXTREMELY INSECURE example to demonstrate using Cert based Auto Auth method with Vault Agent where client authentication (mTLS) is required to communicate with Vault Server (tls_require_and_verify_client_cert = true).

A work-around is needed due to client_cert and client_key files in the vault stanza not being reloaded from disk when sending a SIGHUP to Vault Agent. This requires killing and restarting the Vault Agent in order to load the new Client certificate.

Cert

  1. Create temporary directory

$ TF_LOG=trace tofu apply
2024-05-11T23:52:39.482+1000 [INFO]  OpenTofu version: 1.7.1
2024-05-11T23:52:39.483+1000 [DEBUG] using github.com/hashicorp/go-tfe v1.36.0
2024-05-11T23:52:39.483+1000 [DEBUG] using github.com/opentofu/hcl/v2 v2.0.0-20240416130056-03228b26f391
2024-05-11T23:52:39.483+1000 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-05-11T23:52:39.483+1000 [DEBUG] using github.com/zclconf/go-cty v1.14.4
2024-05-11T23:52:39.483+1000 [INFO]  Go runtime version: go1.21.3
2024-05-11T23:52:39.483+1000 [INFO]  CLI args: []string{"tofu", "apply"}
@111a5ab1
111a5ab1 / gist:4aea3d89a4bbe22989c853044da4b2b2
Created May 31, 2023 03:01
Terraform Vault provider via UDS
$ terraform plan
2023-05-31T12:57:28.618+1000 [INFO] Terraform version: 1.3.7
2023-05-31T12:57:28.618+1000 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2023-05-31T12:57:28.618+1000 [DEBUG] using github.com/hashicorp/hcl/v2 v2.15.0
2023-05-31T12:57:28.618+1000 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2023-05-31T12:57:28.618+1000 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2023-05-31T12:57:28.618+1000 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2023-05-31T12:57:28.618+1000 [INFO] Go runtime version: go1.19.4
2023-05-31T12:57:28.618+1000 [INFO] CLI args: []string{"terraform", "plan"}
2023-05-31T12:57:28.618+1000 [DEBUG] Attempting to open CLI config file: /home/parallels/.terraformrc
@111a5ab1
111a5ab1 / gnome-keyring-daemon.adoc
Created March 11, 2022 12:13
gnome-keyring-daemon SSH issue with resident keys on a YubiKey

sign_and_send_pubkey: signing failed for ED25519-SK

TL;DR

When attempting to SSH with a ed25519-sk resident key if you get the following error:

sign_and_send_pubkey: signing failed for ED25519-SK "" from agent: agent refused operation
@111a5ab1
111a5ab1 / awsAccessKeysCSVToCredentials.sh
Last active December 2, 2019 23:45
One liner to create an AWS CLI "credentials" file from a downloaded accessKeys.csv
while IFS=, read -r id secret; do echo -e "[default]\naws_access_key_id = $id\naws_secret_access_key = $secret" > credentials; done <<< $(tail -n1 accessKeys.csv)
@111a5ab1
111a5ab1 / github-create-repo
Last active July 4, 2019 02:40
Create Github repo via command-line
#!/usr/bin/env bash
set -e
#-----------------------------------------------
# REPOSITORY
# Define GitHub repository details
#-----------------------------------------------
readonly USER="111A5AB1"
readonly REPOSITORY_NAME="terraform-gitlab-repos"
@111a5ab1
111a5ab1 / i3-trackpad-notes
Created June 15, 2019 02:02
Macbook Pro trackpad configuration on i3 via xinput/libinput
# List all the input devices
xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Broadcom Corp. Bluetooth USB Host Controller id=11 [slave pointer (2)]
⎜ ↳ bcm5974 id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
@111a5ab1
111a5ab1 / tmux.md
Last active June 29, 2019 11:03
tmux cheatsheet
@111a5ab1
111a5ab1 / git.md
Last active April 4, 2018 10:33
git command-line cheatsheet

View changes between HEAD and previous commit:

git diff HEAD^ HEAD

View changes between HEAD and <commit_id>:

git diff 0232ea938e607942e3e477e4a72e5e7fbf3dc496 HEAD
@111a5ab1
111a5ab1 / ubnt_check_latest_usg_firmware.sh
Last active February 3, 2018 09:05
Query latest Ubiquiti USG firmware from command-line (depends: curl + jq)
#!/bin/bash
# Will output the latest firmware version and download URL for the Ubuqiti USG
# Depends on curl (https://curl.haxx.se/) and jq (https://stedolan.github.io/jq/)
curl -s 'https://www.ubnt.com/download/?group=usg' -H 'x-requested-with: XMLHttpRequest' | ./jq-osx-amd64 -c '[ .downloads[] | select(.category__slug=="firmware")] | max_by(.version) | {Version: .version, File: @text "https://dl.ubnt.com\(.file_path)" }'