April 8, 2026
Byte-sized code, mega-charged takes
Show HN: A (marginally) useful x86-64 ELF executable in 301 bytes
A battery app in 301 bytes sparks nostalgia, nitpicks, and pure Show HN chaos
TLDR: A 301-byte Linux battery app lit up the thread with cheers for tiny-code magic and snarky debates over efficiency, practicality, and “peak code golf” infinite loops. Fans called it pure Show HN nostalgia, critics nitpicked the assembly, and a few even found real-world uses—fueling a fresh round of anti-bloat bragging.
It’s a battery readout that fits in a few hundred characters—yes, 301 bytes—and somehow the comments are bigger than the program. This tiny Linux-only tool reports your laptop’s battery level and, if certain files aren’t there, it’ll happily spin in an infinite loop because, as one fan put it, that’s “peak code golf.” For the uninitiated, code golf is the sport of writing the smallest program possible, and this thing nails the vibe. If you’re wondering, ELF is just the type of program Linux likes to run (more here).
Reactions came in hot. One camp cheered the audacity: “totally impractical, totally joyful,” with multiple users calling it pure “Show HN energy.” Another crowd squinted at the assembly nerdiness—userbinator clocked some missed optimizations, while still praising it for not being the dreaded “compiler slop.” Meanwhile, a pragmatist popped up with an actual use case: slotting the one-liner into desktop status bars. Cue the chorus: is this brilliance or chaos?
The funniest beat? People applauding the fact that the install command is longer than the app. Nostalgia also flowed—this felt like 80s/90s hobby computing when magazines printed hex you’d type in by hand. Love it or side-eye it, the mood is unanimous: tiny app, big vibes, and a reminder that software doesn’t always need to be huge to make the internet scream with joy.
Key Points
- •A 298-byte x86-64 ELF executable (“btry”) prints battery status on Linux laptops.
- •It reads from /sys/class/power_supply/BAT0 and displays Wh if energy_* files exist, otherwise Ah from charge_* files.
- •Installation is provided via a base64/xz one-liner that decodes to an executable named btry.
- •Limitations include x86-64 Linux only, possible infinite loop if neither energy_full nor charge_full exists, and ignored extra batteries.
- •Build instructions are Linux-only (“make” on x86-64), with a note on ThinkPad X220 behavior for charge_now vs energy_now.