- 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
I would have promoted him to management immediately.
Admin
Admin
Oh come on, the WTF is clearly with the author here. Did that guy never hear of reverse psychology?
Admin
DO NOT EVER READ THIS COMMENT
Admin
Newbie was really dumb. He really needed to see what it did, especially since it told you "DO NOT EVER RUN THIS SCRIPT - IT DESTROYS, THEN RE-CREATES THE DATABASE". It told you right then and there what it did.
Kind of like that old saying of trying the same thing expecting different results.
Admin
Exactly. He should have left the script with new fake table names as well. then it would have been extra hard to mess up
Admin
The REAL wtf is cold fusion and ksh...
Seriously - Who in their right minds runs a program (on a live system) to see what it does? Read the code!
Admin
He never should have run the script. But the script should have been deleted and he should not have access to the script in "production" either.
Admin
Who gives a newbie full access to a database that is critical for the company? The real WTF imho.
Admin
Admin
Yeah, I had this coworker who "accidently" ran FDisk on his computer. At least we had backups. Needless to say, he did not last long. I guess he was pissed when he was fired. He "wiped" his computer by dragging all the icons on his desktop to the Recycle Bin. I guess he should have been escorted out. But, none of his work was worth saving even if he did manage to destroy his projects.
Admin
I would also like to see him promoted ... out of the office and towards home. Someone who takes away two more or less good "security measures" should not stay around me
Admin
I'm glad for stories like this. I've done far too many stupid things in my life, but at least I've never done something this dumb.
Admin
The comment could have been clearer... "re-creates the database" might be interpreted as "restores the database". Should have read "creates a new empty database".
Admin
Ahhh yes, the shiny red button problem. The giant, candy like, glistening red button. No one's supposed to push it, but everyone does eventually.
Admin
Do not mock the Korn shell. The Korn shell can and will destroy you.
Admin
Well he didn't try exactly the same thing; he made some clever changes first, then repeated his mistake over and over.
Point is, he wasn't dumb, he was insane.
Admin
Admin
"...he reached out and pressed an invitingly large red button on a nearby panel. The panel lit up with the words 'Please do not press this button again'." (HHGTTG)
Admin
Hilarious. I've done the exact same thing before. I did it a few times on legacy scripts that wouldn't work anymore, but might be interesting for future developers to look at and rework.
I stuck something very similar in the top of the script and checked it in...never occurred to me anybody would edit the script without reading through it first.
Admin
lol! Too funny, but in all honesty.. there seem to be 2 WTFs at hand. One, the developer's unwillingness to participate with bold instructions, and Two, the script writer's decision to hard code in the production server in to the script... had some of the server connection info been passed in to the script, the likelihood of this happening would be nil for newbie.
Admin
The real WTF is that someone would actually make their own issue management tool. Err, google guys, there are hundreds of them, and a lot of them are free. Plus (and this is a big plus IMHO) they don't tend to come with stupid scripts that destroy it all.
DO NOT EVER REPLY TO THIS COMMENT EVER, OR ELSE IT WILL COMPLETELY RECREATE THIS WEB SITE!
Admin
ooops, I didn't mean conn string here, as this is purely a sql script. the db name would be ideal to pass in to the script. Although this brings up an interesting point... He had to of been firing off this script with connection info and appropriate user permissions to the production server in the first place to have executed this script.. :P
Admin
No, the code used to create the database could prove useful as a reference later, and you might even want to run it as it is to create a second database. Throwing it away would be dumb.
Admin
Admin
Why keep a script around that shouldn't be run? (Yes, you may actually NEED to rebuild the db sometime, but the installer scripts could have been kept in a separate area of the repository with limited read-access.)
Obviously this ran on a *NIX system, so ... why wasn't ownership of the script set to a user with a password that only experienced programmers knew, so that it couldn't be made executable ... or, don't tell me, did everyone know the root password? I'll bet it was written on a post it note on the box running the db.
I know it was a dumb move by the noob, but you have to assume that someone will indeed make a dumb move.
For instance, our production db has a password that every developer knows, and the password is for a master read-write account that can be used to do anything, including "drop database". I know it's going to happen. We devs look around in the db sometimes when trying to debug production issues. I've accidentally deleted a record myself, once, because I forgot I'd signed into the production db and thought I was working on a QA db. Luckily I was able to reinsert it easily.
I've tried to get IT to change the password, but they refuse for some reason.
Admin
Human nature. If you say, "Touch this and we will kick your motherfucking ass", they must touch.
Admin
I just wanted to see what would happen.
Admin
Well I guess thats what happens when you label a button "DO NOT PRESS OR YOU WILL DIE"! Guess what, there will be lots of dead people around that button!
Whats really funny is: To run that script you had to chmod it, and remove the exit(1), and ignore that big print out DO NOT RUN THIS SCRIPT EVER, and ignore the comments... And not actually read the script, and think that running it a hundred times will make it fix itself.
Admin
This would make a standard test procedure for newbies. Give him a job with a faked system and a script like this, and if he doesn't run the script in a week, he would be invited in the next round.
Admin
I worked for a broker than used a spreadsheet as a way of distributing summaries of research - so everytime you wanted to look at the summary info on one company, you had to open the entire spreadsheet (A Sizeable VBA app) on your PC. It also meant only one person could update it at a time, which meant it was usually out of date.
Admin
This is why sane people never have DROP DATABASE in a create script and cleanly exit without doing anything if the database exists.
Admin
Perhaps, had the code been commented appropriately, or if the message was more useful than "Don't run this", there would have been no reason to run it to see what it did. I might not be great at always remembering to comment my code, but if it does something destructive like this, it seems stupid not to. I think the lack of comments is probably also a WTF, though perhaps not as much as the person running the code.
Admin
There is no discussion here.
Newbie should not have gone through the effort to get that script to execute. Newbie is completely at fault.
Just because there is nothing preventing me from steering my car into oncoming traffic on two-lane highways, does not mean I should "to see what happens". Nor does it mean that the engineer that designed the highway or the automobile is to blame.
(Car analogies always apply to software)
Admin
snoofle encounters rampaging stupidity... and survives?!
Admin
Admin
You would be surprised how many people will tell you they what some facet of the system does because they tested it!
Admin
"IT DESTROYS, THEN RE-CREATES THE DATABASE"
If the newbie didn't understand what that meant he shouldn't have got the job in the first place
Admin
Seems like one more line could have saved this script. Instead of just the comments and the exit(1), how about also adding a database dump prior to the drop commands?
Admin
Sadly I've used an excel spreadsheet based bug tracking system that worked better than the actual bug tracking system we were supposed to be using...
Admin
Totally agree with you. Explaining OOP? Use a car. Explaining Efficience? Use a car. Ad infinitum!
What? ullamcorper... damn this captchas are getting WAY too long
Admin
Here, I fixed it:
#!/bin/ksh echo "DO NOT EVER RUN THIS SCRIPT - IT DESTROYS, THEN RE-CREATES THE DATABASE" exit 1 echo "LISTEN DUMBASS, I SAID NEVER RUN THIS SCRIPT. WTF IS WRONG WITH YOU" exit 1 echo "THIS IS YOUR LAST WARNING SHIT FOR BRAINS. DON'T RUN THIS SCRIPT" exit 1 drop table ... echo "SHIT, YOU'VE DONE IT NOW!" create table ... ...
prime the database
insert into table values (...
There, foolproof!
Admin
everyone would run this script. It's like a don't touch label at a museum. Before you never thought of touching it
Admin
I'm always amused when people explain the ethernet and routing using cars. Imagine an intersection randomly picking cars and smashing them to react to traffic jams.
Admin
I am totally amazed at how many people responding to this post think the original poster had some responsibility. Personally, I cannot waste my time preventing every possible idiocy a co-worker could come up with. I don't leave 'drop table' statements in my scripts, but surely enough was done by the OP.
But I was also amazed at how many American's voted for George W. the second time. I wonder if there is a correlation between these 2 groupings. :-)
Admin
For the same reason you should never write "Wet Paint" on a sign of your newly painted outdoor bench, every one will touch it.
The trick: write "Wheth Paint" en everyone comments that the spelling is wrong and that the paint isn't white to start with, but no one touches your paint. :)
Bleumoon
Admin
Reminds me of that Ren and Stimpy short where Stimpy has to guard the History Eraser button. It's so big, and red, and shiny...
Admin
Single user locking Excel? That's easy to fix .. don't need anything as fancy as ColdFusion or nothing .. ;)
"Tools -> Share workbook" .. there fixed ! :p
Admin
If it should not ever be run . . . just delete it.
Admin
Can I see how the comment recreates the website? I'm really curious how that works .. ;o