Skip to content

Instantly share code, notes, and snippets.

View kode54's full-sized avatar

Christopher Snowhill kode54

View GitHub Profile
@kode54
kode54 / 0000-README.md
Last active May 30, 2023 15:56
Xe KMD uAPI adjustments

These are minimal adjustments to the current uAPI, as inspired by Maarten Lankhorst and his process of running the headers through pahole. But instead, I adjusted them manually, making minimal changes so that the 64-bit uarch would result in the same alignment, so existing userspace software with the previous header will still work. The only difference is that 32-bit userspace software needs the new header, to continue working with the kernel.

I've split it into two patches, like was suggested to @mlankhorst, one with the uAPI header, and one with the validation code.

Edited 2023-05-12 20:42 PDT: Updated against latest rebase.

@kode54
kode54 / 43.4.patch
Created April 19, 2023 16:03
Mutter VRR patch, rebased against mutter 43.4
From 596f396f62ab834845fe1253ebb677866f9a6b23 Mon Sep 17 00:00:00 2001
From: Dor Askayo <[email protected]>
Date: Sun, 16 Aug 2020 17:14:03 +0300
Subject: [PATCH 02/25] surface-actor: Add "frozen" signal
This signal is emitted when the surface actor is frozen and will not
update until it is thawed.
---
src/compositor/meta-surface-actor.c | 11 +++++++++++
1 file changed, 11 insertions(+)
@kode54
kode54 / vmbind.patch
Created April 19, 2023 09:38
PATCH v10 of the Intel Graphics VM_BIND set, rebased against drm-tip from 2023-04-19
From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path: <[email protected]>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by smtp.lore.kernel.org (Postfix) with ESMTPS id 1175EC32793
for <[email protected]>; Wed, 18 Jan 2023 07:16:20 +0000 (UTC)
Received: from gabe.freedesktop.org (localhost [127.0.0.1])
@kode54
kode54 / obs-recording-toggle.py
Created March 18, 2023 00:19
OBS Recording Toggle, based on obs-wayland-shortcuts, but using obs-cli and not obs-cli-leafac.
#!/usr/bin/env python3
# Original Author: Andrew Shark
# Homepage: https://gitlab.com/AndrewShark/obs-wayland-shortcuts
# License: GPLv3
# Modified By: Christopher Snowhill
# This script is made for convenience. It is invoked by a logid gesture for MX Master mouse.
@kode54
kode54 / swapinfo.sh
Created October 6, 2022 01:16
Swap Info script for bash, not originally mine
#!/bin/bash
overall=0
outlist=""
for status_file in /proc/[0-9]*/status; do
swap_mem=$(grep VmSwap "$status_file" | awk '{ print $2 }')
if [ "$swap_mem" ] && [ "$swap_mem" -gt 0 ]; then
pid=$(grep Tgid "$status_file" | awk '{ print $2 }')
name=$(grep Name "$status_file" | awk '{ print $2 }')
printf -v output "%s\t%s\t%s KB\n" "$pid" "$name" "$swap_mem"
@kode54
kode54 / hapost.txt
Created September 1, 2022 05:21
Public Hydrogen Audio post
I have been told several times that "what happens on IRC, stays on IRC", and that
sort of attitude is quite annoying to deal with, because then people can be jackasses
on IRC and mostly put on a facade of acceptable behavior on web forums and web sites.
I already left the private alpha foobar2000 chat because Peter thought it was
appropriate to refer to a telemarketer who rang him up at 5:30am as the n-word.
I was contacted by an old acquaintance recently about getting up to speed on foobar2000
components and rejoining the community, and was fed a lengthy diatribe about how great
a developer I am, and how someone of lower stance as him is able to develop an app that
@kode54
kode54 / PVE_manager_nvme.patch
Last active July 21, 2022 05:25
Proxmox Qemu backend support for virtual NVMe drives
diff -u js/pvemanagerlib.js.orig js/pvemanagerlib.js
--- js/pvemanagerlib.js.orig 2022-07-20 21:34:00.523128985 -0700
+++ js/pvemanagerlib.js 2022-07-20 21:38:14.110192280 -0700
@@ -1388,7 +1388,7 @@
toolkit: undefined, // (extjs|touch), set inside Toolkit.js
- bus_match: /^(ide|sata|virtio|scsi)(\d+)$/,
+ bus_match: /^(ide|sata|virtio|scsi|nvme)(\d+)$/,
@kode54
kode54 / luci.upnp
Last active June 13, 2022 12:23
OpenWrt miniupnp rpcd handler, updated for nftables
#!/usr/bin/env lua
local json = require "luci.jsonc"
local UCI = require "luci.model.uci"
local fs = require "nixio.fs"
local sys = require "luci.sys"
local methods = {
get_status = {
call = function()
@kode54
kode54 / r8bbenchdsd.cpp
Created March 5, 2022 03:59
Bit o' R8Brain benchmarking of DSD downsampling
#include <stdint.h>
#include "r8bstate.h"
// In my quick benchmarks on Apple Silicon, this decimator makes the following code about 40% faster
#define DSD_DECIMATOR 1
#ifdef DSD_DECIMATOR
/**
import Cocoa
let encodings = String.availableStringEncodings
print("NSStringEncoding, CFStringEncoding, encodingName, IANAName")
for encoding in encodings {
let encodingName = String.localizedName(of: encoding)
let cfEncoding = CFStringConvertNSStringEncodingToEncoding(encoding.rawValue)
let ianaName = CFStringConvertEncodingToIANACharSetName(cfEncoding) as String? ?? "???"
debugPrint(encoding.rawValue, cfEncoding, encodingName, ianaName, separator: ", ")
}