HNHacker News
TopNewBestAskShowJobs

napsterbr

2,564 karma · joined November 25, 2013

Howdy!

You can reach out to me at r@ena.to

https://github.com/renatomassaro

submissionscomments
napsterbr··on Ask HN: Who is hiring? (August 2026)
I worked at Distru a few years back; I have nothing but positive things to say about the team. Good culture, great people, solid engineering principles. This is a good opportunity, especially if you are into Elixir.
napsterbr··on Workers Cache
There is a world of difference between well-written human text and sloppy walls of AI-generated text. There's nothing wrong in using hyphenations or emdashes -- I use them myself! That's not the point of my comment.
napsterbr··on Workers Cache
One of the recent AI tells other than em dash is the excessive usage of hyphenated words:

> multi-tenant-safe cache keys

> on a server-rendered app

> byte-for-byte identical (classic)

> gets a cache-speed response

> cached-file-extensions list

Honestly, this is terrible. I had to add a "use simple words only, don't hyphenate unnecessarily" warning to my Claude config. After a full day of work, having to read these Claudisms all the time make a noticeable difference on how tired you get. It gets even worse when Claude starts to make up its own vocabulary.

napsterbr··on Anthropic's open-source framework for AI-powered vulnerability discovery
Or hacked them...
napsterbr··on Cloudflare Global Network experiencing issues
Took me ~30 minutes but eventually I was able to log in, get past the 2FA screen and change a DNS record.

I surely missed a valid API token today.

napsterbr··on Campfire: Web-Based Chat Application
Reminds me of Ash (Elixir framework).

Seems great on paper, but quickly turns into a nightmare. Magic is great to get you up to speed, but as soon as you find yourself having to bend the magic, good luck.

napsterbr··on I let LLMs write an Elixir NIF in C; it mostly worked
This is clearly low quality, non-idiomatic AI-generated Elixir code. So the likely answer is that "you" did not use this at all; AI did.

I review this kind of AI-generated Elixir code on a daily basis. And it makes me want to go back to ~2022, when code in pull requests actually made sense.

Apologies for the rant, this is just a burnt out developer tired of reviewing this kind of code.

PS: companies should definitely highlight "No low-quality AI code" in job listings as a valid perk.

napsterbr··on Shardines: SQLite3 Database-per-Tenant with ActiveRecord
Coincidentally I'm working on FeebDB[0], which is similar but for Elixir instead. It can be seen as a replacement to Ecto (which won't work well when you have thousands of databases).

Mostly as a fun experiment, but also from the realization that every place I worked at in the past (small/medium-sized B2B startups) would greatly benefit from such architecture.

Yes, there are massive trade-offs to this approach, and the concerns raised in the comment section are valid. This doesn't mean the database-per-tenant is never worth it. There's a sweet spot for it, and if it fits your business/application, I personally would consider it a technical advantage over competitors.

My goal with FeebDB is to eliminate or reduce the common pain points of database-per-tenant, including:

- ensure there is a single writer per database.

- improved connection management across all tenants (e.g. only keep open at most 1000 DB connections, similar to an LRU cache).

