Skip to content

Instantly share code, notes, and snippets.

@milnak
milnak / sfv.ps1
Created December 2, 2022 08:57
SFV tool: Adaptation of SFVCON to PowerShell #powershell
# TODO:
# sfv.exe takes in a file that can include a path.
#
# sfv.exe supports -rep, -noperc
#
# sfv seems to have a filename truncation routine where it puts ellipses. Not sure what the logic is.
# should be:
# │ [ 4/ 23] Info/05 - Roxy Music - While My Hear...ng.dsf_report.png MISS
# │ [ 5/ 23] Info/07 - Roxy Music - Take A Chance W...dsf_report.png MISS
# not:
@milnak
milnak / regex-reference.md
Last active November 30, 2025 03:52
Regular Expression Language

Regular Expression Language - Quick Reference

Adapted from Microsoft Learn

Character Escapes

The backslash character (\) in a regular expression indicates that the character that follows it either is a special character (as shown in the following table), or should be interpreted literally.

Escaped character Description Pattern Matches
@milnak
milnak / TrToObject.ps1
Last active December 23, 2022 07:47
Parse HTML TR to PowerShell PSCustomObject
# TODO: Should also capture Cycle notes, e.g.
# <td height="26">5 (+1 if page crossed)</td>
$uri = 'https://www.nesdev.org/obelisk-6502-guide/reference.html'
$content = (Invoke-WebRequest -Uri $uri).Content
$regex = '(?s)'
# <tr>
$regex += '<tr>.*?'
# <td width="30%" height="24"><a href="addressing.html#IMP">Implied</a></td>
@milnak
milnak / extract-cue.ps1
Last active August 15, 2024 18:07
Extract audio files from CUE file: Uses ffmpeg.exe as a helper
# https://wiki.hydrogenaud.io/index.php?title=Cue_sheet
Param(
# Path to CUE file
[Parameter(Mandatory = $true)][string]$CuePath
)
function Parse-Cue {
Param([Parameter(Mandatory = $true)][string]$CuePath)
# Top level object. Includes File array.
@milnak
milnak / mousejiggler.ps1
Last active March 14, 2023 01:35
App to demonstrate how to programmatically move mouse on an interval
Param(
# Number of seconds for the interval.
[ValidateRange(1, 60)]
[int]$IntervalSecs = 60,
# Start with zen (invisible) jiggling enabled.
[switch]$Zen = $false
)
$source = @'
using System;
using System.Runtime.InteropServices;
@milnak
milnak / PowerPoint-Notes-To-Markdown.ps1
Last active November 6, 2024 17:46
Extract Powerpoint (PPTX) Notes to Markdown
# Convert PPT notes to Markdown
param ([Parameter(Mandatory)][string]$Path)
$fullpath = Resolve-Path $Path
$msoFalse = 0
$msoTrue = -1
$ppPlaceholderBody = 2
# https://learn.microsoft.com/en-us/office/vba/api/powerpoint.application
@milnak
milnak / garlic-os-tips.md
Last active September 1, 2026 20:49
My set of GarlicOS tips #rg35xx

Garlic OS Tips (Windows-based)

GarlicOS Cookbook

Follow these instructions for an easy way to get up and going quickly! These are complete instructions, and will be the easiest way to get started on a new RG35XX.

Set up SD Card

Get a high quality SD (e.g. SanDisk Extreme) card, 128GB or larger, 256GB is recommended. Don't skimp here, they're cheap, and don't use the card that comes with the RG35XX as it's crap.

@milnak
milnak / putty-config.md
Last active November 30, 2025 03:34
Putty Configuration #windows

Putty Configuration

Putty sessions are saved under HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions.

Click on "Default Settings", Click "Load", then set these settings. Then Click "Save". All new sessions will have these settings.

Terminal

Bell

@milnak
milnak / foobar2000-dsd-sacd.md
Last active September 14, 2026 18:42
Foobar 2000 DSD and SACD support: Guide to setting up Foobar2000 player for hi-res audio (DSF, DFF, SACD, ISO) #windows

Foobar2000 DSD and SACD support

I've successfully followed these steps to get DSD (.dsf filetype) and SACD (.iso filetype) playing at high bit rate using foobar2000 on my S.M.S.L M500 DAC.

This has been adapted from "SECTION II" of this page, thanks to "sirblew" for the tip!

Introduction

DSD stands for Direct Stream Digital and it is a high-definition lossless audio format with a twist. PCM signal solutions (like FLAC, TTA or APE) measure a set of bits multiple times per second to capture the audio data, hence the 16/24-bit parameter. On the other hand, DSD uses only one bit but samples it 2.8 million times a second to capture the audio signal.

@milnak
milnak / clrmame-dat-check.ps1
Last active August 15, 2024 18:06
ClrMame DAT checker: Utility to check a MAME ROM set against a DAT file
# clrmame-dat-check.ps1
# Utility to check a MAME ROM set against a DAT file
# Assumptions: that clones aren't desirable, and that all zip files are split, not merged.
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$RomPath,
[Parameter(Mandatory = $true)]
[string]$DatPath,