homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam

The Geek Culture Forums


Post New Topic  New Poll  Post A Reply
my profile | directory login | | search | faq | forum home
  next oldest topic   next newest topic
» The Geek Culture Forums   » All about the comics!   » The Joy of Tech   » bandwidth hogging

 - UBBFriend: Email this page to someone!    
Author Topic: bandwidth hogging
quantumfluff
BlabberMouth, a Blabber Odyssey
Member # 450

Member Rated:
5
Icon 1 posted February 12, 2007 06:45      Profile for quantumfluff     Send New Private Message       Edit/Delete Post   Reply With Quote 
Snaggy's problem of people linking directly to images and bypassing ad revenue is a surmountable problem.

I think there are at least a few options.

1. I notice the image in JoT is referenced as <img src="joyimages/923.gif" ....>. You could
* make joyimages a script rather than a real location.
* have that script look at the referer. If it is GC, then return the image. If not, return an image that shows the URL for GC.

The options for making it a script are many. One of the easist is to just move the folder to new location, and write a CGI 404 handler. The 404 handler can examing URL and referrer and decide if it should throw the 404 or actually return the image.

Any other ideas?

Posts: 2902 | From: 5 to 15 meters above sea level | Registered: Jun 2000  |  IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted February 12, 2007 07:58      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
We discussed this on IRC about a week ago - maswan & firesnake suggested using a mod_rewrite command in a .htaccess file, based on referrers, but it didn't work correctly. The general idea was, if the picture request comes with a GC or blank referer [sic], let it go through -- otherwise, redirect to the real JoT page for it. (I'm sure I stressed the last point about no referrers, as I have them turned off in Firefox, and get quite annoyed when pages don't work. [Smile] )

Personally, I don't have that much love in my heart for using scripts needlessly, but I can understand where they're useful. In this case, I'd just assume use Apache to handle the problem. [Smile]

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
Snaggy

Sir Snaggalot!
Member # 123

Member Rated:
5
Icon 3 posted February 12, 2007 09:02      Profile for Snaggy   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
I've been trying that mod_rewrite, I just need to spend a bit more time on it as I'm not doing something right. [Mad]

Thanks to maswan and firesnake for finding that, if I can get it to work it should help a lot.

Posts: 8111 | From: Canada | Registered: Jan 2000  |  IP: Logged
uilleann
Discontinued


Icon 1 posted February 12, 2007 09:34            Edit/Delete Post   Reply With Quote 
OK, but what happens if you get "XXXX:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" (a real referrer (I just copied and pasted it) of a type that I get every month) or "Field blocked by Outpost Firewall"?

I personally won't block hotlinking, because if I did, I stop myself from hotlinking to my own server as I please, since I could never codify a working set of exceptions. If I ever got a dangerous case of abuse, I would simply block that one site.

IP: Logged
maximile

SuperFan!
Member # 3446

Member Rated:
5
Icon 1 posted February 12, 2007 10:56      Profile for maximile   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
This A List Apart article has a method that I've used and found to work. Obviously, instead of that PHP script you'd redirect the user back to the comic page. I'm guessing the contents of the .htaccess file are similar to what fireswan were suggesting, but it's there in case it helps.

And if you're having absolutely *no* success, maybe it's because mod_rewrite is disabled or something.

But maybe it would be better, as uilleann says, to do it just to digg.

Posts: 1085 | From: London, UK (Powys, UK in hols) | Registered: Feb 2005  |  IP: Logged
uilleann
Discontinued


Icon 1 posted February 12, 2007 13:24            Edit/Delete Post   Reply With Quote 
snaggy, FWIW, mod_rewrite is a bitch :P It's scary how long it takes to make it behave, and how no-one you know has a clue how to use it. The documentation isn't the best in the world either, and there are so many subtleties to trip over. I'm making slow progress with it, and make sure I have HTTP Werkzeug to hand to read off the raw redirect responses.
IP: Logged
quantumfluff
BlabberMouth, a Blabber Odyssey
Member # 450

Member Rated:
5
Icon 1 posted February 12, 2007 19:17      Profile for quantumfluff     Send New Private Message       Edit/Delete Post   Reply With Quote 
I used to be pretty good with mod_rewrite, and had set up a server to rewrite URLs based on the browser type (e.g. WAP browser taking you to a different home page). I'm on the road for a few days, but I'll dig up the old code thursday and post it. It should be easy to substitute for referrer. I still think the use of a custom 404 handler script is easier in the long run. You get complete flexibility about what you return.
Posts: 2902 | From: 5 to 15 meters above sea level | Registered: Jun 2000  |  IP: Logged
ASM65816
SuperBlabberMouth!
Member # 712

Member Rated:
2
Icon 5 posted February 12, 2007 19:49      Profile for ASM65816   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
* make joyimages a script rather than a real location.
Maybe I didn't understand, but .......