- on-demand migration (all shards are migrated on application startup, but if a shard that hasn't migrated yet receives a request, it will first perform the migration and then serve the request),

- on-demand backups and replication (e.g. the library knows which shards were updated in the last X minutes, so it can trigger Litestream or similar on demand).

- support for enumeration of databases (performing map/reduce/filter operations across multiple DBs)

- support for clustered deployment with "pinned" tenants (for now I'm assuming the IOPS of a single beefy server should be enough for all use cases, but once that's no longer sufficient you can have "shards of shards")

[0] - https://github.com/renatomassaro/FeebDB/

napsterbr··on OpenAI asks White House for relief from state AI rules
I think we are beyond the "theory" phase by now. Just yesterday I saw the president of a country advertising the products of a private company (Trump making an obvious marketing ploy for Tesla).

How can this ever be acceptable?

napsterbr··on Self hosted FLOSS fitness/workout tracker
Another interesting self-hosted tracker is https://ryot.io/.

Demo: https://demo.ryot.io/_s/acl_vUMPnPirkHlT

Code: https://github.com/IgnisDa/ryot

(PS: they opted to go in a direction where it also includes some media-related features -- like tracking movies or books you've seen/read -- but this can be disabled).

napsterbr··on Ask HN: Why buy domains and 301 redirect them to me?
Whatever their play, detect and drop the redirects. Good job on noticing it early on!
napsterbr··on How do interruptions impact different software engineering activities
Sure, and I agree with you, but what you described is just a break, not an interruption.

These breaks were taken at a "natural" time, when you felt one was needed. By definition, an interruption is a "break" when you don't want one.

napsterbr··on Database mocks are not worth it
The entire project is open source, so sure! :D

I actually have two projects that use this approach, FeebDB (which is the library I wrote to manage a "one SQLite database per client" approach) and HackerExperience (a game under development that uses FeebDB).

The overall idea is simple:

1. Before tests start running, create a prop of each database.

2. The prop contains the "starting database" for each test. It may contain seed data (optional).

3. For each test, copy the prop and assign it a unique shard identifier (say, cp /props/user.db /test_data/user/874125.db).

4. The test knows the `shard_id` and can do whatever it wants with it; no one else will bother it.

5. Once ExUnit is finished, delete all shards.

Both projects follow a similar approach (I wrote it first in FeebDB and copied into HackerExperience, which has some sections commented out -- I need to clean up this part of the codebase).

For both projects, you will find steps 1/5 in `test/support/db.ex`, step 2 in `test/support/db/prop.ex` and steps 3/4 in `test/support/case/db.ex`.

- FeebDB: https://github.com/renatomassaro/FeebDB/

- HackerExperience: https://github.com/HackerExperience/HackerExperience/

Email is in profile in case you have follow up questions/comments :)

napsterbr··on Database mocks are not worth it
A hobby project of mine (in Elixir) uses SQLite as primary database. Each test runs in its own fully isolated SQLite database. No mocking (or transaction rolling back) needed. Most of these tests take less than 1ms to run (and when they take longer, it's because of something else).

This kind of setup makes the usual Ecto Sandbox approach feel slow, but I do agree that the way Elixir approaches this is great!

napsterbr··on Starship Flight 5: Launch and booster catch [video]
And here I thought nothing would top the double landing view from Falcon Heavy...
napsterbr··on 1 bug, $50k in bounties, a Zendesk backdoor
It's unbelievable that he received no bounty from Zendesk on this one. If it was out of scope, then surely he could have published it anywhere?
napsterbr··on PostgreSQL Streaming Replication (WAL); What It Is and How to Configure One
> Do I need 2 replicas to avoid the split brain scenario? my brain hurts already.

It will hurt even more.

The recommended way is to set up a witness server. Yet another thing to manage in a properly designed Postgres cluster. Certainly not an easy/trivial thing to do, ops-wise.

From [0]:

> By creating a witness server in the same location (data centre) as the primary, if the primary becomes unavailable it's possible for the standby to decide whether it can promote itself without risking a "split brain" scenario: if it can't see either the witness or the primary server, it's likely there's a network-level interruption and it should not promote itself. If it can see the witness but not the primary, this proves there is no network interruption and the primary itself is unavailable, and it can therefore promote itself (and ideally take action to fence the former primary).

An interesting acronym you'll hear is STONITH (in order to fence the former primary).

[0] - https://www.repmgr.org/docs/current/repmgrd-witness-server.h...

napsterbr··on FreeBSD: How Can We Make It More Attractive to New Users?
> I wonder if creating jails have gotten easier since v8?

I think iocage was released after v8, so yes, definitely! Not only creating, but managing jails as a whole. In many ways, iocage can be compared to docker when it comes to container management.

napsterbr··on FreeBSD: How Can We Make It More Attractive to New Users?
> Currently, FreeBSD lags behind in key areas such as [...] laptop-specific functionalities like suspend/resume

Many years ago I migrated to FreeBSD and absolutely loved it. I was forced to migrate back to Linux once I started a job and ended up staying with Linux to this day.

A few months back I decided to give FreeBSD another shot. The one thing that was an immediate deal breaker was being unable to suspend/resume on my desktop computer. For my workflow, that's an unnecessary waste of power / energy.

Just wanted to share this testimonial to outline the importance of suspend/resume for non-laptop hardware. Almost every time I see this discussion, it's focused on laptops.

By the way, I'm extremely excited about this initiative to make FreeBSD more attractive to non-server users in general (not only new ones). That will surely be a huge benefit to the entire community. If I can't run FreeBSD on my machine, I won't runt it on my servers.

napsterbr··on Optimizing Postgres table layout for maximum efficiency
You are absolutely correct, the current wording causes confusion as to where the speed-up happens. Over the weekend I'll add a note and link to this thread, thanks for pointing that out.
napsterbr··on Optimizing Postgres table layout for maximum efficiency
One interesting thing your team may want to look into (if you haven't already) is compression.

Of course there are a multitude of variables we don't have access from the outside, but Postgres only compresses data that is TOASTed, and based on your description of the table, the data is not being TOASTed (and therefore not being compressed).

Instead, if you could somehow pack your timeseries entries into an array, you would get the benefits of compression automatically.

Given your write performance requirements, using an array may be out-of-question (and you may get too much overhead from dead tuples) -- but who knows? Always a good idea to benchmark.

I actually considered mentioning this at the post but figured it was too long already and could be the material for a future one :)

napsterbr··on Optimizing Postgres table layout for maximum efficiency
Hey, author here.

> Indexes are, by nature, a tradeoff where you give up space to gain time, so this mindset doesn't really apply there.

I agree that (re)aligning indexes are a different beast entirely, but (as mentioned in my recommendation) ideally the developer should keep this in mind when creating the index initially.

Factors like cardinality and even readability should take precedence over perfect alignment, but all else being equal, aligning your indexes from the very moment they are introduced in the codebase is the ideal scenario IMO.

napsterbr··on Flaw has Microsoft Authenticator overwriting MFA accounts, locking users out
Something similar happened to me about a year ago when the Google Authenticator app automatically updated to a new version. I lost all my accounts in the update process. Definitely learned a few lessons there.
napsterbr··on Ask HN: When is pure functional programming beneficial?
> You can write a confusing unreadable Haskell script, just like you can write a confusing unreadable Python script.

I totally agree (and have seen both scenarios throughout my career).

That said, all else being equal[0], refactoring the purely functional code is, usually, easier, more reliable and less scary.

[0] - among other things, this assumes the person doing the refactoring knows, in this example, both Python and Haskell equally well.

napsterbr··on Ask HN: When were flagged submissions/comments added to the profile page?
Heh, same here, although I always held the thought "well, if I did not do such a good job at detecting accidental clicks, I'd never know about it". Now I do!
napsterbr··on Experiencing decreased performance with ChatGPT-4
Same here. FYI it seems the GPT4 API is generally available now. I haven't tested it yet, but I'm expecting to see much better outputs than ChatGPT.
napsterbr··on Brazil's Jair Bolsonaro is barred from office until 2030
For the voters.

If Bolsonaro had not made fun of covid victims and needlessly spilled hate on every other word that came from his mouth, he'd be the current president of Brazil.

A moderate right wing candidate will likely win for 2026, just like an hypothetical moderate Bolsonaro would have won last year.

napsterbr··on Brazil's Jair Bolsonaro is barred from office until 2030
One side will claim the trial was unfair or overreaching or political. The other will claim that the judicial system did work as expected and followed the rules it set forth well before the 2022 elections began.

I have my own take, but then again it is heavily influenced by my own bias. It's hard to share an unbiased opinion here.

The idea that Lula is using his political power to take Bolsonaro out of the game is laughable, IMO.

napsterbr··on Brazil's Jair Bolsonaro is barred from office until 2030
One could say this is actually bad news for Lula, in the sense that Lula and Bolsonaro need each other.

For the next presidential election, any not-too-exteme right wing candidate has great odds of beating Lula, if he were to run for reelection.

napsterbr··on Plane crash rates by model
From the details page:

> This is not a numbered fatal event because the Legacy aircraft, although based on the design of the ERJ135 regional airliner, was not airline passenger flight.

This particular crash is widely known here in Brazil. The two pilots from the small aircraft had turned off the plane transponder. They had a mid-air collision with a 737. Everyone at the 737 died.

The two pilots of the Embraer 190 are Americans. They were sentenced to jail in Brazilian court but were never arrested to this day (not sure why).

Page 1 of 13Next →