Monthly Archives: September 2011

Htaccess – Block Evil Robots, Site Rippers, and Offline Browsers

 

Eliminate some of the unwanted scum from your userspace by injecting this handy block of code.

After such, any listed agents will be denied access and receive an error message instead. Please advise that there are much more comprehensive lists available this example has been truncated for business purposes. Note: DO NOT include the “[OR]” on the very last RewriteCond or your server will crash, delivering “500 Errors” to all page requests.


# deny access to evil robots site rippers offline browsers and other nasty scum
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ^Anarchie [OR]
RewriteCond %{HTTP_USER_AGENT} ^ASPSeek [OR]
RewriteCond %{HTTP_USER_AGENT} ^attach [OR]
RewriteCond %{HTTP_USER_AGENT} ^autoemailspider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xenu [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus.*Webster [OR]
RewriteCond %{HTTP_USER_AGENT} ^Zeus
RewriteRule ^.* - [F,L]

Or, instead of delivering a friendly error message (i.e., the last line), send these bad boys to the hellish website of your choice by replacing the RewriteRule in the last line with one of the following two examples:


# send em to a hellish website of your choice
RewriteRule ^.*$ http://www.hellsite.com [R,L]

Or, to send em to a virtual blackhole of fake email addresses:

# send em to a virtual blackhole of fake email addresses
RewriteRule ^.*$ http://s2.spampoison.com [R,L]

You may also include specific referrers to your blacklist by using HTTP_REFERER. Here, we use the infamously scummy domain, “asae.org” as our blocked example, and we use “yourdomain” as your domain (the domain to which you are blocking asae.org):

RewriteCond %{HTTP_REFERER} ^http://www.asae.org$
RewriteRule !^http://[^/.]\.yourdomain\.com.* - [F,L]

 

 

Ubuntu – Change the date and time (or any other EXIF image meta-data)

There is a very flexible and easy Linux tool that helps you change the EXIF meta-data of images. It allows you to change individual files or whole bunch of them with one command. You can also put different rules about what files and how you want to change them if you need to.

The program is called exiftool. So let’s install it first.

In terminal execute:

sudo apt-get install libimage-exiftool-perl

Now you are ready to start changing the meta-data of the images.

For example, if I wanted to change all the dates and times (DateTimeOriginal, CreateDate and ModifyDate) of the IMG_01.jpg file to the 8th of September 2011 at 6:00:00 PM I would do:


exiftool -AllDates='2011:09:08 18:00:00' -overwrite_original IMG_01.jpg

If I wanted to change the dates on all the files in the “images” directory, I would do:

exiftool -AllDates='2011:09:08 18:00:00' -overwrite_original images

Read more »

Firefox 7 – Get the Full URL Back

The newest update to Firefox just launched yesterday with a number of new features, but one of those happens to include a shortened URL bar.

Thankfully, there is a simple solution:

1. In Firefox’s URL bar, type in: about:config and agree to the pop-up message.
2. Search for: browser.urlbar.trimURLs
3. Double-click or right-click and select “toggle” to change the value to false.

Now you’ll get the full HTTPS or HTTP in the URL so you won’t be confused on whether you’re viewing a secure site.