Searching txt.sour.is

Twts matching #US
Sort by: Newest, Oldest, Most Relevant
In-reply-to » I was drafting support for showing “application icons” in my window manager, i.e. the Firefox icon in the titlebar:

@lyse@lyse.isobeef.org True, at least old versions of KDE had icons:

https://movq.de/v/0e4af6fea1/s.png

GNOME, on the other hand, didn’t, at least to my old screenshots from 2007:

https://www.uninformativ.de/desktop/2007%2D05%2D25%2D%2Dgnome2%2Dlaptop.png

I switched to Linux in 2007 and no window manager I used since then had icons, apparently. Crazy. An icon-less existence for 18 years. (But yeah, everything is keyboard-driven here as well and there are no buttons here, either.)

Anyway, my draft is making progress:

https://movq.de/v/5b7767f245/s.png

I do like this look. 😊

​ Read More
In-reply-to » I was drafting support for showing “application icons” in my window manager, i.e. the Firefox icon in the titlebar:

@movq@www.uninformativ.de I haven’t used KDE or GNOME for ages, but I’m sure KDE at least used to show application icons in the title bars. They proabably still do. But then, one could argue that KDE is mimicking Windows. I never thought like that, I always found KDE way superior, because I was able to configure it like a madman.

In i3, I don’t have any application icons. I remember missing them at the beginning. But I don’t even have the classical minimize, maximize and close buttons in the title bar either. Just the title. Being mostly keyboard driven and a tiling window manager, these buttons are not super useful, anyway.

​ Read More

Here’s an example of X11/Xlib being old and archaic.

X11 knows the data type “cardinal”. For example, the window property _NET_WM_ICON (which holds image data for icons) is an array of “cardinal”. I am already not really familiar with that word and I’m assuming that it comes from mathematics:

https://en.wikipedia.org/wiki/Cardinal_number

(It could also be a bird, but probably not: https://en.wikipedia.org/wiki/Cardinalidae)

We would probably call this an “integer” today.

EWMH says that icons are arrays of cardinals and that they’re 32-bit numbers:

https://specifications.freedesktop.org/wm-spec/latest-single/#id-1.6.13

So it’s something like 0x11223344 with 0x11 being the alpha channel, 0x22 is red, and so on.

You would assume that, when you retrieve such an array from the X11 server, you’d get an array of uint32_t, right?

Nope.

Xlib is so old, they use char for 8-bit stuff, short int for 16-bit, and long int for 32-bit:

https://x.org/releases/current/doc/libX11/libX11/libX11.html#Obtaining_and_Changing_Window_Properties

That is congruent with the general C data types, so it does make sense:

https://en.wikipedia.org/wiki/C_data_types

Now the funny thing is, on modern x86_64, the type long int is actually 64 bits wide.

The result is that every pixel in a Pixmap, for example, is twice as large in memory as it would need to be. Just because Xlib uses long int, because uint32_t didn’t exist, yet.

And this is something that I wouldn’t know how to fix without breaking clients.

​ Read More

We finally got a caliper donated for this year’s scout flea market. We didn’t sell it, but kept it ourselves. It will come in very handy every now and then in our material store. For example, I missed having a caliper in the past when sorting our random assortment of screws or measuring the depth of a hole. It’s a wee bit banged up (probably happened during transport) and didn’t come with a box, but the latter is now solved.

The lid and bottom came from a wardrobe back panel I got from a mate, the sides were rocket sticks in their former lives. I found some scrap of felt in our material store and some hinges laying around in the drawers of my own workshop.

Unfortunately, the table saw teared up the plywood veneer fibres badly, even though I put tape around to prevent that. This is the first time it didn’t work. At. All. To cover that up, I painted the box with some decades old tinting paint (price tag says Deutsche Mark, not Euro!) from my paint cabinet. It’s awesome, works absolutely perfectly and doesn’t smell the slightest bit. I reckon, this caliper box is plenty good enough for occasional use at our scout material store.

Image

​ Read More

Only figured this out yesterday:

pinentry, which is used to safely enter a password on Linux, has several frontends. There’s a GTK one, a Qt one, even an ncurses one, and so on.

GnuPG also uses pinentry. And you can configure your frontend of choice here in gpg-agent.conf.

But what happens when you don’t configure it? What’s the default?

Turns out, pinentry is a shellscript wrapper and it’s not even that long. Here it is in full:

#!/bin/bash

# Run user-defined and site-defined pre-exec hooks.
[[ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/pinentry/preexec ]] && \
        . "${XDG_CONFIG_HOME:-$HOME/.config}"/pinentry/preexec
[[ -r /etc/pinentry/preexec ]] && . /etc/pinentry/preexec

# Guess preferred backend based on environment.
backends=(curses tty)
if [[ -n "$DISPLAY" || -n "$WAYLAND_DISPLAY" ]]; then
        case "$XDG_CURRENT_DESKTOP" in
        KDE|LXQT|LXQt)
                backends=(qt qt5 gnome3 gtk curses tty)
                ;;
        *)
                backends=(gnome3 gtk qt qt5 curses tty)
                ;;
        esac
