Skip to content

Instantly share code, notes, and snippets.

View duttonw's full-sized avatar

William Dutton duttonw

  • Queensland Government
  • Brisbane, Australia
View GitHub Profile
@duttonw
duttonw / imdbv2.sh
Created September 5, 2024 22:49
Ability to set instances IMDS secret key access on servers which have software not ready for V2 security. (Tagged- Environment: PROD)
#!/bin/bash
# Default settings
IMDSV2_SETTING="required" # Change to "optional" if you want to revert back
DRYRUN=false
# Parse arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--setting) IMDSV2_SETTING="$2"; shift ;;
@duttonw
duttonw / #embedSvg.js
Last active October 29, 2024 23:13
Embed Svg's for Handlebars (with build embed as well as dynamic on template compile) for us in (Vite or esbuild) build systems.
import Handlebars from "handlebars";
/**
* Embeds an SVG file into the template
*
* Do note: rendering when inside handlebars will not be relative to a imported template file.
*
* It has two modes, browser mode and node mode.
* When in browser mode, it will place a random id to be filled in when the file is successfully collected
*