Would the following work?
  1. Create a folder which links to the actual graphics. (ex. "/foo0001/")
  2. Use a function to create random 6 character strings. (ex. "tb8y42")
  3. Rename the folder link to the graphics every 12 hours. (ex. "/foo0001/" becomes "/tb8y42/")
  4. Let the HTML get generated with the modified folder name imbedded.
    quote:
    http://www.geekculture.com/joyoftech.php
        includes <img src="tb8y42/923.gif" ....>

A link to <img src="tb8y42/923.gif" ....> would break after 12 hours.

--------------------
Once a proud programmer of Apple II's, he now spends his days and nights in cheap dives fraternizing with exotic dancers....

Posts: 1035 | From: Third rock from sun. | Registered: Mar 2001  |  IP: Logged
WinterSolstice

Solid Nitrozanium SuperFan
Member # 934

Member Rated:
3
Icon 10 posted February 12, 2007 19:54      Profile for WinterSolstice     Send New Private Message       Edit/Delete Post   Reply With Quote 
Oooooh - that's clever. I'll flag that one for future use.

--------------------
An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.

Posts: 1192 | From: Los Angeles | Registered: Oct 2001  |  IP: Logged
drunkennewfiemidget
BlabberMouth, a Blabber Odyssey
Member # 2814

Member Rated:
4
Icon 1 posted February 13, 2007 10:47      Profile for drunkennewfiemidget     Send New Private Message       Edit/Delete Post   Reply With Quote 
mod_rewrite does exactly that for me just fine:

code:
    RewriteEngine ON
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?(mydomain.com)..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(images.)?google..*$ [NC]
RewriteCond %{REQUEST_URI} !^/pics/NO_HOTLINKING_SCUMBAG.jpg$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp)$ http://mydomain.com/pics/NO_HOTLINKING_SCUMBAG.jpg [R]


Posts: 4897 | From: Cambridge, ON, Canada | Registered: Jun 2004  |  IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted February 13, 2007 11:56      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by drunkennewfiemidget:
mod_rewrite does exactly that for me just fine:

code:
    RewriteEngine ON
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?(mydomain.com)..*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(images.)?google..*$ [NC]
RewriteCond %{REQUEST_URI} !^/pics/NO_HOTLINKING_SCUMBAG.jpg$ [NC]
RewriteRule .*.(gif|jpg|jpeg|bmp)$ http://mydomain.com/pics/NO_HOTLINKING_SCUMBAG.jpg [R]


Wow, I think I see why people find mod_rewrite cryptic. I never used it before, but I think I grok the above. Let me know if my interpretation is correct:

