Live data from Hacker News

The day I locked everyone out of the company intranet

dancowell.com

31–40 of 130 posts

Re: The day I locked everyone out of the company intranet

#31
post #29

Back in the 90s I remember a work colleague asking 'can you rollback a drop table?', to which I replied 'no', and all the blood drained from his face in seconds. It's one of those things you've heard happens to people, but until you see it, you can't quite believe it.

> can you rollback a drop table

>_The first thing I did after the recovery marathon was to alias rm so that it instead works by moving stuff to /tmp

Re: The day I locked everyone out of the company intranet

#32
post #23

Always do a select with your criteria before doing a Delete or update. Don’t ask me how I learned this.

Once I wanted to do `rm -fr *~` to delete backup files, but the `~` key didn't register... Now I have learnt to instinctively stop before doing anything destructive and double-check and double-check again! This also applies to SQL `DELETE` and `UPDATE`! I know that `-r` was not neccessary but hey that was a biiiig mistake of mine!

One time I was debugging the path resolver in a static site generator I was writing. I generated a site ~/foo, thinking it would do /home/shantaram/foo, but instead it made a dir '~' in the current directory. I did `rm -rf ~` without thinking. Command took super long, wondered what was going on, ctrl-c'd in horror... that was fun.

Re: The day I locked everyone out of the company intranet

#36

I wish a DELETE or UPDATE only affected a single row by default (and perhaps even wouldn't commit if it would hit multiple rows), unless a keyword for MANY or something similar was added. Aka DELETE ALL where x == y or DELETE MANY where x == y or perhaps you need an explicit limit for it to not be 1, so DELETE where x == y LIMIT ALL

There are some SQL GUIs that require confirmation before running an update/delete query without a where clause

Re: The day I locked everyone out of the company intranet

#38
post #6

Always do a select with your criteria before doing a Delete or update. Don’t ask me how I learned this.

>Don’t ask me how I learned this. Joke's on you, we all learned it this exact way.

i can still feel the pain in the pit of my stomach when i saw the amount of rows affected.

thankfully my boss at the time was a amazing db admin and he helped me fixing my mistake.

Re: The day I locked everyone out of the company intranet

#39
post #29

Back in the 90s I remember a work colleague asking 'can you rollback a drop table?', to which I replied 'no', and all the blood drained from his face in seconds. It's one of those things you've heard happens to people, but until you see it, you can't quite believe it.

> can you rollback a drop table >_ The first thing I did after the recovery marathon was to alias rm so that it instead works by moving stuff to /tmp

In the late 90’s I wanted to try this Linux thing, so I followed a tutorial. First step:

    fdisk
Yes, that was my Windows partition going bye-bye.
Post reply on HN