Skip to content

Instantly share code, notes, and snippets.

@juliostanley
juliostanley / clean-node-modules.ps1
Created December 8, 2019 22:39
Clean node_modules
# Remove node_modules at a certain depth (assumes npm install -g rimraf has been done)
gci "$(pwd)/*/*/*" -Filter node_modules | %{ rimraf "$_" }
@juliostanley
juliostanley / README.md
Last active July 24, 2022 18:20
K3S and Rio on WSL2

Install Rio on K3S running in WSL2 on Windows

Info

  • K3S is a certified kubernetes distro for edge and other scenarios
  • Rio simplifies application development on kubernetes
  • WSL2 run linux on windows, nicer and more integrated than a traditional vm on hyper-v

Prerequisites

  • Windows 10 with WSL2 set as default
@juliostanley
juliostanley / installations.ps1
Last active December 8, 2019 13:40
Installations
#!/usr/bin/env pwsh
# Docker for Windows
$version='edge'
$progressPreference='SilentlyContinue';
Invoke-WebRequest "https://download.docker.com/win/$version/Docker%20for%20Windows%20Installer.exe" -OutFile ~/downloads/docker-installer.exe;
Invoke-Item ~/downloads/docker-installer.exe;
# Enable Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
@juliostanley
juliostanley / install-pwsh.ps1
Last active December 8, 2019 03:08
Install powershell
# This is for pwsh-preview. Remove -preview for pwsh
# https://www.thomasmaurer.ch/2019/07/how-to-install-and-update-powershell-7/
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Preview"
# https://www.thomasmaurer.ch/2019/02/update-powershellget-and-packagemanagement/
@juliostanley
juliostanley / flatten.ps1
Last active November 27, 2019 02:33
PowerShell JSON and YAML
#!/usr/bin/env pwsh
# NOTE: Strips out false and null.
(gc file1.json -raw) | jq '[paths(scalars) as $path | { ($path | map(tostring) | join(\".\")): getpath($path) } ] | add'