John McFarlane's bloghttp://rockfloat.com/blog/feed/?type=rssJohn McFarlane's blogENCopyright 2007Thu, 05 Aug 2010 12:00:00 ESTRockfloat powered by Chula v0.7.0http://blogs.law.harvard.edu/tech/rssPostgreSQL tsearch2 migration from 8.0 to 8.3 - how I did it successfully<p>Recently I was in the process of moving my site to a much better hosting situation (more on that later).&nbsp; During the move I decided to upgrade from PostgreSQL-8.0 to PostgreSQL-8.3 as I&nbsp;was pretty far behind and I&nbsp;prefer to stay current. &nbsp;This sort of upgrade isn't a big deal, and I've done it many times.&nbsp; So I&nbsp;did my usual process:</p> <ol> <li>Install the desired version of PostgreSQL (in this case 8.3)</li> <li>Scp my last backup (taken a few minutes after I&nbsp;lock down the site) to the new host</li> <li>Run a script that essentially creates a new db, and restores the backup to it</li> </ol> <p>That's when things went horribly wrong.&nbsp; After a few searches I&nbsp;quickly learned that moving from 8.0 to 8.3 is a bit tricky when you have tsearch2 stuff in there.&nbsp; It turned out to be really easy to upgrade, read on if you want to know how I&nbsp;did it.</p>http://rockfloat.com/blog/id=42http://rockfloat.com/blog/id=42Fri, 24 Apr 2009 07:53:51 EST2008 Surly Steamroller - my new ride (literally)<p>One of my goals in moving to California was to put more focus on getting healthy.&nbsp; Now I'm lucky enough to be able to ride a really nice bike to work each day and get in a little work out each way.</p>http://rockfloat.com/blog/id=41http://rockfloat.com/blog/id=41Mon, 23 Mar 2009 04:21:21 ESTHow do you setup git-daemon on Ubuntu?<p>Git is by far my favorite version control system I've used.&nbsp; I use it all the time, and one of it's benefits is how easy it is to share code.&nbsp; I usually just send someone the link to gitweb and they can look at my code there.&nbsp; Other times people give me their public key, and they can clone my stuff over ssh.&nbsp; But just recently I&nbsp;wanted to have a way to easily allow anonymous readonly access.&nbsp; I&nbsp;was surprised to find that this isn't exactly straightforward on Ubuntu, but here's how I&nbsp;got it working...</p>http://rockfloat.com/blog/id=40http://rockfloat.com/blog/id=40Sat, 07 Feb 2009 06:27:35 ESTPerforce sucks<p>Seriously, I've had it.&nbsp; Perforce is the most horrible version control system ever.&nbsp; It's not as bad as Microsoft Source Safe - but no one pays for that anymore so it doesn't count.</p>http://rockfloat.com/blog/id=39http://rockfloat.com/blog/id=39Sat, 20 Dec 2008 05:26:01 ESTTips for extremely aggressive content caching<p>When it comes to performance one of the most important considerations is caching of content.&nbsp; There are all sorts of approaches to the caching.&nbsp; Some protect the database from duplicate queries while others protect your application from having to perform an expensive algorithm over and over.&nbsp; Today I am going to talk about the most aggressive form of content caching when it comes to the web - full page caching.</p>http://rockfloat.com/blog/id=38http://rockfloat.com/blog/id=38Thu, 23 Oct 2008 04:51:48 ESTWe wants the precious...<p><a href="http://www.techcrunch.com/2008/09/22/t-mobile-g1-specs-leaked-prior-to-announcement/"><img alt="" src="http://www.mobilecrunch.com/wp-content/uploads/picture-4.png" /></a></p> <p>Must have the precious!</p>http://rockfloat.com/blog/id=37http://rockfloat.com/blog/id=37Tue, 23 Sep 2008 09:05:51 ESTUnit testing is great - but don't forget about configuration testing<p>Recently a friend of mine pointed out that I had an error on one of my pages.&nbsp; It took me almost 45 minutes to figure out what was happening.&nbsp; I wasn't able to reproduce the defect in my development environment.&nbsp; The version of Python installed was exactly the same.&nbsp; I tried executing the problematic piece of code on the production server and it did not reproduce the problem.&nbsp; All of my unit tests passed... I was at a loss as to the source of the problem.</p> <p>It just so happend that a few months ago I had turned on a particular configuration option in Apache that influenced the way Python works.&nbsp; The reason why I wasn't able to reproduce the problem in dev was because it does not use a production configuration.&nbsp; The reason why I wasn't able to reproduce the problem using a Python interpreter is because it doesn't care about how mod_python works.&nbsp; Once I figured out what was wrong the fix was very simple, in fact all I had to change were two letters.</p> <p><b>The moral of the story is:</b> Testing is good, unit testing is great, but don't forget to test your configuration&nbsp; :)</p>http://rockfloat.com/blog/id=36http://rockfloat.com/blog/id=36Fri, 11 Jul 2008 07:56:01 ESTMoving to sunny California<p>So I've landed a job with <a href="http://www.reardencommerce.com">Rearden Commerce</a> in <a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=foster+city,+ca&amp;ie=UTF8&amp;ll=37.567168,-122.268562&amp;spn=0.117288,0.247192&amp;z=12&amp;iwloc=addr">Foster City</a>, California.&nbsp; All of our belongings [including our car] are currently in a trailer on it's way to Redwood City.&nbsp; We sold our house, purchased plane tickets, and pretty much finished up all the stuff required for a move across the entire country.</p> <p>Why wouldn't it be perfect timing to get summoned for <a href="http://www.clermontclerk.org/Jury_Notify.htm">jury duty</a> in Cincinnati&nbsp; :/&nbsp;</p>http://rockfloat.com/blog/id=35http://rockfloat.com/blog/id=35Tue, 22 Apr 2008 08:34:45 ESTStarting to learn Hadoop and Lucene<p>I've been reading about Hadoop and Lucene for a while now.&nbsp; Today I finally started working with the demos to get a better feel for how things work.</p> <p>&nbsp;</p> <p><a href="http://picasaweb.google.com/john.mcfarlane/Hadoop/photo#5170656165974491410"><img hspace="5" alt="" src="http://lh4.google.com/john.mcfarlane/R8HcYzyXwRI/AAAAAAAAAEM/odRNL6FiJDU/s288/hadoop_demo.png" /></a><a href="http://picasaweb.google.com/john.mcfarlane/Hadoop/photo#5170656165974491426"><img hspace="5" alt="" src="http://lh4.google.com/john.mcfarlane/R8HcYzyXwSI/AAAAAAAAAEU/4tUSX5na2hU/s288/hadoop_demo_jobs.png" /></a></p> <p>&nbsp;</p> <p>I'm excited to learn more!</p>http://rockfloat.com/blog/id=34http://rockfloat.com/blog/id=34Sun, 24 Feb 2008 09:18:03 ESTScript kiddies<p>I must admit it's sorta cute watching a script kiddie try to hack your site using sql injection or whatever.&nbsp; But it's even cuter when they try to get your [python] code to execute a get variable in the hopes of causing your [python] code to execute php code.&nbsp;</p> <p>Maybe one should return a link to Netcraft?</p>http://rockfloat.com/blog/id=33http://rockfloat.com/blog/id=33Fri, 01 Feb 2008 06:46:53 EST