Copy changed files from CVS repository

March 14th, 2012 No comments

While converting my cvs repositories to git I needed to copy all the changed files from my working directory into a temp directory and then into my git working dir. This was the solution that I came up with:

cvs -qn update -d 2>/dev/null | grep '^[M|\?|P] ' | awk '{print $2}' > files.list
while read file; do cp -r -f --parents "$file" /tmp/dest/; done < files.list

Basically, cvs -qn update -d does a mock update (doesn’t change files), piped to grep to only list the changed files, use awk to exclude the M, P, ? etc, output to a file.

Loop over the lines in the new file using the cp –parents to preserve directory structure

Categories: Coding Tags:

apr-utils 1.4.1 rpmbuild error (seg fault)

February 22nd, 2012 No comments

When trying to build an rpm for apr-utils on my CentOS 6.2 box I got a nasty error when the rpm was running test:

testmemcache : |/bin/sh: line 2: 14322 Segmentation fault LD_LIBRARY_PATH=”`echo “../crypto/.libs:../dbm/.lib s:../dbd/.libs:../ldap/.libs:$LD_LIBRARY_PATH” | sed -e ‘s/::*$//’`” ./$prog
Programs failed: testall
make: *** [check] Error 139
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.OQddG8 (%check)

This relates to this bug:

Thanks to Peter Poeml for releasing a patch for this, which I’ve put into an updated apr-util.spec

Categories: Uncategorized Tags:

RPM macros

February 17th, 2012 No comments

I have been building a lot of custom RPMs lately and I found this great resource which lists all of the macros that can be used in the spec files and what they equate to.

Categories: Uncategorized Tags:

CVS error

February 10th, 2012 No comments

I recently changed to using the unix command line for cvs and changed all my cvs roots to :ext: instead of :ssh: (tortoise prefers ssh).

When I made the change, anytime I updated cvs I got this error:

/CVSROOTccess /cvsroot
No such file or directory

This makes no sense. Luckily, after searching around I found this is a problem with DOS line breaks screwing with unix cvs. Running the following fixes the problem:

dos2unix `find . -name Root`
dos2unix `find . -name Entries`
dos2unix `find . -name Repository`

Categories: Uncategorized Tags:

Network Solutions and DNSSEC

January 18th, 2012 No comments

It’s interesting that not only does netsol not list any information what-so-ever on their knowledge base about DNSSEC, their support staff have no idea what it is either.

Come on network solutions, sort it out otherwise I may have to move my domains to a registrar that does support DNSSEC.

Categories: Uncategorized Tags:

VLC Airplay on Airport Express

August 15th, 2011 15 comments

There is a way to stream music to your airport express from VLC (means you don’t have to install iTunes).

Under preferences > all > stream output enter this in the “Default stream output chain”:

#transcode{acodec=alac,channels=2,samplerate=44100}:raop{host=<ip address of aiport express>,volume=175}

Categories: Tech Problems Tags: , ,

df not reporting correct disk usage

July 27th, 2011 No comments

I had a problem where df and du disagreed with the amount of disk usage. The cause was processes holding on to unlinked files. Running the following identified the processes:

