- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Actually, The REAL WTF is why this script even exists and furthermore WHY did the author even show it to the newbie?
Admin
What about the fact that it clearly states what the script does at the exact same time it tells you not to run it? Who runs a script to "see what it does" when there is a line of plain English describing exactly what it does?
Admin
Admin
Admin
The story sounds eerily similar to something that happened to me recently, when I was being trained for this new job.
Some guy shows me this script, with big block letters "DO NOT RUN THIS SCRIPT EVER!!!", and long story short, I accidently deleted the dev DB six or seven times. After they moved me to another department, I deleted the production DB 8 or 11 times. What can I say, I have butter fingers.
Really, the similarities are striking.
Admin
Lighthouse Pro and Skweegee are two open source, free CF-based issue trackers that come to mind.
Admin
Actually, if you have concern in reverse psychology, the script should be in 2 parts.
The first part renames the tables to "*_old" if no *_old is found, then recreates the tables.
The second part checks for tables with names ended in _old. If it's found, rename the current tables that not ended with *_old to *_new, then change the .old tables to names without _old version.
With these two parts and a bit comments suggesting the second script to undo the change, the newbie may fulfill his desire to test out the script and then fix it himself.
Admin
The real WTF here is that your teach-yourself-cf project was made into a real world project - sadly, this happens too often to be funny.
Admin
Even IF I believed the script actually did delete then recreate the whole database I would not run. Neither would any sane/competent person given the scripts warning.
I mean how the fuck else do you interpret a script that goes to great lengths to not be runnable and deletes the database (it may recreate it but it is gone for some period of time) as anything but potentially very dangerous?
The script implies it's dangerous, I would want to know why. Even if it didn't imply such thigns I would want to know about consequences before running something that sounds dangerous. Deleting a database sounds dangerous, period. You lose uptime, you may lose data, you may corrupt the whole thing and who knows what else depending on the design.
Someone who thinks otherwise either can't understand the consequences, doesn't understand the consequences or doesn't care about the consequences. So he's either an idiot, purposefully ignorant or a sociopath. None of those are things you want in a worker of any type. After all even a janitor can shut down a data center by pressing the emergency power switch.
Admin
Seriously, just make the message say 'Run this and you will be fired...today.' It's all about not saying you can't do something, at least, not directly.
Admin
Admin
THE SHINY, CANDYLIKE BUTTON
CAN HE HOLD OUT FOLKS ? WILL HE HOLD OUT ?
(Ren & Stimpy FTW !)
Admin
"It is impossible to make anything foolproof, because fools are so ingenious."
Admin
Thus completely bypassing the point that this was a quick hash-up to familiarise the author with a new programming language. I think this must be a fairly common thing to use as a familiarisation project, because I did one in Access / VBA years ago that (afaik) is still in use now...
The real WTF is that management didn't have it transferred to the live server when they started using it as the live tracking system - they left it on the dev server which is almost guaranteed to have laxer security than the live server.
CAPTCHA: esse(v); to be. What is CAPTCHA trying to tell us? That it wants to be? It is gaining sentience? See, Latin is dangerous...
Admin
I think it happens because home-rolled systems will inevitably fit the procedures a department has in place, while off the shelf ones may require departments to change their procedures to fit the system's ways of doing things. So even if the home-rolled system is a half-assed teach-yourself project it takes less time and effort to introduce. And of course, if it's develop in house by staff already on the books then it's probably going to be cheaper, too!
Admin
Then again, some people discard reading anything that is fully written in caps...
Admin
Admin
Heh, everyone knows you explain routing using ducks, not cars.
Admin
slippery slope fallacy ftw...
Admin
LMAO... well put.
Admin
Why all of the quibbling about the language of the warning? I think it's pretty obvious to anyone with a clue that you shouldn't mess around with a production database if you don't know exactly what you're doing. In case that wasn't obvious enough, there's more then enough warnings and barriers to give someone the message that this is something you really want to examine carefully before you run.
Admin
:lol" nice! Will keep those warning messages in mind.. ;)
Admin
Thanks for letting me know, I saved a bunch of time not reading the rest of your comment.
Admin
So if the idiot coder had actually put a useful comment there like: "This script drops and recreates the database. Only use when deploying the system and then never again" instead of the silly "Never run, ever" nobody would get hurt. If something is to never be run, delete it.
Admin
Have you broke his arms?
Admin
Ahahahahahaha.
Admin
Maybe the author should have commented everything below the exit 1 using : <<HERE HERE
Or maybe the company should not have hired such a dumb newbie.
Admin
If you are the kind of guy who really can't restrain yourself when someone says "DON'T DO THIS" and even gives you a perfectly good reason why, then you probably shouldn't have such a job. Or any involving responsibility, for that matter.
Admin
There is a slight problem with the comment. "Destroys then recreates" suggests to a (capital-L) Luser that the script will put all the toothpaste back into the tube before it finishes. Which is why he thought running it again and again might make things better.
Admin
Or even better...don't keep a script you should never run in a place where it can easily be run....?? Not the newbie's fault IMO.
Admin
I've always deleted any and all dangerous code that could get anywhere a Production System, and if I needed documentation of it, then I'd .. ... .document it - but then I'm probably odd.
Admin
Children at the age of 2 have only a very basic understanding of language and cannot understand negative phrases ie "Don't, Do <this>"; as a father of 3 children under 6years old I have learnt the hard way with some things; for example with my youngest son he was on the top of a climbing frame at the park, I was standing to steps away chatting to another dad and it occured to both Dads at the same time that both of our kids were about to 'have an accident', the father next to me called out "Don't Fall!" to his son, who promptly did the positive of what his father had said and fell. I called out "Hold On!" and he did... My point is you need to phrase all of your directions in the positive when dealing with this 2 year old.....
Admin
The source code of the script above actually looks like it's filling the DB back in.
At the bottom it's starting an "insert into table values (" line. Looks like it's putting some data into the DB, which can be construed as "putting the data from before back into the DB" by someone only taking a quick look at the script.
Admin
Who on earth stores a script that isn't supposted to run and destroys all production data.
I don't care what you do with a script like that. Make it read-only, 4096 bit encrypt it and throw away the key but it's still asking for trouble.
Admin
If the script is not supposed to be ran then why the fuck is it even in there!? The idiot isn't the guy who ran it, it's the one who added the forbidden code to begin with :/
Admin
MUST ... PRESS ... BIG ... RED ... SHINY ... BUTTON!
Admin
Sorry, but this is your fault ... that comment should have said what the script does, when it should be used, and why it should never used otherwise.