Skip to content

Instantly share code, notes, and snippets.

@tyhawkins
tyhawkins / main.tf
Created February 9, 2023 19:48
Add git info to Terraform tags
data "external" "gitrepo" {
program = [
"bash",
"-c",
<<-EOF
echo "{ \
\"branch\":\"$(git rev-parse --abbrev-ref HEAD)\", \
\"sha\":\"$(git rev-parse --short=8 HEAD)\", \
\"url\":\"$(git remote get-url origin)\" \
}"
@tyhawkins
tyhawkins / tips-and-tricks.yaml
Created May 6, 2022 16:10
Yaml tips and tricks
## YAML Anchors and tags
ingress_one:
annotations: &annotations
annotation-one: "true"
annotation-two: "false"
annotation-three: "false"
ingress_two:
annotations: *annotations
@tyhawkins
tyhawkins / plugin.yml
Created January 26, 2022 18:22
k9s flux plugin
# $HOME/.k9s/plugin.yml
# move selected line to chosen resource in K9s, then:
# Shift-T (with confirmation) to toggle helm releases or kustomizations suspend and resume
# Shift-R (no confirmation) to reconcile a git source or a helm release or a kustomization
plugin:
toggle-helmrelease:
shortCut: Shift-T
confirm: true
scopes:
- helmreleases
@tyhawkins
tyhawkins / .zsh_extra
Last active March 12, 2021 18:27
Shell environment snippets
# save as much history as possible
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000000
SAVEHIST=10000000
# zsh plugins
plugins=(
aws
docker
git
@tyhawkins
tyhawkins / zoom-mute-status.scpt
Last active May 27, 2022 20:51
Get Zoom Mute/Unmute Status
property btnTitle : "Mute audio"
if application "zoom.us" is running then
tell application "System Events"
tell application process "zoom.us"
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
set returnValue to "Unmuted"
else
set returnValue to "Muted"
end if

Keybase proof

I hereby claim:

  • I am tyhawkins on github.
  • I am tyhawkins (https://keybase.io/tyhawkins) on keybase.
  • I have a public key ASC4Qmad-S1sULOwnwUclRXFYL3sjojoqUxoJogcKNpXOQo

To claim this, I am signing this object:

<!DOCTYPE html>
<html lang="en" class="gupui flow-authenticate state-method-select">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<title>Sign In - USA TODAY</title>
<!DOCTYPE html>
<html lang="en" class="gupui flow-authenticate state-">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<title></title>
@tyhawkins
tyhawkins / loadppks.ps1
Created March 31, 2016 18:48
Load a directory full of PPKs
# -----------------------------------------------------------------------------
# PowerShell script for loading your private key files with pageant.exe
# Author: Martijn Burgers
# Find me on Twitter: http://www.twitter.com/martijnburgers
# -----------------------------------------------------------------------------
$usage = "Usage: loadppks.ps1 [Dir|ppk file]";
if ($args.Count -eq 0) {
write-host "No arguments supplied!"
write-host $usage
@tyhawkins
tyhawkins / putty.bat
Last active March 31, 2016 18:20 — forked from sbiffi/putty.bat
The aim of this vbs script is to launch putty using an URL like ssh://login@host directly from a browser. The .bat is almost the same than .vbs but less robust and just their for older systems. TO INSTALL: drop putty.vbs in C:\ and run the .reg file to update the registry.
:: This version is not as powerfull as vbs version, please prefere the other one.
:: It's just there if you need a non-visual basic way to perform this.
:: Restrictions:
:: - Password cannot contain a % or finish with @
:: - Chrome adds a / at the end of the URL, not yet managed
:: The aim of this script is to execute putty with parameters like ssh://login@host
:: Installation:
:: - Launch putty.reg to associate ssh:// and telnet:// to this script
:: - Edit the putty path in parameter below like puttyPath="C:\Program Files (x86)\putty.exe"