Dump A MySQL Database To YAML Using PHP

The Problem

I was recently working on a project that is built on WordPress / BuddyPress. I built up some content using the CMS features of WordPress in my development server and then I transfered the WordPress content to a beta server using the export/import functionality. That kind of stinks having to do that every time I want to push updates to my beta server. So I looked into using Doctrine to generate data fixtures which I could repeatedly run against the different database. Doctrine supports YAML files, which are extremely easy to edit by hand, so it seemed like a good idea.

So what’s the problem? Well, I didn’t currently have any of my data in YAML files. I didn’t want to had edit them or do some sort of copy and paste madness. So, I wrote a script in PHP to dump my data into a YAML file.

Read moreDump A MySQL Database To YAML Using PHP

Modify PHP CLI Include Path Dynamically

I was working with an application platform that I had just downloaded today. I just wanted to check it out and play with it a bit. In the application framework was an executable script that provided some command line utility. I fired up the script and received an error like “PHP Fatal error: require_once(): Failed opening required…”. Of course non of the files from the downloaded archived were in the include path for my system, but I didn’t want to just go adding it to my php.ini file just to play around with it short term. What to do.

Command Line Options

First I wanted to see if there was a command line option that I could pass to PHP to tell it what include_path to use for just this one execution. If you execute the following you’ll see the usage:
php --help
There is no include_path command line option, but there is the -d foo[=bar] option which allows us to modify any of the INI entries by key/value.

Read moreModify PHP CLI Include Path Dynamically

Bash Script Init Style Status Message

Have you ever wondered how the OK and/or FAILED messages are printed out in the initialization of services on a Linux system during bootup? Well… I have. Anyway, I’ve always thought that it was really cool how the OK and FAILED messages printed out at the same column on the screen and in different colors. So of course I wanted to know how to do that so I could use it in my own scripts.

Read moreBash Script Init Style Status Message

How To Use Subversion Over SSH

The Problem I recently had a problem. I am a software developer and as such I use source control. For this purpose I generally prefer Subversion. I have been keeping my source repositories on an external drive with the intention to back them up to another secure location periodically (yeah, that never happens). I looked …

Read moreHow To Use Subversion Over SSH

Revolution OS – The Linux Story

Revolution OS is a 2001 documentary which traces the history of GNU, Linux, and the open source and free software movements. It features several interviews with prominent hackers and entrepreneurs (and hackers-cum-entrepreneurs), including Richard Stallman, Michael Tiemann, Linus Torvalds, Larry Augustin, Eric S. Raymond, Bruce Perens, Frank Hecker and Brian Behlendorf. The film begins in …

Read moreRevolution OS – The Linux Story

Bash Script Naming – Say My Name, Say My Name!

I use Java as my main Linux server programming language these days and so I usually have a Bash script to go along with each program. The Bash script help encapsulate creating the proper CLASSPATH needed to run the Java program, calls the correct Java class and also passes through any command line parameters that …

Read moreBash Script Naming – Say My Name, Say My Name!

Will The Google Phone Overtake The iPhone?

The release of Apple’s iPhone has made tremendous waves in the cellphone industry. However, the honeymoon is over and the iPhone has been “cracked” in favor or more user customization and third party applications. Apple has announced an SDK (software developer kit) to be release for the iPhone coming in February 2008, but by then …

Read moreWill The Google Phone Overtake The iPhone?