Skip to content

Instantly share code, notes, and snippets.

View MrDwarf7's full-sized avatar
🏠
Working from home

Blake B. MrDwarf7

🏠
Working from home
  • Australia
View GitHub Profile
@MrDwarf7
MrDwarf7 / .wezterm.lua
Created September 1, 2024 14:54 — forked from AntonC9018/.wezterm.lua
Wezterm config
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
config.use_dead_keys = false
-- https://github.com/wez/wezterm/discussions/5102
config.enable_kitty_keyboard = true
config.allow_win32_input_mode = false
{
// VIM/NEOVIM RELATED
"extensions.experimental.affinity": {
"asvetliakov.vscode-neovim": 1
},
"vscode-neovim.compositeTimeout": 200,
"vscode-neovim.compositeKeys": {
"jj": {
"command": "vscode-neovim.lua",
"args": [
@MrDwarf7
MrDwarf7 / CompactWSL.bat
Created November 18, 2024 01:53 — forked from Csqhi515/CompactWSL.bat
Script to help compact WSL and vhdx.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
wsl sudo fstrim --all; echo "Exit status: $?";
#!/usr/bin/env python3
"""
Automates creation of a baseline Btrfs layout on a given device/partition.
- Assumes the partition is already wiped or otherwise ready.
- Creates a Btrfs filesystem with a label.
- Creates subvolumes: @, @boot, @swap, @snapshots, @var, @home, @tmp
- Mounts @ at /mnt, then mounts the others to their respective subdirectories.
- NOTE: You must run this script with sudo (or as root).
import argparse
import subprocess
import sys
import os
def run_cmd(cmd, check=True):
"""
Helper to run a command using subprocess.
If check=True, raises an exception on nonzero return.