Maintain a local mirror of the CakePHP API

Posted in cakephp, tips & tricks on January 23rd, 2009 by Scott Sanders / No Comments »

One of my favorite things about the CakePHP project is the excellent documentation. However, I often find myself developing on my laptop somewhere that doesn’t offer a connection to the internet. When that happens it’s quite nice to have a local copy of the API handy. Fortunately, the CakePHP team is using doxygen style comment markup throughout the core so we can quickly generate our own copy of the API! Here’s how you do it.

Read the rest of this entry »

Reinstall Linux From Afar

Posted in centos, linux on March 13th, 2008 by Scott Sanders / No Comments »

I hate doing Linux installs in a datacenter. Really, I can’t stand it. All those noisy fans and blinking lights inspire me to install hardware and neaten cabling, not sit near-motionless in front of a crash cart inserting CD’s as demanded by a pastel colored GUI installer. However, keeping a machines operating system up-to-date is something every sysadmin is responsible for. What I am about to explain is not new, nor is it my creation, but it is a neat technique to remotely install Linux on a server.

Before I go into the details I should warn you: If you screw up the process, you won’t have much of a way to recover without actually sitting down at the machine and putting in those shiny install discs by hand. Now that thats taken care of… I’ll be using CentOS 5 as the target distribution. There is nothing special about the hardware, except that the network card must support PXE or Netboot. You will also need a source machine to host the install media with a functional web server.

Read the rest of this entry »

Bridged Networking with QEMU in Fedora 8

Posted in fedora, networking, qemu on December 4th, 2007 by Scott Sanders / No Comments »

I use Fedora as my desktop and really enjoy using it, despite the packaging discrepancies that crop up every now and then. (Such is life with a distro like Fedora.) I recently upgraded to Fedora 8 and was very happy to see that QEMU was offered as an alternative to Xen for Virtualization. I prefer QEMU because it doesn’t require the xen kernel. However, upon installing my first virtual machine I noticed a major annoyance with the way Fedora initially sets things up. Bridged networking is not available by default!

I turned to #qemu on Freenode and was directed to the this blog post describing the procedure for enabling a network bridge that Qemu is able to use. I don’t like it. The suggested steps require me to rename my physical ethernet device /dev/peth0 and make the bridge device /dev/eth0. This is quite backwards, in my opinion. Typically the bridge is called /dev/br0 and the physical device is left alone. So, here is the configuration for setting up bridging in what I consider the proper way.

Read the rest of this entry »

Monitoring Distributed MySQL Installations

Posted in mysql, nagios, tips & tricks on November 20th, 2007 by Scott Sanders / No Comments »

At work we use lots of database servers. High availability is a must with any production systems, so we use Linux-HA clustered MySQL servers for our master databases, and replicate the data down to a number of slaves for our read operations. As anyone with MySQL experience knows, replication is somewhat ugly. The actual transactions are passed down to the slaves instead of the delta of the affected rows. Therefore, keeping an eye on both the slave MySQL processes and the replication delay is an important thing for Nagios to keep an eye on.

I wasn’t particularly fond of the existing mysql replication check plugins I found at the Nagios Exchange website, so I wrote my own. (Disclaimer: These are by no means perfect, and don’t adhere strictly to the Nagios plugin guidelines.) They are simple Bash scripts and require a MySQL user with SUPER and REPLICATION CLIENT privileges to exist in the database. These are potentially dangerous privileges, so the user should be tightly secured. Hopefully one day MySQL will let users SHOW SLAVE STATUS without requiring SUPER privileges, but until then be paranoid when creating the user. There are two scripts, one for simply checking MySQL replication, the other for checking replication and delay. While somewhat redundant, I still use both in different circumstances.

Read the rest of this entry »

Making Nagios Mobile Friendly

Posted in nagios, tips & tricks on November 9th, 2007 by Scott Sanders / No Comments »

One of the biggest problems I’ve had with Nagios is that is uses frames for everything. Frames haven’t been in favor with web developers for years and years for many reasons. My primary annoyance was that the web browser on my Blackberry was unable to load our Nagios page, because it didn’t support frames. Looking in the Nagios FAQ I found reference to the statuswml.cgi file.

Browsing to it on the Blackberry works wonderfully, and gives me the ability to acknowledge alerts and access to some other pretty nifty tools. Being the sort of sysadmin that likes to keep things clean, however, I found the link I needed to use (https://nagios.domain.com/nagios/cgi-bin/statuswml.cgi) simply too long and cumbersome to type frequently on the Blackberry’s tiny keyboard. Enter Apache and her terrific RewriteEngine!

Read the rest of this entry »

Entries (RSS)