@aelaraji I wish I had the luxury of not reading that junk. 😅 But instead, I have a Mutt hotkey that pipes an HTML mail through elinks … Bah.
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 … 🤣
I'm literally sitting in a corner *chuckles*. I rarely get any emails nowadays. But if I do and it is not plain-text, then my Mutt gets to bark at it and I, just... won't read it. 🤷🏽♂️
https://wholesalenutsanddriedfruit.com/upside-down-pineapple-was-a-symbol-for-swingers-in-the-colonies/
https://wholesalenutsanddriedfruit.com/upside-down-pineapple-was-a-symbol-for-swingers-in-the-colonies/
Acho que ele ia gostar de ver isso aqui:
https://mastodon.social/@carapace/114699111024833608


>
> As a joke, they started The Dull Men’s Club, which involved some very silly, dull activities. They chartered a tour bus but didn’t go anywhere. “We toured the bus. We walked around the outside of the bus a few times. And the driver explained the tyre pressures and turned on the windscreen wipers.”
https://www.theguardian.com/society/2025/jun/09/meet-the-members-of-the-dull-mens-club-some-of-them-would-bore-the-ears-off-you
>
> As a joke, they started The Dull Men’s Club, which involved some very silly, dull activities. They chartered a tour bus but didn’t go anywhere. “We toured the bus. We walked around the outside of the bus a few times. And the driver explained the tyre pressures and turned on the windscreen wipers.”
https://www.theguardian.com/society/2025/jun/09/meet-the-members-of-the-dull-mens-club-some-of-them-would-bore-the-ears-off-you
Portanto, o #IL não quer ser colado a #Milei e #Musk e então em vez de exigir uma #motosserra... quer um #bulldozer.
*animação de olhos a rebolar*
Portanto, o #IL não quer ser colado a #Milei e #Musk e então em vez de exigir uma #motosserra... quer um #bulldozer.
*animação de olhos a rebolar*
My brain: Good, as you don't feel any obligation to work on your PhD today, you should just open the PhD working file and start working on it, no pressure. it will feel nice, I promise!
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/
https://www.os2museum.com/wp/learn-something-old-every-day-part-xv-keyb-is-half-of-keyboard-bios/


https://pyodide.org/en/stable/usage/packages-in-pyodide.html
#Python #CreativeCoding
Why? Because it turns out you can only see it if you are in landscape, in portrait view the button simply does not exist...
#ux #fail


Why? Because it turns out you can only see it if you are in landscape, in portrait view the button simply does not exist...
#ux #fail


Mas para mim a feira #medieval de #Lamego é aquela altura do ano em que vou até à praça e bebo #hidromel. E quem diz que essa não é uma boa tradição a manter e celebrar? ;-)
* https://pt.m.wikipedia.org/wiki/Cortes_de_Lamego

Mas para mim a feira #medieval de #Lamego é aquela altura do ano em que vou até à praça e bebo #hidromel. E quem diz que essa não é uma boa tradição a manter e celebrar? ;-)
* https://pt.m.wikipedia.org/wiki/Cortes_de_Lamego

(...15 minute version is a great watch though)
(...15 minute version is a great watch though)
fn sub(foo: &String) {
println!("We got this string: [{}]", foo);
}
fn main() {
// "Hello", 0x00, 0x00, "!"
let buf: [u8; 8] = [0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x00, 0x00, 0x21];
// Create a string from the byte array above, interpret as UTF-8, ignore decoding errors.
let lossy_unicode = String::from_utf8_lossy(&buf).to_string();
sub(&lossy_unicode);
}
Create a string from a byte array, but the result isn’t a string, it’s a cow 🐮, so you need another
to_string()
to convert your “string” into a string.- https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy
- https://doc.rust-lang.org/std/borrow/enum.Cow.html
I still have a lot to learn.
(
into_owned()
instead of to_string()
also works and makes more sense to me, it’s just that the compiler suggested to_string()
first, which led to this funny example.)
By the way, looks like there was a bit of a discussion regarding that name:
https://github.com/rust-lang/rust/issues/120048
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? 🤨