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 / update_linux.sh
Last active June 13, 2023 20:11
My linux update script #linux
#!/bin/bash
set -e
cecho() {
color=''
reset=$(tput sgr0)
case "$1" in
bk) color=$(tput setaf 0) ;;
rd) color=$(tput setaf 1) ;;
gn) color=$(tput setaf 2) ;;
@milnak
milnak / SpotifyPlaylistToCsv.ps1
Last active February 23, 2023 06:04
Convert spotify playlist via ctrl-a,ctrl-c to a CSV list of artist,title,uri
# (Get-Clipboard) -split "`n" | .\Write-SpotifyTrackInfo.ps1 | Format-List
param(
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[String[]]$URIs
)
process {
$regex = '<title>(?<Title>.+).* - .*by (?<Artist>.+) \| Spotify<\/title>'
foreach ($uri in $URIs) {
@milnak
milnak / ubuntu20-hyperv-enhanced-session.md
Last active April 24, 2024 20:24
[Enabling enhanced session in Hyper-V for Ubuntu 20] This works for me, although it seems that Hyper-V quick create now supports enhanced session by default. #ubuntu #hyperv

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20 desktop

DO NOT create the VM by choosing Quick Create in Hyper-V Manager. Follow these instructions exactly.

@milnak
milnak / update_plex.sh
Last active June 13, 2023 20:12
My plex update script #linux
#!/bin/bash
set -e
echo 'Enter Plex update URL:'
echo 'e.g. https://plex.tv/downloads/latest/5?channel=16&build=linux-x86_64&distro=debian...'
read -r url
wget --output-document=plex.deb --continue "${url}"
@milnak
milnak / update_pihole.sh
Last active June 13, 2023 20:11
Simple script to update pihole #linux
#!/bin/bash
set -e
pihole -v
pihole -up
@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 / List-PinHP-Roms.ps1
Last active November 23, 2023 20:10
List installed PinHP ROMs, suitable for filtering. #pinhp
<#
.SYNOPSIS
List installed PinHP ROMs, suitable for filtering.
.NOTES
Place this in root of USB.
Prerequisite: advmame106.xml file from "pinHP config files" at https://pinhp.github.io/docs/download.html
Specify location with "-DatFile".
@milnak
milnak / aria-torrent-dl.cmd
Created November 30, 2021 17:12
Script (bash and cmd) to download a torrent using aria
goto(){
# Linux
# Save this script as "aria-torrent-dl.sh"
# sudo apt install aria2 --yes
aria2c --continue=true --max-concurrent-downloads=5 --max-connection-per-server=4 --min-split-size=10M --split=5 --disable-ipv6=true --seed-time=0 --summary-interval=0 --console-log-level=warn $1
}
goto $@
exit
:(){
@milnak
milnak / ipfilter_update.cmd
Last active February 11, 2024 14:50
qBitTorrent ipfilter file updater
@ECHO OFF
REM qBittorrent IP Filter updater.
REM 9:45 AM Sunday, January 24, 2010. Updated 2016-03-15
REM To enable in qBittorrent:
REM Settings - Connection - IP Filtering - Filter path - %APPDATA%\qBittorrent\ipfilter.dat
SETLOCAL
REM https://www.iblocklist.com/lists
REM https://www.ipfilter.app : https://github.com/DavidMoore/ipfilter/releases/download/lists/ipfilter.dat.gz