Skip to content

Instantly share code, notes, and snippets.

View kwilczynski's full-sized avatar
🍀

Krzysztof Wilczyński kwilczynski

🍀
View GitHub Profile
@hjanuschka
hjanuschka / 9002-platform-x86-amd-pmc-ms-s1-max-lps0-quirk.patch
Last active October 8, 2026 22:27
amd_pmc: skip LPS0 handler on MINISFORUM MS-S1 MAX (firmware only implements Microsoft LPS0 _DSM via SMI; OS_HINT hangs s2idle)
From: Helmut Januschka <helmut@januschka.com>
Subject: [PATCH] platform/x86/amd/pmc: firmware-handled LPS0 quirk for MINISFORUM MS-S1 MAX
The MINISFORUM MS-S1 MAX (SHWSA, Strix Halo) ships firmware whose LPS0
PEP device only implements the Microsoft _DSM UUID; its entry/exit
functions trap into SMM (port 0xB2, 0xEA/0xEB) and perform the platform
sleep handshake there. The AMD _DSM UUID advertises no entry/exit
functions at all (function mask 0x3).
When amd_pmc additionally sends OS_HINT, s2idle never resumes: with both
@kwilczynski
kwilczynski / output.txt
Last active June 2, 2026 14:27
System Sensors Summary on B850 based motherboard
System Sensors Summary
CPU (AMD Ryzen)
──────────────────────────────────────────────────
Tctl: 47.6°C
CCD1: 39.6°C
CCD2: 37.6°C
Motherboard (ASUS)
──────────────────────────────────────────────────
@danielrosehill
danielrosehill / amd-gpu-linux-troubleshooting-guide.md
Created November 23, 2025 16:08
A Dummy's Guide to AMD GPU Issues on Linux - Understanding RDNA3, TLB Fences, and Kernel Parameters
@artemgetmann
artemgetmann / claude-code-token-saving-guide.md
Last active September 25, 2026 00:29
Practical workflow for reducing token usage in Claude Code while preserving session continuity. Includes compacting strategies, CLAUDE.md structure, modular context management, and prompt engineering tips.

🧠 How to Save Context Tokens When Using Claude Code

This is a personal reference workflow for minimizing token usage while maintaining project continuity across Claude Code (Sonnet 4 with file access).


✅ Setup: Populate CLAUDE.md

Claude loads CLAUDE.md automatically at session start.

@kwilczynski
kwilczynski / trailers.txt
Last active March 26, 2025 06:15
Linux kernel tag (trailers) order
* PCI legacy (from https://lore.kernel.org/all/20171026223701.GA25649@bhelgaas-glaptop.roam.corp.google.com):
Fixes:
Closes: (link or Message-ID]
Suggested-by:
Link:
Reported-by:
Tested-by:
Co-developed-by: (co-author)
Signed-off-by: (co-author)
@kwilczynski
kwilczynski / script.sh
Last active June 24, 2024 00:49
Build ccache
cd ./ccache/build
make clean
export PATH='/usr/local/bin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
ccmake -DDEPS=DOWNLOAD -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF -DREDIS_STORAGE_BACKEND=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc ..
make -j$(nproc)
make DESTDIR='/tmp/ccache' PREFIX='/usr' install
@kwilczynski
kwilczynski / Makefile
Created February 20, 2024 11:19
Simple Linux kernel module to toggle running process state between "D" (uninterruptible) and interruptible
ccflags-y := -DDEBUG -Wfatal-errors
ifneq ($(KERNELRELEASE),)
obj-m += state-toggle.o
else
BUILD_KERNEL ?= /lib/modules/$(shell uname -r)/build
default:
$(MAKE) -C $(BUILD_KERNEL) M=$(CURDIR) modules
endif
@xuxucode
xuxucode / apparmor-docker-default.js
Last active December 8, 2025 01:29
Get latest `docker-default` AppArmor profile by parsing template.go
// Usage: node apparmor-docker-default.js
const path = require("node:path");
const fs = require("node:fs");
const profileDirectory = "/etc/apparmor.d"
/**
* @typedef ProfileData
* @property {string} name
@aojea
aojea / README.md
Last active March 1, 2026 21:52
Kubernetes DNS: Headless services with large number of endpoints

Kubernetes DNS at scale

It seems that is a common practice in HPC and AI/ML environments that use MPI applications to populate a hosts files with all the nodes on the cluster and copy it over all the nodes, ref https://help.ubuntu.com/community/MpichCluster

It is my observation that in Kubernetes, Headless Services are used to implement this Service Discovery This is very handy because it allows to reference a pod by hostname without having to copy over a generace /etc/hosts.

There must also be an A record of the following form for each ready endpoint with hostname of and IPv4 address . If there are multiple IPv4 addresses for a given hostname, then there must be one such A record returned for each IP.

@aojea
aojea / daemonset.yaml
Created December 3, 2023 16:18
Daemonset to reconcile nodes ethtool configuration
# See for more options https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-ethtool
namespace: kube-system
labels:
k8s-app: node-ethtool-config
spec:
selector: