HNHacker News
TopNewBestAskShowJobs

wolletd

393 karma · joined August 16, 2022

submissionscomments
wolletd··on Desed: Demystify and debug your sed scripts
How? Shouldn't it just all be UTF-8? Or do you use a different encoding on your system?
wolletd··on Desed: Demystify and debug your sed scripts
> try explaining how to use sed to a fresh graduate who's never seen it

Well, for starters, you just `s/<regex>/<replacement>/` and try to use that in your everyday work. Just forget about the syntax. It's a search-and-replace tool.

That's the only way I used sed for years. I've learned more since then, but it's still the command I use the most. And that's also what `sd` focuses on.

Also, if you want to replace newlines, just use `tr`, to hook onto the examples of sd. It may seem annoying to use a different tool, but there are two major advantages: 1. you're learning about the existence, capabilities and limitations of more tools 2. both `sed` and `tr` are probably available in your next shitty embedded busybox-driven device, while `sd` probably is not

As you said, the value comes from being around for a long time and, probably more importantly, still being present on nearly any Unix-like system.

wolletd··on Högertrafikomläggningen
I propose infinite timezones, you simply calculate the true noon from your latitude. Smartphones can do that for us. The time at your workplace would be some minutes off the time at your home. And when your phone is off, you are screwed.

It's like in the old days before railroads when every town had it's own time, but even worse.

wolletd··on IBDNS: Intentionally Broken DNS server
Name resolution problems are the most bizarre.

And they happen at every level and can combine beautifully. I had a DNS server flooded with Format Error messages, because NTP Pool DNS sent an invalid response for a specific query and two (yet to be identified) clients sent (and still send) that query every second or so, because the response never reaches them. And as the upstream query failed, the DNS server would send the same query every second again to a bunch of other DNS servers, every single response generating another Format Error. Dozens of log lines per second.

Those two generate about 1GB of waste traffic per month. And that's the two buggy machines talking to a small DNS server I manage. I wonder how many junk traffic public DNS servers generate.

wolletd··on Show HN: Serverless Postgres
When you say it like that, nothing really is serverless. Everything is running on some computer.

Serverless architectures are provided by servers.

wolletd··on Ping Ff02:1
IPv6 link-local addresses based on MAC address are neat, I use that in production.

We build a machine containing six cameras. All of them come with the same default IPv4 address, but the MAC address is based on the serial number, so the IPv6 address is, too. Employees enter the six serial numbers by scanning Datamatrix codes in order, and I can calculate the IPv6 addresses from that, connect and change their IPv4 addresses all in parallel.

Ten years ago I did the same thing on a different product with weird ARP shenanigans. The IPv6 approach is way faster and cooler.

wolletd··on The C++ Iceberg
What I don't get is, why are we still adding more undefined behaviour to the standard?

For example, C++23 got std::unreachable. From my dips into Rust, I expected something similar to std::abort, terminating the program in some sane and possibly helpful way.

However, in C++, std::unreachable just invokes undefined behaviour when called. It's not usable as a guard from programming errors, it's just an optimization hint. You still have to write the guard yourself.

I'm left wondering about the use-cases for this.

wolletd··on The C++ Iceberg
You can declare and inline-define a function in a CPP file and you don't need inline because there are no other places that can import it.

It's only needed for functions defined in header files where multiple definitions may exist after compiling object files.

wolletd··on New startup sells coffee through SSH
But if I can't trust even that host, I also can't trust the host I'm working on and which doesn't need agent forwarding to access my SSH agent.
wolletd··on BeeBase, a programmable relational database with graphical user interface
The point of images in texts isn't to target illiterate users, either.

A tutorial for a graphical user interface would surely benefit from some screenshots of that very graphical user interface thrown in there.

The tutorial literally explains menus that pop up in text. Some screenshots would've helped.

wolletd··on Remake of the Windows 95 Solitaire game
I recently build some internal app with Qt. Unfortunately, building Qt apps on Windows is somewhat complex.

Also I didn't find a way to install Qt on Windows without later receiving E-Mails from Trolltech (or The Qt Company, nowadays) trying to sell Qt to me.

wolletd··on Dnsmasq wins the first BlueHats Prize
I even know of vending machines that have routers with OpenWRT and dnsmasq in them. Mainly because I put those there.
wolletd··on It's far from clear how grub package updates work on Ubuntu
I shifted to using systemd-boot as default years ago and don't look back.

Granted, prior to Debian Bookworm I had to roll my own initramfs- and kernel-hooks, but there were blog posts and I didn't need to develop them.

I even tried directly booting into Linux EFISTUB, but thats uselessly annoying compared to a proper bootloader.

wolletd··on WinBtrfs – an open-source btrfs driver for Windows
Which is kind of the point. BTRFS only has issues with RAID5/6 configurations. Using it as a filesystem for a single disk or partition should be totally fine.
wolletd··on Ask HN: What is the most useless project you have worked on?
> and the rest will get thrown away not long after that.

I'm still working on a project that was mainly written by someone who left the company right before I joined – ten years ago.

