Skip to content

Instantly share code, notes, and snippets.

View ParadoxGuitarist's full-sized avatar

Brian Monroe ParadoxGuitarist

View GitHub Profile
@ParadoxGuitarist
ParadoxGuitarist / pvc-disk-flattener.sh
Created May 7, 2025 21:08
Bash scripts for migrating block devices Mostly for Harvester/Longhorn
#!/bin/bash
# LICENSE: MIT
# This takes a PVC name and namespace then flattens the boot disk (to get it off a backed image disk).
# Exit if there's none provided.
if [ -z $1 ] && [ -z $2 ]; then
echo "You need to provide a pvcname and namespace for the disk you want to flatten."
exit 1
fi
@ParadoxGuitarist
ParadoxGuitarist / mk-alertmanagerconfigs.sh
Last active November 13, 2023 23:46
mk-alertmanagerconfigs.sh - Generates yaml for alertmanager namespaces in a cluster with provided kubeconfig (or default if none given)
#!/bin/bash
# Replace Line 134 with the encoded webhook secret! and Lines 80 and 108 with your slack channel.
usage() {
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -h, Display this help message"
echo " -a, Combine all the configs into a single yaml
instead of breaking them up."
echo " -v, Enable verbose mode"
echo " -c, Insert the Clustername into the alertconfig"
@ParadoxGuitarist
ParadoxGuitarist / mk-certs.py
Created October 28, 2021 13:44
Python Script to make cert-manager.io certificate objects
#!/bin/python3
import os
import json
import argparse
import logging
import subprocess
import yaml
import time
# Set us up for using runtime arguments by defining them.
@ParadoxGuitarist
ParadoxGuitarist / docker-compose.yml
Created March 23, 2021 06:08
Podman Compose Fie for NextCloud with MariaDB (use db.env from NC's git)
version: 3.8
services:
db:
image: mariadb
restart: always
volumes:
- db:/var/lib/mysql
network:
- nextcloud-net
environment:
@ParadoxGuitarist
ParadoxGuitarist / password-expires.sh
Last active January 24, 2020 19:19
JAMF Extension Attribute for Days until Password Expires for Currently Logged in User.
#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# Gives the number of days left until password expiration as an extension attribute.
#
####################################################################################################
#
@ParadoxGuitarist
ParadoxGuitarist / snipe-it-template.yaml
Created January 3, 2020 19:17
Openshift Yaml for a Ephemerial Snipe-IT Template
---
kind: Template
apiVersion: v1
metadata:
name: snipe-it
annotations:
openshift.io/display-name: Snipe-IT
description: Snipe-IT - Open Source Asset Management
openshift.io/provider-display-name: Grokability, Inc.
openshift.io/documentation-url: https://snipeitapp.com/
@ParadoxGuitarist
ParadoxGuitarist / example.ps1
Created April 18, 2019 00:12
SCCM-Powershell (maybe the worst)
# So this has to be run through SCCM. Both by packaging an "App" and calling powershell.exe to run the script, or by adding a script and running it.
# Variables
# So here's a webpage you want to scrape:
$Source = "http://download.videolan.org/pub/videolan/vlc/last/win64/"
# This will run locally and give you the latest version of the win64.exe installer. Something like: vlc-3.0.6-win64.exe
$Installer = ( Invoke-WebRequest $Source | fl * | Out-String -Stream | sls -Pattern 'win64.exe"' | select-object -First 1 | %{$_ -replace ".*href=.",""} | %{$_ -replace '".*',''} )
# But If you run that same line through SCCM your Installer Variable will be null.