Skip to content

Instantly share code, notes, and snippets.

@spoelstraethan
spoelstraethan / !notes.md
Created October 26, 2023 18:22
WSL WSL2 subnet size/address adjustments

In an elevated Powershell

Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Name "NatNetwork"

This prints the current network in CIDR, the /20 is WAY too many hosts for what almost anybody might need.

Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Name "NatNetwork" -Value "172.17.128.0/24"

@spoelstraethan
spoelstraethan / gist:32f56345de28a7b47d9bf44f3a0bbc65
Last active September 3, 2022 20:00
(WARNING: Work In Progress, ChromeOS breaks due to how holoinstall messes with the grub) Modified holoinstall to install on a Chromebook after running Chrx to set up dual boot
#!/bin/zsh
# HoloISO Installer v2
# This defines all of the current variables.
CMD_PACMAN_INSTALL=(/usr/bin/pacman --noconfirm -S --needed --disable-download-timeout --overwrite="*")
CMD_PACMAN_UPDATE=(/usr/bin/pacman -Sy)
CPU_VENDOR=$(cat /proc/cpuinfo | grep 'vendor' | uniq | cut -c 13-)
SYSTEM_LOCALE="${SYSTEM_LOCALE:-en_US.UTF-8 UTF-8}"
HOLO_INSTALL_DIR="${HOLO_INSTALL_DIR:-/mnt}"
# Internet connectivity check
@spoelstraethan
spoelstraethan / !notes.md
Created September 1, 2022 04:08
Steps to get LG R100 working on Linux (Arch/SteamOS/etc)
@spoelstraethan
spoelstraethan / gist:53c1b7b188845ac9f0957d70be5cfab5
Last active November 15, 2021 19:19
ChromeOS Brunch easy CLI extract and updates
# Download your recovery from https://cros-updates-serving.appspot.com
# Ctrl+Shift+T or open a Crosh Window and type `shell`
# Without arguments `cd` takes you to your $HOME directory
cd
#
cd Downloads/
ls
# Create a temporary directory and capture the name to a variable so we can reuse
MOUNTZIP=$(mktemp -d -p /tmp -t XXXXXX)
fuse-zip chromeos_*.bin.zip $MOUNTZIP
@spoelstraethan
spoelstraethan / !notes.md
Last active September 26, 2021 00:59
Cosmo Communicator handy snippets for i3 or scripting

i3 fixes

sudo apt install i3 rofi
sed -i -e 's/47/48/' -e 's/pango://' /etc/i3/config.keycodes /etc/i3/config
# even with the pango: removed from the config the wizard uses it and fails to show up properly on first login
i3-config-wizard -m alt

Battery device for i3status

@spoelstraethan
spoelstraethan / gist:f0c0f2543e413c01ff3dac9272aef194
Created August 30, 2020 20:25
ssvnc + ss to find open VNC port from Packer/Vagrant
ssvnc -viewer $(ss -ltH '( dport geq :5900 and dport leq :5999 or sport geq :5900 and sport leq :5999 )' | tr -s [:blank:] |cut -d' ' -f 4)

I was having some trouble with libvirt on a Chromebook that supports /dev/kvm passthrough after installing virt-manager and the other packages and what finally fixed it was using sudo apt update && sudo apt upgrade -y and upgrading to Debian Buster 10.3 (I was on 10.2) and then sudo gpasswd -a $USER libvirt and sudo gpasswd -a $USER kvm and then quitting my shell and logging out and then when I logged back in I ensured that I was in the right groups by running id. It turns out that for some reason the kvm group doesn't stick, but running sudo gpasswd -a $USER kvm; newgrp kvm gives you a shell where you can run qemu-system-x86_64 and then I didn't have any further warnings or permissions issues from virt-host-validate. sudo apt install cpu-checker also let me run sudo kvm-ok to validate that the system was KVM ready.