Skip to content

Instantly share code, notes, and snippets.

@valpackett
valpackett / simpledrm-mtk-atags.patch
Created December 29, 2024 06:09
simpledrm hack to parse ATAGS for dynamic fb address
diff --git i/drivers/gpu/drm/tiny/simpledrm.c w/drivers/gpu/drm/tiny/simpledrm.c
index 5d9ab8adf8005..78f0b4b8d3df6 100644
--- i/drivers/gpu/drm/tiny/simpledrm.c
+++ w/drivers/gpu/drm/tiny/simpledrm.c
@@ -3,6 +3,7 @@
#include <linux/aperture.h>
#include <linux/clk.h>
#include <linux/of_clk.h>
+#include <linux/of_fdt.h>
#include <linux/minmax.h>
@valpackett
valpackett / flatpak-rpi-ffmpeg.patch
Created December 31, 2025 23:15
freedesktop-sdk rpi-ffmpeg patch on top of 9673d931e0bbd4
diff --git a/elements/include/ffmpeg.yml b/elements/include/ffmpeg.yml
index 5d4983fea5..626c7e7f94 100644
--- a/elements/include/ffmpeg.yml
+++ b/elements/include/ffmpeg.yml
@@ -11,6 +11,7 @@
- components/fribidi.bst
- components/lame.bst
- components/libjxl.bst
+- components/libdrm.bst
- components/libva.bst
@valpackett
valpackett / README.md
Last active November 14, 2025 01:23
enable-aspm.sh with args (PCIe ASPM toggle per device)

This script allows toggling ASPM at runtime per bus via raw PCI config writes.

Example for Snapdragon X series:

doas enable-aspm.sh 0006:00:00.0 0006:01:00.0 0 # SSD ASPM OFF
doas enable-aspm.sh 0006:00:00.0 0006:01:00.0 2 # SSD ASPM ON
doas enable-aspm.sh 0004:00:00.0 0004:01:00.0 0 # WiFi ASPM OFF
doas enable-aspm.sh 0004:00:00.0 0004:01:00.0 2 # WiFi ASPM ON
@valpackett
valpackett / LICENSE.md
Created November 10, 2011 17:48
Evernote-Marked integration
       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
               Version 2, December 2004

Copyright (C) 2011 Grigory V. floatboth@me.com

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

@valpackett
valpackett / .config
Created January 7, 2025 00:40
mt8167 mainline dev .config for reference
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 6.13.0-rc3 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="clang version 19.1.6"
CONFIG_GCC_VERSION=0
CONFIG_CC_IS_CLANG=y
CONFIG_CLANG_VERSION=190106
CONFIG_AS_IS_LLVM=y
CONFIG_AS_VERSION=190106
@valpackett
valpackett / out.txt
Created October 17, 2024 21:01
Versioned struct generation in Zig
$ zig test versioned_structs.zig ^0^ 17:58
v1:
field 0 is data_len type is i32
field 1 is data_ptr type is *const u8
example value: ver.MakeStruct(.{ .{ ... }, .{ ... }, .{ ... } },1){ .data_len = 420, .data_ptr = u8@deadbeef }
v69:
field 0 is data_len type is i32
@valpackett
valpackett / Alfred-Pinboard-INSTANT.md
Last active September 7, 2023 21:01
INSTANT Pinboard search from Alfred 2

INSTANT Pinboard search from Alfred 2

I've had a Python script that makes an HTML Bookmarks file for LaunchBar.
Now that I use Alfred 2, I modified it to make XML for Alfred.
This allows me to search my bookmarks with GREP SPEED!

Installation

First, add your token (from pinboard.in/settings/password) to ~/.netrc

@valpackett
valpackett / reaperdemo.c
Created March 23, 2023 05:28
FreeBSD reaper API demo
#include <sys/procctl.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sysexits.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <signal.h>
@valpackett
valpackett / global-input-unstable-v1.xml
Last active November 20, 2022 18:40
global-input wayland protocol DRAFT PREVIEW
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="global_input_v1">
<copyright>
Copyright (C) 2017 Val Packett (val@packett.cool)
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@valpackett
valpackett / thread.log
Created November 9, 2020 21:38
Thread ID testing on FreeBSD
% cc -pthread -o /tmp/tid tids.c && truss /tmp/tid
[…]
__sysctl("vm.overcommit",2,0x7fffffffa314,0x7fffffffa308,0x0,0) = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34374418432 (0x800e00000)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(12),-1,0x0) = 34410536960 (0x803072000)
mmap(0x0,4194304,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON|MAP_ALIGNED(21),-1,0x0) = 34422652928 (0x803c00000)
__sysctl("kern.usrstack",2,0x800ac8108,0x7fffffffc228,0x0,0) = 0 (0x0)
getrlimit(RLIMIT_STACK,{ cur=536870912,max=536870912 }) = 0 (0x0)
thr_self(0x803084000) = 0 (0x0)
mmap(0x7fffdfffd000,4096,PROT_NONE,MAP_ANON,-1,0x0) = 140736951472128 (0x7fffdfffd000)