Live data from Hacker News

Suicide Linux (2009)

qntm.org

41–50 of 183 posts

Re: Suicide Linux (2009)

#41

It reminds me of the Russian Linux Roulette... [ $[ $RANDOM % 6] = 0 ] && rm -rf / || echo '*Click*' But it's a bit boring. So there's also an improved version [0], which deletes a random file from the system instead of everything. alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && rm -f $(shuf -n1 -e *) && echo "BOOM" || echo *Click*' [0] https://gist.github.com/mjkaufer/85bb5f800525245942a8

First one requires --no-preserve-root to be effective on GNU tools ;)

Re: Suicide Linux (2009)

#42
post #27

> Perhaps rm -rf / should be replaced with something with more verbose flags set. That way, when you run a bad command, you are told immediately that things are being deleted This gives me an idea: Hell Linux. In Hell Linux, the operating system does its best to pretend that nothing is wrong, so it takes you as long as possible to realize that you've made a mistake. Commands ignore all unrecognized flags. In shell sc…

That's a bit extreme. You should at least allow some error messages. Though those ones should just say "Oops, something went wrong :)"

Or perhaps the famous ? from ed :)

Re: Suicide Linux (2009)

#43
post #28
post #13

This is like that time, last week, when I was having issues with do-release-upgrade and someone helpfully suggested to run sudo apt-get purge python* && sudo apt-get autoclean && sudo apt-get install python* Which I did without paying attention to what I was doing and it turns out that this is one of the worst things you could do ever on a Debian-based distro. Damn you, abu-ahmed al-khatiri.

That's why dnf (the yum successor) has dns, sudo, systemd, systemd-udev and yum set as protected packages by default on Centos 8 (and you can't remove python withouth removing dnf/yum because of dependencies, so it should stop that as well). I imagine apt has something similar, and maybe it's not (or wasn't) set by default on the dist you're running? If not, I would raise that as a bug with the distro, as breaking it…

Python isn't essential on Debian.

* https://unix.stackexchange.com/a/491645/5132

Re: Suicide Linux (2009)

#44

It reminds me of the Russian Linux Roulette... [ $[ $RANDOM % 6] = 0 ] && rm -rf / || echo '*Click*' But it's a bit boring. So there's also an improved version [0], which deletes a random file from the system instead of everything. alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && rm -f $(shuf -n1 -e *) && echo "BOOM" || echo *Click*' [0] https://gist.github.com/mjkaufer/85bb5f800525245942a8

First one requires --no-preserve-root to be effective on GNU tools ;)

There's a more elegant solution:

    rm -rf /*
Just an extra asterisk is enough. The shell expands it to all subdirectories under /, and it's compatible with all Unix systems.

Re: Suicide Linux (2009)

#45
post #13

This is like that time, last week, when I was having issues with do-release-upgrade and someone helpfully suggested to run sudo apt-get purge python* && sudo apt-get autoclean && sudo apt-get install python* Which I did without paying attention to what I was doing and it turns out that this is one of the worst things you could do ever on a Debian-based distro. Damn you, abu-ahmed al-khatiri.

I can one up you:

Coworker was trying to remove node so we could install a new version, so he ran:

rm -rf /usr/bin node

-rf was due to muscle memory, and unfortunately he forgot the space.

That was a fun one to clean up. We were able to use nc because that was in /bin and not /usr/bin, so we used that to pipe curl over through a socket and then used curl to install dpkg + apt, then ran apt update to fix everything and that seemed to work.

That server is still running today, but I'm sure something is still seriously wrong with it. Nothing that affects me though, so I don't care haha.

Re: Suicide Linux (2009)

#46
post #27

> Perhaps rm -rf / should be replaced with something with more verbose flags set. That way, when you run a bad command, you are told immediately that things are being deleted This gives me an idea: Hell Linux. In Hell Linux, the operating system does its best to pretend that nothing is wrong, so it takes you as long as possible to realize that you've made a mistake. Commands ignore all unrecognized flags. In shell sc…

> the operating system does its best to pretend that nothing is wrong

Initially, I though you were talking about the lastest MacOS. You had me there for a second.

Re: Suicide Linux (2009)

#47
post #27

> Perhaps rm -rf / should be replaced with something with more verbose flags set. That way, when you run a bad command, you are told immediately that things are being deleted This gives me an idea: Hell Linux. In Hell Linux, the operating system does its best to pretend that nothing is wrong, so it takes you as long as possible to realize that you've made a mistake. Commands ignore all unrecognized flags. In shell sc…

I remember some of earliest Android phones returned shell errors as “__: not found” using LSM just to make ROM devs’ life harder

Re: Suicide Linux (2009)

#49
post #27

> Perhaps rm -rf / should be replaced with something with more verbose flags set. That way, when you run a bad command, you are told immediately that things are being deleted This gives me an idea: Hell Linux. In Hell Linux, the operating system does its best to pretend that nothing is wrong, so it takes you as long as possible to realize that you've made a mistake. Commands ignore all unrecognized flags. In shell sc…

> In shell scripts, if one branch exits with a nonzero exit code, the other branch is taken.

> 0 exit code is reported for all processes, no matter how they terminate.

These two things are mutually exclusive - shell script branching is usually based off of exit codes.

Re: Suicide Linux (2009)

#50

Earlier quoted context omitted.

That's a bit extreme. You should at least allow some error messages. Though those ones should just say "Oops, something went wrong :)"

Or perhaps the famous ? from ed :)

I like the error messages in some early BASIC interpreters. They must be as short as possible, since the entire interpreter fits in 4 KiB of RAM. For example, in Li-Chen Wang's Palo Alto Tiny BASIC...

The only message for all syntax errors, is:

    WHAT?
The only message for all runtime errors, is:

    HOW?
And the only message for legal but unsupported operations (e.g. out of memory) is:

    SORRY
See the source code here: https://github.com/ancientcomputing/8080_8085/blob/master/Ti...
Post reply on HN