Geoffrey Garbers Thoughts on everything from PHP to photography

Limiting download speeds with Ubuntu’s apt-get

Posted 3 months ago.

So, you’re on Ubuntu, and you’re needing to download and apply updates. The problem is; you’re on a shared connection, or you’re still wanting to continue browsing at a decent speed. Nobody likes a bandwidth hog, right? Well, thankfully, there is a way to limit bandwidth usage, even though there isn’t an easy-to-use option. The example [...]

Bootstrapping plugin configuration in CakePHP 2

Posted 3 months ago.

A new feature in CakePHP 2 is the ability to selectively enable and disable plugins in your APP/Config/bootstrap.php file. Plugins are no longer enabled by default in CakePHP 2 – you have to specifically enable them. However, with this functionality comes the ability to load up plugin bootstrap and routing configuration files. However, something to [...]

Umount: mount disagrees with the fstab

Posted 3 months ago.

When setting up a network or SSHFS mountpoint in your fstab for normal user use, you may have come across an issue where issuing a umount command (after mounting the share, of course) produces an error: mount disagrees with the fstab. Well, I have a solution below that helps to resolve this. If you’re not 100% sure [...]

Using a non-breaking space in UTF-8 documents

Posted 4 months from now.

I’m pedantic when it comes to displaying nested items in a dropdown. I like to ensure that sub-items are suitably indented. My preference is to do this using spaces only. However, the problem in HTML is that multiple spaces are considered as one. Which blows this out of the water. Why not just use a [...]

Why I *still* won’t host in South Africa

Posted 4 months from now.

I would much rather host with a hosting company in South Africa. Recently, I did some research with a view to move away from my current US-based hosting provider (A Small Orange) in favour of a South African-based provider. The comparisons only made me realise how little I pay for what I get, and what great value for money I’m getting!

Static pages in CakePHP

Posted 2 weeks from now.

Generating static pages in CakePHP, without having "/pages/pagename" in your URL has always been a tediously manual affair. However, there is a way to automagically generate the routes for these pages. I'll show you how in this post.

Retrieving the current script’s directory in bash

Posted 2 weeks from now.

When writing bash scripts to run on Linux, it's often useful to perform operations relative to the executing script's current directory. But how do you get the absolute path to this directory? I have a useful little script that will get the current working path for you.

PHP memory management for variables

Posted 1 week from now.

I just stumbled across a super useful blog post on the internals for PHP’s memory management; and explains the management process quite well. It’s an old article (from 2008), and I’m not too sure how much the memory management has changed, but it still provides some good principles. Think twice before passing that variable by [...]