gnuhaut

joined 2 years ago
[–] gnuhaut@lemmy.ml 4 points 2 months ago (5 children)

My hunch on what's going on: Dig opens up a different udp port (it has to, there would be avahi-daemon listening on 5353). So it sends out to the multicast address on 5353, but the answer comes back from the actual IP of whoever is answering, to whatever port dig is listening on, and the connection tracking is not smart enough to figure out this should be let through?

You should look at the traffic with wireshark.

Also maybe that's fine in practice? Do applications actually run their own mDNS queries? Maybe it all goes through avahi-daemon? That uses port 5353 so that would get an answer if it did the mDNS query instead of dig. But I'm not sure how this works, so that's just a guess.

[–] gnuhaut@lemmy.ml 2 points 2 months ago

Yeah you're right, thanks. I did figure this out on my own already, see my other comment:

Oh yeah that, so technically (and I was confused about this), the p in s/from/to/p is not the same as the p command, it’s a flag for the s command that tells it to print the output.

[–] gnuhaut@lemmy.ml 1 points 2 months ago (1 children)

Yeah no problem.

What's maybe interesting is how sed came to be. Back in early days of Unix, they had ed as their editor (or, as some old manpage says, "Ed is the standard text editor.")

Sed has basically the same commands as ed. You typed 3d to delete the third line, or 10,20p to print lines 10 to 20. They only had teletypes back then, which are basically a keyboard and dot-matrix printer with one of those continuous papers for output, prior to when hardware terminals with CRT screens were a thing.

Anyway, someone thought it would be useful if you could put ed-style editing commands inside shell pipelines, and ed doesn't work for that. It is used for interactively editing files in place, and so gets commands from stdin. You can't pipe any files into it. So the "stream editor", sed, was born.

Also interesting: There were improved modified versions of ed going around like em and later ex. The original vi was a "visual mode" extension for ex, and you can still run ex/ed commands from vi by typing : first, e.g. you can delete line 3 by typing :3d inside vi.

[–] gnuhaut@lemmy.ml 2 points 2 months ago (3 children)

Oh yeah that, so technically (and I was confused about this), the p in s/from/to/p is not the same as the p command, it's a flag for the s command that tells it to print the output. You could do multiple commands like /re/ {s/a/b/;p} for the same result, by using a {} block.

If you do, say, /re/ s/a/b/; p those would be separate command, the first does the thing on lines matching /re/, while the p has no address range (e.g. regex) associated with it, so it gets executed for all the lines.

[–] gnuhaut@lemmy.ml 2 points 2 months ago (5 children)

What expressions?

I mean awk is more powerful, it has variables, function, can do arithmetic and format strings, and such proper scripting language features. And the GNU awk manual is rather well written.

[–] gnuhaut@lemmy.ml 8 points 2 months ago* (last edited 2 months ago) (9 children)

You can do something like this to emulate grep:

sed -n '/myregex/p'

The -n suppresses auto-printing. That command should interpreted as: find line matching /myregex/ and then print (p) it.

You can then combine this with s (substitute):

sed '/myregex/ s/from/to/ p`

The complete command is then something like:

LANG=C df -h --output=avail,source | sed -n '/\/dev\/nvme0n1p2/ s/^\s*\([0-9.]\+[KMGT]\).*/\1/ p'

Note that the output can be something like 2.3G, but in my locale that would be 2,3G which is why I added LANG=C.

Easier IMHO is awk:

awk '/myregex/ {print $1}'

prints the first field.

[–] gnuhaut@lemmy.ml 32 points 3 months ago* (last edited 3 months ago) (1 children)

There's some wrong things in this article, and a thing worth mentioning.

Half-Life (and its mods like Counter-Strike) had Linux server versions, and a lot of dedicated servers ran on Linux, which I think is worth mentioning when talking about the history.

Steam wasn't well received at first, people didn't like that there was now this special launcher/downloader you had to use. Mind you they moved their old games onto Steam, so it's not like you knew about this when you bought it. Also there weren't any games on there except Half-Life and related titles, like HL mods that got their own release.

Contrary to what the article claims, MacOS does not support some outdated version of DirectX, it does not and never has supported DirectX at all. DirectX was only ever supported on Windows and XBox.

DirectX also was not well received at first. Here's an old article from gamedev.net (2002):

What later became known as DirectX 1.0 ended up not being very widely accepted. It was buggy, slow, badly structured, and overly complex.

Of course, Microsoft wasn't about to just give up. They kept working at it, asking the community for ways to improve it. The first truly viable version of DirectX was DirectX 3.0. A few years later, they released DirectX 5 (skipping 4 entirely), which was the first truly useful version. Incremental improvements were made with version 6. Then came DirectX 7.0.

DirectX 7 was the first one to actually be embraced by game developers. It worked well, making game programming reasonably easy, and a lot of people liked the interface.

Here's a bunch of things John Carmack had to say about DirectX over the years:

First, a rant by John Carmack from 1996:

I have been using OpenGL for about six months now, and I have been very impressed by the design of the API, and especially it's ease of use. A month ago, I ported quake to OpenGL. It was an extremely pleasant experience. It didn't take long, the code was clean and simple, and it gave me a great testbed to rapidly try out new research ideas.

I started porting glquake to Direct-3D IM with the intent of learning the api and doing a fair comparison.

Well, I have learned enough about it. I'm not going to finish the port. I have better things to do with my time.

John Carmack revised his opinion later. Here he is posting in 2001 about DirectX 8:

D3D is clunky, etc

Not really true anymore. MS made large strides with each release, and DX8 can't be called a lousy API anymore. One can argue various points, but they are minor points. Anti-Microsoft forces have a bad habit of focusing on early problems, and not tracking the improvements that have been made in current versions. My rant of five years ago doesn't apply to the world of today.

But:

All of Nvidia's new features have showed up as OpenGL extensions before they show up as new D3D features.

By 2011 he thought Direct3D was better than OpenGL.

[–] gnuhaut@lemmy.ml 41 points 3 months ago

So, the Manhattan Project started. Manhattan Project was Microsoft's attempt at creating a set of APIs that would make the task of writing games for their platform significantly less painful. The questionable naming decision was, sadly, fully intentional: while Microsoft had most of the PC gaming on its side, the gaming industry as a whole was mostly dominated by game consoles from Japan.

WTF Microsoft.

[–] gnuhaut@lemmy.ml 1 points 3 months ago

Since you say the thing is working fine on Windows, there's almost certainly a bug or several. I'd say probably a driver in the kernel, but could be something else. Changing distro or kernel version does sometimes help with that sort of thing, mainly because another distro may have newer or older kernels and other software, and bugs get both introduced and fixed every release.

Freezing issues can have lots reasons, including buggy apps, RAM exhaustion due to memory leaks, bugs in the graphics drivers or graphics stack more generally, various blocking I/O things taking unexpectedly long due to network issues or faulty hardware or drivers.

If you want a chance to figure this out, you probably need to run things in the terminal, like installing software updates through the apt and snap (?) cli utilities. GUIs are notoriously shit at reporting unexpected errors, whereas all sorts of programs (including GUI apps if you start them in a terminal) do regularly print warnings and error messages to stderr, which will show up in a terminal. This is because it's easy for the programmers to do that with just single printf() (etc.) line.

For driver issues, looking at the kernel logs can sometimes show interesting things as well. I will say that, when looking at logs or terminal output, there often are warnings that are completely unrelated and/or harmless, and that's not necessarily obvious to the user.

If this is a software issue, framework imho shouldn't advertise their stuff being able to run Ubuntu if they cannot stay on top of issues that are happening in this configuration.

[–] gnuhaut@lemmy.ml 11 points 3 months ago* (last edited 3 months ago)

This is actual RAM used by the desktop environments that is not available for cache. That is the number he gets from top, it doesn't include the disk cache. The DE won't use less RAM even when Firefox needs it, because it is not cache, it cannot be dropped if needed, you just have less RAM available for you applications (or for the actual cache, for that matter).

[–] gnuhaut@lemmy.ml 2 points 3 months ago* (last edited 3 months ago)

Glad you got it working.

[–] gnuhaut@lemmy.ml 2 points 3 months ago (2 children)

If we assume, for a moment, that your issue was in fact related to fluidsynth, which I kinda still think it might be, because of what fuser and the logs showed, it would be a good idea to undo your module blacklist thingy and reboot.

If your slow boot issue persists, and you try to fix that tomorrow, then try looking at the bootup messages as described here:

https://askubuntu.com/questions/25022/how-to-enable-boot-messages-to-be-printed-on-screen-during-boot-up

If you reinstall pulseaudio to get back to where you were before, uninstall pipewire, those two shouldn't be running simultaneously.

Good luck and keep me updated if you manage to fix it somehow.

view more: ‹ prev next ›