Skip to content

Instantly share code, notes, and snippets.

@bunkbail
bunkbail / iso2img.sh
Last active February 1, 2026 20:25
Convert Windows ISO images into DD-able Linux .img images (Arch Linux)
#!/bin/bash
# ==============================================================================
# Windows ISO to IMG Converter (Production Version)
# Converts Windows ISOs to DD-able images for Ventoy/Rufus-style writing.
# Features: UDF Support (>4GB files), Non-Root, Scriptable Partitioning
# Dependencies: 7z, genisoimage (cdrkit), mtools, sfdisk, dd, truncate
# ==============================================================================
set -e
@bunkbail
bunkbail / Install.md
Created January 23, 2026 00:40
Complete tutorial for installing Chimera Linux with GNOME, Btrfs on NVMe, and Hibernation

Complete tutorial for installing Chimera Linux with GNOME, Btrfs on NVMe, and Hibernation (Swapfile).

Phase 1: Partitioning & Formatting

  1. Switch to Root:

    doas -s
  2. Partition the NVMe Drive:

@bunkbail
bunkbail / gist:162d503a4cb8f4fc72a9532cd6863499
Created January 10, 2026 13:11
compress png into highly compressed heic
for f in *.png; do
avifenc -q 65 -y 420 -a end-usage=q -a sharpness=0 -a aq-mode=2 -s 2 -j $(nproc) -d 12 -a film-grain-test=0 "$f" "${f%.*}.heic"
done
@bunkbail
bunkbail / force-exit.lua
Created December 9, 2025 11:09
Fix mpv hanging on exit with lsfg-vk on linux
local utils = require 'mp.utils'
mp.register_event("shutdown", function()
mp.msg.warn("Shutdown detected. Saving state and force killing...")
-- 1. Manually force mpv to save the "watch later" position immediately.
mp.command("write-watch-later-config")
-- 2. Get the PID
local pid = mp.get_property("pid")
@bunkbail
bunkbail / template.py
Last active February 3, 2026 20:55
cports/main/linux-cachyos-bin/template.py
pkgname = "linux-cachyos-bin"
pkgver = "6.18.1"
pkgrel = 0 # APK pkgrel
_src_rel = "2" # Arch Linux pkgrel
archs = ["x86_64"]
pkgdesc = "CachyOS kernel repackaged from Arch Linux"
url = "https://cachyos.org"
license = "GPL-2.0-only"
options = ["!check", "!debug", "!strip", "!scanshlibs", "!scanrundeps", "!lto", "textrels", "execstack", "foreignelf"]
@bunkbail
bunkbail / cfl-lite.glsl
Last active February 18, 2026 03:01
CFL-Lite v1.2: A highly optimized Chroma From Luma Upscaler
// CFL-Lite v1.2 - A highly optimized Chroma From Luma Upscaler
// Author: bunkbail
// License: MIT
//
// An adaptive chroma upscaling shader that reconstructs high-resolution color
// information from high-resolution luma using local linear regression.
//
// Features:
// - Linear regression-based chroma prediction
// - Static ridge regularization optimized for SDR and HDR
@bunkbail
bunkbail / FSR-Lite.glsl
Last active February 17, 2026 21:40
FSR-Lite v1.2: A highly optimized, single-pass implementation of AMD FidelityFX Super Resolution
// FSR-Lite v1.2
//
// A highly optimized, single-pass implementation of AMD FidelityFX Super Resolution.
// Optimized and Tuned by bunkbail
// Based on the mpv port by agyild and original code by AMD
//
// --- ARCHITECTURE OVERVIEW ---
// FSR-Lite is a custom evolution of FSR 1.0 designed specifically for video playback.
// It achieves high performance by replacing the standard RCAS pass with a logic-driven
// "Hybrid" architecture and utilizing a conditional memory strategy.
#!/bin/bash
mkdir -p temp upscaled
for video in original/*.mkv; do
filename=$(basename "$video" .mkv)
mkdir -p temp/split
mkdir -p temp/processed
#!/bin/bash
# Download the GPG key and add it to the keyring
wget -qO - https://github.com/bunkbail/pika-sources/raw/refs/heads/main/pika-keyring.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/pika-keyring.gpg
# Download the sources list
sudo wget -qO /etc/apt/sources.list.d/pika.sources https://github.com/bunkbail/pika-sources/raw/refs/heads/main/system.sources
# Download the APT preferences settings
sudo wget -qO /etc/apt/preferences.d/0-pika-apt-settings https://github.com/bunkbail/pika-sources/raw/refs/heads/main/0-pika-apt-settings
steam.sh[19675]: Running Steam on devuan 6 64-bit
steam.sh[19675]: STEAM_RUNTIME is enabled automatically
setup.sh[19744]: Steam runtime environment up-to-date!
steam.sh[19675]: Steam client's requirements are satisfied
tid(19805) burning pthread_key_t == 0 so we never use it
[2024-05-05 08:56:02] Startup - updater built Mar 6 2024 20:27:25
[2024-05-05 08:56:02] Startup - Steam Client launched with: '/home/bunkbail/.steam/debian-installation/ubuntu12_32/steam' '-nominidumps' '-nobreakpad'
minidumps folder is set to /tmp/dumps
05/05 08:56:02 Init: Installing breakpad exception handler for appid(steam)/version(1709846872)/tid(19805)
[2024-05-05 08:56:02] Loading cached metrics from disk (/home/bunkbail/.steam/debian-installation/package/steam_client_metrics.bin)