Skip to content

Instantly share code, notes, and snippets.

View noblepayne's full-sized avatar
🎙️

Wes Payne noblepayne

🎙️
View GitHub Profile
@noblepayne
noblepayne / netalertx.nix
Created January 4, 2026 05:30
NixOS OCI Config for NetAlertX
{
config,
pkgs,
...
}: {
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
@noblepayne
noblepayne / devenv-dotenvx-devenv.nix
Created July 8, 2025 23:40
dotenvx + devenv tasks
{ pkgs, lib, config, inputs, ... }:
{
tasks = {
"myapp:task1" = {
exec = ''echo "{\"output\": \"$IN_THE_ENV\"}" > $DEVENV_TASK_OUTPUT_FILE'';
package = pkgs.writeShellApplication {
name = "dotenvx-run";
text = ''
exec ${pkgs.dotenvx}/bin/dotenvx run -o -- bash "$1"
@noblepayne
noblepayne / devenv-dotenv-flake.nix
Last active July 6, 2025 00:53
devenv: .env and dotenvx example flake
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
devenv.url = "github:cachix/devenv";
devenv.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
devenv,
@noblepayne
noblepayne / pmem_kexec.md
Created April 29, 2021 20:11
Notes on pmem and kexec.

PMEM and Kexec

Step 1

Step 1 is adding the memmap command line option to your kernel to reserve chunk of memory. e.g. memmap=20G!4G which reserves 20G of ram after/starting-at 4G.

You can do step 1 either on your existing install, or if you prefer, by modifying the cmdline of a live distro. Depending on distro you may need to install the pmem module? But fedora has it by default.

Step 2

Once booted (and modules loaded) you'll see a /dev/pmem0 you can use as a block device.

@noblepayne
noblepayne / linkedlist.py
Created May 26, 2020 00:44
Immutable Singly Linked List in Python
"""A clojure heathen's immutable linked list"""
## PRIVATE
class _LinkedList:
def __init__(self, data=None, nxt=None):
self.data = data
self.nxt = nxt
def add(self, data):
"""Prepend data to list, returning new list."""
@noblepayne
noblepayne / sesx.sh
Created January 28, 2019 06:00
Extract chapters from Audition files
function extract-chapters () {
xmllint --xpath '/sesx/session/xmpMetadata/text()' "$1" | \
grep -v '<?' | \
xq '."x:xmpmeta"."rdf:RDF"."rdf:Description"."xmpDM:Tracks"."rdf:Bag"."rdf:li"[0]."xmpDM:markers"."rdf:Seq"."rdf:li"[] | "\(.["xmpDM:name"]) \(.["xmpDM:startTime"])"'
}
@noblepayne
noblepayne / peano.clj
Last active March 12, 2018 08:00
peano naturals
(ns peano.nat
"A simple construction of the natural numbers."
(:refer-clojure :exclude [zero?]))
;; A natural number. All natural numbers have a predecessor (except zero).
(defrecord Nat [pred])
(defn succ
"Given a natural number, return its successor."
[n]