fi

for backend in "${backends[@]}"
do
        lddout=$(ldd "/usr/bin/pinentry-$backend" 2>/dev/null) || continue
        [[ "$lddout" == *'not found'* ]] && continue
        exec "/usr/bin/pinentry-$backend" "$@"
done

exit 1

Preexec, okay, then some auto-detection to use a toolkit matching your desktop environment 



 and then it invokes ldd? To find out if all the required libraries are installed for the auto-detected frontend?

Oof. I was sitting here wondering why it would use pinentry-gtk on one machine and pinentry-gnome3 on another, when both machines had the exact same configs. Yeah, but different libraries were installed. One machine was missing gcr, which is needed for pinentry-gnome3, so that machine (and that one alone) spawned pinentry-gtk 


​ Read More

gomdn: Yet another Static Site Generator
Yet another Static Site Generator (SSG), but this one is mine.

It’s a stupidly simple Go program ( wc says 229 lines), more like a
hack, really, but I don’t need something like Hugo. Most of the real
work is done by the goldmark package, of course. This is mostly just a
wrapper, deciding if something needs to be rebuilt.

I’ve been using a Perl script together with cmark (originally
Markdown.pl) since forever. And before that the old [txt2tags](htt 
 ⌘ Read more

​ Read More

I have a Python script that transforms the original YouTube channel Atom feed into a more useful Atom feed by removing the spam description and replacing it with the video duration, filtering out videos by title, duration, etc. I just updated it to exclude the damn Shorts garbage more efficiently. Finally, YouTube updated their Atom feed generation, so that the video URL contains /short/ if it’s of this useless kind. Never thought that they ever actually will improve their Atom feeds. Thank you, much appreciated!

​ Read More
In-reply-to » @kat why does ffmpeg always freeze the video in the first five seconds after a cut lmfao

@kat@yarn.girlonthemoon.xyz I have absolutely no idea, but I wouldn’t be surprised if it uses the closest full image after your cut point and not the one before. Hence, the deltas between the two full images have nothing to really refer to. So, the video player just shows the first full image it finds and “freezes” the image until the video stream actually hits it.

Let me try to visualize it, | represent full images, . just subsequent deltas:

Original start of video
↓
|......|.....|........|......|..
   ↑                      ↑
   Cut point      Cut point

Resulting video:

   ....|.....|........|....
   ↑↑↑↑
   This is where it freezes         

Could be complete bullshit, though. Wouldn’t be the first time that I’m wrong. :-)

I’m just curious, what exact command line do you use to cut the video?

​ Read More

I have this very simple #Python script that uses #imageio to convert all PNG files on a folder into a #GIFAnimation, and this is a #FreeSimpleGUI version of it (I usually run a command line version).

As I usually run #gifsicle on the command line after creating a GIF, I decided to update it to add #pygifsicle to do it for me and save a step.

https://github.com/villares/sketch-a-day/blob/main/admin_scripts/make-gif.py

Image

​ Read More

Maybe someone can explain this to me.

An #EU citizen trying to access Facebook today faces the following choices (see screenshots).

In there, they say that they are asking this again to comply with #EU rules, and yet the question - and the options to choose from - are the same they had in the past.

So, hm, how does this make them comply with something they weren’t complying before? What’s the detail I’m missing?

#Meta #Facebook #GDPR

Image

Image

​ Read More

Xfce does one thing very right: It stores its settings in plain-text XML files. This allows me to easily read, track, and maybe even distribute these settings to other machines.

(Unlike GNOME’s dconf, which uses some binary file format. Fun fact: The older and now deprecated gconf also used XML files.)

​ Read More

«Using data from Morgane Laouenan et al., the map is showing birthplaces of the most “notable people” around the world. Data has been processed to show only one person for each unique geographic location with the highest notability rank. Click below to show people only from a specific category.
Made by Topi Tjukanov.»

https://tjukanovt.github.io/notable-people

via @mekaru@mekaru
#wikidata #cartography

​ Read More
In-reply-to » PSA: setpriv on Linux supports Landlock.

@prologic@twtxt.net Yeah, it’s not a strong sandbox in jenny’s case, it could still read my SSH private key (in case of an exploit of some sort). But I still like it.

I think my main takeaway is this: Knowing that technologies like Landlock/pledge/unveil exist and knowing that they are very easy to use, will probably nudge me into writing software differently in the future.

jenny was never meant to be sandboxed, so it can’t make great use of it. Future software might be different.

(And this is finally a strong argument for static linking.)

​ Read More

The WM_CLASS Property is used on X11 to assign rules to certain windows, e.g. “this is a GIMP window, it should appear on workspace number 16.” It consists of two fields, name and class.

Wayland (or rather, the XDG shell protocol – core Wayland knows nothing about this) only has a single field called app_id.

When you run X11 programs under Wayland, you use XWayland, which is baked into most compositors. Then you have to deal with all three fields.

Some compositors map name to app_id, others map class to app_id, and even others directly expose the original name and class.

Apparently, there is no consensus.

​ Read More
In-reply-to » Been spending a lot of time researching campers as I want to / plan to upgrade our current Camper Trailoer (forward fold) Stoney Creek XL-FF6 to a slightly larger Hybrid Camper/Caravan with ensuite, internal kitchenette, external full hitchen, pop-top roof and twin bunks.

@prologic@twtxt.net @bender@twtxt.net That’s what I thought as well, sounds way too expensive to me. But I have no idea what the prices are over here. Probably also astronomical. Campers sit around most of the time, one really would need to use them a lot to justify spending so much money on them.

But yeah, each to their own (expensive) hobbies. :-) I, for example, burn my money on tools that I don’t reallyℱ need. :-P

​ Read More

i made a new tumblr account to interact with fandom last week. while using the site today i got logged out and when i logged back in i was told my account was terminated. mullenweg will pay for this

​ Read More
In-reply-to » This aggressive auto-logout on my bank’s website 


@lyse@lyse.isobeef.org I do my timetracking in a little Python script, locally. Every now and then, I push the data to our actual service. Problem solved – but it’s a completely unpopular approach, they all want to use the web site. I don’t get it. Then, of course, when it’s down, shit hits the fan. (Luckily, our timetracking software is neither developed nor run by us anymore. It’s a silly cloud service, but the upside is that I’m not responsible anymore. đŸ€·)

Some of our oldschool devs tried to roll out local timetracking once, about 15 years ago. I don’t remember anymore why they failed 


This is developed inhouse, I’m just so glad that we’re not a software engineering company. Oh wait. How embarrassing.

Oh to be anonymous on the internet. That must be nice. 😅

​ Read More
In-reply-to » The lack of suckless-like simple, hackable software these days is appalling.

@movq@www.uninformativ.de This is a really good example of “simplicity” but achieves the intent and goals 👌

(Now, I don’t know if your screen reader can work with this. Let me know if it doesn’t.)

I don’t use a screen reader fortunately (actually they’re pretty garbage). So all good 👍 (I juse use full-screen zoom).

​ Read More
In-reply-to » The lack of suckless-like simple, hackable software these days is appalling.

@prologic@twtxt.net Yeah, this really could use a proper definition or a “manifest”. 😅 Many of these ideas are not very wide spread. And I haven’t come across similar projects in all these years.

Let’s take the farbfeld image format as an example again. I think this captures the “spirit” quite well, because this isn’t even about code.

This is the entire farbfeld spec:

farbfeld is a lossless image format which is easy to parse, pipe and compress. It has the following format:

╔════════╀═════════════════════════════════════════════════════════╗
║ Bytes  │ Description                                             ║
╠════════â•Ș═════════════════════════════════════════════════════════╣
║ 8      │ "farbfeld" magic value                                  ║
â•Ÿâ”€â”€â”€â”€â”€â”€â”€â”€â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â•ą
║ 4      │ 32-Bit BE unsigned integer (width)                      ║
â•Ÿâ”€â”€â”€â”€â”€â”€â”€â”€â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â•ą
║ 4      │ 32-Bit BE unsigned integer (height)                     ║
â•Ÿâ”€â”€â”€â”€â”€â”€â”€â”€â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â•ą
║ [2222] │ 4x16-Bit BE unsigned integers [RGBA] / pixel, row-major ║
╚════════╧═════════════════════════════════════════════════════════╝

The RGB-data should be sRGB for best interoperability and not alpha-premultiplied.

(Now, I don’t know if your screen reader can work with this. Let me know if it doesn’t.)

I think these are some of the properties worth mentioning:

  • The spec is extremely short. You can read this in under a minute and fully understand it. That alone is gold.
  • There are no “knobs”: It’s just a single version, it’s not like there’s also an 8-bit color depth version and one for 16-bit and one for extra large images and one that supports layers and so on. This makes it much easier to implement a fully compliant program.
  • Despite being so simple, it’s useful. I’ve used it in various programs, like my window manager, my status bars, some toy programs like “tuxeyes” (an Xeyes variant), or Advent of Code.
  • The format does not include compression because it doesn’t need to. Just use something like bzip2 to get file sizes similar to PNG.
  • It doesn’t cover every use case under the sun, but it does cover the most important ones (imho). They have discussed using something other than RGBA and decided it’s not worth the trouble.
  • They refrained from adding extra baggage like metadata. It would have needlessly complicated things.

​ Read More
In-reply-to » The lack of suckless-like simple, hackable software these days is appalling.

For example, I reckon software should treat stdout and stderr with care and never output logs or other such garbage to stdout that cannot possibly be useful in a UNIX pipeline 😅

