Skip to content

Instantly share code, notes, and snippets.

View chrisfinazzo's full-sized avatar

Chris Finazzo chrisfinazzo

View GitHub Profile
@troyhunt
troyhunt / Build-Troys-PC.md
Created October 20, 2025 04:04
Help me spec out a replacement PC that absolutely *flies*

Time is money, and my 5+ year old desktop is costing me a heap of it right now. The final straw has come when processing several terabytes of stealer logs which has taken forever. Meanwhile, Stefan has been flying through them with a massive NVMe drive on a fast motherboard.

So, in no particular order, here's what I need it to do:

  1. Read and write multi-terabyte files fast
  2. Run SQL Server locally for both development and querying of large data sets (the latter is especially memory intensive)
  3. Dev environment is largely Visual Studio, SSMS and other (less intensive) tools
  4. Run a gazillion simultaneous Chrome tabs 😛

And here's my current thinking:

#!/bin/sh
# dfn: df normalized, or df not noisy, or df nicely, or df new
#
# Whatever you want to call it, this script makes df useful again.
# It removes read-only disks for Time Machine backups, system volumes
# that can't be modified, unbrowsable volumes, and other stuff you don't
# really care about.
#
# Instead, you get the same drives that you see on your Mac desktop in an
@mdbraber
mdbraber / save-safari-pdf.swift
Last active August 8, 2025 13:08
Save Safari website as PDF (with syncing cookies)
#!/usr/bin/swift
@preconcurrency import WebKit
@preconcurrency import Foundation
@preconcurrency import Darwin
// Disable everything written to stderr
freopen("/dev/null", "w", stderr)
struct Cookie {
@jasonsnell
jasonsnell / countdupes.py
Last active February 8, 2025 22:02
Count Duplicates in List
import subprocess
import re
import sys
from Levenshtein import ratio
from collections import defaultdict, Counter
# Configuration: Adjust as needed
INCLUDE_PARENTHESES = False # Set to True to include parentheticals, False to exclude them
OUTPUT_TO_CLIPBOARD = True # Set to True to copy output to clipboard, False to print to console
@ldavidh
ldavidh / moreFinderTerminal.sh
Last active July 4, 2025 11:34
alternate sel script
#cd into directory in Finder's front window
function cdf() {
finderPath=`osascript -e 'try
tell application "Finder" to set the source_folder to (folder of the front window) as alias
on error
tell application "Finder" to set source_folder to insertion location as alias
end try
return POSIX path of source_folder as string'`
cd "$finderPath"
@ivmirx
ivmirx / mute-mastodon.txt
Last active August 7, 2024 01:28
Filter list for Mastodon, based on mentalhealth.txt by @potatoqualitee
Disclaimer: many of those are extremely important but I believe that social media isn't fit to discuss them
## Politics ##
alt-right
bipartisan
Brexit
Capitol
CCP
China
CIA
@timothyham
timothyham / ipv6guide.md
Last active December 4, 2025 16:38
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@chockenberry
chockenberry / df.sh
Created March 4, 2024 18:51
df Replacement
#!/bin/sh
if [ ! -z "$*" ]; then
echo "this is ~/bin/df, use /bin/df"
exit 1
fi
protect=`mount | grep -v "read-only" | grep "protect" | cut -f 3 -w`
nosuid=`mount | grep -v "read-only" | grep "nosuid" | cut -f 3 -w`
@gruber
gruber / Split Tabs to New Window.scpt
Last active December 1, 2025 22:56
An AppleScript for Safari to move all tabs in the frontmost window, from the current tab to the rightmost (last) tab, to a new window.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
Original script: John Gruber (https://daringfireball.net/linked/2023/12/05/an-applescript-for-safari-split-tabs-to-new-window)
Much more elegant version: Leon Cowle (https://github.com/leoncowle)
Even more elegant version: https://stackoverflow.com/questions/54066100/applescript-to-split-safari-tabs-into-new-window/54089865#54089865
Worth a warning: "moving" tabs with this script doesn't actually move them like
drag-and-drop does. The tabs "moved" by this script will reload in the new window,
@chrisfinazzo
chrisfinazzo / plain-text-template.txt
Created December 2, 2023 02:47 — forked from rodriguezcommaj/plain-text-template.txt
An example plain text email template.
Hello friends!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ut leo faucibus, pharetra velit vel, porta tortor. In ac est odio. Sed dolor erat, bibendum vel cursus et, mollis vitae eros. Fusce volutpat, quam vel rutrum tristique, mi lectus tincidunt massa, at sodales arcu nibh in erat. Sed accumsan mi at ipsum feugiat laoreet. Fusce blandit nulla at imperdiet condimentum. Etiam eget aliquet leo. Mauris interdum ligula facilisis arcu hendrerit rutrum.
- Bullet list item
- Bullet list item
- Bullet list item
_,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,__,.-'~'-.,_