Archive for the 'Technology' Category

IP based redirect for bots using .htaccess

Like all of us – I think – I really hate comment spammers. I really hate unruly bots, actually. I really do. If you start keeping stats of visitors on your site, you’ll quickly spot bots crawling all over your site, searching for all sorts of ways to epxloit your website. They look for email addresses, they try to submit spam comments, they try to find ways to enter your database, they do everything but help you. They are leeches. They stink. I really don’t like them…

Luckily, there are different ways to handle bots as well. If you’re using a .htacces file, for example, you can add a snippet to block the vermin based on their IP address. An idea I liked even better is to redirect the bots to a site that tries to reeducate the bots. You never know.

In stead of redirecting the bots to a governement site where they can take a seat and follow a hands-on course on cyber crimes, another good idea is to send the little bastards to a spam trap page. Gives me visions of all bots in the world swimming around in a pool of interlinked spam pages, never able to get out by them selves. Heaven…

So that’s what I do now, I redirect the bots to a spam trap. Typing in the IP’s in the required format for the .htaccess file, however, can be a PITA. Therefore, I wrote a little script to generate the .htaccess snippet based on a list of IP’s in their normal format. The .htaccess format itself comes from Am I Famous Now. Insert the URL where you want to send the bots to or leave the one I use, insert the IP’s of the bots and push the button:



The URL to refer the bots to:

The IP’s to refer (one per line):

Copy paste the snippet into your .htaccess file, and you’re all set. (WATCH OUT: if you don’t know what you’re doing, messing with .htaccess can wreck your site in a second. Don’t blame me. I told you.) This works fine, ofcourse, when you can easily keep track of the bots. When you have huge traffic on your site, you probably have a huge number of bots visiting it as well. In that case, you’re probably better of with a lean and mean, fully automated and integrated bot trapping/blocking device like this or this

Pentax K20D firmware update under Linux

Pentax has recently issued a new firmware update (1.03) for their current top DSLR, the K20D. Linux users might be suprised to see that only Windows and Mac users are supposed to download the firmware, as there’s only a download link for those two. A closer look to the accompanying text, however, shows that the Mac download is actually an ordinary zip file. I have yet to see a Linux distro that doesn’t support extraction of zip-files, and this particular zip-file extracts to the bin-file you need to update the camera. Even under Linux (or BSD or…)

Ctrl-click layer in GIMP

Just the way I like buying cheap music, I like cheap software. But just the way I don’t like pirating music, I don’t like using cracked versions of expensive programs either. And the good news is: there’s no need to!

I’m pretty sure everybody with some graphical experience has seen a cracked version of Adobe Photoshop at least once in his life. And rumour has it that Photoshop condones this, because there’s no way that young kids, for example, are going to pay $500+ for a legal version. By using cracked versions, the kids learn to work with Photoshop, so that once these talented kids start working for real, they are hooked. Free promotion.

While obviously, Adobe won’t admit this, I guess there are some good reasons for them to try and hook as many people as possible. And one of them is the GIMP (Gnu Image Manipulation Program). At least at amateur level, there’s not much one can do with Photoshop that you can’t do with GIMP. The main problem for GIMP is: it’s different from Photoshop. I think nobody will baldly claim that Photoshop is easy to learn. Everybody who hasn’t had much graphical experience before, will need a couple of hours to find out what the basic principles and possibilities of PS are. That’s because there’s an awfull lot that Photoshop can do.

If a Photoshop user starts using GIMP, he can be assured that what he wants to achieve is possible. The only problem is that when he starts looking in the menu for a certain function, chances are he can’t find it: a lot of functions are called differently, and sometimes placed in a totally different menu. GIMP is different.

The thing I missed the most, when I started using the GIMP, was ctrl-clicking a layer, for selecting all non-transparent items. I couldn’t find it, and for a while, I really thought that this was a Photoshop-only killer feature. And then, the day of relief dawned: I found it. While it’s not a shortcut, the function is easily accessible by right-clicking on a layer, and selecting “Alpha to Selection”. You can find it as well under Layers>>Transparancy>>Alpha to Selection.

By now, I’ve forgotten most Photoshopisms, and I feel using GIMP like I felt using Photoshop before. (That is: I’m sure somebody can do it, but I’ve no idea where to start myself… ;)

So if you have a crackedl version of Photoshop on your pc, and it gives you a quirky feeling, just give GIMP a try. And make sure not to give up too easily, because I can promise you: there will be times that you curse GIMP for making you feel like a beginner, looking for half an hour for something you could easily do in 2 minutes in PS. But trust me: it’s worth it…

ps: For the curious-but-conservative people: there’s a GIMP plugin that tries to mimic Photoshop behaviour and menu structures in GIMP: GIMPshop. Haven’t tried it myself, so feel free to chip in your comments.