Reading List

The most recent articles from a list of feeds I subscribe to.

Failed Attempts to Install NixOS on the Raspberry Pi 4

In creating the tutorial, “Installing NixOS on Raspberry Pi 4,” I ran into a ton of paths that didn’t work.

I’ve collected them here for the sake of saving others time retrying the same steps.

The standard NixOS aarch64 image doesn’t work

When I checked the NixOS download page, I saw that they offered 64-bit ARM images.

Screenshot of 64-bit ARM download links on NixOS download page

NixOS offers bootable images for 64-bit ARM systems

Beware of PHPUnit data providers with heavy setup methods

Data providers can be a perfect fit to assert a lot of expectations without writing a full test for each.

This makes it cheap and easy to add more test cases. For an in-depth introduction to data providers, I recommend this excellent article on the Tighten blog.

class AddTest extends TestCase
{
/** @dataProvider values */
public function it_adds_values(int $a, int $b, int $result): void
{
$this->assertEquals($result, add($a, $b));
}
public function values(): array
{
return [
[1, 1, 2],
[1, 2, 3],
[5, 5, 10],
// …
];
}
}

Data providers run setUp for each value. If you need a clean slate for every test, there’s no way around this. If you don’t, data providers make your tests slower than they need to be.

Consider a heavier integration test that migrate & seeds the database in setUp().

class MyTest extends TestCase
{
public function setUp(): void
{
parent::setUp();
// Migrate and seed database values…
}
/** @dataProvider values */
public function it_does_something(string $value): void
{
// …
}
public function values(): array
{
return [ /* … */ ];
}
}

Each case in values() will re-seed the database. If this isn’t needed, you’re better off looping over the values yourself.

class MyTest extends TestCase
{
public function setUp(): void
{
parent::setUp();
// Do some heavy lifting…
}
public function it_does_something(): void
{
$values = [ /* … */ ];
foreach ($this->value() as $value) {
// …
}
}
public function values(): array
{
return [ /* … */ ];
}
}

We recently updated a few tests in a project we’re working on, and it almost doubled the speed!

With a data provider:

Time: 00:08.517, Memory: 92.50 MB
OK (43 tests, 43 assertions)

In a loop:

Time: 00:04.448, Memory: 70.14 MB
OK (1 test, 43 assertions)

Beware of PHPUnit data providers with heavy setup methods

Data providers can be a perfect fit to assert a lot of expectations without writing a full test for each.

This makes it cheap and easy to add more test cases. For an in-depth introduction to data providers, I recommend this excellent article on the Tighten blog.

class AddTest extends TestCase
{
/** @dataProvider values */
public function it_adds_values(int $a, int $b, int $result): void
{
$this->assertEquals($result, add($a, $b));
}
 
public function values(): array
{
return [
[1, 1, 2],
[1, 2, 3],
[5, 5, 10],
// …
];
}
}

Data providers run setUp for each value. If you need a clean slate for every test, there's no way around this. If you don't, data providers make your tests slower than they need to be.

Consider a heavier integration test that migrate & seeds the database in setUp().

class MyTest extends TestCase
{
public function setUp(): void
{
parent::setUp();
 
// Migrate and seed database values…
}
 
/** @dataProvider values */
public function it_does_something(string $value): void
{
// …
}
 
public function values(): array
{
return [ /* … */ ];
}
}

Each case in values() will re-seed the database. If this isn't needed, you're better off looping over the values yourself.

class MyTest extends TestCase
{
public function setUp(): void
{
parent::setUp();
 
// Do some heavy lifting…
}
 
public function it_does_something(): void
{
$values = [ /* … */ ];
 
foreach ($this->value() as $value) {
// …
}
}
 
public function values(): array
{
return [ /* … */ ];
}
}

We recently updated a few tests in a project we're working on, and it almost doubled the speed!

With a data provider:

Time: 00:08.517, Memory: 92.50 MB
OK (43 tests, 43 assertions)

In a loop:

Time: 00:04.448, Memory: 70.14 MB
OK (1 test, 43 assertions)

I don't know how I feel about email

hero image uncertain-foxgirl
Counterfeit -- a girl with yellow eyes, pink hair, fox ears, a white hoodie, and a short skirt walking through a park; her hair is very long and is wearing a very uncertain look.

So recently I've been trying to use email and I just don't know how I should feel about it. There's a lot of core problems with it that seem to seep out to every part of the protocol, user experience, and the entire thing is just leaving me uncertain for its future.

I have to choose a server

One of the biggest things that confuses me is that I have to choose a server to use email. I'm not really given explanations of what each of these servers mean and what the differences are, but I have heard that some servers can't interact with eachother due to petty administration disputes. I don't know which server I should pick, but my phone keeps trying to get me to use iCloud mail.

A lot of my friends use this Gmail thing run by Google, but I don't know if I really want to put Google back in my life after I cut it out.