​ Read More
In-reply-to » The lack of suckless-like simple, hackable software these days is appalling.

@prologic@twtxt.net Hm, I wouldn’t say that. Go code could fall into that category as well.

Maybe this topic could use a blog post / article, that explains what it’s about. I’m finding it hard to really define what “suckless-like software” is. đŸ€” (Their own philosophy focuses too much on elitism, if you ask me.)

​ Read More
In-reply-to » The lack of suckless-like simple, hackable software these days is appalling.

@prologic@twtxt.net Ah, I’m referring to software that’s similar to that of suckless.org: Small, minimal codebases, small tools, but still useful. dmenu is probably the best example and also farbfeld.

Here’s the author of Anubis talking about some of their experiences:

https://xeiaso.net/blog/why-i-use-suckless-tools-2020-06-05/

(You can skip the long config and keybinds part.)

​ Read More
In-reply-to » This aggressive auto-logout on my bank’s website 


I hear you, @movq@www.uninformativ.de! :‘-(

At work, too. For a few weeks now when I try to log into this horrible Outlook web intershit (Because why would they fix the Evolution integration?! It’s cactus for well over a year now. Probably more like two.), it forwards me to the corporate weblogin, I enter my credentials, even do the bloody MFA crap and get redirected back to Outlook. “Loading mailbox
” “Please wait for us to log you out, do not close this window while this process is underway.” Fuck you! I have to delete the cookies for this damn domain each and every fucking time. Otherwise, this goes in circles forever. I tried the game for 15 minutes, no joke.

But wait, there’s more! Why just fuck it up only a little bit? This week I get logged out at the middle of the day. Every. Single. Day. Not even close to eight hours since I started, no. What the hell!? I reckon I just don’t even bother reauthenticating anymore in the arvo. No more e-mails for Lyse after lunch. Fuck it. It’s just distraction, anyway, right?!

​ Read More

Cheers @danzin@danzin, was it you who added a PR to core #Python about pprint?

(listening to #corepy #podcast)

Update: Thank you so much for improving Python @danzin@danzin !

core.py: PyCon US 2025 Recap
Starting from: 01:32:45 https://podcasters.spotify.com/pod/show/corepy/episodes/PyCon-US-2025-Recap-e347dc3
https://anchor.fm/s/eb6edc3c/podcast/play/104100675/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2025-5-13%2Fb281ac3a-b0ec-49b9-b31d-7a90031e910d.mp3#t=5565

​ Read More

Someone did a thing:

https://social.treehouse.systems/@ariadne/114763322251054485

I’ve been silently wondering all the time if this was possible, but never investigated: Keep doing X11 but use Wayland as a backend.

This uses XWayland’s “rootful” mode, which basically just gives you a normal Wayland window with all the X11 stuff happening inside of it:

https://www.phoronix.com/news/XWayland-Rootful-Useful

In other words, put such a window in fullscreen and you (more or less) have good old X11 running in a Wayland window.

(For me, personally, this won’t be the way forward. But it’s a very interesting project.)

​ Read More
In-reply-to » Just realized: One of the reasons why I don’t like “flat UIs” is that they look broken to me. Like the program has a bug, missing pixmaps or whatever.

@movq@www.uninformativ.de Yes, flat UIs are broken! I’m used to that by now, but it’s still more work to recognize than when there are borders around buttons, etc.

These are lists in your Inkscape example, right? (I’m too lazy to start Inkscape myself and look at it. And writing this took longer than just seeing for myself, but here we are. I met up with one of my best schoolmate this morning and it’s fucking hot already. So I blame the heat.) Nested tabs are probably an own death sin in itself. I know, I know, the upper ones can be made into windows and dragged around, but still.

​ Read More
In-reply-to » I did a “lecture”/“workshop” about this at work today. 16-bit DOS, real mode. đŸ’Ÿ Pretty cool and the audience (devs and sysadmins) seemed quite interested. đŸ„ł

@lyse@lyse.isobeef.org

They’re all talks, not real hands-on trainings like you did.

I love listening to good, well-structured talks. Problem is, not everybody is a good speaker and many screw it up. đŸ„Ž I’m certainly not a great speaker, which is why I gravitate more towards “workshops”, in the hopes that people ask questions and discussions arise. Doesn’t always work out. đŸ€Ł At the very least, I almost always have some other person connect to the projector/beamer/screenshare and then they do the stuff – this avoids me being wwwwaaaaaaaaayyyy too fast.

We are usually drowned in stress and tight deadlines, hence events like today are super rare 
 We used to do it more often until ~10 years ago.

Once a year the security guys organize a really great hacking event, though.

Oh dear, I’d love to participate in that. đŸ€Ż That sounds like a lot of fun. (Why don’t we do this?!)

​ Read More
In-reply-to » I did a “lecture”/“workshop” about this at work today. 16-bit DOS, real mode. đŸ’Ÿ Pretty cool and the audience (devs and sysadmins) seemed quite interested. đŸ„ł

@movq@www.uninformativ.de Interesting internal education sessions are way too infrequent here as well. There are a bunch of “knowledge transfer” meetings actually, but 90% of the topics already sound totally boring to me. The other 9% talks turned out to be underwhelming, sadly. I only attended a single one where it was delivered what has been promised. They’re all talks, not real hands-on trainings like you did.

Once a year the security guys organize a really great hacking event, though. Teams can volunteer to hand in their software dev instances and all workmates are invited to hack them and report security vulnerabilities. That’s a lot of fun, but also gets frustrating towards the end when you don’t make any progress. :-) There’s also some actual hands-on training in advance for preparation of the two days. Unfortunately, I missed the last event due to my own project being very stressful at the time.

When I had a Do What You Want Day I also show my direct teammates what I learned in the hopes of this being interesting to them as well. I’m the only one in my team using this opportunity, sadly.

​ Read More

I did a “lecture”/“workshop” about this at work today. 16-bit DOS, real mode. đŸ’Ÿ Pretty cool and the audience (devs and sysadmins) seemed quite interested. đŸ„ł

  • People used the Intel docs to figure out the instruction encodings.
  • Then they wrote a little DOS program that exits with a return code and they used uhex in DOSBox to do that. Yes, we wrote a COM file manually, no Assembler involved. (Many of them had never used DOS before.)
  • DEBUG from FreeDOS was used to single-step through the program, showing what it does.
  • This gets tedious rather quickly, so we switched to SVED from SvarDOS for writing the rest of the program in Assembly language. nasm worked great for us.
  • At the end, we switched to BIOS calls instead of DOS syscalls to demonstrate that the same binary COM file works on another OS. Also a good opportunity to talk about bootloaders a little bit.
  • (I think they even understood the basics of segmentation in the end.)

The 8086 / 16-bit real-mode DOS is a great platform to explain a lot of the fundamentals without having to deal with OS semantics or executable file formats.

Now that was a lot of fun. đŸ„ł It’s very rare that we do something like this, sadly. I love doing this kind of low-level stuff.

​ Read More

** My measurer **
My dad is an electrical engineer and physicist. Measuring things is a core part of his professional life, and something he seems to spend a lot of time doing around the house. This is all to say my dad is relatively expert in the ways of measuring things so I think it’s hilarious that he calls absolutely anything he is using to measure anything else“my measurer.” Measuring tape, oscilloscope, scale, volt meter, bubble level, table spoons, whatever. They’re all“my measurer.” ⌘ Read more

​ Read More

Saw this on Mastodon:

https://racingbunny.com/@mookie/114718466149264471

18 rules of Software Engineering

  1. You will regret complexity when on-call
  2. Stop falling in love with your own code
  3. Everything is a trade-off. There’s no “best” 3. Every line of code you write is a liability 4. Document your decisions and designs
  4. Everyone hates code they didn’t write
  5. Don’t use unnecessary dependencies
  6. Coding standards prevent arguments
  7. Write meaningful commit messages
  8. Don’t ever stop learning new things
  9. Code reviews spread knowledge
  10. Always build for maintainability
  11. Ask for help when you’re stuck
  12. Fix root causes, not symptoms
  13. Software is never completed
  14. Estimates are not promises
  15. Ship early, iterate often
  16. Keep. It. Simple.

Solid list, even though 14 is up for debate in my opinion: Software can be completed. You have a use case / problem, you solve that problem, done. Your software is completed now. There might still be bugs and they should be fixed – but this doesn’t “add” to the program. Don’t use “software is never done” as an excuse to keep adding and adding stuff to your code.

​ Read More

Okay, here’s a thing I like about Rust: Returning things as Option and error handling. (Or the more complex Result, but it’s easier to explain with Option.)

fn mydiv(num: f64, denom: f64) -> Option<f64> {
    // (Let’s ignore precision issues for a second.)
    if denom == 0.0 {
        return None;
    } else {
        return Some(num / denom);
    }
}

fn main() {
    // Explicit, verbose version:
    let num: f64 = 123.0;
    let denom: f64 = 456.0;
    let wrapped_res = mydiv(num, denom);
    if wrapped_res.is_some() {
        println!("Unwrapped result: {}", wrapped_res.unwrap());
    }

    // Shorter version using "if let":
    if let Some(res) = mydiv(123.0, 456.0) {
        println!("Here’s a result: {}", res);
    }

    if let Some(res) = mydiv(123.0, 0.0) {
        println!("Huh, we divided by zero? This never happens. {}", res);
    }
}

You can’t divide by zero, so the function returns an “error” in that case. (Option isn’t really used for errors, IIUC, but the basic idea is the same for Result.)

Option is an enum. It can have the value Some or None. In the case of Some, you can attach additional data to the enum. In this case, we are attaching a floating point value.

The caller then has to decide: Is the value None or Some? Did the function succeed or not? If it is Some, the caller can do .unwrap() on this enum to get the inner value (the floating point value). If you do .unwrap() on a None value, the program will panic and die.

The if let version using destructuring is much shorter and, once you got used to it, actually quite nice.

Now the trick is that you must somehow handle these two cases. You must either call something like .unwrap() or do destructuring or something, otherwise you can’t access the attached value at all. As I understand it, it is impossible to just completely ignore error cases. And the compiler enforces it.

(In case of Result, the compiler would warn you if you ignore the return value entirely. So something like doing write() and then ignoring the return value would be caught as well.)

​ Read More
In-reply-to » Just discovered how easy it is to recall my last arg in shell and my brain went đŸ€Ż How come I've never learned about this before!? I wonder how many other QOL shortcuts I'm missing on đŸ„Č

@aelaraji@aelaraji.com I use Alt+. all the time, it’s great. 👌

FWIW, another thing I often use is !! to recall the entire previous command line:

$ find -iname '*foo*'
./This is a foo file.txt

$ cat "$(!!)"
cat "$(find -iname '*foo*')"
This is just a test.

Yep!

Or:

$ ls -al subdir
ls: cannot open directory 'subdir': Permission denied

$ sudo !!
sudo ls -al subdir
total 0
drwx------ 2 root root  60 Jun 20 19:39 .
drwx------ 7 jess jess 360 Jun 20 19:39 ..
-rw-r--r-- 1 root root   0 Jun 20 19:39 nothing-to-see

​ Read More
In-reply-to » Speaking of Wine, Arch Linux completely fucked up Wine for me with the latest update.

@kat@yarn.girlonthemoon.xyz I guess that qualifies as an “Arch moment”, albeit the first one I encountered. I’m running this since 2008 and it’s usually very smooth sailing. 😅

@lyse@lyse.isobeef.org Yeah, YMMV. Some games work(ed) great in Wine, others not at all. I just use it because it’s easier than firing up my WinXP box. (I don’t use Wine for regular applications, just games.)

​ Read More
In-reply-to » OpenBSD has the wonderful pledge() and unveil() syscalls:

@movq@www.uninformativ.de That sounds great! (Well, they actually must have recorded the audio with a potato or so.) You talked about pledge(
) and unveil(
) before, right? I somewhere ran across them once before. Never tried them out, but these syscalls seem to be really useful. They also have the potential to make one really rethink about software architecture. I should probably give this a try and see how I can improve my own programs.

​ Read More

Speaking of Wine, Arch Linux completely fucked up Wine for me with the latest update.

  • 16-bit support is gone.
  • Performance of 3D games is horrible and unplayable.

Arch is shipping a WoW64 build now, which is not yet ready for prime time.

And then I realized that there’s actually only one stable Wine release per year but Arch has been shipping development releases all the time. That’s quite unusual. I’m used to Arch only shipping stable packages 
 huh.

Hopefully things will improve again. I’m not eager to build Wine from source. I’d rather ditch it and resort to my real Windows XP box for the little (retro)gaming that I do 
 đŸ«€

​ Read More
In-reply-to » https://threadreaderapp.com/thread/1935344122103308748.html Interesting article on how ChatGPT is rotting your brain đŸ€Ł

@prologic@twtxt.net Ahhh, right, my bad, I could have easily found that. đŸ€Š

There’s also a project page which lists some limitations of this study: https://www.media.mit.edu/projects/your-brain-on-chatgpt/overview/

It certainly sounds plausible. “Use it or lose it.”

​ Read More

Unless your Terms of use update email looks and reads the same as the one I got yesterday from mastodon.social, I don’t wanna know about it, nor do I agree to it.

​ Read More
In-reply-to » Fuck me sideways, Rust is so hard. Will we ever be friends?

@prologic@twtxt.net I’m trying to call some libc functions (because the Rust stdlib does not have an equivalent for getpeername(), for example, so I don’t have a choice), so I have to do some FFI stuff and deal with raw pointers and all that, which is very gnarly in Rust – because you’re not supposed to do this. Things like that are trivial in C or even Assembler, but I have not yet understood what Rust does under the hood. How and when does it allocate or free memory 
 is the pointer that I get even still valid by the time I do the libc call? Stuff like that.

I hope that I eventually learn this over time 
 but I get slapped in the face at every step. It’s very frustrating and I’m always this đŸ€ close to giving up (only to try again a year later).

Oh, yeah, yeah, I guess I could “just” use some 3rd party library for this. socket2 gets mentioned a lot in this context. But I don’t want to. I literally need one getpeername() call during the lifetime of my program, I don’t even do the socket(), bind(), listen(), accept() dance, I already have a fully functional file descriptor. Using a library for that is total overkill and I’d rather do it myself. (And look at the version number: 0.5.10. The library is 6 years old but they’re still saying: “Nah, we’re not 1.0 yet, we reserve the right to make breaking changes with every new release.” So many Rust libs are still unstable 
)


 and I could go on and on and on 
 đŸ€Ł

​ Read More
In-reply-to » Come on, why is the bloody IBAN only in the damn HTML part of your e-mail but not in the plain text!? Grrr! Don't you wanna get paid, dealer!? Your new web shop system sucks so bad, I want the old version back.

@movq@www.uninformativ.de Yeah. :-( But hey, there are at least six of us using mail as it should beℱ. :-)

I sent the dealer an e-mail about that with all sorts of other issues as well. Let’s see if they fix anything of that some day. Or yet just even read it.

​ Read More
In-reply-to » Come on, why is the bloody IBAN only in the damn HTML part of your e-mail but not in the plain text!? Grrr! Don't you wanna get paid, dealer!? Your new web shop system sucks so bad, I want the old version back.

@lyse@lyse.isobeef.org 
 because you, me, and that guy over there in the corner are the only three people left using plain-text email. đŸ«€ (And probably Stallman.)

​ Read More

OpenBSD has the wonderful pledge() and unveil() syscalls:

https://www.youtube.com/watch?v=bXO6nelFt-E

Not only are they super useful (the program itself can drop privileges – like, it can initialize itself, read some files, whatever, and then tell the kernel that it will never do anything like that again; if it does, e.g. by being exploited through a bug, it gets killed by the kernel), but they are also extremely easy to use.

Imagine a server program with a connected socket in file descriptor 0. Before reading any data from the client, the program can do this:

unveil("/var/www/whatever", "r");
unveil(NULL, NULL);
pledge("stdio rpath", NULL);

Done. It’s now limited to reading files from that directory, communicating with the existing socket, stuff like that. But it cannot ever read any other files or exec() into something else.

I can’t wait for the day when we have something like this on Linux. There have been some attempts, but it’s not that easy. And it’s certainly not mainstream, yet.

I need to have a closer look at Linux’s Landlock soon (“soon”), but this is considerably more complicated than pledge()/unveil():

https://landlock.io/

​ Read More

So I was using this function in Rust:

https://doc.rust-lang.org/std/path/struct.Path.html#method.display

Note the little 1.0.0 in the top right corner, which means that this function has been “stable since Rust version 1.0.0”. We’re at 1.87 now, so we’re good.

Then I compiled my program on OpenBSD with Rust 1.86, i.e. just one version behind, but well ahead of 1.0.0.

The compiler said that I was using an unstable library feature.

Turns out, that function internally uses this:

https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.display

And that is only available since Rust 1.87.

How was I supposed to know this? đŸ€šđŸ«©

​ Read More
In-reply-to » @prologic I am finding writing my Notes very therapeutic. Just create a markdown file and commit, push, and it’s live. Whatever comes to mind, whatever I want to keep as relevant. Silly things, more like a dump.

@bender@twtxt.net I know I know! I don’t know why I ever signed up and used it and still continue to pay for the silly thing. Twtxt/Yarn is so much better in every way đŸ€Ł

​ Read More
In-reply-to » @prologic I am finding writing my Notes very therapeutic. Just create a markdown file and commit, push, and it’s live. Whatever comes to mind, whatever I want to keep as relevant. Silly things, more like a dump.

@prologic@twtxt.net yes, I never understood you using micro.blog (and paying for it, nonetheless!). I don’t like it (as a platform), and have an unexplainable dislike for its creator.

​ Read More
In-reply-to » Great article from Tailscale about how security policies we've often seen in many large complex organizations that we all love to hate don't actually provide the security that we assumed.

@prologic@twtxt.net do you remember Hamachi? Tailscale/Headscale is Hamachi on steroids. They are used primarily for creating a VPN among all your devices so they can talk to one another as if they were on the same LAN, even when they’re not. That was, mostly, my WireGuard usage.

I still have WireGuard running—because it is so lite that it doesn’t matter—to use as regular VPN, but Headscale keeps all my devices connected forming their own “mini-Internet” 100% of the time.

​ Read More
In-reply-to » Great article from Tailscale about how security policies we've often seen in many large complex organizations that we all love to hate don't actually provide the security that we assumed.

@bender@twtxt.net What’s awesome about it btw? I use WireGuard pretty heavily here. And my entire family also use it to keep a VPN connection back to our home network

​ Read More

I’ve told that whomever has this link will be able to watch live the third and edition of “Secret Garden festival”.

“We bring you the delights of Scott Marshall Hurdy Gurdy, and Bristol’s Dead Space Chamber Music, with a little Sieben to kick off proceedings. Come join us in the garden!”

Starting now!

https://www.youtube.com/live/k9V92zE4dyk

​ Read More
In-reply-to » I wanted to port this to Rust as an excercise, but they still have no random number generator in the core library: https://github.com/rust-lang/rust/issues/130703

@prologic@twtxt.net Yeah, it’s difficult, you often don’t get what you’d expect. They also make heavy use of 3rd party libraries. IIUC, for random numbers, they refer to this library. I’ve read many times that the Rust stdlib is intentionally minimalistic (to make it easier to maintain and port and all that).

I’m struggling with this, using 3rd party libs for so many things isn’t really my cup of tea. I’ll probably make my own tiny little “standard library”. It’s silly, but I don’t see any other options. đŸ€·

​ Read More

Lately (since there are AI summaries at the top), each time I Google for the answer to a question, the AI summary has at least a part of the answer wrong. It makes up laws that do not exist, books that were never published - in sum, well written sentences that make linguistic sense, but with made up content.

Let me repeat: each time. Maybe I only search for hard stuff, or fringe stuff, or this some other explanation - but seriously, it’s hard to understand how isn’t Google ashamed of its AI overviews
 or not sued under some regulation regarding fake news.

PS: yes, I know, my fault for using Google as a search engine.

​ Read More

Of Pointlessware and CEOs
Had a moment, to check up on some of the companies, I stopped following, get to The Browser Company and see their newest product - it’s just Chrome, with an AI chat window pop-up and that’s it. Something Canary Chrome, come with already.
I see Theo from T3.gg, making fun of it on YouTube and promoting “his” product - an AI chat app, where you can choose from multiple models, by all the popular AI companies. Something I already have a worse version of, at work and I don’t even use it.
There’s also an interview, about the future of virtual keyboards, surely this is at least actually a real thing and not more pointless horse shit. I check the website of the keyboard SDK, and it’s around 20 identical apps, that just copy the same keyboard SDK/api and slap chatgpt features on top - in the App Store, these are surrounded by chatgpt clones, that just feed the users prompts, into the real thing and put ads, next to the answers.

​ Read More

[$] Improving iov_iter
The iov_iter interface is used to
describe and iterate through buffers in the kernel. David Howells led a combined storage and
filesystem session at
the 2025 Linux Storage,
Filesystem, Memory Management, and BPF Summit (LSFMM+BPF) to discuss ways
to improve iov_iter. His topic\‹proposal listed a few different ideas including replacing some
iov_iter types and possibly allowing mixed types in chains of 
 ⌘ Read more

​ Read More

Marines to arrive in LA as ABC camera operator hit by less lethal round during protests
An additional 700 US Marines are expected to reach Los Angeles on Monday night or Tuesday morning, local time, as part of efforts to quell the protests. ⌘ Read more

​ Read More

Looser gun laws tied to thousands more US child shooting deaths
Issam Ahmed,  Staff Writer  -  Agence France-Presse / Raw Story

Stephan: The failure of the Democrats and Republicans, and the corrupt Supreme Court MAGAt majority to deal with gun violence in the United States has made death by gunfire the leading cause of nonmedical death. The Trump coup fascists have even gone so far as to legalize functional machine guns in civilian hands.

![](https://www.sc 
 ⌘ Read more

​ Read More

Gouverneur kritisiert Trump scharf
Der demokratische Gouverneur von Kalifornien, Gavin Newsom, hat scharfe Kritik an der weiteren Entsendung von Mitgliedern der Nationalgarde und von Marines nach Los Angeles geĂŒbt. Die Entscheidung des republikanischen PrĂ€sidenten Donald Trump sei „geistesgestört“, so Newsom am Montag (Ortszeit). WĂ€hrend sich die Lage bei den Protesten gegen Razzien der US-Einwanderungsbehörde in der Millionenmetropole beruhigte, kam es in anderen US-StĂ€dten zu Demonstrationen. ⌘ Read more

​ Read More

10 Movie Characters Who Make Us Laugh at Unemployment
For one reason or another, most people have been between jobs at some point and experienced the frustration, uncertainty, and various problems that come with unemployment. That’s why movies that deal with being out of work in a lighthearted way can be so appealing. Humorous depictions of what is normally such a stressful time may [
]

The post [10 Movie Characters Who Make Us Laugh at Unemployment](https://listverse.com/2025/ 
 ⌘ Read more

​ Read More

Alle Mitglieder von Impfgremium entlassen
In den USA hat Gesundheitsminister Robert F. Kennedy Jr. alle Mitglieder eines wichtigen Gremiums (ACIP) von Impfexpertinnen und -experten der US-Seuchenbehörde CDC entlassen. Kennedy begrĂŒndete den Schritt am Montag (Ortszeit) in einem Gastkommentar fĂŒr das „Wall Street Journal“ mit angeblichen Interessenkonflikten der Forschenden. Fachleute zeigten sich von der Entscheidung entsetzt. ⌘ Read more

​ Read More

Ex-military officers raise concerns about ‘combat unit’ marines sent to LA
Former US military officers say hundreds of marines deployed to the LA protests are from combat units, which was a drastic move that raises questions about President Donald Trump’s intentions. ⌘ Read more

​ Read More