Utoipa recursive objects causing stack overflows

Here’s an example of an Enum which is completely legal in Rust and … makes utoipa / axum stack overflow while generating a schema:

#[derive(ToSchema)]
pub enum Filter {
    Eq(String, String),
    Cnt(String, String),
    Pres(String),
    Or(Vec<Filter>),
    And(Vec<Filter>),
    AndNot(Box<Filter>),
}

The problem is that whole “contains itself” thingin the second half of the variants. Again, completely legal, nothing weird about it, but codegen just falls in a heap.

Here’s the fixed version with appropriate attributes:

[Read More]

Inline Mounts On Macos Docker Container Builds

Well that’s a learning; in Dockerfiles you can have steps that look like:

RUN --mount=type=cache,id=cargo,target=/cargo do whatever

RUN --mount=type=cache for example from the docs…

And it’ll only mount the cache folder for that step.. turns out if you do that on a mac, the underlying filesystem of the cache thing is a mac filesystem, so shit gets BROKEN AND WEIRD when the container’s Linux and the programs expect Linux filesystem things.

[Read More]

IPv4-Mapped IPv6 Address Cheat Sheet

Sometimes networking is cool, sometimes it’s just weird. Linux loves to use IPv4-mapped IPv6 addresses when passing information to servers, so here’s a quick cheat sheet on working them out…

[Read More]

IKEA SOMRIG and RODRET Pairing

It took me a little bit to find, but if you can’t get your IKEA Zigbee things to work, press the “link” button four (4) times to “factory reset” them and put them in pairing mode.

The rear of an IKEA SOMRIG with the link button highlighted

[Read More]

Ecowitt WS90 Bunnings Mount

The ECOWITT WS90 “Wireless 7-in-1 Electronic Sensor Array Haptic Rain Gauge and Ultrasonic Anemometer” has a place for a 25mm tube to sit on.

I couldn’t find an antenna mount with a 25mm tube, but the “20mm” galvanised pipe assortment fit just fine.

For this you need:

  1. 20mm Galvanised Pipe (400mm) use whatever length makes you feel happy. I won’t judge.
  2. 20mm Galvanised Tee
  3. 20 x 15mm Gavalnised Reduced Hex Nipple
  4. Galvanised Round Flange With 15mm Drill Mall

I ended up using the 15mm flange because there wasn’t any 20mm on the shelf, and I needed a fitting to go between the Tee and the plate anyway.

[Read More]

How I Am Using Obsidian

Tips on using Obsidian

The basics

This goes for how I blog as well, but If I had to search for something on the internet to find information, I’ll generally brain-dump the search terms as well as the answer because that’s how I’m going to find it later.

Organisation

I use … a variation on Zettelkasten. It is an organisation system where “one idea is an object”. Don’t make megaposts unless they’re indexes, IMO. Break them up, they’re free.

[Read More]

What Is Using Port 5000 On My Mac?

Turns out it’s ControlCentre - because by default macs are set up as AirPlay receivers.

$ sudo lsof +c0 -nP -i4TCP:5000 | rg LISTEN
ControlCenter 698 yaleman   10u  IPv4 0x431cfa88f6905b65      0t0  TCP *:5000 (LISTEN)

Go into System Settings -> General -> Airdrop & Handoff and turn off “AirPlay Receiver”. You can also just search for “airplay”.

Airplay Settings

$ sudo lsof +c0 -nP -i4TCP:5000 | rg LISTEN | wc -l
0

Fixed!

[Read More]

Element not Found Connecting to Samba Share

Well, that was a weird start to the day. I started getting the following error while attempting to connect from my Windows 10 machine to my Samba fileserver:

System error 1168 has occurred.

Element not found.

I’ve been using my yaleman@domain SPN-style username for a long time to keep the permissions correct across the filesystem… and now it just stopped working? Random.

I had to create a new user without the full SPN in Samba (smbpasswd -a yaleman) and it works now. Stupid Windows.

[Read More]

YouFoodz Classic Roast Chicken & Mash

I thought “more like lots of potato with a tiny bit o’ chicken” but they hid the chicken deep under everything else. The sauce is nice enough… gravy-adjacent?

[Read More]