Skip to content

Instantly share code, notes, and snippets.

@radupotop
radupotop / libfix_strix_cwsr.so
Created October 1, 2026 01:22 — forked from birep/libfix_strix_cwsr.so
Fix for gfx1151 (Strix Halo) ROCm "out of memory" abort on hipStreamCreate
/*
* Fix for gfx1151 (Strix Halo) ROCm "out of memory" abort on hipStreamCreate:
*
* Issue: amdkfd enforces ctx_save_restore_area_size >= topo cwsr_size (0x124c000 / 19.2 MB).
* hsakmt hardcodes 0xd4c000 (13.9 MB), causing AMDKFD_IOC_CREATE_QUEUE to return -EINVAL,
* which ROCr surfaces to HIP as hipErrorOutOfMemory.
*
* Solution: Intercept mmap/ioctl to expand CWSR buffer sizes to match kernel requirements.
*
* Build: gcc -shared -fPIC -O3 fix_strix_cwsr.c -o libfix_strix_cwsr.so -ldl
@radupotop
radupotop / PKGBUILD
Created September 14, 2026 13:38
zfs-utils=2.4.4-3
# Maintainer: Jan Houben <jan@nexttrex.de>
# Contributor: Jesus Alvarez <jeezusjr at gmail dot com>
#
# This PKGBUILD was generated by the archzfs build scripts located at
#
# http://github.com/archzfs/archzfs
#
pkgbase="zfs-utils"
pkgname=("zfs-utils" "zfs-tests")
@radupotop
radupotop / display-setup.sh
Created September 3, 2026 10:56
LightDM display-setup script
#!/bin/bash
# Get list of connected monitors
connected_monitors=$(xrandr --query | grep " connected" | cut -d ' ' -f 1)
echo "Discovered monitors:" $connected_monitors
# Iterate through connected monitors
first=true
for monitor in $connected_monitors; do
if $first; then
Jul 22 06:11:01 ArchLinux systemd-logind[1266]: suspend requested from client PID 2947 ('xfce4-power-man') (unit session-2.scope)...
Jul 22 06:11:01 ArchLinux systemd-logind[1266]: The system will suspend now!
Jul 22 06:11:01 ArchLinux ModemManager[1324]: <msg> [sleep-monitor-systemd] system is about to suspend
Jul 22 06:11:01 ArchLinux NetworkManager[1339]: <info> [1784697061.4425] manager: sleep: sleep requested (sleeping: no enabled: yes)
Jul 22 06:11:01 ArchLinux ModemManager[1324]: <msg> [sleep-monitor-systemd] ready to sleep; dropping inhibitor
Jul 22 06:11:01 ArchLinux NetworkManager[1339]: <info> [1784697061.4428] device (wlan0): state change: unavailable -> unmanaged (reason 'unmanaged-nm-disabled', managed-type: 'full')
Jul 22 06:11:01 ArchLinux NetworkManager[1339]: <info> [1784697061.4431] manager: NetworkManager state is now DISABLED (ASLEEP)
Jul 22 06:11:01 ArchLinux NetworkManager[1339]: <info> [1784697061.4432] device (eno1): state change: activated -> deactivating (reason 'sleeping', man
from __future__ import annotations
import heapq
import itertools
from dataclasses import dataclass
from datetime import datetime
from typing import TypeAlias
@dataclass(frozen=True)
@radupotop
radupotop / 01-harden.conf
Created September 20, 2025 19:21
Jellyfin Systemd hardening override files
[Service]
# Prevent gaining extra privileges or executing setuid binaries.
NoNewPrivileges=yes
# Separate /tmp and /var/tmp
PrivateTmp=yes
# Make most of the filesystem read-only; whitelist writable paths below.
ProtectSystem=strict
# https://docs.astral.sh/ruff/settings/
#
# extend = "../pyproject.toml"
line-length = 90
[lint]
select = ["E", "F"] # Pyflakes and pycodestyle
ignore = ["E501"] # Allow long lines
unfixable = ["F401"] # Allow unused imports
@radupotop
radupotop / settings.json
Last active July 28, 2025 17:39
Zed settings.json (JSONC)
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"icon_theme": "Material Icon Theme",
@radupotop
radupotop / newone.json
Created July 28, 2025 17:36
New One Zed theme
{
"name": "New One",
"author": "Zed Industries",
"themes": [
{
"name": "New One",
"appearance": "dark",
"style": {
"border": "#464b57ff",
"border.variant": "#363c46ff",
# File: /etc/systemd/system/x86_energy_perf_policy@.service
#
# Valid arg values are: performance, balance-performance, normal, balance-power, power
#
[Unit]
Description=Set x86_energy_perf_policy %i
[Service]
Type=oneshot