no-www

This blog is hosted on my own domain, ever since the start I’ve supported finding my site as lowtek.ca or www.lowtek.ca.

WordPress allows you to do some simple URL rewriting to push people to whatever you want, and I had configured things to push visitors to www.lowtek.ca/roo since the ‘www’ seemed like the right thing to do. I never really thought much about it until I came across no-www.org.

No-www.org strives to make the Internet and communications about it as fruitful as possible. To that end, we make the modest proposal that website makers configure their main sites to be accessible by domain.com as well as www.domain.com.

This makes a lot of sense, and any site that supports they consider a Class A site. They define a further level of no-www support as Class B, and consider this optimal no-www compliance level. There is also Class C, but is not recommended.

Thus lowtek.ca has been a Class A compliant no-www site all along. However just the other day I switched things around to be Class B – allowing both www.lowtek.ca and lowtek.ca to work, but redirecting people who visit www.lowtek.ca to simply lowtek.ca. I had two reasons that motivated me: 1) lowtek.ca is shorter 2) I’m working on getting a SSL certificate and having the short name allows me to reuse it for other things (like mail) if I want.

To make the change I needed to address a couple of things. First step was to go to all of the wordpress blogs I host and change the General Settings to make sure wordpress wasn’t going to try to rewrite the URL to have a www prefix. Failure to do this will result in a broken site as you get a rewrite/redirect loop.

Next I had to do battle with my apache configuration. This is something I’m sure would be easier if I was a better web server admin. I ended up adding the rewrite rules to the sites-available definition(s) I use, one for normal HTTP and the other for HTTPS. Many suggest using .htaccess but I would rather this was codified in my actual apache config files.

The no-www.org FAQ has a rewrite rule, but I ended up using

RewriteCond %{HTTP_HOST} ^www.lowtek.ca$ [NC]
RewriteRule ^(.*)$ http://lowtek.ca$1 [R=301,L]

The [NC] specifies ‘no case’, ie: case insensitive. The R=301 specifies that we’re redirecting, and the HTTP code is 301 ‘Moved Permanently‘. The L indicates this is the last rule, as you can have multiples.

Now my domain validates with no-www.org as a Class B implementation.

There is a downside to the no-www movement, but only for larger sites. This is likely why Google continues to have a www prefix. Cookies that are set from domain.com can be read by anything.domain.com. For small sites like mine, this has no impact, for larger sites it could be a problem.

How To: Migrate from Raid1 to Raid5

Recently I discovered that the iPhoto data was actually stuffed under a deleted user that existed as part of the Mac migration process, this meant it wasn’t being seen by my rsnapshot backup of the active user directory. Fixing the location of the iPhoto library was relatively easy to do, but having an extra 130GB of data to back up immediately ran me into storage problems.

I had setup a RAID1 system using two 1TB volumes, I had decided to split the 1TB mirrored volume into 300Gb/700Gb so I could limit the space used by backups to 300Gb. In hindsight this was a silly idea, and it also made the migration process more complicated. If I had placed the 300Gb volume second, it might have been feasible to move that data somewhere then expand the 700Gb volume to fill the remainder of the drive – but I had put the 300Gb volume first. One day someone will write the utility to allow you to shift the start of a volume to the left (towards the start of a drive).

Instead of sticking with a RAID1 setup, I decided to move to RAID5. While there is a little less redundancy with RAID5, the additional flexibility seems like a good trade off to me at this point. I’ll avoid getting into the religious debate over which type of RAID you should use, or if RAID makes sense at all with large sized drives. Also there are some good off the shelf solutions now such as Drobo or QNAP.

With a project like this it is a good idea to make a plan in advance, then log your steps as you go along. Migration of 100’s of Gb of data will take time, lots of time. I did the work over about 5 days, some of it while on a trip outside the country (remote access!). Here was my plan:

  1. install new drive – ensure system is happy
  2. break mirrored set – run in degraded mode
  3. repartition new drive & unused mirrored drive
  4. create degraded raid 5 (2 drives only)
  5. copy data from degraded mirror onto degraded raid5
  6. decommission degraded mirror & repartition
  7. add volume to raid5 set

I also was careful to check that the new volume had the same capacity as the other two having been bit by that in the past. (I used fdisk -l /dev/sde to get the stats of the drive) Continue reading “How To: Migrate from Raid1 to Raid5”

Kingston RAM

RAM is one of the most important aspects of your computer system, but spending a lot on fast RAM is usually not worth it – better to get more RAM that is cheaper. I’ll frequently just buy whatever is cheapest that meets the specs I need.

Back in 2006 when I bought a refurbished Mac Mini (G4) from Apple it came with 512MB of RAM. The PPC Mini was limited to a single RAM slot, and 512MB was ok – but not really enough.

For Macs there was RAM specially tagged as compatible, or I could go the aftermarket route and just buy some RAM with the same specifications. If my memory is correct, the price delta was 30% or so. In the end, even at the premium price (about $100) the 1Gb of RAM I needed wasn’t a huge expense so I went for the guaranteed to work. The memory arrived, it worked fine until just recently.

The mini stopped booting, running a memory test resulted in it indicating the RAM was bad (I thought maybe the hard drive had gone). As Kingston has a lifetime warranty I figured it was worth seeing if I could get a free replacement (vs. a $30 price for a new unit at todays RAM cost).

Wow! Kingston’s support/warranty process is amazingly good.

I called and almost immediately got a real live person. It was really hassle free, they asked why I thought the RAM was bad and I said I had run a self test on it – and that was it. I was immediately in line for a RMA #.

The RMA process is really slick. Once you get the right documentation from Kingston (via email!) – you only need to package the RAM and drop it off at a FedEx location. Kingston picks up the cost of shipping it both ways.

The shipping was fast (and free to me):
Oct 4, 2011 9:45 AM Delivered FOURNTAN VALLEY, CA
Oct 4, 2011 8:57 AM On FedEx vehicle for delivery COSTA MESA, CA
Oct 4, 2011 8:03 AM At local FedEx facility COSTA MESA, CA
Oct 4, 2011 5:59 AM In transit LOS ANGELES, CA
Oct 4, 2011 4:04 AM Departed FedEx location INDIANAPOLIS, IN
Oct 4, 2011 2:04 AM International shipment release INDIANAPOLIS, IN
Oct 4, 2011 12:27 AM Arrived at FedEx location INDIANAPOLIS, IN
Oct 3, 2011 10:44 PM In transit MIRABEL, PQ
Oct 3, 2011 8:04 PM In transit OTTAWA, ON
Oct 3, 2011 6:23 PM Left FedEx origin facility OTTAWA, ON
Oct 3, 2011 5:16 PM Picked up OTTAWA, ON

A brand new stick of RAM arrived on my doorstep on October 12th (again via FedEx). It was amusingly over packaged (as you can tell from the photo at the top of this post). Of course it works perfectly.

Sure I paid Kingston a premium form Mac specific RAM, but that was back in 2006. To get such red carpet service 5 years after I bought something is really amazing. Their warranty also covers the regular ValueRAM etc, so you should get similar great service. They usually have very good pricing on their RAM, but given my experience with the warranty even if they aren’t the best price it will be tempting to spend a few bucks more to get Kingston.