wolletd··on Regex character "$" doesn't mean "end-of-string"
At some point, I felt like I knew them all. There are probably more regex dialects out there, but I don't encounter them and my set of knowledge works most of the time.

I feel it's like driving a rental car. It behaves slightly different than your own car, some features missing, some other features added, but in general, most of the things are pretty similar.

wolletd··on Regex character "$" doesn't mean "end-of-string"
The differences of the various regex "dialects" came to me over the years of using regular expressions for all kinds of stuff.

Matching EOL feels natural for every line-based process.

What I find way more annoying is escaping characters and writing character groups. Why can't all regex engines support '\d' and '\w' and such? Why, in sed, is an unescaped '.' a regex-dot matching any character, but an unescaped '(' is just a regular bracket?

wolletd··on I summarized my understanding of Linux systems
Also, a lot of devices require very specific ioctl() commands to work with and don't provide everything as a file.

For example, you can't set the baudrate of a serial port by writing it to some /proc node.

wolletd··on gh-116167: Allow disabling the GIL
"small threaded programs had been run successfully"

I have ran a lot of programs containing race conditions successfully many times until I ran into an issue.

wolletd··on Use KeePassXC to sign your Git commits
People don't get the security concepts. Probably, just a lot of people wanted signed commits because they somehow "better", but couldn't get PGP to work.

But they use SSH keys to push to GitHub anyway, so someone added the option to use SSH keys to sign Git commits. Now everyone can have a green "Verified" symbol on their commits.

It's worth less, but it looks better!

wolletd··on Bash Debugging
Well, otherwise `if grep "line" $file; then` wouldn't work, which in my opinion is the primary use case for grep in scripts.

I'd still prefer a `grep <args> || true` over not having `set -e` for the whole file.

wolletd··on Bash Debugging
Just adding `set -e` also exits the script when a subshell exits with non-zero error code. I'm not sure why I would leave `set -e` out in any shell script.
wolletd··on So you think you understand IP fragmentation?
In my case, the application was using the Wireguard MTU correctly, but the Wireguard packet itself was too big for something on the path. So, the Wireguard MTU wasn't set correctly, basically. But Wireguard packets aren't marked DF, so one would expect a worse, but still working connection in that case. However, that something on the path seemingly just dropped the packets without ICMP notice.
wolletd··on So you think you understand IP fragmentation?
WireGuard!

I had multiple issues with WireGuard related to MTU/fragmentation. Once, service reported that a system is pingable, but the management website didn't load. I was able to SSH into it, but similarily, the connection broke everytime I tried to run `ip addr` or view logs. Commands with short output worked, however – apparently, somewhere on the path the packets got fragmented and/or dropped without notice.

wolletd··on Figure out who's leaving the company: dump, diff, repeat
I also have friends, but I rarely see them on workdays. Having other people around me on those days feels good, I don't like being alone for several days. I totally can do and have done that, but I prefer to not be alone.

Additionally, my colleagues and I share big parts of our life: every damn workday. None of my friends are capable of talking as long and nuanced about things happening at my workplace. They don't really want to hear emotional rants about bullshit projects because they have no way to relate to those feelings.

But I want to rant about bullshit projects and thankfully, I have colleagues that like hearing such rants from time to time, as they totally can relate. When I am mad about some shit, start talking about it and they ask "oh, was that XY who said that?" and it totally was XY, that is comforting.

I have friends, yes, and I don't need to meet my colleagues after work. But I still have healthy social relationships to them.

wolletd··on Demystifying GPU compute architectures
Just to be fair: as also stated at the beginning of the post, CPUs are far more complex nowadays than they represent themselves to the outside.

They don't work like a von-Neumann machine, they act like one. Granted, we know a lot more about the inner workings of modern CPUs thn GPUs, but a lot of real-life work still assumes that the CPU works "as-if" it was a computer from the 70s, just really, really fast.

wolletd··on Notcurses: Blingful character graphics/TUI library
Absolutely, yes, should've mentioned that. Most of these tools are for internal use at my company and I know what terminals they run in – even better: I can just test it.

But honestly, some of these run in tmux on my machine and in the Windows Terminal in production and both do the same thing. I guess if you assume modern, emulated terminals and don't do exotic stuff (I mostly move the cursor and clear lines), you can go some way without termcap. It's a tool from a time when terminals where physical machines.

wolletd··on Notcurses: Blingful character graphics/TUI library
For the handful slightly fancy TUI applications I wrote, I had some fun in just using raw escape sequences.

I really like the buildkit output style, I couldn't figure out how to do something like this – multiline output without a full-term application – with curses, so I did it myself.

wolletd··on In loving memory of square checkbox
> There's no money in making a thing that works well, only in making things that look good.

I work in a company building vending machines and such and it's the other way around here. Most products are shipped with a pretty mediocre UI because it just isn't valued. The software has to run the machine, vend products to people and don't eat their money.

wolletd··on DaedalOS – Desktop environment in the browser
I'm looking forward to the day when I can run a browser in my browser.
← PreviousPage 2 of 4Next →