Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Since we need curl let's see if it is installed
if cmd=$(command -v curl); then
CURL=$cmd
else
echo "$(date "+[%Y-%m-%d - %H:%M:%S%p]"): ERROR: Required binary curl is missing, please install it" > $LOG 2>&1
exit 1
fi
@pyrodex
pyrodex / frigate-space.sh
Last active June 2, 2025 20:27
Script to report on Frigate usage by camera and/or date
#!/bin/bash
set -euo pipefail
usage() {
echo "Usage: $0 [-d YYYY-MM-DD [-c CAMERANAME] [-C]] [-D]"
echo "-d: Date to search in YYYY-MM-DD format"
echo "-c: (Optional) Name of the camera as Frigate knows it"
echo "-C: All cameras (use with -d)"
echo "-D: Show total disk usage per day across all cameras"
@pyrodex
pyrodex / lunch.py
Last active August 19, 2025 02:50
Simple python code to pull Meal Viewer daily menu and write it to an HTML file
import requests
import json
from datetime import datetime
from datetime import timedelta
lunch_file = "/apps/swag/config/www/lunch_entrees.html"
# Get today's date
date = datetime.now() + timedelta(days=1)
# Get the day of the week name
day_of_week = date.strftime("%A")