Teaching, rebuking, correcting & training in righteous web design.

ip2Country.pl - A fast little script to bulk id IPs by country

May 14th, 2008 Posted in Code-Snippets, How-To | No Comments »

ip2Country.pl - a fast little PERL script to bulk identify IPs by countryYes, I know, all cool programmers use Python these days - but to this old-school programmer, PERL is to my antiquated PC what GWBasic was to first computer at work back in 1983. That is a nice little tool to get things done, like identify a list of IP addresses by country.

Here’s the situation, I’ve been getting a lot of incoming spambots attempting to create accounts and post comments both here on HYCW and a few other sites I help manage. The Akismet spam filtering service catches all of it - but there’s still at times a huge draw on bandwidth, CPU and other resources when these bots hit.

So from time to time, I harvest the IP addresses from the thwarted ne’er-do-well’s failed attempts via my user registration table and/or Apache logs and then add them to the firewalls, .htaccess file and/or application IP ban lists of these various sites - except for those IPs incoming from countries where both the languages and laws give me the ability to email the abuse administrator.

Moreover, by excluding IPs from countries like the US, Canada, etc … from my ‘hit list,’ I don’t accidentally banish entire ISPs such as RoadRunner, ComCast or AOL when one of their user’s machines goes z0mbie goes due to some malware.

So the trick is then to take all the IPs from all the computers with which I’m associated, and drive the list through a simple application that will generate a list of IPs to ban - while excluding IPs whom I can (and do) contact via email at a later time.

Which is what inspired me to write ip2Country.pl - a fast little PERL script to bulk identify IPs by countries who don’t have IP abuse administrators who care, and generate a bash script to insert the entries into my apf firewall deny_hosts.rules file:

#!/usr/bin/perl
#
# by Dean Peters
# http://healyourchurchwebsite.com/
#
use IP::Country::Fast;
use Geography::Countries;
my $reg = IP::Country::Fast->new();

print "#/bin/sh\n";
print "# -- append firewall --\n";
while() {
        chomp;
        my $ip = $_;
        my $ip_cntry_abr = $reg->inet_atocc($ip);
        my $ip_cntry_nam = country $ip_cntry_abr;
        next if ($ip_cntry_abr =~ m/US|CA|GB|AU|NZ/i);
        print “/etc/apf/apf -d $ip {mad spammer from $ip_cntry_nam}\n”;
}
print “# — restart firewall –\n”;
print “/etc/apf/apf -r\n”;

__DATA__
121.1.29.246
121.15.200.148
193.238.213.70
196.20.7.74
210.22.83.146
217.30.244.226
222.124.200.212

Oh sure, I could be real fancy and write a version that takes command line arguments for individual IP addresses and/or a file of IP addresses … but the point here was to demonstrate how a crufty old tool like PERL can help bulk identify IPs by countries so you can too add them to your firewalls, .htaccess file and/or application IP ban list.

That said, if you’ve got a Python or even PHP version of the same, leave a comment and share the goods.

Or you can just preemptively use the online services of Block a Country and be done with it.

%DIGG%
Share This

Presenting the WordPress Plugin - Obammath

May 12th, 2008 Posted in Code-Snippets | No Comments »

As a card-carrying member of the vast math conspiracy, and in light of Barack Hussein Obama, Jr.’s statement made in Beaverton Oregon last week that has been all but ignored by old media - I have decided to fight off the fatigue of almost turning 50 next weekend by providing the blogosphere the tools required to accurately quote, report and interpret quotes such as the one made below:

It is wonderful to be back in Oregon. Over the last 15 months, we’ve traveled to every corner of the United States. I’ve now been in 57 states? I think one left to go. Alaska and Hawaii, I was not allowed to go to even though I really wanted to visit, but my staff would not justify it.”

So it is with great programmatic pleasure that I present the WordPress Plugin : Obammath, which once installed will:

  • convert all instances of the number 50 prefixed with the small letter ‘o’ to ‘58′;
  • convert all instances of the word ‘fifty’ prefixed with the small letter ‘o’ to ‘fiftyeight’;
  • grammatically correct any pluralized reference to the ’state of Alaska and Hawaii’.

Not only will such a plugin help the new media continue to report stories squelched by the old media, but can and should help a tuckered-out Obama execute along the following objectives:

  • correctly identify the number of stars on the new line of Obama-swag such as on his new patriotic lapel pin;
  • introduce super-stealthy hidden taxes where all tax rates are increased by an additional 16%;
  • immediately increase the Federal minimum wage by $1.14 to $8.29;
  • empower the native-born Honoluluan with yet another special interest group by combining the Hawaiian and Alaskan cultures into a new protected demographic known as ‘Hawaskans’;
  • clear the way for the statehood of the District of Columbia, American Samoa, and Puerto Rico with plenty of headroom left for Mexico, Jamaica, Cuba, French Ontario, the 13th District of Chicago; and
  • head-off any hinky Hillary Al-Gore-ithms introduced by Michigan and Florida delegates.

Here is a link to download the plug-in, which with some luck, will require augmentation and expansion as the Jr. Senator from Illinois continues to make ‘macaca moments’ available to the general public as demonstrated in the YouTube video below:

You need to a flashplayer enabled browser to view this YouTube video

In the meantime, I am going to seek Federal grant in case this application requires four years of ongoing maintenance.

