Skip to content

Instantly share code, notes, and snippets.

@DiogenesAnalytics
DiogenesAnalytics / system_update.sh
Created October 22, 2025 04:30
Updating and Optionally Rebooting / Halting Script
system_update() {
echo "Authenticating sudo once..."
sudo -v || return 1
echo "Updating apt packages..."
sudo apt-get update -y && sudo apt-get upgrade -y
echo "Refreshing snaps..."
sudo snap refresh
@DiogenesAnalytics
DiogenesAnalytics / README.md
Last active September 18, 2025 21:12
Frigate Storage Drainage Scripts

About

A collection of shell scripts, fstab entries, and autofs files for creating a merged drive using mergerfs and autofs

@DiogenesAnalytics
DiogenesAnalytics / adjust_triangle.py
Created August 12, 2025 11:58
Adjust Triangle Sides From Rough Estimate to Precise Approximations
import math
import argparse
from decimal import Decimal, getcontext
from typing import Tuple, Union, Optional
def adjust_sides(
A: float,
B: float,
C: float,
@DiogenesAnalytics
DiogenesAnalytics / mixin.py
Last active May 15, 2025 21:50
Python Mixin ABC
from abc import ABC
from typing import Any
class Mixin(ABC):
"""Base class for all mixins to enforce correct usage."""
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Prevent direct instantiation of Mixin itself."""
if type(self) is Mixin:
raise TypeError("Mixin cannot be instantiated directly.")
@DiogenesAnalytics
DiogenesAnalytics / Dockerfile
Last active November 8, 2024 18:35 — forked from ddelange/itunes_xml_to_m3u.py
Convert iTunes Music Library xml to m3u8 playlists
# Use a lightweight Python base image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Set the working directory
WORKDIR /app
@DiogenesAnalytics
DiogenesAnalytics / Dockerfile
Last active September 11, 2024 15:27
Streamlit app for calculating buy/rent threshold
# Use the official Python image as the base image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements.txt file to the working directory
COPY requirements.txt .
# Install the dependencies
@DiogenesAnalytics
DiogenesAnalytics / compilation.sh
Last active September 20, 2024 20:30
Creates a compilation of videos by concatenating them together and write them out to WEBM
#!/bin/bash
# Function to concatenate all AVI files and convert to WebM
concat_avi_to_webm() {
output_file="output.webm"
# Check if an argument is passed (for the output file)
if [[ -n "$1" ]]; then
output_file="$1"
fi
@DiogenesAnalytics
DiogenesAnalytics / timelapse.sh
Created August 29, 2024 00:56
Creating a timelapse with FFmpeg
#!/bin/bash
create_timelapse() {
local input_file="$1"
local output_ext="${2:-webm}" # Default to "webm" if $2 is not provided
local input_ext="${input_file%.*}"
local output_file="${input_ext}_timelapse.${output_ext}"
ffmpeg -i "$input_file" -filter:v "setpts=0.1*PTS" -an "$output_file"
}
@DiogenesAnalytics
DiogenesAnalytics / Dockerfile
Created July 15, 2024 14:26
Coral Edge TPU test example executed in Docker for Coral USB Accelerator
# ref: https://www.jeffgeerling.com/blog/2023/testing-coral-tpu-accelerator-m2-or-pcie-docker
# base image
FROM debian:10
# setting workdir
WORKDIR /home
# setting home var
ENV HOME=/home
#!/bin/bash
cd /
sudo apt update
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -