- 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
Maybe you aren't familiar with SQL, but the command to CREATE a database is completely separate from the command to DROP one. While it could prove useful to retain the CREATE command to make a clone of the database, there's no value in archiving 'DROP DATABASE database_name'.
Admin
The spelling is wrong, and the moon isn't blue.
Admin
Do NOT hit the big red button
Admin
I can't fathom what was going through the newbie's mind... "well, I ran this script and now everyone's shouting at me. I think I'll just run it again a few more times and see what happens..."
Admin
In other news, work progresses smoothly on the big, red, "Please do not push the big red button", button.
Admin
Darn you Ant!
Admin
Admin
I'm trying to get my head around the exact pathology of the guy.
He understands how to change permissions on a file. He understands (sort of) ksh scripts (or at least how to delete "exit 1").
He doesn't understand plain English in block capitals. He doesn't understand sql (fair enough, but c'mon ... "drop table?").
Most of his synapses appear to be fried. Exactly what would he have been looking for, after running the script, to "see how it worked?"
Admin
He should have added a mail(); call that mailed him and [email protected] with the name of the person who ran the script saying "This guy just destroyed everything after we asked him not to"
Admin
The only logical answer is that he understood "Re-create the database" as re-creating the database and all the data rather than a blank db.
Admin
cat cant_run_this_script > newscript
chmod +x newscript
Wouldn't have made a difference.
Admin
There should be a class of error called a Chernoble error. To make a Chernoble error, you first defeat all features designed to prevent catastrophe. Then proceed to test... the catastrophe.
Admin
One of my first jobs in IT/software was working for a trade organization that handled a group insurance plan for their members. When I started (in the early 90's) they were keeping each member company's employee data in a Lotus 1-2-3 spreadsheet with a bunch of lookup tables to figure out the premiums. A separate file for each company. Every time the insurance provider changed premiums (about twice a year), we had to go in and change the values in the lookup tables on every single file. That's what they initially hired me to do, because they'd heard I was "good with computers." It was workable when they only had 20 or so companies to deal with. But shortly after I started, they expanded the program and soon had over 100 member companies.
It quickly became obvious that the spreadsheet solution wasn't going to work anymore. I convinced them to move to a database solution. But I was very inexperienced (I had just finished my first year of college, majoring in Biochemistry, and had only had a single programming course). I wound up doing the whole thing in Access 2.0, and had to pretty much teach myself relational databases from the ground up. The employees were all kept in a table, with the employers and premium amounts in separate tables. So when premiums had to be changed, we only had to do it in a single place. I set up forms for doing things like adding or editing employees or companies. The premium bills were a set of reports, one for each company, and I set up a macro that would print them all off with the click of a single button. It was infinitely better than the spreadsheet solution, but looking back, I can think of about 50 things I did totally wrong. Still, they were so happy, they made me a full time employee (when I was home during summer and holidays) and gave me a big raise. Plus, if they had to call me at school to troubleshoot something, they'd pay me for the extra time. That job was riddled with WTFs, but it kept me in pizza and text book money for 3 years.
Admin
The real wtf is clearly letting a newbie having sufficient access rights to destroy production data.
Admin
He NEVER read terry pratchett? If you label a door "Do not enter here, ever, seriosuly, you WILL die", the first thing a wizard will do is to enter the door, just to see what is on the other side.
Admin
What kind of genius makes highly destructive scripts which should never be run, and worse yet, can be modified and run by the ignorant? Layoff "farewell" code, perhaps? Might as well make that rm -fr script next.
Admin
Sure, if we were kids in high-school... but come on! We're supposed to be professionals in a business! I think it's beyond time for the IT industry as a whole to grow up a little and act like adults instead of teenagers (or younger).
That's not say don't enjoy your job, or have fun, etc. But do it as an adult, please!
Admin
So if you see a sign that says "Wet paint" and you touch it and get paint all over your hands, the solution is to touch the wet paint over and over again to see if you can get the paint off. Brilliant!
Admin
I can only repeat what some people have already said. Of course the newbie shouldn't have run the script, but the author also shouldn't have kept the script around for anyone to run, much less configured to access the production data. Putting "Don't run this script" at the top is equivalent to saying "I'm too dumb to delete this script".
Admin
Sure, if you're a moron, which the newbie was.
or just don't let the noob developer have delete access on a production database.
because it was in source control.Admin
I don't see the problem. Sure, it destroys the database but then it recreates it. Sounds perfectly safe to run to me!
Admin
Never delete anything that could possibly be useful. Also, don't hire idjits to write your code.
Admin
Never delete anything that could possibly be useful. Also, don't hire idjits to write your code.
Admin
Never delete anything that could possibly be useful. Also, don't hire idjits to write your code.
Admin
Whoever suggested removing the DROP command from the script so that the CREATE fails and exits gracefully....
This n00b has already shown he would stop at nothing to run this script. After getting the database error "table already exists", what do you think he would do?
Sure, the script shouldn't have been there in the first place, but this guy was a very determined tinkerer, and he really is the WTF.
Admin
If the metaphor was perfect, it wouldn't be a metaphor. For some purposes, using a car metaphor may be appropriate, if cars share the relevant characteristics. For other purposes, it wouldn't make any sense.
Admin
You are a moron for leaving the script out there. Of course someone is going to run.... If not some newbie, then someone may disgruntled employee will...
You should be held just as responsible as the newbies.
Admin
You should have told Alex about that before he replied to it last week... Who knows how long it will be before he can reset all the colors to their normal sane values?
Admin
Well, I have to support the view that writing that the script "RE-CREATES" the database is at fault here.
The script doesn't. It just RE-CREATES the empty structure, NOT the data.
Of course this is normal procedure for people experienced with databases, but I would NEVER EVER write this to any non-professional out there. They would ALL assume that RE-CREATE will both include STRUCTURE as well as DATA.
Why didn't you dump the data in a file in the script BEFORE dropping anyway?
For me that's standard procedure in such a script.
Admin
Everyone dealing with new employees in the tech field must understand the Tao of the man with the Yellow Hat: "Until you have learned, looking is a virtue, touching is a vice."
It was probably the living-documentation reference for how to recreate the database structure fresh--you don't throw that kind of thing away.Admin
Why? Allaire Cold Fusion started life as a pretty decent application server. It ran on Solaris with version 3.1 when they figured out it could be a serious production tool.
Oh and what a revolution, a mere junior developer can embed presentation logic right in the presentation layer! Of course, the inevitable happens when you let THEM write procedural logic into a declarative file. Spaghetti.
Admin
Noobs clearly disown.
Admin
Admin
Seems to me, creating a script
was kinda asking for trouble. :)
Admin
I've always thought it's better to put these things into the positive, i.e. don't use "don't". For example:
RUN THIS SCRIPT WHEN YOU WANT TO BE FIRED
EXECUTE THIS PROGRAM WHEN LIFE NO LONGER HAS MEANING FOR YOU
IF YOU LIKE EVERYONE HATING YOU, THEN START THIS JOB
MAKING TOO MUCH MONEY? DO THIS TO REDUCE YOUR PAYCHECK TO 0!
GET ESCORTED OUT BY MERELY PUSHING THIS SHINY RED BUTTON
Admin
Maybe I'm missing something but :
How can one run SQL commands directly from a ksh script ? That story might be fun, but as far as I'm concerned, it's total BS.
(but... if scripts contains something like : ( ** SQL COMMANDS HERE ** ) | isql command with log+password
this, might work.
Admin
I folks, I'm the submitter of this one...
As I said in the post, it was only intended to be a teach-myself-how-to-do-something-non-trivial-in-CF system, intended to be thrown away.
There was no actual production db; just the one in the development db server. As for keeping the script around, it was in a doc's folder, which had a _README.txt file at the top of the directory listing clearly spelling out what each file/directory in the system did. There were 3 paragraphs dedicated to this script.
The guy who took over for me had 8 years of "professional" experience and seemed rather intelligent, at least conversationally.
Addendum: after he trashed this system, my boss transferred him to another department, where he went on to trash a real prod db, with lots of transaction data in it. For that one, he was fired.
Admin
The real wtf is that you can't spell ColdFusion. That one never gets old.
Seriously though, I'm surprised you guys aren't bashing CF more here. I though it was a favourite past time around here.
Seriously though, CF is cross platform, and is a great product. Unlike lets says ASP, or .NET it runs natively on Windows, Linux, Macs, etc. I believe it's even certified on 64bit solaris.
Admin
#!/bin/ksh echo ... isql -u username -p password -s server <<EOF drop ... create ... commit quit EOF
Admin
I never leave comment like that any more. Come back a year later and I wouldn't even know what I wrote. Way better to say 'THIS SCRIPT DROPS THEN RE-CREATES THE TICKETS DATABASE. ALL DATA WILL BE LOST'
I've been in the newbie's position before, but in my case I commented out all the sql execute commands and instead printed them to the screen.
a WTF on both sides, in this case.
Admin
So if the script is never supposed to be run, what is it doing on the filesystem? Delete the damn thing. If you need it, for future reference, it's (presumedly) in version control.
Admin
While it makes US feel better to hear that, the real problem is that HE was probably still totally clueless. He's probably sulking about how he was "unfairly dismissed" and "did nothing wrong".
Reminds me of a comedian I saw once. He said "You know how in every family there's always that one dumb one? ... and if you're sitting there thinking, 'wait, no, my brother's not dumb' -- guess what? It's YOU!"
Admin
well holy shit... The man is given a second chance and is shown the errors of his ways via the dev db, only to get put on another project and thrash the prod db?? I think your company made the right decision in firing him.
But still...... you mean to tell me after everyone had the luxury of knowing how much of a renegade jackass this guy was, he was STILL given full permission to a production server in the other dept?!?? :P
Well, either your boss didn't communicate the problem effectively, or the other department didn't really heed your boss's warnings about said noobie. In which case, someone else is still at fault, imo.
Admin
Disagree. Once it's used for real business and tracking prod issues, it's a production DB.
Admin
WTF!
was a n00b given admin rights to all the files?? shouldnt this type of script be under admin rights only? how was he able to change permissions on such a file. WTF ind33d
Admin
Oh, how long can trusty Cadet Stimpy hold out? How can he possibly resist the diabolical urge to push the button that could erase his very existence? Will his tortured mind give in to its uncontrollable desires? Can he resist the temptation to push the button that, even now, beckons him even closer? Will he succumb to the maddening urge to eradicate history? At the MERE...PUSH...of a SINGLE...BUTTON! The beeyootiful SHINY button! The jolly CANDY-LIKE button! Will he hold out, folks? CAN he hold out?
Admin
I think you meant "Brillant!".
Admin
Should've taken a different tact:
"THIS SCRIPT DOES NOTHING. THAT'S RIGHT, NOTHING. SEE ALL THOSE DROP STATEMENTS? THEY DO NOTHING. IN FACT, I DARE YOU TO RUN THIS SCRIPT. I DOUBLE DARE YOU, WITH A CHERRY ON TOP. ONLY REAL MEN RUN THIS SCRIPT THAT DOES NOTHING. ARE YOU A REAL MAN?"
Admin
Admin
I agree with poster #1. Just wondering why the heck he let a "newbie" touch code on production?! Any decent place I've worked does not allow that type of access to a newbie; trust is earned, not free.