%DIGG%
Share This

The price of .org domain names to increase by 10%

May 12th, 2008 Posted in Reading Room | No Comments »

The price of .org domain names to increase by 10% Those putting off the purchasing and/or long-term renewal of a domain name for their church and/or charity because the price was too high may want to re-think that strategy as it appears that the Public Interest Registry (PIR), the registry for ‘.org’ domain names, will be raising their annual wholesale price for ‘.org’ domains by 10%.

In a May 1, 2008 communications with Internet Corporation for Assigned Names and Numbers (ICANN), the PIR disclosed the increase that would bring the annual fee to $6.75. Last year, PIR imposed a 2.5 percent fee increase to $6.15. PIR did not cite a reason in its letter - nor does it have to - as the PIR does not need ICANN’s approval for such increases.

What this means for the rest of us buying 1 or 2 domains at the retail level is likely a similar price increase - though it’ll be interesting to see how many domain name registries keep the increase to 10% of their current price, as opposed to marking up a bit more as I suspect some will.

As the Internet’s 6th most popular domain name suffix, it also likely means an increase in renewal for the nearly 7 million domain names already registered as ‘.org” - provided of course one’s domain name service hasn’t beaten you to the punch.

As for me, considering the is now very little price disparity between .com and .org, and taking into consideration the popularity and ease in which others remember the .com suffix, I’m thinking I might put my bucks into a .com domain if I had to choose between the two …

… tough I always STRONGLY recommend that any church and/or charity purchase both .org and .com domain name, for as long a period as they can afford it.

More info about the recent PIR rate increase can be found below:

%DIGG%
Share This

Is Church marketing dead? Nope, just stuck on stupid!

May 8th, 2008 Posted in Bad Design Posters, Theology | No Comments »

There’s no getting around it, despite the efforts of many to teach, rebuke, correct & train in righteous web design, there still exists a great cloud of witlessness when it comes to the Church’s presence online. A fact painfully corroborated by the persistent body of ‘kitsch‘ out there that distracts, annoys and otherwise drives-away people seeking and/or serving the Lord.

5 Things Eight Belles and Church Webmasters have in common

May 6th, 2008 Posted in Fast Five, Theology | No Comments »

Last night while listening to various speculations as why the horse that ‘placed’ at the Kentucky Derby was put down, my mind drifted to 5 things Eight Belles has in common with many church webmasters I know, including …

Making a Ready Defense by Planning for Failure

May 2nd, 2008 Posted in Bad Design Posters, How-To, Resource Filled | 1 Comment »

Those who fail to plan, plan to fail. While this aphorism is very worn, it is also very true. Here are some simple things you can do with mysqldump, crontab, tar/gzip and a little contingency planning to insure you don’t lose your sanity when your server crashes upon the shoals of of virtual disaster.

10 Principles Of Good Church Website Design

May 1st, 2008 Posted in Reading Room, Resource Filled | 1 Comment »

Want to make sure your church website follows the principles of good church website design? Then stop coding that rotating Flash banner you think is cook and start learning how user-centric design has become a standard approach for successful websites with high conversion rates.

Spring Cleaning, or time for a HealYourChurchWebsite do-over.

April 25th, 2008 Posted in About HYCW, How-To | 2 Comments »

The birds are singing, the flowers are blooming and WordPress 2.5 has been ‘in the wild’ for a couple of weeks. These factors, and the fact that my own blog is getting a bit crufty has me thinking it is time for yet another Heal Your Church Website do-over. That and I’ve been getting some […]

Vista vs. Ubuntu and the value proposition of a work in progress

April 21st, 2008 Posted in Disruptive Innovation, Reading Room | 3 Comments »

Steve Ballmer says Vista is a work in progress. With that in mind, and if my office, contact management, presentation, web administration, and other applications are all web-based, then what is the value proposition of sticking it out with Microsoft’s expensive work in progress, versus a more cost effective work in progress such as Ubuntu?

5 things the Holy See website could do with the Pope’s visit to the U.S. and UN

April 18th, 2008 Posted in Fast Five | No Comments »

I realize, understand, and respect the Catholic tenant that their faith is built upon a combination of Scripture and historic tradition. That said, there’s no reason the Vatican website should continue to ineffectively rock like it’1999. With that in mind, here are 5 things I’d do to enhance the Holy See website to better publicize and describe Pope Benedict XVI’s April 15-21, 2008 Apostolic Journey to the United States of America and visit to the United Nations Organization Headquarters:

Jakob Nielsen: Four Bad Designs and a 403 error to boot!

April 14th, 2008 Posted in Conversion Goals, Reading Room | 2 Comments »

What could be more ironic than to receive an email from Jakob Nielsen’s Alertbox on the topic of “Bad content, bad links, bad navigation, bad category pages” that links to a page that throws a 403, permission access denied page?-) Fortunately for you, I got screenshots, followed by some commentary on the article once the good folks at UseIt.com realized the error or their ways.

How to quickly check your error logs for oddities

April 2nd, 2008 Posted in How-To, Resource Filled | 2 Comments »

With more church webmasters taking advantage of free, one-click installs provided by inexpensive web hosting solutions, I figure it is time to provide a quick tutorial on how to harvest useful operational, user and security information the error logs using a variety of commands already at your disposal - free.