Skip to content

Instantly share code, notes, and snippets.

View karoltheguy's full-sized avatar

Carol Ouellet karoltheguy

View GitHub Profile
@karoltheguy
karoltheguy / README.md
Created August 19, 2026 18:10
claude-commit-msg: a Claude Code PreToolUse hook that checks commit subjects before git runs

claude-commit-msg: stop Claude Code writing a bad commit subject

A Claude Code PreToolUse hook that checks the commit subject before the git commit command runs, and denies the tool call if the subject is wrong. Claude then rewrites the subject and tries again, instead of running into a rejected commit and having to recover from it.

It holds no rules of its own. It finds the message in the command and hands it to your existing commit-msg git hook, so there is one source of truth for the convention.

@karoltheguy
karoltheguy / README.md
Created August 19, 2026 18:10
commit-msg: a Conventional Commits hook for git, with setup instructions

commit-msg: a Conventional Commits hook for git

A single bash hook that rejects commit subjects which do not follow Conventional Commits. It checks two things:

  1. The subject matches type(scope): lowercase description, with no trailing period.
  2. The subject is 72 characters or fewer.

Merge, revert, fixup, squash, and reapply subjects that git generates itself are skipped, since they are not yours to reformat.

@karoltheguy
karoltheguy / forgejo-labels-homelab.yaml
Created April 1, 2026 04:20
Homelab label template for Forgejo issues ($FORGEJO_CUSTOM/options/label/)
labels:
- name: "type: bug"
color: d73a4a
description: Logic errors in scripts, runtime crashes, or service connectivity failures.
- name: "type: feature"
color: 0075ca
description: New code functionality or an entirely new service deployment.
- name: "type: enhancement"
color: 2cbe4e
description: Refactoring existing code for performance, improving UI/UX, or hardening security configs.
@karoltheguy
karoltheguy / dnsdist.conf
Last active March 16, 2025 05:38
"High Availability DNS Failover for Pi-hole / AdGuard using DNSdist
-- Bind DNS on all available interfaces on port 53
setLocal('0.0.0.0:53', {})
-- Set Access Control List to allow all IPv4 and IPv6 addresses
setACL({'0.0.0.0/0', '::/0'})
-- Bind the web server on port 8083 on all available interfaces
webserver("0.0.0.0:8083")
-- Set the web server configuration
setWebserverConfig({
@karoltheguy
karoltheguy / nessus_kb_extract.py
Last active November 5, 2024 21:47
Tenable Nessus KB Extract
import openpyxl
def extract_kbs_from_excel(excel_file):
workbook = openpyxl.load_workbook(excel_file)
sheet = workbook.active
kbs = set() # Use a set to automatically handle duplicates
for row in sheet.iter_rows(min_row=2, values_only=True): # Assuming the first row is the header
priority = row[3] # 4th column (index 3)
@karoltheguy
karoltheguy / average_cpu_usage.sh
Created January 11, 2024 06:57
Bash All Core Average CPU Usage
#!/bin/bash
# extract average CPU usage of all cores
idle_time=$(mpstat 1 1 | awk '/Average:/ {print $NF}' | sed 's/\,/./' )
cpu_usage=$(echo "(100 - $idle_time)" | bc -l )
echo $cpu_usage
@karoltheguy
karoltheguy / docker-compose.yml
Created December 29, 2023 23:09
Bitfocus-Companion StreamDeck container docker compose
services:
companion:
container_name: companion
image: ghcr.io/bitfocus/companion/companion:latest
ports:
- "8000:8000"
- "16622:16622"
- "28492:28492"
volumes:
- /dev/bus/usb:/dev/bus/usb
@karoltheguy
karoltheguy / update-discord
Last active January 10, 2024 04:13 — forked from niklasdewally/update-discord
Discord Installer
#!/bin/bash
shopt -s nullglob
pp (){
if [ -x "$(command -v cowsay)" ]
then
cowsay "$1"
else
echo "=========="
echo "$1"
@karoltheguy
karoltheguy / set_suspend_timer.bat
Last active December 3, 2023 05:31
Set powercfg suspend timer of current power profile
@echo off
set TIMEOUT_SECONDS=%1
for /f "tokens=4 skip=1" %%f in ('powercfg -list ^| findstr \*') do set GUID=%%f
SET SUB_SLEEP=238c9fa8-0aad-41ed-83f4-97be242c8f20
SET STANDBYIDLE=29f6c1db-86da-48c5-9fdb-f2b67b1f44da
powercfg -setacvalueindex %GUID% %SUB_SLEEP% %STANDBYIDLE% %TIMEOUT_SECONDS%
@karoltheguy
karoltheguy / lxc-idmapper-helper.py
Last active November 30, 2023 06:06
Tool to generate idmap for Proxmox lxc configuration
#!/usr/bin/env python
import argparse
# validates user input
def parser_validate(value, min = 1, max = 65535):
(container, host) = value.split('=') if '=' in value else (value, value)
(containeruid, containergid) = container.split(':') if ':' in container else (container, container)
(hostuid, hostgid) = host.split(':') if ':' in host else (host, host)