• ChetOS (unregistered)

    I would have promoted him to management immediately.

  • Tim (unregistered) in reply to ChetOS
    ChetOS:
    I would have promoted him to management immediately.
    /flawless victory
  • (cs)

    Oh come on, the WTF is clearly with the author here. Did that guy never hear of reverse psychology?

  • Stiggy (unregistered)

    DO NOT EVER READ THIS COMMENT

  • (cs)

    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.

  • Me (unregistered) in reply to PSWorx
    PSWorx:
    Oh come on, the WTF is clearly with the author here. Did that guy never hear of reverse psychology?

    Exactly. He should have left the script with new fake table names as well. then it would have been extra hard to mess up

  • (cs)

    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!

  • (cs)

    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.

  • Rune (unregistered)

    Who gives a newbie full access to a database that is critical for the company? The real WTF imho.

  • (cs) in reply to notromda
    notromda:
    Who in their right minds *runs* a program (on a live system) to see what it does? Read the code!
    Use the Source, Duke!
  • (cs) in reply to pitchingchris

    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.

  • Cloak (unregistered) in reply to ChetOS
    ChetOS:
    I would have promoted him to management immediately.

    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

  • Henry Miller (unregistered)

    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.

  • rockfrog (unregistered)

    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".

  • Wilkeson (unregistered)

    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.

  • Phleabo (unregistered) in reply to notromda
    notromda:
    The REAL wtf is cold fusion and ksh...

    Do not mock the Korn shell. The Korn shell can and will destroy you.

  • Justice (unregistered) in reply to pitchingchris
    pitchingchris:
    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.

    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.

  • anonymous (unregistered)
  • (cs) in reply to Wilkeson
    Wilkeson:
    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.

    "...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)

  • (cs)

    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.

  • Barf 4 eva (unregistered) in reply to Wilkeson
    Wilkeson:
    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.

    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.

  • John (unregistered)

    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!

  • Barf 4 eva (unregistered) in reply to Barf 4 eva
    Barf 4 eva:
    Wilkeson:
    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.

    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.

    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

  • Anonymouse (unregistered) in reply to akatherder
    akatherder:
    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.

    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.

  • (cs) in reply to John
    John:
    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.
    Errr... if you have read the article carefully, you should have remembered that this project was written to familarize author with ColdFusion (a kind of code kata). Nevertheless instead of using it in practice, one should use some ready issue management tool (perhaps there is even a free one in ColdFusion).
  • Paul (unregistered)
    1. 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.)

    2. 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.

  • (cs)

    Human nature. If you say, "Touch this and we will kick your motherfucking ass", they must touch.

  • (cs) in reply to John
    John:
    DO NOT EVER REPLY TO THIS COMMENT EVER, OR ELSE IT WILL COMPLETELY RECREATE THIS WEB SITE!

    I just wanted to see what would happen.

  • (cs)

    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.

  • (cs)

    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.

  • Er..um (unregistered)
    I worked in a fairly large department that used a spreadsheet as the bug-submission-tracking "system".

    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.

  • The OP is dumb (unregistered)

    This is why sane people never have DROP DATABASE in a create script and cleanly exit without doing anything if the database exists.

  • Jeremy (unregistered)

    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.

  • whicker (unregistered)

    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)

  • me too (unregistered)

    snoofle encounters rampaging stupidity... and survives?!

  • (cs) in reply to John
    John:
    DO NOT EVER REPLY TO THIS COMMENT EVER, OR ELSE IT WILL COMPLETELY RECREATE THIS WEB SITE!
    [image]
  • Richard Sargent (unregistered) in reply to notromda
    notromda:
    Who in their right minds *runs* a program (on a live system) to see what it does?!

    You would be surprised how many people will tell you they what some facet of the system does because they tested it!

  • ANONYMOUS (unregistered) in reply to PSWorx

    "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

  • Slakr (unregistered)

    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?

  • (cs)

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

  • Ubersoldat (unregistered) in reply to whicker
    whicker:
    (Car analogies always apply to software)

    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

  • Anon (unregistered)

    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!

  • mario (unregistered)

    everyone would run this script. It's like a don't touch label at a museum. Before you never thought of touching it

  • N (unregistered) in reply to Ubersoldat

    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.

  • (cs) in reply to mario

    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. :-)

  • Bluemoon (unregistered)

    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

  • Bob N Freely (unregistered)

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

  • Drunken Monkey (unregistered)

    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

  • James (unregistered)

    If it should not ever be run . . . just delete it.

  • Drunken Monkey (unregistered) in reply to John

    Can I see how the comment recreates the website? I'm really curious how that works .. ;o

Leave a comment on “Do not run this script, ever!”

Log In or post as a guest

Replying to comment #:

« Return to Article