Skip to content

Instantly share code, notes, and snippets.

View vebutton's full-sized avatar

vebutton

  • Dallas
View GitHub Profile
# Functions to format a markdown using your style sheet of choice
# requires md-to-pdf to be installed. and a style sheet
# function to create the pdf
md2pdf () {
md-to-pdf "$@" \
--stylesheet ~/obsidian-like.css \
--body-class obsidian \
--pdf-options '{"format":"Letter","margin":{"top":"0.75in","right":"0.75in","bottom":"0.75in","left":"0.75in"},"printBackground":true}'
}
#!/bin/bash
# Define the directory where logs will be stored
LOG_DIR="/var/log/qemu-agent-hooks"
# Get the type of event (freeze or thaw) passed as the first argument
EVENT_TYPE="$1"
# --- Script Logic ---
#!/bin/sh
# Flush MySQL tables to disk before the filesystem is frozen.
# Keeps a read lock to avoid write accesses from other clients until thawed.
MYSQL="/usr/bin/mysql"
MYSQL_OPTS="-uroot" # "-prootpassword"
FIFO="/var/run/mysql-flush.fifo"
# Check if mysql is installed and the server is running
if ! [ -x "$MYSQL" ] || ! "$MYSQL" $MYSQL_OPTS < /dev/null; then
#!/bin/bash
# Define the directory where logs will be stored
LOG_DIR="/var/log/qemu-agent-hooks"
# Get the type of event (freeze or thaw) passed as the first argument
EVENT_TYPE="$1"
# --- Script Logic ---
@vebutton
vebutton / gist:e86221f3c29eea4517a7a54223a8a1f5
Last active December 13, 2025 14:44
patch-pvc-annotation
cleanpvc() {
if [ -z "$1" ]; then
echo "Error: Please provide a Persistent Volume Claim (PVC) name."
echo "Usage: cleanpvc <pvc-name>"
return 1
fi
local PVC_NAME="$1"
echo "Attempting to remove system annotations from PVC: ${PVC_NAME}..."
@vebutton
vebutton / patch-tvk-console.txt
Last active October 20, 2025 17:23
Enable TVK Console
# Forget to install the Trilio console plugin to Openshift?
# Add it via the CLI. Wait a minute for it to reconcile.
oc patch consoles.operator.openshift.io cluster --type=merge -p '{"spec":{"plugins": ["trilio-console-plugin"]}}'