Linux meminfo

Adding swap space to an Amazon EC2 Micro Instance

Amazon EC2 micro instances are a great way to test out what cloud servers have to offer and to find your feet in the AWS console. But they are slightly lacking in terms of RAM. 615MB of RAM is enough to test using the console and doing basic things. It will even let you use Apache and serve some basic web pages. But if you want to start doing dynamic web pages or even start doing database driven stuff you might start to run out of memory quickly.

Continue reading

Amazon Web Services logo

Setting up FTP Access on Amazon EC2

I would never normally recommend the use of FTP on an Internet facing server. Always use something more secure such as SFTP etc. But where needs must, here is a quick guide on how you do it under CentOS/RHEL based instances. The same principle will apply under Debian/Ubuntu based servers, but obviously the commands and config files will differ slightly.
Continue reading

Laravel plus Openshift equals Awesome, Part 2

laravel plus openshift equals awesome

laravel plus openshift equals awesome

This is part 2 of the Laravel plus Openshift Tutorial. Part 1 is here. If you’ve not done so already, have a read of that first you eager beaver you.

At this stage you should have an Openshift account, your public/private key pair installed and you should have git cloned your Openshift application into your webroot.

Agreed?

Good, lets go.

Continue reading

Laravel plus Openshift equals Awesome, Part 1

laravel plus openshift equals awesome

laravel plus openshift equals awesome

I’ve been playing with a few PaaS providers for a while now but never really found one that offered the features I liked combined with use-ability and tweak-ability. The only one that came close was Zend’s PHP Cloud which I get access to as part of the Zend PHP 5.3 Certification. I believe this is now an open beta if you want to give it a try. The other main contenders, PagodaBox and EngineYard don’t offer the same level of features in their free offerings.

That search for awesomeness ended however, when I discovered Redhat’s Openshift platform.

Continue reading

php logo

Code Kata

Here’s a quick coding kata I like. It’s called fizz buzz. It makes you think about solving simple problems in different ways and can usually be solved in under 5 minutes. These little brain teasers are also useful for learning new language basics.

For those who have no idea what a code kata is, read this. If you’ve only just come across this idea, head over to here and buy this book. It will change the way you program.

Here are a few solutions in PHP:

(spoiler alert)

Continue reading

CodeIgniter Logo

CodeIgniter database environment gist created

During the development lifecycle of your CodeIgniter application you probably move it between several servers using different database settings for each server.

I’ve created a new database.php file which uses the ENVIRONMENT constant to allow different database settings per server.

To use it, add your database settings to each case statement inside of /application/config/database.php. Then when you switch between servers change the environment constant inside of /index.php.

The file is available as a gist here.