HNHacker News
TopNewBestAskShowJobs

dividuum

2,704 karma · joined October 19, 2011

I love programming

Working full time on a digital signage service:

  https://info-beamer.com
See https://dividuum.de/ for other projects.

Contact me at fw@dividuum.de / @dividuum

submissionscomments
dividuum··on How to optimize boot time in user space on a Raspberry Pi 4 / Boot2Qt
Even if your userspace is pretty fast, some necessary initialization happening before the kernel is even loaded means the you probably never get lower than 6-8 seconds. There is a lengthy EEPROM issue thread about that for the Pi4: https://github.com/raspberrypi/firmware/issues/1375
dividuum··on Exploring the scalable matrix extension of the Apple M4 processor
> Although Apple has included a matrix accelerator in its devices since 2019, it used a proprietary instruction set inaccessible to developers, who officially could only use Apple-provided numerical libraries.

How does that work? Does the hardware throw some kind of fault when using those instructions? Or are they merely undocumented and you could use them if you figure out how they work? I guess the second, as hinted by the "officially"?

dividuum··on A good day to trie-hard: saving compute 1% at a time
Right. Out of curiosity I looked into what code gperf generates and it seems it would end up O(1) for misses (it's always three lookups into a generated table) and O(L) for hits, as a potential hit has to be confirmed by essentially a strcmp. Not sure how something like https://github.com/rust-phf/rust-phf would work, but probably similar?
dividuum··on Why bother with argv[0]?
Seriously: Their reason is basically "argv[0] is bad because security snake oil software is garbage":

1) Oh no, the only protection is looking at argv[0]. What kind of clown software is that? Software that notably runs on an already compromised system..

2) No need for argv[0] to fool software that concats argv values with spaces: just run 'curl -o "test.txt |grep" 1.1.1.1'

3) A long argument messes up telemetry? Let's hope that bucket doesn't have more holes.

dividuum··on Extreme Pi Boot Optimization
> Supposedly on the Pi 5, the SoC could be put to sleep while RP1 remains active [..]

You mean "echo +60 > /sys/class/rtc/rtc0/wakealarm && halt"?

dividuum··on Password protect a static HTML page, decrypted in-browser in JavaScript
Sure
dividuum··on Password protect a static HTML page, decrypted in-browser in JavaScript
Built the same thing, but with a slightly different focus: Have the result as small as possible, so assuming you can trust your browser you can audit the received HTML file prior to entering your password: https://github.com/dividuum/html-vault
dividuum··on PC Floppy Copy Protection: Formaster Copy-Lock
It turned on write protection. It was a while ago, so I don’t remember exactly, but things got weird as the OS assumed writes got persisted while in reality they just got completely ignored. Was a fun experiment.
dividuum··on PC Floppy Copy Protection: Formaster Copy-Lock
For anyone curious: https://github.com/BertoldVdb/sdtool is a tool to for that. I may or may not have bricked a card while toying around with in on a Pi :)
dividuum··on Async hazard: MMAP is blocking IO
I don't see how that would work. The memory access causing the page fault still blocks, but now another thread handles paging in the requested data. So without coordination between those two, nothing really changes. Sounds easier to just use nonblocking reads directly.

Thanks for the pointer to userfaultfd. Didn't know that existed.

dividuum··on Solar energy breakthrough could reduce need for solar farms
I'm still waiting for a tesa data storage device!
dividuum··on Stremio OS Is Now Available for Raspberry Pi 5 and 4
The software decoder is fast enough: See https://forums.raspberrypi.com/viewtopic.php?p=2145762#p2145...
dividuum··on Stremio OS Is Now Available for Raspberry Pi 5 and 4
That’s incorrect: Both have hardware support for decoding H265 up to 4K. The difference is H264: the Pi4 still has a hardware decoder (up to FullHD) while the Pi5 doesn’t and will use software decoding as it’s more than fast enough. As it is software, there’s no resolution limit.
dividuum··on Analog GPS: Scrolling Wrist and Car-Mounted Maps of the 20s and 30s (2016)
There's a 90' style website for longer bike trips between (mostly) German cities: https://radweit.de/. Each trip is often one A4 page and cuts up the complete track into individual map segments neatly arranged so it fills a single page. We used that once a while ago and it worked great.
dividuum··on SimSig: Railway Signalling Simulations
> A more advanced system would aim to have trains as close together as cars are on a freeway.

https://en.wikipedia.org/wiki/European_Train_Control_System#...

dividuum··on Show HN: BeaconDB – An Alternative to Mozilla Location Services
While most users probably don't realize that they contribute to Wifi crowd sourcing, AFAIR using locations services is opt-in on iOS. So "without their consent" doesn't seem true. The info popup also explicitly mentions the WiFi location crowd sourcing.
dividuum··on Writing GUI applications on the Raspberry Pi without a desktop environment (2019)
> I've thought about switching to Pi4/5 for this. Based on your experience, would you recommend that platform?

