393 karma · joined August 16, 2022
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.
It's like in the old days before railroads when every town had it's own time, but even worse.
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.
Serverless architectures are provided by servers.
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.
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.
It's only needed for functions defined in header files where multiple definitions may exist after compiling object files.
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.
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.
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.
I'm still working on a project that was mainly written by someone who left the company right before I joined – ten years ago.
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.
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?
For example, you can't set the baudrate of a serial port by writing it to some /proc node.
I have ran a lot of programs containing race conditions successfully many times until I ran into an issue.
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!
I'd still prefer a `grep <args> || true` over not having `set -e` for the whole file.
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.
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.
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.
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.
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.
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.