Live data from Hacker News

Suicide Linux

qntm.org

71–80 of 135 posts

Re: Suicide Linux

#71

In all seriousness, what if it's a machine that no one should ever really be running commands on? This could be an effective, albeit naive, way to discourage undesirables in the system.

Sadly, the machines I don't want people running commands on happen to be also the machines I don't want to rm -rf everything on as well.

Re: Suicide Linux

#73
post #68

Earlier quoted context omitted.

Don't miss his work at SCP wiki, either. http://www.scp-wiki.net/qntm-s-author-page

Visiting that page on mobile asked for permission to record audio and take photos...

I didn't get any such request in chrome on android. Then again, that's the kind of site with the kind of subject matter to randomly request access every nth page just for the reaction it evokes.

Re: Suicide Linux

#74

On Illumos rm -rf / does nothing. POSIX says that removing / has undefined behavior, so the obviously smart (useful, user-friendly, GOOD) thing to do is to do nothing, as that fits "undefined behavior".

rm -rf /* ?

Re: Suicide Linux

#75
post #8

This reminds me of Vigil, "the eternal morally vigilant programming language" https://github.com/munificent/vigil

Shouldn't the programmer also be punished? I find flagellation by static type errors unsatisfying.

Re: Suicide Linux

#76
post #26

> You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway? What? No, what's that about?

There's the cdspell shopt: "If set, minor errors in the spelling of a directory component in a cd command will be corrected. The errors checked for are transposed characters, a missing character, and a character too many. If a correction is found, the corrected path is printed, and the command proceeds." ( https://www.gnu.org/software/bash/manual/html_node/The-Shopt... )

That's for `cd smoedir` I am not aware of what would do `./smoeexec`

Re: Suicide Linux

#77
post #76
post #26

Earlier quoted context omitted.

There's the cdspell shopt: "If set, minor errors in the spelling of a directory component in a cd command will be corrected. The errors checked for are transposed characters, a missing character, and a character too many. If a correction is found, the corrected path is printed, and the command proceeds." ( https://www.gnu.org/software/bash/manual/html_node/The-Shopt... )

That's for `cd smoedir` I am not aware of what would do `./smoeexec`

zsh can do that, but will prompt you before actually running anything.

Re: Suicide Linux

#78
post #26

> You know how sometimes if you mistype a filename in Bash, it corrects your spelling and runs the command anyway? What? No, what's that about?

There's the cdspell shopt: "If set, minor errors in the spelling of a directory component in a cd command will be corrected. The errors checked for are transposed characters, a missing character, and a character too many. If a correction is found, the corrected path is printed, and the command proceeds." ( https://www.gnu.org/software/bash/manual/html_node/The-Shopt... )

It's an interesting idea, but is made mostly irrelevant by tab completion.

Re: Suicide Linux

#79
post #76

Earlier quoted context omitted.

That's for `cd smoedir` I am not aware of what would do `./smoeexec`

zsh can do that, but will prompt you before actually running anything.

Which is not really relevant because the thread and the linked article are about bash.

Re: Suicide Linux

#80
post #30

> The reaction from the OS is actually rather underwhelming. Somehow related, a coworker at a previous place unmounted some disks on an old AIX production box. It took him a solid minute to realise he had mistakenly unmounted / due to a typo (yes it was possible) as old processes with already opened files were happily serving stuff and only new attempts at opening files were beginning to produce errors. Also, a simil…

A few months back I was wiping some old drives using a USB->SATA adapter plugged into an old Linux machine I keep around for experimenting on random things. Mostly because I could just leave it to run for however long it took. There were two drives in the machine, sda and sdb. So the drive came up as sdc.

So then I typed:

$ shred -n1 -v /dev/sda

Took me about 4 seconds to realize what I did before hitting Ctrl-C.

Then, I sighed. Considered whether I could save anything. Realized there wasn't anything on there worth saving, and reinstalled. :)

I'm usually much more cautious than that and I'm thankful it happened on a dumb test machine at home and not something important, but it was still a bummer and my first real sysadmin-type screw up. Mistakes happen, though. Even Linus once dialed his hard drive [0].

[0] https://liw.fi/linux-anecdotes/

Post reply on HN