ls -ld /proc/*/fd/* 2>&1 | fgrep ‘(deleted)’

I killed the processes and df is now showing the correct information.

Categories: Uncategorized Tags: , ,

Dreamhost supports ipv6

April 29th, 2011 No comments

I just found out that dreamhost supports ipv6 (has done since March ’11). Just go to manage domains in the control panel and click “Add IP” next to each of your domains.

Now if only our enterprise hosting at Verio/NTT supported ipv6!

Categories: Uncategorized Tags:

Browser Wars (sunspider edition)

April 14th, 2011 No comments

It seems that most browsers are focused on speeding up javascript execution now as most websites are heavy with ajax and complex js.

With Firefox releasing their pre-beta “dev” version Aurora this morning I decided to run all the current browsers through sunspider to see if any progress has been made.

Chrome-dev: 294ms
Aurora (FF dev): 324ms
Firefox 4: 348ms
IE9: 251ms
IE10 preview 1: 254ms

So it would seem that Firefox has sped up their js engine, but has a little way to go to catch up to the other browsers.

Categories: Uncategorized Tags: , , ,

Remove site from Google

February 22nd, 2011 No comments

We found that Google had indexed a site that shouldn’t be indexed so I setup a robots.txt file to deny all crawlers and locked down the site with http auth. I also put in a request to have the urls removed from the index and cache.

When I did this Google returned ~2,400 results when doing a “”. A few days later it was returning ~54,000. Today it is returning ~133,000.

I’m not sure how Google managed to mix up “remove my site” with “index it more”. Maybe this is just part of the removal process?

Update: Google is now up to 217,000 results for this site. Maybe removing your site from the index is good for SEO?

Categories: Uncategorized Tags:

Change CVS path

February 16th, 2011 No comments

Found a small command to run through code directories and change the CVS path, handy if you’re changing CVS username or path.

find . -name ‘Root’ -exec perl -pi -e ‘s/OLD_URL/NEW_URL/’ {} \;

Categories: Tech Problems Tags:

unzip 6 for RHEL 5.6

February 15th, 2011 2 comments

Redhat likes to run old packages with backported patches, but sometimes it’s nice to have the latest version that includes new features. Unfortunately the unzip from RHEL yum can’t unzip files > 4GB. I found the src rpm and compiled binaries that work with RHEL 5.6 (may work with older).


Categories: Uncategorized Tags: ,

Deny access to website, but allow robots.txt

February 15th, 2011 No comments

I had a problem where Googlebot was indexing a development site, so we locked it down using apache basic http auth. Now Googlebot was being served with a 401 when accessing the site, but because it had no stored robots.txt it was persistently trying to crawl the site.

Using the following allows anyone to access robots.txt but denies access to the rest of the site:
<Directory “/home/username/www”>
AuthUserFile /home/username/.htpasswd
AuthName “Client Access”
AuthType Basic
require valid-use

<Files “robots.txt”>
AuthType Basic
satisfy any

Eventually Googlebot will get the hint and stop indexing the site and we can remove existing content using webmaster tools.

Categories: Uncategorized Tags: , , ,

Overheating Macbook Pro

February 14th, 2011 No comments

I’ve been having problems recently with it overheating. It’s not much fun when trying to code on the couch with a boiling hot mac on your lap.

I found a program called smcfancontrol which seems to take care of that. It’s now under 50oC and coding it now more fun!

Categories: Uncategorized Tags:

Online Banking

January 5th, 2011 1 comment

Why is it that in this day and age it takes a day to transfer money from one bank to another? And if it’s a weekend or public holiday it takes even longer. Do computers not work weekends now?

Can someone please invent a protocol or process to allow bank transfers to be instant? Surely it can’t be that hard, it’s just numbers/data being shifted around. I can transfer entire DVDs of information from one side of the world to the other in a short period of time, why can’t a bank process things in real time?

Categories: Uncategorized Tags:

PANWA2204A WLAN 11g Router

November 17th, 2010 2 comments

I came a cross an unbranded router with the FCC ID PANWA2204A stamped on the bottom (with MAC addresses and serial number). If anyone else is trying to identify one of these it’s a “RadioLabs High Power O2Link Broadband Turbo G Router“.

Categories: Uncategorized Tags:

Auckland Frost Dates

July 5th, 2010 1 comment

I had been searching for approximate frost dates for Auckland to help schedule veggie plantings. Luckily the people at NIWA are nice and respond very quickly to emails. I was told that ground frosts are days where grass minimum temperature are less than -1.0 degree C. Screen frosts are when the air temperature dips below 0.0 degrees C.

Using NIWA’s free data explorer tool “Cliflo” and the closest weather station to me I came up with the following data:

First Frost: 2009-04-10
Last Frost: 2009-09-09

First Frost: 2008-04-21
Last Frost: 2008-09-07

First Frost: 2007-05-29
Last Frost: 2007-10-04

First Frost: 2006-05-31
Last Frost: 2006-09-19

First Frost: 2005-04-22
Last Frost: 2005-09-03

First Frost: 2004-05-21
Last Frost: 2004-09-30

First Frost: 2003-04-26
Last Frost: 2003-10-27

First Frost: 2002-07-14
Last Frost: 2002-10-24

First Frost: 2001-05-29
Last Frost: 2001-09-29

First Frost: 2000-06-14
Last Frost: 2000-09-29

This averages out to:

First Frost: May 19
Last Frost: September 27

Hopefully this helps the local gardeners. Join me on Folia

Categories: Uncategorized Tags:

Creating Access ODBC datasource under Windows 7 (64bit)

June 1st, 2010 27 comments

I had to create an ODBC datasource for an access database on my Windows 7 machine and for some reason the *.mdb driver doesn’t show up in the control panel ODBC administrator.

After much swearing and google-ing I found the solution.

In C:\windows\sysWOW64 there is an executable called odbcad32.exe. You need to run this exe as administrator to gain access to all the ODBC drivers that come with Microsoft Office, etc.

Thanks Microsoft for another fine product!

Categories: Tech Problems Tags: , , ,

Google DNS and OpenDNS vs CDNs

December 4th, 2009 4 comments

With more and more people moving towards using a global DNS system (like Google DNS and OpenDNS) the speed advantages of a CDN may be cancelled out.

Most of the major CDNs use geotargeting based on where the DNS is being resolved from. For example Facebook’s CDN solution (using Akamai) resolves to 210.55.501.200, a 5ms response time. Using Google’s public DNS server ( the same domain resolves to,, a 200ms response time.

So while using Google’s DNS/OpenDNS may save a few ms while resolving a domain, it may slow down a site by putting the CDN pops further away from end users. Until CDN’s can work with these public DNS providers the internet may become slower for those using these services.

Categories: DNS Tags: , , ,

Windows XP 32bit drivers for Dell Studio XPS 435MT

June 10th, 2009 7 comments

We just recieved a couple of new computers today, shiny new Dell Studio XPS 435MT boxes. As everyone here still runs XP 32bit I decided to reinstall the new computers with the same OS, so we didn’t run into any compatability problems. The problem is Dell doesn’t support any other operating systems on these computers other than Vista 64bit!

After searching around the internet for a couple of hours I found the drivers needed, they are as follows:

Network (Intel 82567):*%20XP%20Professional&lang=eng

Chipset (Intel X58):*+XP+Professional&lang=eng&strOSs=44&submit=Go!

Graphics (ATI Radeon 4850):

Audio (Realtek HD Audio):

I hope this helps anyone with a similar problem

Categories: Tech Problems Tags: , , ,

Webby Awards

April 30th, 2009 No comments

The Webby Awards are upon us again for the 13th year. It’s ironic though that awards that celebrate the best on the internet have one of the worst designed sites. The Webby People’s Voice site ( is hard to register on and vote. This has discouraged a lot of people from voting for their favourite websites.

Categories: Uncategorized Tags:

Recursive file sizes (filtered by file type)

April 9th, 2009 1 comment

I had to find out the size of all our images on a site today. This was the easiest and fastest way to do it


find /home/username/public_html -name ‘*.png’ -printf “%s\n”|awk ‘{sum+=$0}END{print sum}’


Categories: Uncategorized Tags:

Photography links

April 6th, 2009 No comments

Here’s a great list of photography resources:

Categories: Uncategorized Tags:

iMob Friend Codes

January 25th, 2009 1,220 comments

Add your imob friend code to the comments and I’ll add you

My code is 100 631 009 (also for iKnights)

If you haven’t installed iMob yet, search for it on the itunes store and install it on your iPhone for free.

Update: Comments are now closed, there are over 1200 people posting here and it takes ages to page through them all. If you want your code added to this post (at the top) please donate $2 via paypal:

Add your code into the comments of the payment and I’ll add it. Limited to 100 places. This is highly ranked page for imob codes and gets a ton of traffic, you’ll get added by hundreds of users (I’ve been added by 2300 people).

Other codes to add:


Categories: Uncategorized Tags:

Freezer Jam

October 15th, 2008 No comments

Learn about freezer jam and how to make it. I hadn’t heard of it before, but apparently it’s quite a popular way to make jams these days. Saves a lot of time.


Strawberry Freezer Jam
Blueberry Freezer Jam

Categories: Uncategorized Tags: , ,