Skip to content

Exim Deny Manager

Dear Reader,

Yes, I know I’ve gotten in a rut of simply updating older content and passing it off as new but the pressure of bring creative or witty on a daily basis is getting to me. So bear with me here. The meds will kick in soon and I will be back to normal.

After I released exim_deny_filter.php There was a long discussion over at the DirectAdmin forum with Jeff Lasman about whether or not it was a good idea to be blocking ip addresses in exim. He (well thought out) argument was that exim was not really designed to do this even though it can do it. He argued that it was probably taking up more resources doing it this way than filtering it at the firewall and that firewalls are designed to do IP based filtering so why not let them. (I’ve shortened an 3 day conversation into 2 sentences for so you that I can say I add value with my blog. There…)

He, of course, was right. However, Firewalls can’t detect a dictionary scan and block it while exim can. I toyed with the idea of letting exim issue firewall blocks immediately but that meant that I either had to run exim as root (bad mojo) or I had to open up APF so that it could be executed by the mail user. (bad mojo) So I did what I always do, I wandered off to watch CSI. (Vegas BABY, not those other 2 imposters) Sometime in the intervening week, I hit upon the idea of a compromise. (Those that know me know that this is a wholly foreign idea to me.) Let exim detect and initially block the IPs as it detects an attack. Then, at some regular interval, move those IPs over to the firewall. And of course, give some way to remove them after a pre-defined time.

Thus was born, exim_deny_manager. It has all the features of exim_deny_filter.php and can still be used just like it. Now though, it has added capacity and functionality. (and 10% more brighteners!)

So dear reader, it is with much fanfare that I release to you, after 3 solid days of use on my own system, Exim_Deny_Manager.php. Full implementation instructions can be found on the project page

As always, questions, comments and criticisms are always welcome and sometime even responded to. (Ask Fred, sometimes I do answer emails!)

Until next time, GO Steelers!
(l)(k)(bunny)

=C=

Exim_deny_filter.php Update

Dear Reader,

Because I know so many of you use it, I’ve updated my little script to maintian the exim_deny_filter described here. After being deluged with emails of congratulations, eternal thanks and feature requests[1] I finally broke down and coded the one additional feature every user I talked to[2] requested. It now has the ability to tell you how many IP addresses are in your file. Ok, technically it tells you how many lines begin with a # but since each IP address has a timestamp line before it that starts with a # you get the same info.

Anyhow, you can download it here. Full details on how to implement IP filtering in Exim can be found here.

Enjoy!
(l)(k)(bunny)

=C=

[1] Ok, it’s the one feature I wanted to add.
[2] Ok, so I only talked to myself.

TagClouds in PHP Revisited

Dear Reader,

Yes I know TagClouds are so 2005; and yes I know TagClouds are the new Mullet; they are still fun to play with. With that having been said, I went back and re-factored the PHP code I wrote a while back for my AJAX resume. For that project, my sole purpose was just to get a TagCloud of my skills and any old TagCloud would do. This time, my purpose was to build a class to automate it as well as build an example to show how useful/useless it really is. I’ve accomplished both of those lofty goals. Here is the source code and here is the example.

Originally I was going to spend a lot of time explaining to you how I did it in an insipid tutorial. I realized though that you dear reader, fall into one of 2 classes of people.

Programmers
If you are a programmer then the last thing you want is for me to explain it to you when you can read the source yourself. Therefore, if you are in this camp, just download it and read it. I’ve tried to comment it thoroughly but if you have any questions, don’t hesitate to drop me a line.

Users
If you are in this group then you don’t really care how it works, you just want to know how to use it. First, check out the example page. The keywords on the sample page come from the last 30 entries of my blog. I’ll admit I cheated and just open the database and pull them from there instead of trying to call my blog w/curl or fopen and parse it. (Although that would have been cooler.) I then ran each blog entry against Yahoo’s Term Extraction API to get the terms. Then I pumped that array into my new TagCloud maker. The important code you can’t see from the index.php is below.

$x = TagCloud::fetch_cloud($thisArray,'...',
'tagcloud_','http://www.technorati.com/tags/%s');
$o = new TagCloud($thisArray,'...','tagcloud_',
'http://www.technorati.com/tags/%s',10,'weight',2);
$o->get_cloud();
$y = $o->output_cloud;

As you can see, I used 2 different methods of creating the 2 lists. The first is just calling the object::method statically with all the necessary parameters. This is by far the easiest way to use this class and unless you need something special, it's the way I recommend. The second way it to instantiate an object. I pass all the variables into the constructor but you could just as easily use the setters to set them all. (don't know why you would but hey, I spent an extra 15 minutes creating getters and setters so use them, by all means use them!)

Then just use the contents of $y somewhere in your page. (To those of you who have worked on teams I have built, yes, I know I always preached that it's a fire-able offense to use a single letter variable name but since I don't work for you I don't care!) :)

That's it. Use it or don't. I don't care; I had fun writing it. As is my custom, I think I'll turn it into a WordPress plugin. Because god knows we need tag clouds in our blogs!

Until next time, I love you even when you piss me off.
(l)(k)(bunny)
=C=

p.s. This blog was originally titled "It's Raining Tags" which was a lot more fun but not nearly as descriptive.

p.s.s. Proof that great minds think alike I found this. The site is in (Japanese?) but the code is in...php.

AJAX Frameworks and toolsets. My initial thoughts.

Dear Reader,

Over the holidays I spent a lot of time researching AJAX. Being a PHP developer I looked at everything I saw through the glasses of “How well does this integrate with what I’m doing now?”

I’ve boiled all the frameworks, tool sets and class libraries I looked at down into 2 categories; 1) Back-end centric and 2) Front-end centric.

(more…)

Another WP Plugin

Dear Reader,

Through the fog of Birthday induced depression, I found the time to work on another WordPress plug-in. Building on the work of Jarno Ristaniemi and Clay Smith I’ve added an options page to allow you to set all the options from within wordpress. You can see it in action of you look at my sidebar. This one was fun because it was the first one I did with an options page. Again, kudos to the WP team. I was able to squeeze it all into a single file. Granted it’s still not as complex as some plug-ins I’ve seen but I’m getting there.

Read the install page and download here.

Until next time, the final countdown has begun.

=C=