gnuhaut

@gnuhaut@lemmy.ml

This profile is from a federated server and may be incomplete. Browse more on the original instance.

gnuhaut,

As others have said, if you quote your variables, they won’t get split on spaces. The Unix shell unfortunately has ton of gotchas like this, and the reason this is not changed is backwards-compatibility. Lots of shell scripts depend on this behavior, e.g. there might be something like:


<span style="color:#323232;">flags="-a -l"
</span><span style="color:#323232;">ls $flags
</span>

If you quote this (ls “$flags”), ls will see it as one argument, instead of splitting it into two arguments. You could patch the shell to not split arguments by default, and invent some other syntax for when you want this splitting behavior, but that would break a ton of existing shell scripts, and confuse users who are already familiar with the way it works right now. It would also make the shell incompatible with other shells, and violate the POSIX standard.

gnuhaut,

I disagree. The vast majority of the time when writing shell scripts, I quote variables, because that’s almost always what I want. Splitting is basically only useful if you have a list of arguments, and you know for sure there are no spaces in any of the arguments (so no filenames).

(The workarounds in pure POSIX shell are btw super annoying if you want to pass a list arguments that may have spaces in them: You can abuse the special “$@” variable. Or you could probably also construct something with xargs.)

gnuhaut, (edited )

Ah that’s your point. Yeah I agree that splitting literal a b c is convenient. It is surprising to many (like here) that this happens after variable substitution, and that’s not very convenient since you almost never want that. You could define this to happen the other way around, but then you’d obviously have to invent a new syntax for explicit splitting, which would be its own kind of annoying.

Edit: YSH (oil) does that btw. See here.

gnuhaut, (edited )

I did it during the gcc 3 transition. I used a very new gcc 3 (maybe even pre-release), which wasn’t at all recommended. A couple of (most?) C++ packages didn’t compile (some change having to do with namespace scope), which meant I had to fix the source of some packages (generally pretty trivial changes, usually having to prepend namespace:: to identifiers). Overall this problem was pretty rare, like it affected less than 1% of C++ files, but with things like Qt or Phoenix (or whatever Firefox was called back then), with thousands of files, I had to fix dozens of things. I guess running into problems made it more interesting and fun actually.

Did I learn anything? The main thing I learned is about all the different basic packages and what sort of binaries and libraries are included in them and why you need them. Also about some important config files in /etc. And a bit of shell experience, but I dare say I knew most of that stuff already. How much you learn depends a lot on how much you already know.

Overall what I learned was not very deep knowledge, nor was it a very time-efficient way to learn. But it was a chill learning experience, goal-oriented and motivating. And it made me more comfortable and confident in my ability to figure out and fix stuff.

Also it’s obviously not practical to keep that up to date, so I switched back to a distro after a couple of months of this.

Auto kill memory leaking processes before swap death loop

I’m using linux mint 21.3, and a process (brave aka chrome) sometimes memory leaking, so eats all the RAM, and then linux goes into swap death loop, when everything freezes (sometimes the mouse cursor is moving), and nothing can’t be done, i can just see the HDD led blinking, and do a reset. Is there a way to make the system...

gnuhaut, (edited )

This doesn’t work to avoid thrashing. The kernel may invoke the OOM killer slightly quicker if you have no swap, so I guess that can sort of help, but it doesn’t properly solve the problem.

On Linux, there’s a thing called the page cache (aka disk cache): Every time (part of) a file gets read to or written from, that (part of) the file gets copied to RAM. The file is then kept there unless that RAM is needed for something more important. It is cached in RAM. But since it is also on disk, the kernel can drop the file from RAM anytime it wants.

If you’re low on RAM, the kernel therefore evicts all of the disk cache, because it can, because those pages can be reloaded from disk if needed. This means it will drop all the programs you’re running, the binary code. So any program you’re running is constantly interrupted, because its code is not in RAM.

So it runs a couple of instructions, but oh no! Call to function foo() from glibc, but guess what? That’s on disk. Queue wait for the kernel to load that. Oh now it wants function bar() from zlib, shit! Need to load that. Since loading stuff from disk is about as slow as running like a gazillion instructions, all your programs are like 1000x slower now.

This happens even with zero swap.

The correct advice is the one from @RedWeasel: install/enable systemd-oomd or earlyoom.

gnuhaut,

I’ll make an appeal to authority (kernel developer working on memory management):

Disabling swap does not prevent disk I/O from becoming a problem under memory contention, it simply shifts the disk I/O thrashing from anonymous pages to file pages. Not only may this be less efficient, as we have a smaller pool of pages to select from for reclaim, but it may also contribute to getting into this high contention state in the first place.

And then he goes on to say what I said, that it can make the OOM killer quicker to react.

chrisdown.name/2018/01/…/in-defence-of-swap.html

gnuhaut,

Does Russia aim those nukes at Poland? They will if there are nukes there.

gnuhaut,

Die stb-care Holding GmbH betreibt das Heim seit 1. März.

Das ist so gewollt, irgendwas mit Markt und Wettbewerb. Das ist die effizienteste und rationalste Art um die gesamte Gesellschaft zu organisieren, das ist klar.

gnuhaut,

Since that bug seems related to the X server somehow, I wonder if your monitor is showing black or actually off/standby (as in backlight off)?

If it’s the backlight, maybe it’s related to DPMS (monitor power management), and you can jolt it back to life with something like


<span style="color:#323232;">xset dpms force on
</span>

after waking up. Or maybe disable DPMS completely and see if that changes anything.

It would also be interesting to know if this problem also happens outside of XFCE. If you just use (say) openbox (which I don’t think does any power management or DPMS stuff by itself), does that work?

gnuhaut,

It actually starts, and then turns off. I didn’t notice it before you drew my attention.

That does sound like DPMS (“vesa display power management signaling”) shenanigans though.

Maybe you can disable XFCE’s display power management stuff completely? Systemd’s logind (/etc/systemd/logind.conf) can do (and does by default I think) suspend on lid-close without any window manager involvement at all, works fine with i3 here. So disabling XFCE’s stuff probably “only” messes with your monitor not going standby after a while, and you can maybe use xset or xscreensaver and set this by hand (after making sure it’s actually properly disabled in XFCE, so XFCE doesn’t override that stuff).

Found this about how to stop xfce4-power-manager and disable DPMS:


<span style="color:#323232;">xfce4-power-manager -q
</span><span style="color:#323232;">xset -dpms
</span>

Try doing that and see if lid close works afterwards.

gnuhaut,

OK glad you found some workaround!

gnuhaut,

Since when is aluminium biologically important? I’m under the impression that humans (and other life?) do not need aluminium at all.

Having said that, my info is that it’s nothing to worry about. It is very common in food (naturally and since forever), and the body can get rid of it, and they haven’t been able to show adverse effects except in very very high doses. That’s the messaging I’ve been seeing anyway.

What is this block-rate-estim?? Suddenly came to life

While I was writing a shell script (doing this the past several days) just a few minutes ago my PC fans spinned up without any seemingly reason. I thought it might be the baloo process, but looking at the running processes I see it’s names block-rate-estim . It takes 6.2% CPU time and is running since minutes, on my modern 8...

gnuhaut,

Maybe you have some sort of auto-completion plugin that attempts to parse –help output? And that particular binary doesn’t understand –help probably.

Maybe try running pstree to see who spawns that process?

gnuhaut, (edited )

Btw, based on the name, and looking at the source, I think this block-rate-estim is a benchmark helper program for the libde265 video decoder. I think it takes in a file with log data (like debug output or something) and does some statistical calculation on it. My guess is the “block rate” is the speed/throughput.

It’s not available on Debian here (not part of any package, i.e. not installed/compiled, not sure why Fedora Arch would include this in the package tbh), since I think it’s supposed to be an internal dev tool or something like that.

It expects two arguments: a tag (whatever that is) and a filename for input data. It definitely doesn’t understand –help and I suspect it endlessly loops when it doesn’t get valid filename as the second argument.

I’m sticking to my hunch from my other comment, that it is one of your vim (or maybe shell) plugins. It possibly runs every binary installed on your system with –help, to provide some sort of autocomplete or something like that. If that is the case, that seems like a bad idea honestly.

I see no reason why FreeTube would run this, but if it did, it surely wouldn’t incorrectly run it with just –help as an argument.

gnuhaut,

I know gv can auto-reload, though not sure if it’s any faster or less flickery than evince or mupdf. Maybe worth testing.

gnuhaut, (edited )

Außenministerin Annalena Baerbock (Grüne) hat sich verärgert über Berichte geäußert, wonach es einen Streit zwischen ihr und dem israelischen Ministerpräsidenten Benjamin Netanjahu gegeben haben soll. “Der deutsche Botschafter in Israel, Steffen Seibert, war mit dem Stab des Premierministers in Kontakt und hat klargemacht, was wir von solchen verzerrenden Veröffentlichungen halten”, sagte die Grünenpolitikerin am Rande des G7-Außenministertreffens auf die Frage eines Journalisten, ob sie über den Vorgang bereits mit Netanjahu gesprochen habe. (zeit.de)

Ich sehe da kein Rückgrat.

Und laut Spiegel hat Baerbock nur das gemacht:

Baerbock bat ihn dem Bericht zufolge, die Bilder nicht zu zeigen, da sie nicht der Realität im Gazastreifen entsprächen.

Da steht nicht, dass die auf den nachfolgenden Bullshit von Netanjahu irgendwie reagiert hat.

Ich fasse mal zusammen: Minimale Kritik geäußert an lachhaft-peinlicher Propaganda, dann Nazi-Vergleich über sich ergehen lassen, scheinbar ohne Widerworte. Und dann der Presse Verzerrung vorwerfen, wenn mal wer auch nur nachfragt. Hört sich das für dich an, als würde die da irgendwen “wie ein bockiges Kind direkt in die Schranken weisen”?

gnuhaut,

Zu deiner Meinung würde ich empfehlen, dass du mal wenigstes ein paar Minuten diese Interview-Antwort von Finkelstein anhörst, bevor du Palästinenser verurteilst, die sich mit den Kämpfern vom 7. Oktober solidarisieren:

youtu.be/I_Sh-ERypMA?feature=shared&t=1287 (relevante Timestamp, aber es schadet auch nicht, das im Ganzen anzuschauen)

gnuhaut, (edited )

When the old Nazis of the Adenauer govt started supporting Israel (and the genocide convention), they did that not out of genuine guilt, but because the US said so, and so they could use it as in their anti-communist propaganda (“See we are morally superior and you’re doing all these terrible things <insert atrocity propaganda here> over there in the east. Maybe we need to do something about that!”).

Perhaps later generations actually started to feel ashamed for their opas, but they too used this as justification. “Oh we’re sooo repentant, that makes us so much better than all you unrepentant sinners and btw it means we definitely need to bomb Belgrade.”

And now they’re using it to pummel Palestinians (and also all Muslims, both in Germany and elsewhere), because those have not accepted they’re also filthy sinners/antisemites, and the Germans can put all their opas’ sins on that scapegoat and be cleansed. And who better to put this on and punish, than the people they already hate, and whose resources they want to steal.

tl;dr It was originally fake abuser logic, and now se Germans have it internalized, because it makes them feel superior and can be used as a weapon.

They don’t need get rid of their guilt, they can just stop abusing it for their selfish desires.

gnuhaut,

They trade with all of them, so it’s not like they have to choose.

Germany sells a ton of weapons to Israel, and they also buy weapons and surveillance tech from Israel. German foreign policy is basically copy-pasted from Washington, and they are all-in on the US empire (which the German capitalists benefit(ted) from massively, at least up to recently), so every reason the US has to support Israel also applies to Germany.

It also allows them to transfer their guilt/responsibility to Muslims, which are convenient punching bags for politicians to use in order to gather votes from the Islamophobic German public. And it makes (made?) them look good: they can pretend to have learned from the Nazi past, and pretend not be antisemites by getting approval from (Zionist) Jews, which, in the past, actually improved their image domestically and internationally (in the all-important West at least). And, like I said before, it gives them an air of moral superiority and righteousness to pretend they’re totally reformed, no longer Nazis, seen the error of their ways (swear to god!). And they can lord that over their enemies, and use it to convince the public to support military aggression in the name of defeating another Hitler, or preventing another Holocaust (which is Germany’s special responsibility, you see!).

With what Israel is doing right now, and social media showing the utter horror, it no longer looks very good internationally, but domestically, pro-Israel sentiment among the German public (and even more so institutionally and and in the press) is still incredibly high, so saying the most unhinged pro-Israel shit is actually genuinely popular. And with the repression of pro-Palestinian voices that’s not going to change anytime soon either. People are genuinely afraid to speak up, lest they get fired, smeared, blacklisted, or arrested. German language media is like US media from 30 years ago in terms of uncritical pro-Israel views.

gnuhaut,

He spoke at the conference via video chat, which the police used as justification to basically immediately shut down the whole conference, because apparently he’s also virtually banned from Germany.

tagesschau | archive (warning: German Zionist brainrot)

gnuhaut,

Two things, yes. I can’t be trusted to time anything by myself just by looking at the clock, and you often have multiple things cooking at the same time.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • kavyap
  • everett
  • thenastyranch
  • magazineikmin
  • ngwrru68w68
  • DreamBathrooms
  • modclub
  • Youngstown
  • slotface
  • PowerRangers
  • osvaldo12
  • InstantRegret
  • rosin
  • Leos
  • hgfsjryuu7
  • Durango
  • vwfavf
  • khanakhh
  • tester
  • GTA5RPClips
  • ethstaker
  • mdbf
  • cubers
  • tacticalgear
  • normalnudes
  • cisconetworking
  • provamag3
  • All magazines