Live data from Hacker News

The day I locked everyone out of the company intranet

dancowell.com

21–30 of 130 posts

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

#21

Use chatGPT to double check too.

"Yes, you can delete those items via that query." "But now all has been deleted??!?! WTF HEEELP" "I apologize for my previous answer, you are correct, you now deleted everything!"

Thank you for the laugh, I can imagine someone running untested chatGPT code on prod and this actually happening.

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

#22
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.

Luckily I learned from someone else. I did figure out start with a transaction the hard way though

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

#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!

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

#24
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!

You remind me of that time I wanted to `rm -rf ./*` but the dot hadn't registered... I now avoid that statement.

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

#25
post #12

I was working on an old old old "ERP" system written in D3 PICK. It's a database, programming language and OS all in one with roots in tracking military helicopter parts in the 1960's. I was working on it in the mid-2000s. It had SQL like syntax for manipulating data, but it was interactive. So you would SELECT the rows from the table that you wanted, then those rows would be part of your state. You would then do UPD…

You recreated a production database of 20 years data by hand overnight? You deserve an award !!!

Yep, the entire table. I figured since I had to write it to do the day at a minimum, doing the whole table would help me find corner cases and errors since it was a much larger range of data

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

#26

Earlier quoted context omitted.

You recreated a production database of 20 years data by hand overnight? You deserve an award !!!

he only recreated the ones not saved by the nightly backup, meaning he used the previous nightly backup and recreated from invoices the last ~23 hours.

No, I did the entire table. That helped me find corner cases and errors in my logic having such a bigger range of source data.

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

#27
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

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

#28
Early on when I'd first started making the transition from pure developer role working only on product to a platform role running the development environment, I was encountering problems with build scripts on CI servers leaving behind a bunch of dead symlinks. Tired of tracking them down manually, I wrote a nice script that automatically found all dead symlinks and deleted them.

It turned out, for some arcane reason I still don't understand, our production instance of Artifactory was running on top of Docker Compose with host path volume mounts, and somehow, symlinks that were not valid from the perspective of the host actually were valid from inside the container, and doing this on all of our servers broke Artifactory. For some even stupider reason, we weren't doing full filesystem-level snapshots at any regular interval (which we started doing after this), so instead I needed to enlist the help of the classic wizard ninja guy who had been acting as a mostly unsupervised one-man team for the past six years who had hacked all of this mess together, documented none of it, and was the only person on the planet who knew how to reconstruct everything.

This was probably still only the second-stupidest full on-prem lab outage I remember, behind the time the whole network stopped working and the only person who had been around long enough remembered they had trialed a temporary demo hardware firewall years earlier, management abandoned the evaluation effort, and it somehow remained there as the production firewall for years without ever being updated before finally breaking.

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

#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.
Post reply on HN