Their kernel fork is well maintained and if there is a reproducible problem it usually gets fixed quite quickly. Overall pretty happy. KMS/DRM was a bit wonky as there was a transition phase where they used a hacky mix between KMS and the old proprietary broadcom APIs (FakeKMS). But those days are over and so far KMS/DRM works pretty well for what I'm using it.

dividuum··on Writing GUI applications on the Raspberry Pi without a desktop environment (2019)
In general DRM/KMS can be quite confusing a there seems little userland documentation available. I assume you get the DMA buffers from the HDMI input somehow? If so, you should be able to use drmModeAddFB2WithModifiers to create a DRM framebuffer from them. Then attach that to a DRM plane, place that on a CRTC and then schedule a page flip after modesetting a video mode.

The advantage would be that you can directly run without starting into any kind of visual environment first. But it's a huge mess to get going: I wrote quite a bit of Pi4/5 code recently to make a zero copy HEVC/H264 decoder working and it was a quite a challenge. Maybe code like https://github.com/dvdhrm/docs/tree/master/drm-howto can help?

dividuum··on Bytecode Breakdown: Unraveling Factorio's Lua Security Flaws
OP only refers to bytecode. There's nothing wrong with executing Lua when provided to the VM via source code. The only reason to allow the VM to load bytecode directly is 1) a very minor improvement in loading time, as the interpreter then doesn't have to parse Lua code into bytecode itself 2) allowing obfuscation of logic running within Factorio. Both seem rather irrelevant, so I'm not sure why they allow loading bytecode directly.
dividuum··on OctoPrint's anonymous usage stats were manipulated
What does that have to do with OctoPrint?

Edit: Whoops. I'm stupid. Nevermind.

dividuum··on CRIU, a project to implement checkpoint/restore functionality for Linux
Not sure that’s needed. Sending SIGSTOP (or using cgroup freeze) and letting the linux memory management do its job should do most of that already.
dividuum··on Cities: Skylines II Found a Solution for High Rents: Get Rid of Landlords
> Russia does not have landlords. Virtually all apartments available for rent belong to moms and pops who happen to have a surplus so they're renting out.

Also known as "being a landlord"? Maybe I'm missing something!?

dividuum··on Libtree: Ldd as a tree saying why a library is found or not
linux-vdso.so.1 isn't a real library you'll find anywhere in the file system and it's not referenced within the ELF file, so libtree doesn't know about it. Instead it is mapped into the address space of a newly started process automatically by the kernel. It's an optimization feature to avoid syscall overhead for function like gettimeofday. See https://man7.org/linux/man-pages/man7/vdso.7.html
dividuum··on You'll regret using natural keys
I took a look at a bunch of stripe customer ids I have stored and at least mine look very random on first glance. I assume their blog post uses demo keys or something similar.
dividuum··on Raspberry Pi AI Kit available now at $70
The GPU uses Mesa and KMS/DRM nowadays. Hardly secret.
dividuum··on What I think about Lua after shipping a project with 60k lines of code
I think you can add a metatable to _G with an __index function. This should be called when accessing undefined local variables (as they end up trying to access the global scope _G) and you can thrown an error.
dividuum··on Wuffs: Wrangling Untrusted File Formats Safely
Not sure that’s possible. I’m pretty sure it is not safe to assume „parses in wuffs“ -> „is safe in any other decoder“. I’m using wuffs to check user upload (see my recent response in another thread) but I still generate out linear RGBA and work with that. I still consider the original JPEG data hostile.
dividuum··on Nearly all Nintendo 64 games can now be recompiled into native PC ports
Really surprised this topic didn't come up anywhere. I couldn't find anything in the linked repositories either. I guess there's no self-modifying code due to it being mapped into the address space from a cartridge?
dividuum··on Ask HN: How to handle user file uploads?
I consider the approach of using virus scanning inherently flawed: They rely on heuristics and rules to essentially create a blacklist. And they add a ton of complexity (more code -> usually more bugs) which is not something you want if you work with untrustworthy data.

What you instead want is a whitelist: Only allow properly formatted images and videos and ruthlessly reject anything else. I wrote about how I implemented this for my service in another response.

dividuum··on Ask HN: How to handle user file uploads?
I wrote a little bit more about this here: https://community.info-beamer.com/t/an-updated-approach-to-c...

I’m a huge fan of building minimal self-contained tools, so all of the C programs statically link in the required parser libs (libavcodec/wuffs/freetype) so the resulting binaries don’t require additional dependencies on the target machine. The python wrapping code is rather straightforward as well and is only like 300 lines of code.

← PreviousPage 3 of 24Next →