Using an element14 Wi-Pi [sic] on FreeBSD
8 February 2025 | 11:28 pm

With all my discussion last year about an ultraportable computer I can use on the train, I remembered that I bought a GPD Pocket in Akihabara back in 2018 for testing BSD hypervisors at conventions. It’s hinged, which isn’t ideal for commuting when standing, but I thought the form factor could be a good test case.

My Libretto 70CT and GPD Pocket

Alas, the machine has 802.11ac, meaning a no-go on FreeBSD currently (though that may change soon). I rummaged through my drawers of random adaptors, and found an old element14 “Wi-Pi” dongle, ostensibly designed for a Raspberry Pi. According to this teardown by Gough Lui, the Wi-Pi has a Ralink RT5370N IC.

A quick search, and I found it’s supported by run(4), which is awesome. According to the manpage, you can add the following to loader.conf:

if_run_load="YES"
runfw_load="YES"

Then add to rc.conf:

# sysrc wlans_run0="wlan0"
# sysrc ifconfig_wlan0="WPA DHCP"

A reboot later, and it works!

Now you can configure your wireless networks with wpa_supplicant.conf. The FreeBSD Handbook has more details.

I’ll still probably get a less obtrusive dongle for commuting, but this worked in a pinch. Not bad for a device that’s sat in a drawer for close to a decade!

By Ruben Schade in Sydney, 2025-02-09.


Content Security Policy for inline data:image
8 February 2025 | 9:45 pm

This is a bit of a nuts-and-bolts post, but I was trying to get inline images on a page working with Content Security Policy. A target page had the following:

<img src="data:image/png;base64,[...]==" />

I thought images expressed in data would be an unsafe-inline, just like inline CSS styling. I was wrong:

Content-Security-Policy: default-src 'self'; 
    style-src 'self' 'unsafe-inline';
    img-src 'self' 'unsafe-inline';

The solution is to use data:, which also doesn’t need quotes

Content-Security-Policy: img-src 'self' data:;

Thanks to the responses on the Information Security Stack Exchange for pointing me in the right direction.

By Ruben Schade in Sydney, 2025-02-09.


A (blue) selection of excellent site designs
8 February 2025 | 9:37 pm

I’ve been meaning to write about their excellence for a few years, but I’ve decided to collate them here for easy reference:

There are a few more in that vein—vain?—but those are the best ones. The one with the grey text and background is actually bad.

Speaking of which!

  • Make Frontend Shit Again. Playful shit, not modern shit! Make useless stuff; make the web fun again!

  • Ruben’s Retro Corner. Literally lifted from my 1997 “theme”. It was more fun to build than anything I’ve done in years. Fuck!

By Ruben Schade in Sydney, 2025-02-09.



More News from this Feed See Full Web Site