Live data from Hacker News

Ooops.

github.com

191–200 of 247 posts

Re: Ooops.

#191
post #182
post #171

Earlier quoted context omitted.

I've done a similar thing a few years ago Ha - I'll bet everybody here has a story that starts like that. (Although your heroic save was heroic!) My sad delete story was in 1982 - I had a fantastic graphical robot-vs.-robot game stored on tape on an HP portable computer (I was in high school). For some reason, the delete command on the HP had a variant that deleted from a given block forward on the tape, as I recall,…

I'm pretty sure that was the coolest piece of software ever written anywhere at any time. Hah! I literally (not figuratively) laughed for a minute at that. I'm still smiling a few minutes later. Well played. Let's mourn together at the memories of long lost code.

Let's mourn together at the memories of long lost code.

I'll drink to that.

Re: Ooops.

#192
post #90

Earlier quoted context omitted.

Almost all of the desktop environments commonly used with Linux do have a trash bin.

If it wasn't obvious, "Why is `rm -rf` not connected to the recycle bin?" is implicit in my original question.

If you want a recycling bin don't use rm, use mv.

Re: Ooops.

#193
The two sure fire ways to live a long and happy life:

1. find . -name "pattern" | sudo xargs rm -f

2. WHERE some_id = 36; DELETE FROM table_name

Re: Ooops.

#194
post #113

Earlier quoted context omitted.

"Double-edged sword" has never worked for me, as a cliche. Do you often find yourself inadvertently smacking against the dull side of a single-edged sword, such that you stay away from double-edged swords for your own safety? rm is like a double- ended knife, i.e.: http://image.shutterstock.com/display_pic_with_logo/4253/425... (Fun fact: many knife throwers grip the blade end anyway, rendering the cliche to an even…

This is completely unrelated to the original topic at hand, but I thought it might be interesting to shed some light on knife throwers' grips. For a given thrown weapon, whether a knife or an axe (or anything else that is meant to spin end-over-end), the number of revolutions is roughly fixed and is a function of the distance from the thrower to the target. Thus if you happen to be at a distance where you're getting…

I have always been amazed by knife-throwers' ability to calculate the amount of revolutions between their hand and their target when throwing. It just seems like one of those things that the human brain couldn't possibly calculate correctly on a consistent basis. Does it take a very long time to get comfortable with it when training?

Re: Ooops.

#195
I keep /usr in a squashfs, mounted with aufs over top of it, for the 0.01% speedup I probably get (I grew up on gentoo, forgive me). Periodically, I need to rebuild the squashfs to reclaim space in the aufs writable directory.

I once had a script something like this:

    mksquashfs /usr /squashed/usr/usr_tmp.sfs -b 65536
    umount -l /usr
    umount -l /squashed/usr/ro
    rm /squashed/usr/usr.sfs
    mv /squashed/usr/usr_tmp.sfs /squashed/usr/usr.sfs
    rm -rf /squashed/usr/rw/*
    mount /squashed/usr/ro
    mount /usr
Guess what happens if you hit Ctrl-C during the mksquashfs? That's right, bash runs all the rest too, including the deletion of the old squashfs file. I was left without a /usr, and it was brutal. Managed to recover (it's incredible how resilient a linux system is, as long as /bin and /lib are intact), and immediately put "set -e" in almost every bash script on my machine (I also fixed the script to keep the system in a recoverable state at all times...).

Re: Ooops.

#196
post #46

I learned a rather unusual trick to keep myself safe from unintended glob matches. It is not "fool"-proof, but it will probably dilute an unmitigated disaster into an incomplete disaster: Keep a file named -i in the sensitive directories. When glob picks it up, which should be fairly early, it will be treated like a command line argument. Has saved me on occasions. I also had a friend in school who used to, for whate…

Quoting the directories would also stop this, eg.

  rm -rf /usr /lib/nvidia-current/xorg/xorg # KABOOM!
  rm -rf "/usr /lib/nvidia-current/xorg/xorg" # Harmless.

Re: Ooops.

#197
I actually ran that piece of code. Sure was glad it was only on a test partition. I did lose some trust in the developers after this, but I tried bumblebee again later and am happy I did because it works great!

I forgive them.

Re: Ooops.

#198

Earlier quoted context omitted.

I hate that feeling you get in the pit of your stomach after you realize what's happening. Same thing when you forget the WHERE on a DELETE FROM.

For me it's not the stomach. First, breath stops, then for a few seconds numbness in chest and jaw, then face turns pale and soon red. A small nausea follows and then regret sets in. The rest of the day is ruined.

How eloquent.

Re: Ooops.

#200
post #171
post #163

I've done a similar thing a few years ago when I was first starting work on my guild hosting company's code. At the time, the main thing hosted on that machine was my WoW guild's website, which I had been working on for close to a year, and was beginning work on converting the site over to a general purpose guild hosting site. I was doing some work for a client, setting up a mirror of sorts for some kind of yearbook…

I've done a similar thing a few years ago Ha - I'll bet everybody here has a story that starts like that. (Although your heroic save was heroic!) My sad delete story was in 1982 - I had a fantastic graphical robot-vs.-robot game stored on tape on an HP portable computer (I was in high school). For some reason, the delete command on the HP had a variant that deleted from a given block forward on the tape, as I recall,…

Mine was plugging in the power connector backwards on a super important ide drive (it was the only backup for an already failed server) and watching smoke issue from its controller board.

Having to explain what I'd done to the boss was so scary, I slunk home with the drive and traced the power circuit with my oscilloscope until I found a capacitor that had blown short. I soldered on a through-hole replacement and it worked!

I pulled the data and felt like king of the whole frikkin world for the next week or so.

Post reply on HN