Live data from Hacker News

Suicide Linux

qntm.org

101–110 of 135 posts

Re: Suicide Linux

#102

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".

It's actually required by POSIX to do nothing:

If either of the files dot or dot-dot are specified as the basename portion of an operand (that is, the final pathname component) or if an operand resolves to the root directory, rm shall write a diagnostic message to standard error and do nothing more with such operands.

Source: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm...

Re: Suicide Linux

#103
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…

Within the first year or so of having installed Linux (mid-90's), I made the mistake of accidentally deleting /etc (wrote a script to tidy /tmp at boot, but it hadn't cd'd correctly).

That was possibly the best unix/linux learning experience of my life. Rebuilding /etc sufficient to rescue my files I cared about before a reinstall. Rescue CDs weren't really a thing, USB was a new thing at the time, and I was on dial-up.

Re: Suicide Linux

#104
post #103
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…

Within the first year or so of having installed Linux (mid-90's), I made the mistake of accidentally deleting /etc (wrote a script to tidy /tmp at boot, but it hadn't cd'd correctly). That was possibly the best unix/linux learning experience of my life. Rebuilding /etc sufficient to rescue my files I cared about before a reinstall. Rescue CDs weren't really a thing, USB was a new thing at the time, and I was on dial-…

Reminds me of this: https://www.ee.ryerson.ca/~elf/hack/recovery.html

Re: Suicide Linux

#105

Earlier quoted context omitted.

I never type sl, but often type "gerp". I have an alias though.

A friend of mine aliased `git status` `git statsu`; I, being lazier, chose `git st`. Any time saved I lost by not copying his other alias, `c = commit -amSTUFF`...

For your ~/.gitconfig:

    [alias]
	co = checkout
	psuh = push
	s = status
	l = log
	d = diff
And then alias g=git in your shell configuration. "g s", "g l", etc. But nowadays I just use magit.

Re: Suicide Linux

#106
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…

Years ago, I forget how, I managed to wipe the partition table of a DOS PC. I ended up reconstructing it by hand using MS-DOS Debug and a copy of Peter Norton's book.

Another fun one: "killall" on Linux kills processes with names matching a string. "killall" on Solaris reboots the machine ...

Re: Suicide Linux

#107
post #100

Earlier quoted context omitted.

If it didn't exist in the first place, then you had no business searching for it. You should have just known not to look. :)

I like this joke, it kind of reminds me of the difference between `find_by_id` and `find` in ruby on rails. In the former, if a result can't be found it will return `nil` but in the latter it expects the record to exist and so will raise an exception if it can't be found.

I've heard that joke once, but in C++

Re: Suicide Linux

#108
post #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. The…

Shortly after I started using Fedora as my daily driver I was attempting to dd if=/dev/zero the MBR and partition table off a USB disk sdb and accidentally wiped the one off of sda instead.

As luck would have it, I had the output of fdisk -l /dev/sda in my terminal scrollback buffer and was able to recreate the partition table with no damage done.

Re: Suicide Linux

#110
One idea I like is randomly flipping a bit on the root partition every day or so. You'll have to take an incredibly long time to find the problem, of which there will be one eventually.
Post reply on HN