Author Archive

Date format

Format a date in ruby using the string from time method (strftime).

Format options:
%a - The abbreviated weekday name (“Sun”)
%A - The full weekday name (“Sunday”)
%b - The abbreviated month name (“Jan”)
%B - The full month name (“January”)
%c - The [...]


Ruby on Rails for RHEL 5

Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5 with MySQL.
Using yum install ruby and mysql. The command below does not list all the required packages, but due to dependencies, the additional packages will be installed (or should be - this is all from memory).


Reduce database connections using :include

When displaying a list that requires information from several tables in the database, you can sometimes end up with three or more database queries per list row. Depending on the situation, this may not be a problem. However, it is possible to join the tables in one large SQL query using the :include [...]


Move an LVM-based virtual machine to another host

For those running Xen on servers with no back-end SAN, the following instructions detail the steps necessary to move an LVM-based virtual machine to a new physical host. There may be more elegant ways to achieve this, but this is what worked for me.
Environment
Ok, so let’s set the scene:

vmhost is a RHEL 5 server [...]


Install phpMyAdmin

phpMyAdmin is web-based PHP application for managing MySQL databases. It is fairly easy to install and configure.
Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice. I prefer to keep the installation outside of the web root and use an apache alias to reference [...]