- 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
OUCH!
Admin
For every complicated problem there is a simple solution. And it's wrong.
Admin
I say we take off and nuke the entire site from orbit. It's the only way to be sure.
---Ripley
Admin
i'm speechless!
Admin
#revision 1.1
do
./upload_site
until 1 < 0
CAPTCHA:clueless - How appropriate
Admin
Admin
I love the Clerks reference!
Admin
I don't get it.... What's wrong with that?
Admin
That was from Aliens.
Admin
Wrong movie?
Admin
So what's the WTF? That he didn't try to upload_site more times that that?
To be REALLY SAFE, you need to reimplement it something like this.
WHILE (0=1)
./upload_site
LOOP
That way, you don't even have to manually run the upload code, since it's running forever as a kind of whacked out service!
Admin
both movies
Admin
I assume you meant 0 <1 ? Or perhaps 0 != 1 ?
Admin
So that's 15,000 files * approximately 120 executions of thes cript (didn't count; eyeballed it) = 1.8MM files to be checked?
No problem, just as long as your machine has a handy dandy 4TB cache
Admin
I know it's in the animated clerks, that only had like 6 episodes. They prolly got it from aliens,
Does the computer get annoyed of doing the exact same command hundreds of times?
Admin
I don't understand; in what way did this script get past the firewall?
I think the real WTF is in the firewall if simply trying 100 times is what it takes to succeed in doing something that the firewall is set to block.
Admin
I'd prefer
(paula = <FONT size=+0>"Brillant")</FONT>
Admin
The TRUE WTF is that issuing the command "./upload_site --no-terminate" didn't work! ;-P
Admin
Possibly, but the "--Ripley" firmly distinguishes it as an Aliens quote.
Admin
The firewall isn't set to block, if it were, then it would have never worked. The firewall probably terminated connections of the rsync nature if the connection lived for longer than a set period of time. The number of times needed probably varied slightly depending on bandwidth, traffic, and content.
Admin
No, although the quote is originally from Aliens - the Clerks reference is actually doubly-brillant. In "Clerks - The Animated Series", they actually use this quote from Aliens in a witty reference (when Leonardo Leonardo's base launches into orbit).
So actually, whoever posted "I love the Clerks reference" actually one-upped all you geeks out there with a double reference.
Admin
It must have been auto-generated.
(captcha = paula :))
Admin
Isn't it obvious?
The shell script was written by the network folks to test a self-DOS attack.
or something
The real WTF is that they didn't burn the web site to CD 100 times, carry the CDs over to the web server, and copy each of them in turn. I think that would be an excellent way to ensure job security, especially for the CD retailer.
Admin
Admin
at least the dot wasnt in the local path. and captcha = craptastic...so is this in reference to my comment or the ./upload-site?
Admin
We need a "Scripting languages considered harmful" article, written by a computing authority :)
The saddest part is that they probably only needed to check the return code of the script. A simple example in bash: ("simple" means that the syntax is probably incorrect and that there must a hundred of more correct ways to do it, but this one would still be much better than what they did)
Admin
That'll be it! Never start writing a WHILE but add the condition for a DO UNTIL.
Still, what's a WTF submission without at least one WTF reply?
Admin
Proper way to code this sort of thing:
while [[ 1 ]]; do echo "./upload-site" >> script; ./script; done
Like, duh.
Admin
Non no no - put the CD on the wooden table, ...
Admin
The real WTF is that they didn't use XML ...
<root>
<node1>
<subnode a="0" b="./upload_site" />
<subnode a="1" b="./upload_site" />
<subnode a="2" b="./upload_site" />
<subnode a="3" b="./upload_site" />
<subnode a="4" b="./upload_site" />
<subnode a="5" b="./upload_site" />
<subnode a="6" b="./upload_site" />
<subnode a="7" b="./upload_site" />
etc
</node1>
</root>
Admin
no you see this is very efficient code... notice how he unrolled the loop to reduce overhead!
Admin
How is that different from:
while [[ 1 ]]; do
./upload-site
done
?
Admin
Grrr - never-mind - smudge on crt over the second '>' 0- didn't see it
Ironically, captcha = quality
Admin
Reminds me of the old days when people said "Please" to their computers.
Admin
You're making it too hard. You just need
while (true)
{
./upload_site
}
Or you could do this
while (true)
{
if (0==1)
{
break;
}
./upload_site
}
And for you Java purists out there, i'm sorry, but the { SHOULD be on a seperate line!
Admin
No, it should not.
sincerely,
Richard Nixon
Admin
The language does not dictate where its syntactic elements should be placed, unless said placement is part of the syntax (as in mIRC scripting).
That would be a coding convention.
Admin
<FONT face=Tahoma size=2>This one is so funny I'm actually inspired to post:</FONT>
<FONT face=Tahoma>LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOL</FONT>
Admin
Let's be thankful that there aren't "C"-style #define's in Java, or there'd be folks doing stuff like this:
(Once, on a bet, I wrote a Pascal/C translator doing most of the work with #define statements)
Admin
Nay sir. For every complicated problem there is a simple solution and a wrong one.
This is the 3rd solution, the idiotic one.
No, this is a shell script, in shell scripts affectation requires the use of
SET
.Fuck no, K&R for the win.
Admin
Yeah, another WTF answer! (captcha: wtf...)
Way to proper way™ Step 1:
while [[ 1 ]]; do echo "./upload-site" >> script; chmod u+x script; ./script; done
Way to proper way™ Step 2:
while [[ 1 ]]; do ./upload-site; done
Way to proper way™ Step 3:
while true; do ./upload-site; done
Way to proper way™ Final Step 4:
Fix the network.
And the forum software sucks... why is it impossible to migrate to something not as braindead as that one? The sole fact that this is an ASP page...
Admin
Grah. Meant to quote that post. Now this is the "Design" editor, and I see [ quote ] marks. BBcode embedded in HTML? STFU (captcha).
Admin
This would be totally ok and even somewhat cunning way of looping ad infitum but usually you can't use a single number as an variable. Sad really :(
Admin
I'm going to buy the "Micro Mitt", turn it on, and punch the class action lawsuit guy.
Admin
Hahahahahahahaaa!!!
Admin
Nah, just use perl and check the exit status:
while(!($x == -1)){
system(./upload_site);
$x = ($? & 127);
}
There you go, guaranteed to smash your system like a tin can under an unending barrage of process forks.
Admin
Better:
while [[ 1 ]]; do echo "./upload-site" >> script; done; ./script
Admin
I always preferred to write the "begin" on the same line in Pascal, too. There is no need to start a block on an empty line because the indent denotes the start of a new block...
Admin
The only time I ever see people putting {'s on a line by themselves aside from opening a function, class, or namespace where it will be all the way at the beginning of the line, is when people are trying to increase their LOC.
Admin
Did I miss something, or will both of these simply fill the file 'script' with lines (untill the disk runs out of space and it crashes) while never actually getting to the part where it executes the script?
Now that is replacing a WTF with a real WTF.