Skip to content

Instantly share code, notes, and snippets.

@milnak
milnak / settings.json
Last active December 31, 2020 18:07
Windows Terminal 1.0 configuration file - %LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"copyOnSelect": false,
"copyFormatting": false,
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"initialCols": 120,
"initialRows": 40,
"keybindings": [
{
@milnak
milnak / mame_ini_to_csv.cmd
Created July 13, 2021 15:53
Convert mame folder ini file to CSV rom=value format
@echo off
setlocal enabledelayedexpansion
REM Convert mame folder ini file to CSV rom=value format
if "%~1" equ "" (
echo Need ini filename.
goto :eof
)
echo "rom","value"
set section=
@milnak
milnak / chordpro2pdf.cmd
Created March 15, 2022 16:06
Convert chord pro file to PDF
@ECHO OFF
SETLOCAL
for /f "tokens=1,2,*" %%a in ('reg.exe query "HKEY_LOCAL_MACHINE\SOFTWARE\Artifex\GPL Ghostscript\9.55.0" /ve') do set "UAC=%%c"
SET GSWIN64C=%UAC%\bin\gswin64c.exe
IF NOT EXIST "%GSWIN64C%" (
ECHO Can't find %GSWIN64C%
ECHO Download Windows 64 bit from https://ghostscript.com/releases/gsdnld.html
@milnak
milnak / verify_dns.cmd
Created May 23, 2022 15:37
CMD script to verify that DNS server is up and running. Useful for pihole.
@echo off
setlocal
if "%~1"=="" ( ECHO Specify DNS server to verify, e.g. %~nx0 192.168.1.17 & GOTO :EOF)
set DNSSERVER=%~1
REM To have this script run on user login:
REM
REM taskschd.msc
REM Action, Create Basic Task
REM Name: verify_htpc_pihole
@milnak
milnak / download_youtube.cmd
Created August 26, 2022 16:15
Download playlists or channels from youtube using yt-dlp
@echo off
setlocal
REM Set codepage to UTF-8
chcp 65001 > NUL
echo.
REM Hidden ESC character on next line.
set ESC=
GOTO :MAIN
@milnak
milnak / pdf_burst.cmd
Last active September 30, 2022 01:06
Burst a PDF Document into Single Pages using qpdf - https://github.com/qpdf/qpdf
@ECHO OFF
REM Burst a PDF Document into Single Pages using qpdf - https://github.com/qpdf/qpdf
SETLOCAL
IF "%~1"=="" (
ECHO PDF_filename
ECHO Example: %~nx0 document.pdf
GOTO :EOF
)
@milnak
milnak / ICalToText.ps1
Created November 9, 2022 07:06
Convert an online ICAL to a text representation
# Powershell: No Rules calendar (ICAL import)
[cmdletbinding()] # Support -Verbose
Param(
# Google Calendar URL.
# Calendar Settings > Calendar Details > Calendar Address > ICAL
# Settings for my calendars > [Calendar Name] > Integrate calendar > Public address in iCal format
[string]$ICalUrl = 'https://calendar.google.com/calendar/ical/FILL_THIS_IN/public/basic.ics',
# If False, then only events after the current day are displayed.
[switch]$AllEvents = $False,
@milnak
milnak / ffmpeg-normalize-all.cmd
Last active November 16, 2022 17:14
Normalize mp3 and flac files in currently directory using ffmpeg-normalize
@echo off
REM Normalize mp3 and flac files in currently directory using ffmpeg-normalize
REM https://github.com/slhck/ffmpeg-normalize/
setlocal
goto :main
:normalize_file
setlocal
@milnak
milnak / windows_ee.md
Last active November 24, 2022 02:04
[Windows v1 - v3 Easter Eggs] How to access the easter eggs in early versions of Windows. #eastereggs #windows

Windows 1 - 3 Easter Egg Information

Encryption/Obfuscation

Windows 1.x - 2.x

Chained XOR. To decrypt, XOR the nth byte with the key, XOR the key with that decrypted byte and repeat until the EOF mark is hit. Initial key is the integer 77.

@milnak
milnak / DownloadLatestPS.ps1
Last active November 24, 2022 02:06
[Download Latest PowerShell] PowerShell script to download latest PowerShell x64 MSI from github
Function DownloadLatestPS {
Param([Parameter(Mandatory=$true)][string]$Folder)
$json = curl -s 'https://api.github.com/repos/PowerShell/PowerShell/releases/latest' | ConvertFrom-Json
$ps = $json.assets | Where-Object name -Like 'PowerShell-*-win-x64.msi'
"Downloading: {0}" -f $ps.name
$oldpp = $progresspreference
$progresspreference = 'SilentlyContinue'