Category Archives: Coding

New side project

I had an idea for a website over the Christmas holiday, took a few hours over a few days and got some proof of concept code up and running. I bought a domain for it, and am now making it robust to handle some traffic. Today I played around with MongoDB and got it up and running and it works great. I’ll be hosting it on OpenShift (for now anyway). I’m hoping to launch the site later this month.

In the meantime, if you use Goodreads and Overdrive, let me know if you want to be a beta tester.

Using ant to exec mysql .sql files via a fileset

In trying to automate our DB development, we decided to use ant and Jenkins to run our SQL scripts for a deploy. We had a hard time getting ant to work and after much trial and error (and cussing and fussing) we finally got it to work. The key really was the addsourcefile=”false” attribute and the redirector. Since mysql can run sql from a file using redirection (< ) you have to use a redirector (which is poorly documented). The ant apply task can apply an executable to every file in a fileset, so this will use the mysql executable to exec every *.sql file it finds. Continue reading

Unit testing JavaBeans

I always just pretty much skipped unit testing JavaBeans since the work involved didn’t seem worth it. Today though, I was troubled by the lack of coverage on the Javabeans in our Emma code coverage reports so I googled and found this bit of unit testing brilliance: Unit Testing Javabeans. It’s a simple class that uses introspection to test the bean and works great!

Upgrading Perl in Linux Mint

WARNING: don’t do this – it could hose your system like it did mine… details to follow once i figure out how to undo it.

Figured I’d share this since it was a PITA to figure out. Linux Mint 11 ships with Perl 5.10. I was trying to install icinga and it needs Perl 5.12.4 or greater.

To make it happen I had to:

  • add this line to /etc/apt/sources.list: deb http://ftp.de.debian.org/debian wheezy main
  • install/upgrade with this: apt-get install gcc perl -o APT::Immediate-Configure=0 (from linux mint forums)

and Bob’s your uncle.

AND…. to put 5.10 back in place…

  • remove the entry you put in /etc/apt/sources.list and replace it with deb http://ftp.de.debian.org/debian squeeze main
  • sudo apt-get install perl=5.10.1-17ubuntu4 perl-base=5.10.1-17ubuntu4 perl-modules=5.10.1-17ubuntu4

upgrading to 5.12 caused lots of problems – Pidgin wouldn’t work and most importantly, my VPN stopped working – it would disconnect after about 30 seconds.