Skip to content

Instantly share code, notes, and snippets.

View litui's full-sized avatar

Litui litui

View GitHub Profile
@litui
litui / S02-combined-sinks.conf
Created April 28, 2026 20:43
Merging of two stereo sinks to a reversible 4.0 surround setup and mirrored stereo setups in pipewire
# Thrown in ~/.config/pipewire/pipewire.conf.d
context.modules = [
{ name = libpipewire-module-combine-stream
args = {
combine.mode = sink
node.name = "combine_sink_4_0_desk"
node.description = "Pink Room Audio - Desk Surround"
combine.latency-compensate = false
combine.props = {
@litui
litui / pool-dns-config.tf
Last active March 25, 2026 06:41
Working pattern for MutatingAdmissionPolicy to adjust pod dnsConfig based on Cilium multi-pool pool.
# Required kube-apiserver params as of 2026-03-24. Requires Kubernetes v1.34.
# --feature-gates=MutatingAdmissionPolicy=true
# --runtime-config=admissionregistration.k8s.io/v1beta1=true
# I found there was minimal documentation out there on how to use this properly for configuration
# (not specifically adding a sidecar) so here's some connecting the dots and a working example.
# It took me some trial and error to get here.
#
# Kubernetes references:
# - https://kubernetes.io/docs/reference/access-authn-authz/mutating-admission-policy/
@litui
litui / k8s-gamerun.sh
Last active January 23, 2026 04:46
Steam game launch script to scale down GPU-intensive kubernetes pods before starting a game (with bonus static launch options).
#!/bin/bash
# A steam game launch script for those of us who are gamers but also run k8s clusters with GPU hogging containers on our systems.
# Add this as a launch option in steam, eg: "k8s-gamemode.sh %command%" and it will reduce your replica counts on chosen deployment
# specs to 0, and will restore them after the game exits.
#
# If you have multiple systems with GPUs and plenty of VRAM you can just do the "kubectl cordon" and "kubectl drain ..."
# thing on your node instead. This script assumes you have limited resources and no need to keep the pods up while you're gaming.
#
# Requires you have kubectl installed and set up with default credentials, and the jq utility installed.
@litui
litui / gw5a_7seg_count.py
Last active October 6, 2025 03:03
Torii-based 7seg example for Tang Primer 25K FPGA board
#!/usr/bin/env python3
# Example from https://github.com/icebreaker-fpga/icebreaker-amaranth-examples/blob/master/icebreaker/7seg_count/7seg_count.py
from torii.hdl import Elaboratable, Module, Signal, Cat
from torii.build import Resource, Subsignal, PinsN, Attrs
from torii_boards.gowin.gw5a import TangPrimer25kDockPlatform
seven_seg_pmod = [
Resource(
@litui
litui / gsg-multitwitch.js
Last active July 27, 2025 00:48
GSG Multitwitch Tampermonkey Script
// ==UserScript==
// @name Dynamic GSG Multitwitch v1.1.0
// @namespace https://gsg.live
// @version 2025-07-26
// @description Try to dynamically add/remove streams from multitwitch
// @author Aria Burrell <litui@litui.ca>
// @match https://www.multitwitch.tv/*
// @icon https://gsg.live/favicon.ico
// @run-at document-idle
// @grant GM_xmlhttpRequest
@litui
litui / stf.js
Last active July 24, 2025 21:52
Streamer Text Filtering Tampermonkey Script
// ==UserScript==
// @name Streamer Text Filtering
// @namespace https://litui.net
// @version 2025-07-23
// @description not perfect, but this aims to keep streamers safer by filtering out specific regular expressions
// @author Aria Burrell <litui@litui.ca>
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=undefined.ai
// @grant unsafeWindow
// @run-at document-start
@litui
litui / realtime.cfg
Last active March 21, 2025 16:51
grub.d file for kernel performance tweaks (multimedia/gaming)
# Kernel tweaks for multimedia/gaming performance (borrowed from ubuntustudio packages)
# Only bother using this if "uname -ra" shows PREEMPT_DYNAMIC in its result
# In ubuntu and debian this option is now in the generic kernel.
# Place this file in /etc/default/grub.d then run update-grub as root
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT preempt=full threadirqs"
# For more detail on the preempt=full option see:
# - https://discourse.ubuntu.com/t/ubuntu-24-04-boosts-gaming-performance/45721/9
@litui
litui / refreshTV.sh
Last active March 17, 2025 17:22
Script to detect LG CX OLED TV on/off status using i2c and change wayland dpms status accordingly
#/bin/bash
# Running this script using `systemctl --user` and a simple systemd script.
tv_on=0
while :
do
plasmashell_proc=$(ps ux | grep plasmashell | grep -v grep | head -n 1 | sed -E 's/^[A-Za-z0-9\-\_]+\ +([0-9]+).*$/\1/')
XDG_RUNTIME_DIR=$(tr '\0' '\n' < "/proc/${plasmashell_proc}/environ" | grep XDG_RUNTIME_DIR | sed -E 's/^[^=]+=//')
@litui
litui / fireworks_deepseek_r1_pipeline.py
Created February 5, 2025 07:14
Open-WebUI pipeline script for DeepSeek-R1 as hosted at Together.AI
from typing import List, Union, Generator, Iterator
from pydantic import BaseModel
import requests
import os
class Pipeline:
class Valves(BaseModel):
# You can add your custom valves here.
FIREWORKS_DEEPSEEKR1_API_KEY: str
@litui
litui / together_deepseek_r1_pipeline.py
Created February 5, 2025 06:57
Open-WebUI pipeline script for DeepSeek-R1 as hosted at Together.AI
from typing import List, Union, Generator, Iterator
from pydantic import BaseModel
import requests
import os
class Pipeline:
class Valves(BaseModel):
# You can add your custom valves here.
TOGETHER_DEEPSEEKR1_API_KEY: str