Warning: getimagesize(/home/benc/public_html/../../../../../../../../../../../../../../../../../../../../tmp/fb125.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/benc/public_html/wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php on line 438

Warning: getimagesize(/home/benc/public_html/../../../../../../../../../../../../../../../../../../../../tmp/pista.png) [function.getimagesize]: failed to open stream: No such file or directory in /home/benc/public_html/wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php on line 438

Warning: Cannot modify header information - headers already sent by (output started at /home/benc/public_html/wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php:438) in /home/benc/public_html/wp-includes/feed-atom.php on line 8
Ben Cornwell 2008-07-06T23:22:25Z WordPress http://www.bencornwell.com/feed/atom/ ben_author http://www.bencornwell.com <![CDATA[Cleaning Up After CruiseControl]]> http://www.bencornwell.com/?p=52 2008-07-06T23:22:25Z 2008-07-06T23:22:25Z CI builds tend to generate a *lot* of output. With CruiseControl that’s no problem in itself, but you’ll probably want to purge old build artifacts periodically to avoid maxing out on disc usage.

Here’s a python script for cleaning up your artifacts dir. Posted by Phill (apparently doesn’t like to share his last name). Just put it somewhere sensible and slot into crontab.

#! /usr/bin/env python
# ==== Variables ====
ARTIFACTS_DIR="/opt/cruisecontrol/artifacts/"
NUM_BUILDS_TO_KEEP=10
# ==== End Variables ====

import os

def rm_recursive(path):
        """Removes a directory recursively"""

        for root, dirs, files in os.walk(path, topdown=False):
                for name in files:
                        os.remove(os.path.join(root, name))
                for name in dirs:
                        os.rmdir(os.path.join(root, name))
                #os.rmdir(path)

def delete_old_builds(path):
        """Deletes old builds"""

        builds = os.listdir(path)
        if len(builds) <= NUM_BUILDS_TO_KEEP:
                print "No builds to delete"
                return

        builds.sort()
        builds.reverse()

        i = 0

        for build in builds:
                i += 1
                if i <= NUM_BUILDS_TO_KEEP:
                        continue

                print "Deleting", build
                rm_recursive(os.path.join(path, build))

for file in os.listdir(ARTIFACTS_DIR):
        path = os.path.join(ARTIFACTS_DIR, file)

        if (os.path.isdir(path)):
                delete_old_builds(path)
]]>
0
ben_author http://www.bencornwell.com <![CDATA[CITCON]]> http://www.bencornwell.com/?p=50 2008-06-27T13:28:28Z 2008-06-27T13:28:07Z CITCON 2008 kicked off earlier this evening in Melbourne.

More to follow tomorrow!

]]>
0
ben_author http://www.bencornwell.com <![CDATA[Fail]]> http://www.bencornwell.com/?p=49 2008-06-26T09:50:47Z 2008-06-26T09:49:19Z I’m not normally one to partake of stealing posts from other blogs, but this is just too good to resist. Lifted from FailBlog.org ]]>

I’m not normally one to partake of stealing posts from other blogs, but this is just too good to resist.

Lifted from FailBlog.org

]]>
0
ben_author http://www.bencornwell.com <![CDATA[PHPUnderControl (Install cont.)]]> http://www.bencornwell.com/?p=48 2008-06-25T13:30:20Z 2008-06-25T13:24:28Z In a previous post, I mentioned I would post the init script I’ve been using to start/stop CruiseControl. It’s not my own work (lifted from teh Internets). Looks like it was originally written by someone from ThoughWorks, but I didn’t find it on a ThoughWorks site & it didn’t come with a licence or copyright notice. Until I’m told otherwise, I guess it’s OK to redistribute.

Download it here

Obviously you’ll need to configure the script for your environment and allocate appropriate permissions. When you’re done, drop it into /etc/init.d/ and CruiseControl will automatically start during your server’s init routines. Also, when trying to stop the process, rather than scanning ps output trying to find the correct pid to kill, you just run:

# sudo /etc/init.d/cruisecontrol stop
]]>
0
ben_author http://www.bencornwell.com <![CDATA[PistaDex]]> http://www.bencornwell.com/?p=47 2008-06-24T21:08:59Z 2008-06-24T21:08:15Z pistadex.com

With official interest rates likely to increase by one billion percent in the second half of 2008, the RBA is advising potential pista-riders to get into the market while they can.

(previously: PistaDex)

]]>
0
ben_author http://www.bencornwell.com <![CDATA[PHPUnderControl Install Guide]]> http://www.bencornwell.com/?p=46 2008-06-22T07:22:09Z 2008-06-22T07:20:08Z Lately I’ve been doing some work with PHPUnderControl. It’s based on the Cruise Control Continuous Integration framework, which in turn, is based on Ant. It combines PHPUnit, PHPDocumentor & CodeSniffer to build & test software projects. It works pretty well, though there were a few mysteries along the way to getting an install up and running. I’m in the middle of preparing a comprehensive how-to, but meanwhile, here are a few notes I made about the installation & configuration process.

* There’s no easy way to start and stop Cruise Control. You’ll need to add an init script for starting/stopping/restarting. I’ll post mine here eventually.

* Disc Space: Builds can potentially use up a ton of the stuff. Make sure you have plenty of room, and/or, an easy way to shutdown the CC process if you find yourself running out of disc space.

* Configuration changes require a restart/reload to take affect. This should be second-nature if you’re used to configuring apache etc. Having said this, it caught me out a couple of times.

* You can configure builds to be triggered only where code changes have been merged to your svn sources. This saves heaps of unnecessary disc writing etc.

* Be careful using relative file paths. I’m still looking into how Ant handles file paths, but it definitely seems to be inconsistent. I’m using absolute paths in my build.xml & config.xml config files.

* If commands in your build process are failing, check the contents of /path/to/cruisecontrol/cruisecontrol.log - This will detail the exact commands being run by cruisecontrol.

* To test your build.xml configuration for a specific project run /path/to/cruisecontrol/apacheAnt-Version/bin/ant from within the project directory. Do this before restarting the cruisecontrol process to avoid builds failing because config errors.

]]>
0
ben_author http://www.bencornwell.com <![CDATA[Bianchi Pista]]> http://www.bencornwell.com/?p=45 2008-06-22T01:28:11Z 2008-06-20T12:18:57Z I’m building a bike! Bought a frame through Ebay last week which should be arriving any day now. More pics from the build will turn up here. ]]>

I’m building a bike! Bought a frame through Ebay last week which should be arriving any day now. More pics from the build will turn up here.

]]>
0
ben_author http://www.bencornwell.com <![CDATA[Eastlink (plus to & from)]]> http://www.bencornwell.com/2008/06/11/eastlink-plus-to-from/ 2008-06-11T09:44:49Z 2008-06-11T09:41:58Z This Sunday should be fun!

]]>
0
ben_author http://www.bencornwell.com <![CDATA[Velo-Rage]]> http://www.bencornwell.com/2008/06/08/velo-rage/ 2008-06-08T10:29:11Z 2008-06-08T10:29:11Z

]]>
0
ben_author http://www.bencornwell.com <![CDATA[On Cycling]]> http://www.bencornwell.com/2008/06/06/on-cycling/ 2008-06-06T11:50:46Z 2008-06-06T11:48:17Z Fat Cyclist:

“Everyone talks about their hobbies and what they do for fun. Cycling, though, is much more than a hobby for me. It’s a giant reset button. I can be having the worst day ever; after ninety minutes on a bike, I’ve got my balance back.”


My problems are trivial compared to what this bloke & his family are coping with, but this is a sentiment shared.

]]>
0