Mara is hmm
<Mara> Does it even matter if everyone else you talk with uses Gmail anyways? Google still has copies of the conversations and their recent TOS change allows them to train AI models on user data.
Aoi is rage
<Aoi> What? They can read my email? It's not encrypted until I try to read it? Can't you do some end-to-end encryption or something?
Cadey is coffee
<Cadey> Can and should are different words. PGP is hell. You don't want to.
Aoi is facepalm
<Aoi> Oh god.

Also apparently there's no real way to migrate between email servers either, so whatever I choose is going to be my permanent home. Lots of online applications will tie into your email address (some even make your email address a primary key for your account with no way to change it!), so whatever email address I choose will probably have to be used forever. I can forward emails from an old account to a new account, but Google is going to delete inactive accounts and I can't imagine that other providers aren't going to follow suit.

Oh and if that server goes down and stays down, I lose access to any of my emails that I haven't downloaded yet.

I can't run my own server

Okay, so if I have to use a server can't I just run my own server? I have an AnalogBrocean and I can set up an Ubuntu instance or something to act as a mailserver. It shouldn't be that complicated right?

What do you mean spam is a thing? Doesn't the spamfilter take care of that?

What do you mean email servers don't come with spamfilters by default?

What do you mean that the default configuration of email servers means that I have to vigilantly monitor everything to ensure that bots don't send emails and destroy my reputation at unreasonable hours of the night?

What do you mean that if someone else on my server chooses a bad password, bots will figure it out and start sending a torrent of spam?

What do you mean that IP addresses aren't a reliable way to detect who people are?

What do you mean that the spamfilter software takes 12 gigabytes of ram, 4 CPU cores, and 35 GB of local space in order to work?

What do you mean I can do everything right but some AI model will get angry at me and all of the efforts I do to "fix" it are wasted time?

Aoi is rage
<Aoi> How does anyone deal with this shit?

I don't know which client to use

Once I have my email account (and maybe my own email server if I really hate myself), I need to connect to it with a client. Every OS comes with a mail client, but all of them suck (Apple Mail seems decent though?). If I open the App Store and search "email client" I get hundreds of results. Same in the Google Play store. More if I look for clients for Windows. Even more if I look for clients for my Steam Deck. I don't know enough to know if these mail clients are legit or not. Which ones are reputable? Which ones are made by development teams I can trust? Which ones will support the kinds of emails I will read?

Oh and even better, apparently Gmail is starting to lock down access to your emails with only a username and password in the interest of "security", so you have to go through convoluted hoops in order to check your email in something that isn't the gmail web UI. It is literally impossible for me to check my work mail in something like Aerc.

And then comes the issue of clients and message formatting. When I compose and send an email, I type text in the box, drag in attachments, and maybe bold important things. Then I try to send my email to a friend and they tell me they can't read it and send back a bunch of HTML garbage. I don't get it. Why does the format of messages matter? I just want to send my emails and have my friends read them, but then I have to dig through confusing or impossible to set configuration options to only send things in "plain text" instead of formatted messages. My iPad doesn't have the option to send emails in "plain text".

Apparently some smaller email servers will defederate with yours if you send HTML emails too, so if my client fucks something up in the eyes of another server admin, it could get my server defederated. What the hell kind of user experience is that?

Mailing lists

So email has groups called mailing lists, but using them with many email clients is an exercise in futility. Apparently some of the biggest open source projects in the world are developed on these things? Every mailing list has their own unspoken rules on how you're supposed to use your client, reply to emails, and more.

If you break these rules, you're threatened with banning. It's bullshit. I don't know how people deal with this. I just want to ask questions about the linux kernel, I don't want to have to entirely redo my entire setup on my iPad just to send clarifying questions back when I'm at a coffee shop. I don't care about "plain text", I care about getting the answer to my question.

Maybe this is why Microsoft was looking at proposing the Linux kernel move to something more amenable to the modern age. They got shot down for this of course, but why can we have nice things when we have "simple configuration options" in a billionty email clients?


I give up on email. If you want to talk with me, you'll need to project to my astral sigil. You can find it in the upper left hand corner of the website. There's a villa in the northwest corner of the island. I'll be waiting there.

the profile picture for cadey
Xe @cadey
M07 14 2023 23:41 (UTC)

I tried using Email but the onboarding was very confusing. I have to choose a server? And I'm at the whims of server admins having petty disputes for if my posts are delivered to my friends?

Link

TinyPilot: Month 36

New here?

Hi, I’m Michael. I’m a software developer and the founder of TinyPilot, an independent computer hardware company. I started the company in 2020, and it now earns $60-80k/month in revenue and employs seven other people.

Every month, I publish a retrospective like this one to share how things are going with my business and my professional life overall.

Highlights

  • I’m trying to figure out where I’m spending unnecessary time on TinyPilot.
  • I realized I’ve once again become addicted to email.
  • I built my first server rack.

Goal grades

At the start of each month, I declare what I’d like to accomplish. Here’s how I did against those goals: