Skip to content

Instantly share code, notes, and snippets.

View tjhop's full-sized avatar
⛈️

TJ Hoplock tjhop

⛈️
View GitHub Profile
@tjhop
tjhop / convert_go-kit_slog.bash
Last active May 11, 2025 12:34
Convert go-kit/log to slog calls
#!/usr/bin/env bash
#
# License: Apache-2.0
#
# Description: Convert go-kit/log to slog calls
#
# Authors:
# - Ben Kochie (@superq)
# - TJ Hoplock (@tjhop)
#
~/go/src/github.com/tjhop/mango (main [ ]) -> cat test/mockup/inventory/hosts/testbox/variables
mango_host_template_var="Hi, I'm a host variable!"
mango_host_var_for_override="This is the original host variable content."
~/go/src/github.com/tjhop/mango (main [ ]) -> cat test/mockup/inventory/modules/test-template/variables
mango_module_template_var="Hi, I'm a module variable!"
mango_host_var_for_override="Module has updated host var!"
~/go/src/github.com/tjhop/mango (main [ ]) -> cat test/mockup/inventory/modules/test-template/apply
#!/usr/bin/env bash
FILE="/tmp/$(basename ${0%/*})-$$"
~/go/src/github.com/tjhop/linode-tagger (main [ U ]) -> linode-cli linodes list --json | jq '.[] | select(.label | startswith("tagger")) | .label, .tags'
"tagger-1_us-southeast_testing"
[]
~/go/src/github.com/tjhop/linode-tagger (main [ U ]) -> cat packaging/etc/tagger.yml
tagger:
instances:
- regex: '^.+_(.+)_(.+)$'
tags:
present:
- 'region=$1'
@tjhop
tjhop / individual_ip_requests.log
Created July 19, 2021 13:34
go-discover optimize linode IP retreival
~/go/src/github.com/hashicorp/go-discover (master [ U ]) -> linode-cli linodes list --tags go-discover --text --no-headers | wc -l
50