Skip to content

Instantly share code, notes, and snippets.

View lirrensi's full-sized avatar
😎

lirrensi lirrensi

😎
  • 13:25 (UTC +07:00)
View GitHub Profile
@lirrensi
lirrensi / wsl-dev-sandbox.md
Last active March 23, 2026 19:55
Isolate WSL for on-demand folder mounting with ease.

WSL Dev Sandbox Setup

Isolated WSL session that mounts only your current Windows folder — nothing else on your disk is visible or accessible. Goal: prevent WSL to see your c/d... drives and so on.

Run --dangerously-skip-permissions with ease!

Threat model:

  • wsl's home folder still open to anyone
  • drives NOT auto mounted
@lirrensi
lirrensi / KeepHDDAwake.ps1
Created February 13, 2026 03:25
Smol pwsh script that keeps your external enclosure HDDs spinning forever without sleep. Useful for loud drives and reduces mechanical wear if your controller is very agressive and puts to sleep every 5min or so. It pokes ALL drives, ssd are safe anyway, but all HDDs will wake!
# Drive Keep-Alive Script - WAKEY WAKEY ALL THE DRIVES
# Pokes every drive letter every X minutes so they dont fucking sleep!
Write-Host "🔄 Starting Drive Keep-Alive Monitor..." -ForegroundColor Cyan
Write-Host "Press Ctrl+C to stop`n" -ForegroundColor Yellow
function Get-AllDrives {
# Get all drive letters that are ready (mounted and accessible)
$drives = Get-PSDrive -PSProvider FileSystem | Where-Object {
$_.Used -ne $null -and $_.Free -ne $null
@lirrensi
lirrensi / shrink_wsl.ps1
Created February 13, 2026 03:20
PWSH script to shink overgrown WSL and reclaim disk space. Finds all containers and removes free space made by autogrow. Warning: may kill your wsl! Close first pls.
# WSL VHDX Shrink Script
# This fancy lil script will save ur precious space cause microslop geniuses forgot that auto-growing disks need periodic compaction.
$ErrorActionPreference = "Stop"
# Check if running as admin
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Write-Host "`n❌ Not running as Administrator. Come on, really?" -ForegroundColor Red
Write-Host "Right-click and 'Run as Administrator' like a normal person.`n" -ForegroundColor Yellow
@lirrensi
lirrensi / meta-manager.md
Created February 13, 2026 03:12
Opencode agent for managing opencode itself. Put into .config/opencode/agents.

description: MetaAgent - Manages OpenCode AI settings safely. Knows all internal paths, configs, permissions, tools and docs. Always proposes changes and asks for confirmation before editing anything. mode: primary temperature: 0.3 tools: read: true edit: true write: true bash: true glob: true