Block Countries in Apache
Assuming you have mod_geoip installed in apache we can block certain countries in 6 lines of code.
I had a client who was experiencing an inhumane amount of spam on their phpBB forums, which are notorious for bot attacks. Luckily this forum was geographically specific - so we can block all the countries we aren't interested in.
Convert phpBB IP Addresses
phpBB stores its IP addresses in a funky format. They're useless to the human eye!
Convert them to normal IPs with the following code
SELECT CONCAT( CONV( substring( poster_ip, 1, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 3, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 5, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 7, 2 ) , 16, 10 ) ) AS IP
FROM phpbb_posts
WHERE `poster_id` = USERID
LIMIT 0 , 30
This code will convert all know IPs from a selected user (In my case 51).
Using Wordpress header and footers externally
I needed to integrate a Wordpress header (header.php) and footer (footer.php) into an external application.
There are quite a few ways round this, but none are really ideal. For example, if you want to include an external page in Wordpress for whatever reason, you could use the Exec-PHP plugin. Simple, hey? No.
Anonymous apache & PHP for cPanel
So I've started playing with cPanel/WHM recently. I've got to say it does make my life immensely easier, at, in my opinion, reduced security. So I'm working on security cPanel/WHM. Apart from the obvious, which I won't go into in this post, we'll make apache and PHP anonymous.
How to move Wordpress directory or server – properly
I ran into an annoying, but easily avoided problem the other day. When moving a clients Wordpress site from the development/staging area to it's live domain, I did the usual update "WordPress address" and "Blog address" in the Wordpress settings.
Thats all you need to do, right? No.
Who needs credit cards?
I don't! Times are hard. We're in a credit crunch, spiralling to recession. Apparently.




