kieranbarnes do you know where your towel is?

Permanently mount a Windows share in Linux

Posted on April 4, 2009

A Terrabyte?Sick of manually mounting a Windows share on Linux with "mount" for it to drop off randomly? Or not really knowing if it is mounted or not?

Then make a permanent mount in fstab.

SQLyog Query Profiler

Posted on February 10, 2009

MySQL has always lacked the sophisticated profiling tools shipped with proprietary databases like SQL Server, etc. MySQL developers have largely depended on EXPLAIN for tuning queries. The SHOW PROFILE patch by Jeremy Cole was introduced in the MySQL Community version 5.0.37 and it provided much more insight into where the query spends its time. However, to take advantage of this feature, MySQL developers were supposed to switch on profiling, run their queries and then filter the profiling data from a table that contained the profiling results of the last few profiled queries. A lot of manual book-keeping is required to take advantage of this powerful feature. In an ideal situation, the MySQL developer should execute the queries and the profiling info should be available along with the result-set. Unfortunately, none of the MySQL client tools (desktop or web-based) provide intrinsic support for this feature.

Watch the Screencast on Query Profiler.

I♥MySQL

Filed under: MySQL, Windows No Comments

This is not a door

Posted on January 16, 2009

img_2185-medium

Filed under: Photography No Comments

Run DMC Crossing

Posted on January 13, 2009

img_0029-medium

Filed under: Photography No Comments

Moist Honda

Posted on December 18, 2008

hh2

Filed under: Photography No Comments

Block Countries in Apache

Posted on November 18, 2008

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.

Filed under: Apache, Geeky Continue reading

Convert phpBB IP Addresses

Posted on October 9, 2008

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).

Filed under: MySQL, PHP 5 Comments

Using Wordpress header and footers externally

Posted on September 24, 2008

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

Posted on September 11, 2008

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

Posted on August 24, 2008

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.