Skip to content

Instantly share code, notes, and snippets.

View agoose77's full-sized avatar
🏠
Working from home

Angus Hollands agoose77

🏠
Working from home
View GitHub Profile
@agoose77
agoose77 / gist:f26d9445a3a698fec1a66b140ed260d4
Last active October 8, 2026 10:11
Things I've learned about Module Federation and React
- Rspack / webpack produce `var` bundles, `@module-federation/vite` supports module bundles
- Suspense can block for SSR if the server entrypoint uses the proper streaming utility / event source
- `@module-federation/vite` only initialises the global MF instance in the browser, not SSR
- With SSR, MF components can be pre-loaded and only async hydrated
@agoose77
agoose77 / README.md
Last active October 1, 2026 22:12
A demonstration of decrypting secrets in a repo2docker context

See https://github.com/agoose77/binder-secrets-demo

This spike runs an egress command (cp) inside the built R2D container inside an init container. A secondary init container runs sops to decrypt this secret. Finally, we mount the decrypted secret into the actual notebook container.

This is safer than simply invoking sops in notebook container, because the private sops key is never exposed to the user code.

@agoose77
agoose77 / main.md
Last active September 21, 2026 09:20

Frontier Physics Paper

Statement

$$ \ds{f}{t}=0 $$

Proof

import * as fsp from "node:fs/promises";
import * as path from "node:path";
import { createRequestHandler } from "react-router";
import * as build from "virtual:react-router/server-build";
const MAGIC_BASE_URL = build.basename;
const TRUE_BASE_URL = process.env.BASE_URL ?? "/";
const PRERENDER_PATHS = [`${MAGIC_BASE_URL}`, `${MAGIC_BASE_URL}parent/about/`];
@agoose77
agoose77 / 998-fix-wifi-roaming.patch
Last active September 19, 2026 15:47
Build an OpenWRT image with kernel-patches from a release
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 6dfc61a9a..76291c489 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -511,7 +511,15 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
key->conf.flags |= IEEE80211_KEY_FLAG_NO_AUTO_TX;
if (mac_addr) {
+ bool defer_hw_upload;
+
@agoose77
agoose77 / find-nodegroup-ami.sh
Last active August 7, 2026 21:45
Find the AMI details for a deployed managed nodegroup on AWS
#!/usr/bin/env bash
: "${nodegroup:?Need nodegroup}"
: "${region:?Need region}"
: "${cluster:?Need cluster}"
# Get the autoscaling group name from the EKS node pool
autoscaling_group_name=$(aws --region "${region}" eks describe-nodegroup --cluster-name "${cluster}" --nodegroup-name "${nodegroup}" --output json | jq '.nodegroup.resources.autoScalingGroups | last | .name' -r)
# Determine the ASG launch template for this ASG
launch_template_name=$(aws --region "${region}" autoscaling describe-auto-scaling-groups --auto-scaling-group-names "${autoscaling_group_name}" | jq '.AutoScalingGroups | last | .MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName' -r )
# Now query the image ID for that template
@agoose77
agoose77 / controller.py
Created July 28, 2026 12:51
Deployment controller
#!/usr/bin/env python
import argparse
from kubernetes import client, config
from kubernetes.client.exceptions import NotFoundException
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("replicas", type=int)
parser.add_argument("--deployment", default="node-placeholder")
import argparse
import collections
import csv
import escapism
import string
import sys
def escape_email(email):
return escapism.escape(email, safe=safe_chars, escape_char="-").lower()
@agoose77
agoose77 / flake.nix
Created June 3, 2026 10:48
Docker image in Flake
{
description = "nbgitpuller";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = {
self,
nixpkgs,
xterm_colors = [
# colors 0..15: 16 basic colors
(0x00, 0x00, 0x00), # 0
(0xCD, 0x00, 0x00), # 1
(0x00, 0xCD, 0x00), # 2
(0xCD, 0xCD, 0x00), # 3
(0x00, 0x00, 0xEE), # 4
(0xCD, 0x00, 0xCD), # 5
(0x00, 0xCD, 0xCD), # 6
(0xE5, 0xE5, 0xE5), # 7