Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile

Patching the Dynamic Linker/Loader of a Compiled Binary using patchelf

Given a foreign binary on a Nix system, you have to patch its dynamic linker/loader.

First you need to find out what linker/loader to use.

You can do this by going into your nix repl and loading your desired nixpkgs.

Then you run:

@573
573 / Hyper-V GPU-PV with Linux guest.md
Created September 25, 2025 08:39 — forked from krzys-h/Hyper-V GPU-PV with Linux guest.md
Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Modern versions of Windows support GPU paravirtualization in Hyper-V with normal consumer graphics cards. This is used e.g. for graphics acceleration in Windows Sandbox, as well as WSLg. In some cases, it may be useful to create a normal VM with GPU acceleration using this feature, but this is not officially supported. People already figured out how to do it with Windows guests though, so why not do the same with Linux? It should be easy given that WSLg is open source and reasonably well documented, right?

Well... not quite. I managed to get it to run... but not well.

How to do it?

  1. Verify driver support
@573
573 / Cargo.toml
Created August 27, 2025 18:12 — forked from gsquire/Cargo.toml
Export your Pocket CSV to a NETSCAPE bookmark file that linkhut can import
[package]
name = "pocket2linkhut"
version = "0.1.0"
edition = "2024"
[dependencies]
anyhow = "1.0"
argh = "0.1"
csv = "1.3"
serde = { version = "1.0", features = ["derive"] }
@573
573 / .gitignore
Created August 24, 2025 07:58 — forked from wenkokke/.gitignore
Code to print out all voice commands in the knausj talon repository,
cheatsheet.tex
*.aux
*.fls
*.log
*.synctex.gz
*.fdb_latexmk
*.lot

A sensible NixOS Xfce Configuration

NixOS provides good support for the Xfce desktop environment out-of-the-box, but the defaults are minimal. The files in this Gist provide a more complete experience, including a suite of basic software and plugins as well as an optional home-manager configuration for theming.

The key additions to the default Xfce provided by NixOS are:

  • Complete bluetooth / audio support with panel indicators and apps
  • LightDM with theme
  • Extra Xfce apps for calendaring, disk partitioning, etc.
  • Various quality-of-life improving non-essentials
@573
573 / readme.md
Last active June 19, 2025 19:17
playlist m3u android

ls -1 | egrep '.*m4a' -o | sed -e "s/^'//" > out.m3u

@573
573 / .emacs
Created May 8, 2025 09:48 — forked from amygrinn/.emacs
Autoshare -> Tasker -> Termux -> Org Protocol -> Org Capture
;; Required setup for emacs init file
(package-initialize)
(require 'org)
(require 'org-protocol)
;; Set 'my-org-directory' to the base directory of all of
;; your org files (with a trailing slash). For me it's:
(setq my-org-directory "/scp:org:/home/orgmode/")
;; But it could be a local directory for you