Skip to content

Instantly share code, notes, and snippets.

View ormico's full-sized avatar

Zack Moore ormico

View GitHub Profile
@ormico
ormico / wsl-system-vhd-fix.md
Created April 4, 2026 23:07
WSL system.vhd missing after Docker Desktop uninstall — fix walkthrough

WSL system.vhd Missing After Docker Desktop Uninstall

Symptom

Any attempt to install a WSL distribution fails with:

Failed to attach disk 'C:\Program Files\WSL\system.vhd' to WSL2: The system cannot find the file specified.
Error code: Wsl/InstallDistro/Service/RegisterDistro/CreateVm/MountDisk/HCS/ERROR_FILE_NOT_FOUND
@ormico
ormico / install-ghcli.sh
Created October 7, 2025 23:40
Install gh cli ubuntu
(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
@ormico
ormico / cross-stage-variables-azure-devops-yaml-pipeline.yml
Created August 15, 2025 18:20 — forked from rudfoss/cross-stage-variables-azure-devops-yaml-pipeline.yml
Cheat-sheet for setting and retrieving variables in Azure DevOps yaml pipelines across different steps, jobs and stages.
# Cheat-sheet for using dynamically defined variables between steps, jobs and stages in Azure DevOps Yaml Pipelines
# Documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
trigger: none
pr: none
stages:
- stage: DefineVarStage
jobs:
- job: DefineVarJob
@ormico
ormico / remove_node_modules_recursively.ps1
Created September 27, 2021 23:22 — forked from SynCap/remove_node_modules_recursively.ps1
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf
@ormico
ormico / example.sql
Created November 8, 2020 22:36
SQL pass list
CREATE TABLE [dbo].[TestTable]
(
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](100) NOT NULL,
[Value] [numeric](18, 4) NOT NULL,
CONSTRAINT [PK_TestTable] PRIMARY KEY CLUSTERED([ID] ASC)
)
GO
insert into TestTable (Name, Value) values ('Alpha', 100000.1111);
@ormico
ormico / .gitignore
Last active October 27, 2020 19:57
dotnet-gitignore
bin/
obj/
ClientApp/node_modules
node_modules
wwwroot/node_modules
appsettings.development.json
*.user
@ormico
ormico / powershell-template.ps1
Created September 11, 2020 19:02
template for powershell script
<#
.SYNOPSIS
a SYNOPSIS
.DESCRIPTION
a description
.PARAMETER OptionalParam1
a parameter
# https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx
# https://github.com/JanDeDobbeleer/oh-my-posh
# https://github.com/dahlbyk/posh-git
# https://github.com/microsoft/cascadia-code
# install CascadiaCodePL.ttf and CascadiaCode.ttf by double clicking file
# set font in Terminal settings.json
# "profiles":
# {
# "defaults":
# {