
Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
A NixOS configuration for a working sound driver on an A1418 Cirrus Logic CS8409/CS42L83.
{ stdenv, lib, fetchgit, linuxKernel, kernel ? linuxKernel.kernels.linux_5_15
, version ? "d0d785dc1859b09299bde6d0f1d6786a0d610e7f" }:
stdenv.mkDerivation {
inherit version;
name = "sna-hda-codec-cs8409-${version}-module-${kernel.modDirVersion}";
# Upstream: https://github.com/davidjo/snd_hda_macbookpro
src = fetchgit {
url = "https://github.com/egorenar/snd-hda-codec-cs8409.git";
rev = version;
sha256 = "sha256-0UeoERcYpM+ojeZ7dDIE3ruTIoHkkC+s7FcoEVUTR0w=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
NIX_CFLAGS_COMPILE = [ "-g" "-Wall" "-Wno-unused-variable" "-Wno-unused-function" ];
makeFlags = kernel.makeFlags ++ [
"INSTALL_MOD_PATH=$(out)"
"KERNELRELEASE=${kernel.modDirVersion}"
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
postPatch = ''
printf '
snd-hda-codec-cs8409-objs := patch_cs8409.o patch_cs8409-tables.o
obj-$(CONFIG_SND_HDA_CODEC_CS8409) += snd-hda-codec-cs8409.o
KBUILD_EXTRA_CFLAGS = "-DAPPLE_PINSENSE_FIXUP -DAPPLE_CODECS -DCONFIG_SND_HDA_RECONFIG=1"
KERNELRELEASE ?= $(shell uname -r)
KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build
PWD := $(shell pwd)
default:
make -C $(KERNEL_DIR) M=$(PWD) CFLAGS_MODULE=$(KBUILD_EXTRA_CFLAGS)
install:
make -C $(KERNEL_DIR) M=$(PWD) modules_install
' \
> Makefile
sed --in-place 's|<sound/cs42l42.h>|"${linuxKernel.kernels.linux_6_0.dev}/lib/modules/${linuxKernel.kernels.linux_6_0.modDirVersion}/source/include/sound/cs42l42.h"|' patch_cs8409.h
sed --in-place 's|hda_local.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_local.h|' patch_cs8409.h
sed --in-place 's|hda_jack.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_jack.h|' patch_cs8409.h
sed --in-place 's|hda_generic.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_generic.h|' patch_cs8409.h
sed --in-place 's|hda_auto_parser.h|${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/sound/pci/hda/hda_auto_parser.h|' patch_cs8409.h
'';
meta = { platforms = lib.platforms.linux; };
}
Then build it as a extra/custom kernel module. The results of stumbling upon yet another troublesome device…
{ pkgs, ... }:
{
boot = {
extraModulePackages = [
(pkgs.callPackage ../packages/snd-hda-cs8409/default.nix {
kernel = pkgs.linux_5_15;
})
];
};
}

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
My default
nix
configuration on NixOS.
This configuration is more for building/debugging stuff and caching with
nix-serve
.
Usually my package version is locked since different
versions of
nix
can have some effects.
{ config, ... }:
{
nix = {
package = (import ../versions.nix).nix_2_12 { inherit config; };
settings = {
log-lines = 25; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-log-lines
fallback = true; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-fallback
tarball-ttl = 0; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-tarball-ttl
show-trace = true; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-show-trace
connect-timeout = 5; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-connect-timeout
auto-optimise-store = true; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-auto-optimise-store
narinfo-cache-negative-ttl = 0; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-narinfo-cache-negative-ttl
narinfo-cache-positive-ttl = 0; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-narinfo-cache-positive-ttl
builders-use-substitutes = true; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-builders-use-substitutes
min-free = 268435456; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-min-free (256 MB in Bytes)
max-free = 1073741824; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-max-free (1 GB in Bytes)
allowed-users = [ "root" "@wheel" ]; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-allowed-users
trusted-users = [ "root" "@wheel" ]; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-trusted-users
experimental-features = "nix-command flakes"; # https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-experimental-features
};
};
}

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
Chrome
--headless
can
dump the to the
command
line. Set a virtual time budget in
[?]
for the to settle down and then do stuff.
Html() {
chromium \
--headless \
--dump-dom \
--virtual-time-budget=999999 \
"$1"
}
HtmlToText() {
lynx -stdin -dump -nolist
}
This has “peculiar” uses. Fun fact: invoking the name of chromium around normal people confers alien–like status.
Html 'https://www.youtube.com/' | HtmlToText

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
WordPress has
an affinity for back–doored radioactivity.
If I can get my way (which is hard), a WordPress install has only 1
theme and
0
plugins.
wordpress/
|-- public
`-- wp-config.php
/* Disable installing plugins and themes */
define('DISALLOW_FILE_MODS', true);

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
My puppeteer scripts now use deno.
No more need for npm in my personal stack! spawnSync
+
which
returns the local browser’s path.
import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";
const chrome = "firefox"; /* Browser Chrome: "firefox" | "chromium" | "google-chrome" | ... */
const product = "firefox"; /* Product Base: "firefox" | "chrome" */
const { status, stdout, stderr } = Deno.spawnSync("which", {
args: [ chrome, ],
});
const executablePath = new TextDecoder().decode(stdout).trim();
const browser = await puppeteer.launch({
headless: false,
executablePath: executablePath,
product: product,
});
const page = await browser.newPage();
await page.setViewport({ width: 1024, height: 768, });
const sites = [ "example.com", ];
for (const site of sites) {
await page.goto("http://" + site);
await page.screenshot({ path: site + ".png" });
}
await browser.close();
deno run --allow-all --unstable main.ts

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
Web servers can be spun up quickly on the command line but with gotchas.
Take the innocent web server .
php -S 127.0.0.1:8080
Best not to use PHP
’s web server cli
(even for PHP) because routes with a
dot (.) are assumed to be
static files. Use a real web server
or superior cli
web servers with minor gotchas.
python -m http.server --bind 127.0.0.1 8080
busybox httpd -f -p 127.0.0.1:8080
ruby -run -e httpd . -p 8080

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
Hugo has
template performance metrics
with the --templateMetrics
flag. Here’s a snippet of the metrics for this
site.
$ hugo --templateMetrics
Start building sites …
hugo v0.101.0+extended linux/amd64 BuildDate=unknown
Template Metrics:
cumulative average maximum
duration duration duration count template
---------- -------- -------- ----- --------
7.278303484s 49.177726ms 237.175705ms 148 partials/generate-feeds.html
7.22797312s 112.93708ms 246.988674ms 64 _default/single.html
6.982028147s 83.119382ms 245.262274ms 84 partials/navigator-right.html
6.683942678s 47.070018ms 237.223569ms 142 partials/web-ring.html
1.685089741s 5.561352ms 28.254398ms 303 _default/summary.html

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
One way to remove multi–page transition jank is to force a permanent scrollbar.
Are there any kindred spirits? Yes — there’s
a kindred spirit. Overflows
may disable descending position: sticky
behavior. Avoid that problem with
other
jank removal techniques.
html {
overflow-y: scroll;
}
body {
overflow-y: scroll;
}

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.

Another wandering soul screaming into the void. If you are looking for my blog you are in the wrong place. The profile and header pictures are brought to you by @cdd20.
Whenever I’m handcrafting , content selection rules are usually the first declarations on my sheet. Might as well ensure user selected text is readable. Easiest win for accessibility.
::selection {
color: #fff;
background-color: #000;
}
::-webkit-selection {
color: #fff;
background-color: #000;
}
::-moz-selection {
color: #fff;
background-color: #000;
}