Skip to content

Instantly share code, notes, and snippets.

View Kline-'s full-sized avatar

Matthew Goff Kline-

  • 06:07 (UTC -05:00)
View GitHub Profile
@Kline-
Kline- / visio_toggle.vba
Last active October 11, 2022 15:18
Visio multi-layer visibility toggle
' Visio objects attached to more than one layer will stay visible as long as any layer they are a member of is visible.
' This was undesireable behavior for the drawing I was creating and this is the solution I came up with. Suggestions and
' improvements are welcome as I rarely touch VBA code and prior to last week had only ever used Visio for about 5 minutes :)
' The ToggleLayer sub will toggle the visibility of a named layer in Visio. After updating the layer visibility it
' then calls the UpdateShapes sub to iterate through all objects and show/hide them by setting
' Geometry1.NoShow and Misc.HideText values based on the layer visibility.
Option Explicit
@Kline-
Kline- / image-check.sh
Created October 21, 2021 11:32
Check docker hub for image updates. Adapted from: https://mlohr.com/check-for-docker-image-updates/
#!/bin/bash
VERBOSE=false
ec() {
if $VERBOSE; then echo -en $1; fi
}
for IMAGE in $(docker images | grep -v '^REPOSITORY' | cut -f1 -d' ')
do
ec "Fetching Docker Hub token...\n"
@Kline-
Kline- / anti_idle.vbs
Created December 28, 2021 13:38
Prevent Windows screensaver and idle timer from activating.
Set objShell = WScript.CreateObject("WScript.Shell")
Do While True
objShell.SendKeys("{SCROLLLOCK}")
WScript.Sleep(100)
objShell.SendKeys("{SCROLLLOCK}")
WScript.Sleep(24000)
Loop
@Kline-
Kline- / backup-mariadb.sh
Last active September 5, 2023 17:22
Backup MariaDB data running in a Docker container
#!/bin/bash
BASE=`date -I`-mariabackup
CONT=mariadb
DEST=/home/matt/_gdrive/mariabackup/
MAGE=365
OWNER=matt:matt
TGZ=$DEST$BASE.tgz
# check if the container is running
if [ "$( docker container inspect -f '{{.State.Running}}' $CONT )" == "true" ]; then
@Kline-
Kline- / deb-nvidia-headless.txt
Created January 3, 2024 02:58
Debian NVIDIA driver install for headless server
The current nvidia-driver package in Debian 12 is designed for desktop systems and has dependencies to install Xorg
and other desktop packages. There is no package similar to the nvidia-headless package provided by Ubuntu. These were
the minimal packages (and their dependencies) I had to install to get a Quadro P400 running on a headless Debian 12
box for transcoding use.
install dkms nvidia-kernel-dkms libnvcuvid1 libnvidia-encode1 nvidia-smi linux-headers-amd64 nvidia-driver-bin
rmmod nouveau
modprobe nvidia