Live data from Hacker News

Ooops.

github.com

181–190 of 247 posts

Re: Ooops.

#181

Earlier quoted context omitted.

The -I flag is a bit more friendly; one may safely alias rm to rm -I and not even notice on the common case (deleting a single file).

I use a script that moves a file to a ~/.trash directory when I use rm. If I am sure I want to actually delete a file permanently I just use /bin/rm.

Sounds like a great way to fill up your disk to me.

Re: Ooops.

#182
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,…

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.

Re: Ooops.

#183

Unix could really do with a command that you can wrap around this type of call. Either a sanity check on the path part or a safe rm alternative that contains it. I would gladly give up full rm access to know that I can safely (or safer-ly) delete in scripts. It could be something as simple as a file with paths on each line it - match one path or a path with a glob - and the script fails before destroying anything imp…

Ah. It seems I have just described 'safe-rm'. Great minds etc :)

Indeed. Those were exactly the design goals I had when I wrote safe-rm (shortly after deleting my /usr/lib!).

Re: Ooops.

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

Yeah, the same thing happened to me a couple of years ago and at the time I thought I was the coolest guy on the planet when I recovered most of my data. I had accidentally deleted all my chat logs. Luckily, all the chat logs had a timestamp in them, so I just searched for all timestamped lines on the disk and dumped them to a file. I then wrote a script to group and sort all the logs based on the date and who I was…

I thought I was the coolest guy on the planet when I recovered most of my data.

That's the feeling. It's almost euphoric. It's the "FUCK YEA" meme (http://knowyourmeme.com/memes/fck-yea).

In actual content, it's convenient that you had timestamps to work with. That eliminates a lot of the need to trim off trailing bytes. Kudos to you for the epic save, and on a live (mounted?) disk too? Living dangerously :)

Re: Ooops.

#186

That's pretty heinous, but deleting /usr shouldn't cause you to lose any irreplaceable data.

From the FreeBSD handbook ( http://www.freebsd.org/doc/handbook/users-introduction.html):

    The home directory is the full path to a directory on the system in
    which the user will start when logging on to the system. A common
    convention is to put all user home directories under /home/username
    or /usr/home/username. The user would store their personal
    files in their home directory, and any directories they may create
    in there.
All of my irreplaceable data is stored in `/usr'. `/home' is a symlink to `/usr/home', as created by the installer.

Re: Ooops.

#187
post #142

Earlier quoted context omitted.

SQL is desperately in need of some updates. For starters, DELETE FROM should never be allowed without a WHERE clause. DBs should simply define that as malformed sql.

Exactly. There is no need given TRUNCATE exists.

well, the only difference is that truncate also resets the auto-increment to zero. But you could allow where 1=1 to make it explicit if people really wanted an unbounded DELETE FROM.

Re: Ooops.

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

The simplest hack I've ever used for this kind of thing is to keep a notepad on my desk and whack it instead of the enter key whenever I'm doing critical work.

In the time it takes to thump the notepad, it gives my brain a vital few seconds to triple check what I just typed before I blast monkies into space. Saved my behind more than a few times.

Re: Ooops.

#190
post #102

Looks like someone never read the Unix Hater's Handbook. Another fun thing is rm + shell expansion. A file named * or / can cause extremely unintended deletions.

Files can be named anything but / in Unix.
Post reply on HN