CodeIgniter sample .htaccess
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0
PHP exec() not returning output
I found that a script I was running was calling some linux functions using exec() but they weren’t always successful and I couldn’t tell why. exec('command to run'); This would…
You can’t specify target table ‘xxx’ for update in FROM clause
I recently needed to update a whole bunch of records using an IN() on the target table: UPDATE table1 SET field1 = 'some value' WHERE table_id IN ( SELECT table_id…
OpenVPN on Linux – save password
My Linux box is secure, so why do I need to remember the extremely difficult to remember password for one of my OpenVPN connections? I don’t. On Linux, I create…
Toggle radio buttons by clicking the label
I’ve seen a few methods of this using over-elaborate JavaScript, when its really not necessary. All you need to do is wrap the <input with a <label – as a…
eXfat drive not working in Windows XP?
So you got a nice 64GB USB stick, and can’t format it NTFS but want to transfer huge files on it. You probably formatted it with eXfat (Windows Vista, 7,…
Finding files in Linux/Mac Terminal
Finding files is a little different to MS DOS! find <startlocation> <type> <filename> <exec> The exec is a simple way of performing functions on the results. If you leave it…
Case Insensitive JQuery contains selector
If you need to use :contains() as a selector but need a case insensitive one, you need to extend jQuery yourself: This function will do it: $.extend($.expr, { 'containsi': function(element,…
Apache PHP mkdir not writable?
If you ever find that you are creating a folder with PHP, and its immediately not writeable by Apache, then you’ve probably done what I did with the chmod. It…
Get MAC address from IP address
Had a routing issue the other day, and I was remotely trying to forward a port to a device. I didn’t know the MAC address of the device, and my…