In English:
Turn on mod_rewrite
Do not match blank referrers - yay! (Makes people like me happy)
Do not match valid requests from one's own domain - [case insensitive]
Do not match links from Google Image Search (aka GIS) [case insensitive]
Do not match the 'go away hotlinkers' picture [case insensitive]
For all files ending in .gif, .jpg, .jpeg, .bmp, redirect (R) picture request to the 'go away hotlinkers' picture. (The linked image will be replaced by something hopefully tame, but clear.)
(Edit: [NC] fixed per uill's comment - thanks!)

If I may suggest, redirect to a custom picture for hotlinkers that is very low in file size, but politely suggests visiting the real site. Maybe a black and white PNG that is mostly text, but with a hint of the comic behind it, so that people don't just say 'Oh fsck it' and move on.

If I'm adequately bored later today, I'll sketch up a screenshot and include file size info. Or perhaps uilleann will be adequately bored, and write a few more paragraphs, with expertly crushed PNGs... =P (But having suggested that, I'm sure it'll be ignored. [Wink] )

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
WinterSolstice

Solid Nitrozanium SuperFan
Member # 934

Member Rated:
3
Icon 1 posted February 13, 2007 13:34      Profile for WinterSolstice     Send New Private Message       Edit/Delete Post   Reply With Quote 
See, I like to treat deep linkers to huge shocking porn images [Smile]

--------------------
An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.

Posts: 1192 | From: Los Angeles | Registered: Oct 2001  |  IP: Logged
uilleann
Discontinued


Icon 1 posted February 13, 2007 14:03            Edit/Delete Post   Reply With Quote 
NC is definitely not "No change" :p It's "no case" (case insensitive match) If it was only as hard as it looked above, it would be easy. Although some of the above seems extraneous.

But no. For example, if you want to merge two fragments of a destination URI together, the first has to end in a slash, and the second must start with one also. "http://www.site.com/" + "/path/to/page". Ignore the assumption that this will create "http://www.site.com//path/to/page" because mod_rewrite will take off one of the slashes. Leave one off on purpose and the redirect breaks.

There are all sorts of strange subtleties and oddities to be found in how it works. Very, very weird and confusing, but invaluable. If you only want simple redirects DO NOT USE MOD_REWRITE -- use the Redirect* directives from mod_alias, which I never realised existed! It will save you so much trouble! But in cases like referer handling, you need mod_rewrite. And when you're with Globat, because they ban use of mod_alias for security reasons (!) yet allow mod_rewrite. Fuck knows.

IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted February 13, 2007 14:57      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by WinterSolstice:
See, I like to treat deep linkers to huge shocking porn images [Smile]

That won't help bring new traffic to GeekCulture. [Wink]

(And if it does, it's probably not the traffic Snaggy wants. [Razz] )

P.S. uilleann: I corrected my post - thanks for the feedback.

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
uilleann
Discontinued


Icon 1 posted February 13, 2007 16:05            Edit/Delete Post   Reply With Quote 
I get people hotlike my desktop wallpaper to use as backgrounds on scummy sites like Xanga and Myspace. I put up a "do not hotlink" image via mod_rewrite for one of them, but it seemed that he was still doing it, so I replaced that image with a rather bizarre one of messy, chubby naked women -- it really freaked him out, as I came to read on his blog when I checked to see if he'd noticed.

Turned out that it was two separate people after all and I'd not given him any warning :P

The thing is, he was so blatantly ignorant that he reckoned his site had been hacked -- it seemingly never occurred to him that by using a picture on someone else's site, he was using their bandwidth and they had control over what would load.

I had a chat with him on AIM, but he was a good-natured guy.

Generally, as long as I have tons of free bandwidth every month, I let people hotlink, since it's not costing me and it's easier for me to leave them alone than get angry and stressed over it and start trying to block everyone.

What did surprise me, is that one of the many sites using my Digital Music graphic art image, did in fact credit my domain under the image. That's gotta be a first -- a hotlinker who freely acknowledges the source of the work they're thieving :P

IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted February 13, 2007 19:05      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by uilleann:

What did surprise me, is that one of the many sites using my Digital Music graphic art image, did in fact credit my domain under the image. That's gotta be a first -- a hotlinker who freely acknowledges the source of the work they're thieving [Razz]

Many people don't have a clue what 'hotlinking' means, or that there's a problem with linking to other people's web content. The guy (or girl) probably thought it was only fair to give you credit, as they liked what you created, and hadn't a clue that it might come out of your pocket to include it -- or to ask you in the first place if it was okay to use.

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
drunkennewfiemidget
BlabberMouth, a Blabber Odyssey
Member # 2814

Member Rated:
4
Icon 1 posted February 13, 2007 19:29      Profile for drunkennewfiemidget     Send New Private Message       Edit/Delete Post   Reply With Quote 
I (obviously) sanitised the info I put in my mod_rewrite rule. The image returned by my servers is a black-on-white png with a not-so-nice-or-family-friendly message telling them to piss off and stop linking my images.
Posts: 4897 | From: Cambridge, ON, Canada | Registered: Jun 2004  |  IP: Logged
uilleann
Discontinued


Icon 1 posted February 13, 2007 22:44            Edit/Delete Post   Reply With Quote 
dragonman, you still don't get my sense of humour, do you? :)
IP: Logged
dragonman97

SuperFan!
Member # 780

Member Rated:
4
Icon 1 posted February 13, 2007 22:51      Profile for dragonman97   Author's Homepage     Send New Private Message       Edit/Delete Post   Reply With Quote 
quote:
Originally posted by uilleann:
dragonman, you still don't get my sense of humour, do you? [Smile]

Nah...I simply thought you were overestimating the intelligence of your thieves...couldn't let that go. [Razz]

--------------------
There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...

Posts: 9332 | From: Westchester County, New York | Registered: May 2001  |  IP: Logged
uilleann
Discontinued


Icon 1 posted February 13, 2007 23:43            Edit/Delete Post   Reply With Quote 
It's not the bandwidth theft that bothers me so much as the lack of recognition. When I check my referrer log I don't find sites that say anything interesting about what I've put on my site, or anything at all -- just stealing all my graphics and photos. What particularly riles me is people using a screenshot from Gorillas Deluxe to illustrate Gorillas and totally neglecting to mention my Deluxe version (that I spent a year working on). It would be nice to actually gain some recognition for all the work I've put into my site since summer 2000, but no, just thieve my work. It does get me down ... I wonder why I keep posting new content, except I don't really post a lot any more. Where's the motivation?

But then, you always get a joker come along. Someone in Colombia has seriously (and I am not kidding) asked me to restore CGA support in Gorillas Deluxe, since I openly state to having broken it somewhere along the line (albeit years ago) and I did offer to fix it if anyone wanted it working again. Not that anyone would .....

Doh.

IP: Logged


All times are Eastern Time  
Post New Topic  New Poll  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | Geek Culture Home Page

2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0



homeGeek CultureWebstoreeCards!Forums!Joy of Tech!AY2K!webcam