Show more

We all have a chat protocol server thing waiting for us.

Show thread

I wanna write a chat protocol server thing in zig.
Also, I want to learn zig.

Actually, let's add a third option:
flat key-value pairs:

request_count 42
active_connections 5
queued_connections 1

very similar to the json example but strongly assumes flatness and is easily parsable with awk

Show thread

Which format would you prefer for sending a known beforehand set of a few integer variables, like:
"request_count": 42,
"active_connections": 5
"queued_connections": 1

42 5 1

Wolf480pl boosted

OpenPush - A Free, Decentralized Push Messaging Framework for Android

(The embedded video doesn't play because of a strict CSP policy, if you want to watch it, you'll need to click through to the #FOSDEM talk page)

Wolf480pl boosted
git subtree is instant, free, vendoring of git repositories with exactly the semantics which you actually want
Wolf480pl boosted
@mimorinka "Tenshi Eating a Corndog" is a much discussed concept on /jp/. The significance of it is disputed, so I will focus on one core concept: the symbolism behind it. But first we must identify and explore the key components of it. Hinanawi Tenshi is a human child that has ascended to become a celestial being. In Hinduism, she would be called a Siddha or a Deva. In Chinese, it would be refered to as a Tian Xian, or heavenly immortal. In Japanese, it would be using the same kanji characters as in Chinese, being called a Tennin. She is also refered to as an angel, although the role of a heavenly messenger is better suited to her companion Nagae Iku. Regardless of which Oriental cosmology she claims the greatest influence from, Hinanawi Tenshi in Touhou: Scarlet Weather Rhapsody is presented as a roving celestial being that decides to cause mayhem out of childish boredom. A corndog on the other hand is simply a sausage coated in a thick layer of cornmeal batter on a stick. It is considered a quintessential part of the American diet, being a cheap combination between convenience and an arguably delicious meal of protein and carbohydrates. It is not a new concept by any means, but it is something that is also unmistakably modern and mundane. Thus this is why "Tenshi Eating a Corndog" is so intriguing. Why exactly is a celestial being consuming a corndog, despite having access to the Jade Wine Waterfalls and Immortal Peach Orchards of Heaven? The earthly and celestial is contrasted in an oustanding way. Take a look at the blue sky in the background and the color of her hair. In the Swami Vivekananda, the concept of infinity is considered blue. Take the air and water, for within the space of our hands, it is colorless, but in a vast quantity it is blue. Tenshi is shown to represent infinity, as she to is of the sky. As to the corndog to her, the Route 66 sign is to the sky. What of the tiny stretch of road to the vastness of the heavens? But without that land, the heavens would not be. So as it is, you see the Heavenly consume the Earthly. Not out of pleasure, as we can see from her expression, but of necessity to understand the realm she observes from up high. But we see it as something of joy, for we too know that the divine are as of us. This is perhaps a commentary of the immaturity of Tenshi Hinanwi, who still has a physical body unlike truly enlightened beings. But it could also be a commentary of the unwilligness of humans to see gods (at least the important ones) as anything but in their image and why the gods so often take human form. This is represented even in the game afterwards, Hisoutensoku (Unpercieving of Natural Law). Unlike its predecessor, Gakutensoku (Learning of Natural Law), Hisoutensoku is considered blind to it, as it from a land without logic. In the utter contrast of "Tenshi Eating a Corndog", we see through the eyes of Hisoutensoku. This is the true symbolism behind "Tenshi Eating a Corndog": That our perception is constrained by the laws that invisibly govern over us. Pierce the veil of illusion, and see why the mustard intertwines with the ketchup.
Wolf480pl boosted

I work in IT which is the reason this house has:

- mechanical windows
- mechanical door locks
- no Alexa/HomeKit/Google
- no Internet connected thermostats, lamps, or whatnots
- a dumb TV
- wall switches for lights

Wolf480pl boosted
Wolf480pl boosted

@sir indeed.

tbh. it's best to just watch Garry Bernhardt's talk:

But I'll try to summarize it:

For each parts of your program, eg. for a particular function, there are all kinds of ways in which it can be ran.

Some of them are correct. But most of them are bogus / illegal / should never happen.

A test takes one of the legal ways to run it, and makes sure that it works correctly in that particular situation.

A good type signature takes (almost) all of the illegal ways and proves that they will never happen.
You describe a small subset of situations you care about, and a type checker proves that everything else is impossible, or - if it can't prove it - fails the build.

Wolf480pl boosted

@Wolf480pl perfect

or, in short, design an API that tautologically cannot be used incorrectly

Wolf480pl boosted

Solve hard problems first, then use the implementation of the rest of the system to prove that your solution is correct

Also, I had this issue open all the time in my browser:

And it describes the exect same problem except with UUIDs.

And I have read it before.
And yet it didn't occur to me at that time that the same thing might be happening with labels.

Show thread

Oh, so the inherit-from-parent thing is not a built-in feature, but another udev rule:

ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"

For some reason I didn't notice that file when reading 60-persistent-storage-rules for the first time.

And it looks like it's fixed in udev upstream:

Show thread

YES. That worked.

tl;dr if you're gonna embed partitions in an iso9660 filesystem, give them labels. Any labels. Or they'll inherit the iso's one from the whole-disk udev node thingy.

Show thread

Many hours of random fighting, thinking that there's a bug in blkid?

There's nothing like that on the issue tracker, maybe I should ask on -linux IRC channel? Well ok, there was one pull request about detecting ISOs better, but it was about not giving label to a partition if the whole-disk already had that label... not relevant I guess.

Maybe something accidentally uses busybox's builtin blkid instead of the util-linux one?
Or maybe if I add a random `udevadm trigger` it'll fix itself (it does 50% of the time).

Wait a sec, that blkid in the udev rule is an udev buitlin, not an external command.

Found the source code, started reading it. It was all cryptic calls to libblkid that I had no idea what were doing. And something about reading properties inherited from parent device.

Anyway, could it be that it's a bug in libblkid?
Also, what is this "test" argument passed to the builtin? Maybe there's a way to dry-run it?
Sure there is!

udevadm test-builtin blkid /sys/class/block/sda2
Ok, prints some properties, but nothing about label.
So libblkid does the right thing.

Waait... udev properties are inherited from parent devices!
So /dev/sda2 inherits label from /dev/sda because it doesn't have its own label!

So if I add a label - any label - to my vfat image, eg. by adding "-n EFI" to mkfs.vfat's options...

Show thread

So I made a usual ultra-hybrid bootable-from-usb ISO clusterfuck with an EFI system partition. You know the deal:

/dev/sda iso9660 MY_LIVE
鈹溾攢/dev/sda1 iso9660 MY_LIVE
鈹斺攢/dev/sda2 vfat

3rd column is fs label.

Then in initramfs I find the iso like

blkid -lt LABEL=MY_LIVE -o device

...aand it returns /dev/sda2.


But blkid without options prints the right thing:

/dev/sda2: UUID=1234-5678 TYPE=vfat
/dev/sda1: LABEL=MY_LIVE TYPE=iso9660
/dev/sda: LABEL=MY_LIVE TYPE=iso9660

What about:

blkid -t LABEL=MY_LIVE -o device ?
/dev/sda1, OK

ls -l /dev/disk/by-label/MY_LIVE ?
/dev/sda2, wrong.

A quick look through blkid source shows that the -l "print one line only" flag actually switches to "just read udev symlinks" mode.

So it's udev's fault.

udevadm info /dev/sda2 |grep LABEL

where did that one come from?


KERNEL!="sr*", IMPORT{builtin}="blkid"

So udev got it from blkid and got it wrong? Wtf?

To be continued...

Wolf480pl boosted

If your software has become more complex to accomodate more use-cases, this is very bad

If your software has become more simple to accomodate more use-cases, this is very good

Wolf480pl boosted

Will you refuse to install an application because of the programming language it was written with?

- Yes
- Conditionally (Yes, but only if there is no binary available and I have to install the language's build tools)
- No
- Other conditions: please specify

Boosts appreciated, because I find the "boosts appreciated" trick working for other people and I figured I'd try once

why would anyone make a UEFI which can boot in MBR/BIOS mode, but deliberately restrict it only to removable devices?

Show more

Welcome to your niu world ! We are a cute and loving international community 锛(鈮р柦鈮)锛 !