Skip to content

Instantly share code, notes, and snippets.

View FNGarvin's full-sized avatar

Fred N. Garvin FNGarvin

  • Moline, IL
View GitHub Profile
@FNGarvin
FNGarvin / generate_subs_with_whisper.py
Created August 7, 2025 15:46
Example wrapper for more reliably generating subs w/ Whisper
def _generate_subs_with_whisper(self, generated_srt_path):
"""Generates subtitles using Whisper. This is the final fallback."""
print(f"\n--- Generating Subtitles with Whisper ---", flush=True)
# Create a predictable scratch directory for intermediate files
scratch_dir = os.path.join(tempfile.gettempdir(), 'subtitle_processor_scratch')
os.makedirs(scratch_dir, exist_ok=True)
# Use a predictable filename based on the video for easier debugging
video_basename = os.path.splitext(os.path.basename(self.args.video_file))[0]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# detect_and_crop.py
# FNGarvin (c) 2025
#
# This script uses a pre-trained YOLOv8 model to detect objects in an image
# specified as a command-line argument. For each detected object exceeding a
# specified confidence threshold, it generates ImageMagick 'convert' commands
# to crop the object. These commands are then printed to the console and

General guidance for managing WSL space:

  • Use ncdu -x to get an overview for disk usage.
  • Use podman system df to get an overview for prune savings.
  • Delete old, tagged, unwanted images from podman image list w/ podman rmi [imagename].
  • Do a podman ps -a and ensure every container to keep features the to-keep label mnemonic for filtering. Workflow to add it follows:

Workflow to add -to-keep label:

  1. Commit the [stopped] container

Guide: Configuring Windows OpenSSH Server for Full WSL Sessions

Last Updated: June 23, 2025

Authorship: This guide was developed in a collaborative session between a user and Google's Gemini assistant.

Objective

This guide details a robust method to configure the Windows OpenSSH Server to provide users with a direct and seamless WSL/Linux shell.

@FNGarvin
FNGarvin / chapt_2_mp3.rb
Created April 19, 2025 03:59
A Simple Script to Convert a Video Into a Collection of MP3s, One File Per Chapter
#!/usr/bin/ruby -w
#a simple script to take a video file and convert it
#into a collection of mp3 files, one file per chapter
#requires an ffmpeg install with ffprobe and support for
#mp3 plus whatever formats the input uses
#FNG, 2025
require 'json'
@FNGarvin
FNGarvin / burp_without_burp.md
Created November 30, 2024 14:34
IntroToBurp CTF Without BurpSuite.

IntroToBurp CTF Without BurpSuite

I've been having fun with these puzzles, but I don't appreciate being asked to download paid software from organizations I do not know or trust. Fortunately, this CTF can be easily completed with integrated browser features alone. Here, I'll document my step-by-step process - first in Firefox and then in Chrome.

First, start the instance and open the provided link.image

Fill the form with whatever you please and submit it.image

Bring up the developer tools by right-clicking anywhere and choosing "Inspect".image

@FNGarvin
FNGarvin / rgbram.sh
Last active October 11, 2024 18:30 — forked from topalovic/rgbram.sh
Kingston Fury Beast DDR5 RGB controller script
#!/bin/bash
#
# Kingston Fury Beast DDR5 RGB controller script
#
# Sauce:
# https://gitlab.com/CalcProgrammer1/OpenRGB/-/issues/2879#note_1336953263
#
# Supports only static colors.
#
# Usage examples: