Ephera

joined 4 years ago
MODERATOR OF
[–] [email protected] 2 points 2 days ago

Yeah, that is a very good question. It's one of the last commands in the script and initially I thought they had set up the script so that it would abort, if any of the commands before it would fail.

But then a colleague pointed out that it's actually the opposite. So, you can tell the shell to abort execution on error by running set -e. But what they had written at the top was set +e, which explicitly turns that off (even though it should be off by default).
The last command in the script is also exit 0, so it always indicates success.
So, yeah, they seem to have knowingly made it so that if the script fails, then it doesn't retry or anything. It tries to plough through as many of the commands as it can manage (ignoring any that fail on the way) and then it always deletes itself.

I guess, it's not as egregious of an assumption, because it only runs on a fresh OS. That's a pretty controlled environment to be executing in, so the chance of something going wrong is rather low.
Well, and the other question is what else would you do? If the script fails and you don't delete it, it's going to re-run on the next boot. What's going to be different on the next boot to make it succeed then? Might as well do as much as you can and then quit...

[–] [email protected] 9 points 2 days ago

For me, it's a matter of this joke being old. If someone had sat down and drawn it as a comic anyways, that would make it cool and the thought of it can be humorous in its own way. But since they didn't, it's ultimately just an old joke. It not having been made through manual labor does change my enjoyment of it.

(And much like the others, I don't care that it looks well-drawn. I just care that someone decided, fuck it, I'm a silly goose, I'll spend some time crafting something for no good reason.)

[–] [email protected] 3 points 2 days ago

Yeah, my stance for both of those is the same: If the complexity aids you in communicating better, then use it. But if you're using big words where small words would do, then you're doing a disservice to your readers.

[–] [email protected] 3 points 2 days ago* (last edited 2 days ago) (2 children)

Yeah, I'm talking less deep than that. Plenty programming beginners will be reading Python code. And personally, I'm a fulltime software engineer, but just don't do much Python, so while I had it in the back of my mind that Python does truthiness, I would have still thought that var must be a boolean, because it's being negated. Obviously, a different variable name might've given me more of a clue, but it really doesn't reduce mental complexity when I can't be sure what's actually in a variable.

[–] [email protected] 11 points 2 days ago (7 children)

You always want explicitness when programming. Not everyone reading your code will be deep into Python and relying on falsiness makes it harder to understand.

[–] [email protected] 7 points 2 days ago (6 children)

We've been mucking around with how to pre-configure Raspberry Pis after flashing at $DAYJOB and basically, the way the Raspberry Pi Imager works is that it writes a firstrun.sh onto the SD card which gets run during first boot.

How does it know to not run that script from the second boot onwards? Well, one of the lines in that script is:

rm -f firstrun.sh

...it deletes itself while it's running. 🙃

[–] [email protected] 4 points 2 days ago

To perhaps lean more into why complex carbs are useful:

Your body can't really not digest something you've eaten. Once it's in your stomach, it will be broken down and gets put into your blood. With the simple carbs, you get a lot of blood sugar very quickly and your body then has to deal with that. It does so by producing insulin, which tells the rest of your body to take sugar out of the blood. It's put into either a limited, temporary storage (glycogen) or, once that's full, into more permanent storage (body fat).
Eating lots of sugar can also lead to your body producing too much insulin, which will cause too much sugar to be taken out of the blood, so you often have a high and then a crash/low after ingesting sugary foods.

Ideally, you want blood sugar to always stay at a reasonable level, where it can supply your brain and muscles, but where your body does not have to start storing lots of it. And that's where complex carbs are neat, because they don't get broken down all at once, when they're in your stomach/intestines, meaning their sugar enters your blood at a more sustainable rate. By eating them instead of sugar, you're less likely to put on fat and less likely to have a crash.

[–] [email protected] 13 points 2 days ago (1 children)

Mindustry is basically Factorio with more focus on tower defense.

[–] [email protected] 7 points 2 days ago

Mystery train

[–] [email protected] 4 points 2 days ago* (last edited 2 days ago)

Today, at $DAYJOB, we wanted to assign a temporary IP address to the Ethernet port of a Raspberry Pi, so we could connect an Ethernet cable to it and SSH in. We considered using an IPv6 address for that, because there's a lower chance of someone already using that IP address.

But as far as we could tell (didn't investigate terribly long), NetworkManager in Linux will kill a connection, if it does not get an IPv4 address in time, because it assumes there to be a DHCP server behind an Ethernet port. So, we decided to just use an IPv4 address instead.

I'm sure there's ways to make NetworkManager not do that, but those involve additional steps and complexity. And yeah, it's just kind of ridiculous to me, that we built these workarounds, like DHCP, to make IPv4 work and then the defaults assume those workarounds to be in place, which means the IPv6 experience is worse than the IPv4 experience with its workarounds...

[–] [email protected] 2 points 2 days ago

Yeah, I assumed this to be a situation where 90+% of devices are capable, but people don't switch over out of laziness. That's kind of insane to me that it's only at 50%.

 

Hatte letztens die Idee, eine Butterdose für meinen angebrauchten Tofu zu verwenden. Funktioniert echt gut.

 

We often talk about the climate impact based on greenhouse gases, but extracting fuel from the ground and using it in exothermal processes of course also releases energy as heat.

This is mostly¹ in contrast with renewables, which make use of energy that's not long-term contained to begin with, so would end up as heat in our atmosphere anyways.

So, my question is: Does the amount of energy released by non-renewables have any notable impact on our global temperature? Or would it easily radiate into space, if we solved the greenhouse gas problem?


¹) In the case of solar, putting up black surfaces does mean that less sunlight gets reflected, so more heat ultimately gets trapped in our atmosphere. There's probably other such cases, too.

 
 

Hi, I just read online that you can apparently run apt --fix-broken install.

I wanted to know, what that really does, but both apt --help and man apt only show a high-level summary of the subcommands and flags. The --fix-broken flag is never mentioned, and presumably many others neither.

Is there some way to access documentation for all subcommands and flags?

 

Real screenshot from (crappy) personal project...

19
July (lemmynsfw.com)
 
 
 
 
view more: ‹ prev next ›