Comment On Do not run this script, ever!

Originally posted by "snoofle"... [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Re: Do not run this script, ever!

2008-01-22 10:57 • by ChetOS (unregistered)
I would have promoted him to management immediately.

Re: Do not run this script, ever!

2008-01-25 10:11 • by Tim (unregistered)
173241 in reply to 172530
ChetOS:
I would have promoted him to management immediately.

/flawless victory

Re: Do not run this script, ever!

2008-01-25 10:13 • by PSWorx
Oh come on, the WTF is clearly with the author here. Did that guy never hear of reverse psychology?

Re: Do not run this script, ever!

2008-01-25 10:15 • by Stiggy (unregistered)
DO NOT EVER READ THIS COMMENT

Re: Do not run this script, ever!

2008-01-25 10:20 • by 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.

Re: Do not run this script, ever!

2008-01-25 10:20 • by Me (unregistered)
173249 in reply to 173243
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

Re: Do not run this script, ever!

2008-01-25 10:23 • by notromda
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!

Re: Do not run this script, ever!

2008-01-25 10:23 • by 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.

Re: Do not run this script, ever!

2008-01-25 10:24 • by Rune (unregistered)
Who gives a newbie full access to a database that is critical for the company? The real WTF imho.

Re: Do not run this script, ever!

2008-01-25 10:25 • by DaveAronson
173255 in reply to 173250
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!

Re: Do not run this script, ever!

2008-01-25 10:25 • by jgayhart
173256 in reply to 173248
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.

Re: Do not run this script, ever!

2008-01-25 10:27 • by Cloak (unregistered)
173261 in reply to 172530
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

Re: Do not run this script, ever!

2008-01-25 10:31 • by 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.

Re: Do not run this script, ever!

2008-01-25 10:34 • by 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".

Re: Do not run this script, ever!

2008-01-25 10:36 • by 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.

Re: Do not run this script, ever!

2008-01-25 10:42 • by Phleabo (unregistered)
173268 in reply to 173250
notromda:
The REAL wtf is cold fusion and ksh...


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

Re: Do not run this script, ever!

2008-01-25 10:44 • by Justice (unregistered)
173270 in reply to 173248
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.

Re: Do not run this script, ever!

2008-01-25 10:46 • by anonymous (unregistered)

Re: Do not run this script, ever!

2008-01-25 10:47 • by GalacticCowboy
173273 in reply to 173264
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)

Re: Do not run this script, ever!

2008-01-25 10:47 • by savar
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.

Re: Do not run this script, ever!

2008-01-25 10:55 • by Barf 4 eva (unregistered)
173277 in reply to 173264
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.

Re: Do not run this script, ever!

2008-01-25 10:56 • by 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!

Re: Do not run this script, ever!

2008-01-25 11:01 • by Barf 4 eva (unregistered)
173281 in reply to 173277
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

Re: Do not run this script, ever!

2008-01-25 11:07 • by Anonymouse (unregistered)
173283 in reply to 173251
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.

Re: Do not run this script, ever!

2008-01-25 11:15 • by jnareb
173285 in reply to 173278
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).

Re: Do not run this script, ever!

2008-01-25 11:16 • by 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.

Re: Do not run this script, ever!

2008-01-25 11:20 • by FredSaw
Human nature. If you say, "Touch this and we will kick your motherfucking ass", they must touch.

Re: Do not run this script, ever!

2008-01-25 11:23 • by WhiskeyJack
173290 in reply to 173278
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.

Re: Do not run this script, ever!

2008-01-25 11:28 • by dlikhten
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.

Re: Do not run this script, ever!

2008-01-25 12:01 • by tray
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.

Re: Do not run this script, ever!

2008-01-25 12:09 • by 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.

Re: Do not run this script, ever!

2008-01-25 12:13 • by 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.

Re: Do not run this script, ever!

2008-01-25 12:13 • by 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.

Re: Do not run this script, ever!

2008-01-25 12:14 • by 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)

Re: Do not run this script, ever!

2008-01-25 12:17 • by me too (unregistered)
snoofle encounters rampaging stupidity... and survives?!

Re: Do not run this script, ever!

2008-01-25 12:28 • by cconroy
173317 in reply to 173278
John:
DO NOT EVER REPLY TO THIS COMMENT EVER, OR ELSE IT WILL COMPLETELY RECREATE THIS WEB SITE!


Re: Do not run this script, ever!

2008-01-25 12:31 • by Richard Sargent (unregistered)
173318 in reply to 173250
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!

Re: Do not run this script, ever!

2008-01-25 12:32 • by ANONYMOUS (unregistered)
173319 in reply to 173243
"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

Re: Do not run this script, ever!

2008-01-25 12:32 • by 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?

Re: Do not run this script, ever!

2008-01-25 12:36 • by jon787
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...

Re: Do not run this script, ever!

2008-01-25 12:38 • by Ubersoldat (unregistered)
173326 in reply to 173311
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

Re: Do not run this script, ever!

2008-01-25 12:44 • by 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!

Re: Do not run this script, ever!

2008-01-25 12:46 • by 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

Re: Do not run this script, ever!

2008-01-25 12:53 • by N (unregistered)
173334 in reply to 173326
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.

Re: Do not run this script, ever!

2008-01-25 12:55 • by Rick
173336 in reply to 173331
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. :-)

Re: Do not run this script, ever!

2008-01-25 12:56 • by 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

Re: Do not run this script, ever!

2008-01-25 13:03 • by 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...

Excel? Easy ...

2008-01-25 13:04 • by 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

Re: Do not run this script, ever!

2008-01-25 13:04 • by James (unregistered)
If it should not ever be run . . . just delete it.

Re: Do not run this script, ever!

2008-01-25 13:07 • by Drunken Monkey (unregistered)
173341 in reply to 173278
Can I see how the comment recreates the website? I'm really curious how that works .. ;o
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Add Comment