ubuntu

Packaging Doctrine for Debian and Ubuntu

I have been indoctrinated into to the everything on production machines should be packaged school of thought. Rather than bang on about that, I intend to keep this post relatively short and announce that I have created Debian (and Ubuntu) packages for Doctrine, the ORM for PHP.

The packaging is rather basic, it gets installed just like any other Debianised PEAR package, that being the files go in /usr/share/php, the package.xml and any documentation goes into /usr/share/doc/<package>, and the tests are stored as examples in /usr/share/doc/<package>/examples. The generated package will be called php-doctrine_1.2.1-1_all.deb (or similar), to comply with the Debian convention of naming all PEAR packages php-<pear-package-name>_<version>_<architecture>.deb. I have only packaged 1.2.1, but the files can easily be adapted for other versions, some of the packaging is designed to be version agnostic anyway.

To create your own Doctrine deb, follow these steps:

  • Create a directory, such as ~/packaging/php-doctrine-1.2.1
  • Change into the new directory
  • Download my debian/ tarball and extract it in your php-doctrine-1.2.1 directory
  • Download the PEAR package tarball from the project website and extract it in your php-doctrine-1.2.1 directory
  • If you don't already have a standard Debian build environment setup, set one up by running sudo apt-get install build-essential
  • To build the package run dpkg-buildpackage -k<your-gpg-key-id> -rfakeroot . If you don't have a gpg key drop the "-k<your-gpg-key-id>" from the command

Now you should have a shiny new Doctrine deb. I think the best way to deploy it is using apt and private package repository.

Update: @micahg on identi.ca pointed me to a Doctrine ITP for Debian. Hopefully Federico's work will mean I no longer need to maintain my own packaging of Doctrine.

Howto Setup a Private Package Repository with reprepro and nginx

As the number of servers I am responsible for grows, I have been trying to eliminate all non packaged software in production. Although ubuntu and Debian have massive software repositories, there are some things which just aren't available yet or are internal meta packages. Once the packages are built they need to be deployed to servers. The simplest way to do this is to run a private apt repository. There are a few options for building an apt repository, but the most popular and simplest seems to be reprepro. I used Sander Marechal and Lionel Porcheron's reprepro howtos as a basis for getting my repository up and running.

nginx is a lightweight http server (and reverse proxy). It performs very well serving static files, which is perfect for a package repository. I also wanted to minimise the memory footprint of the server, which made nginx appealing.

To install the packages we need, run the following command:

$ sudo apt-get install reprepro nginx 

Then it is time to configure reprepro. First we create our directory structure:

$ sudo mkdir -p /srv/reprepro/ubuntu/{conf,dists,incoming,indices,logs,pool,project,tmp}
$ cd /srv/reprepro/ubuntu/
$ sudo chown -R `whoami` . # changes the repository owner to the current user

Now we need to create some configuration files.

/srv/reprepro/ubuntu/conf/distributions

Origin: Your Name
Label: Your repository name
Codename: karmic
Architectures: i386 amd64 source
Components: main
Description: Description of repository you are creating
SignWith: YOUR-KEY-ID

/srv/reprepro/ubuntu/conf/options

ask-passphrase
basedir . 

If you have a package ready to load, add it using the following command:

$ reprepro includedeb karmic /path/to/my-package_0.1-1.deb \
# change /path/to/my-package_0.1-1.deb to the path to your package

Once reprepro is setup and you have some packages loaded, you need to make it so you can serve the files over http. I run an internal dns zone called "internal" and so the package server will be configured to respond to packages.internal. You may need to change the server_name value to match your own environment. Create a file called

/etc/nginx/sites-available/vhost-packages.conf

with the following content:

server {
  listen 80;
  server_name packages.internal;

  access_log /var/log/nginx/packages-error.log;
  error_log /var/log/nginx/packages-error.log;

  location / {
    root /srv/reprepro;
    index index.html;
  }

  location ~ /(.*)/conf {
    deny all;
  }

  location ~ /(.*)/db {
    deny all;
  }
}

Next we need to increase the server_names_hash_bucket_size. Create a file called

/etc/nginx/conf.d/server_names_hash_bucket_size.conf

which should just contain the following line:

server_names_hash_bucket_size 64;

Note: Many sites advocate sticking this value in the http section of the

/etc/nginx/nginx.conf config

file, but in Debian and Ubuntu

/etc/nginx/conf.d/*.conf

is included in the http section. I think my method is cleaner for upgrading and clearly delineates the stock and custom configuration.

To enable and activate the new virtual host run the following commands:

$ cd /etc/nginx/sites-enabled
$ sudo ln -s ../sites-available/packages.internal.conf .
$ sudo service nginx reload

You should get some output that looks like this

Reloading nginx configuration: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful
nginx.

Now you can add the new repository to your machines. I recommend creating a file called

/etc/apt/sources.list.d/packages.internal.list

and put the following line in the file:

deb http://packages.internal/ubuntu/ karmic main

To make the machine aware of the new repository and associated packages, simply run:

$ sudo apt-get update

That's it. Now you have a lightweight package repository with a lightweight webserver - perfect for running in a virtual machine. Depending on your setup you could probably get away with using 256Mb of RAM and a few gig of disk.

Packaging Drush and Dependencies for Debian

Lately I have been trying to avoid non packaged software being installed on production servers. The main reason for this is to make it easier to apply updates. It also makes it easier to deploy new servers with meta packages when everything is pre packaged.

One tool which I am using a lot on production servers is Drupal's command line tool - drush. Drush is awesome it makes managing drupal sites so much easier, especially when it comes to applying updates. Drush is packaged for Debian testing, unstable and lenny backports by Antoine Beaupré (aka anarcat) and will be available in universe for ubuntu lucid. Drush depends on PEAR's Console_Table module and includes some code which automagically installs the dependency from PEAR CVS. The Debianised package includes the PEAR class in the package, which is handy, but if you are building your own debs from CVS or the nightly tarballs, the dependency isn't included. The auto installer only works if it can write to /path/to/drush/includes, which in these cases means calling drush as root, otherwise it spews a few errors about not being able to write the file then dies.

A more packaging friendly approach would be to build a debian package for PEAR Console_Table and have that as a dependency of the drush package in Debian. The problem with this approach is that drush currently only looks in /path/to/drush/includes for the PEAR class. I have submitted a patch which first checks if Table_Console has been installed via the PEAR installer (or other package management tool). Combine this with the Debian source package I have created for Table_Console (see the file attached at the bottom of the post), you can have a modular and apt managed instance of drush, without having to duplicate code.

I have discussed this approach with anarcat, he is supportive and hopefully it will be the approach adopted for drush 3.0.

Update The drush patch has been committed and should be included in 3.0alpha2.

DRBD on Ubuntu Karmic

Ubuntu 9.10 (aka karmic koala) has a frustrating packaging bug. Even though the stock server kernel includes the DRBD module, the drbd8-utils package depends on drbd8-source. drbd8-source uses DKMS to build the drbd module to match the installed kernel/s. As I stated in the bug report (lp:474660), "really don't like having build-essential installed on production net facing servers, and where possible any productions servers".

As side from personal opinion on whether the module should be bundled or not, the fact is that is bundled and so there is no need for the dependency on drbd8-source. As a work around I have added a meta package to provide drbd8-source, so I don't need to install build-essential and build the module every time a new kernel is installed.

After a quick test it is working well. Here is the DEBIAN/control file I used to make it all happen.

Package: dhc-drbd8-source-hack
Version: 0.1
Section: meta
Priority: optional
Architecture: all
Provides: drbd8-source
Installed-Size:
Maintainer: Dave Hall <spamme@davehall.com.au>
Description: Package to hack around drbd8-source dependency for drbd8-utils

If you are unsure how to use the control file above, see my recent blog post on building meta packages for ubuntu and debian.

Setting up a private package repository is outside the scope of this post. If you want to set one up, I would recommend Sander Marechal's slightly dated howto - Setting up and managing an APT repository with reprepro. With a few changes I found it worked well.

If you have your own repository running you can simply run sudo apt-get install dhc-drbd8-source-hack drbd8-utils, if you don't you can run the following commands sudo dpkg -i /path/to/dhc-drbd8-source-hack*.deb && sudo apt-get install drbd8-utils. Either way you should now have drbd8-utils installed on ubuntu karmic without having to install the redundant drbd8-source package.

To take it a step further you could build a meta package to install both drbd8 packages and allow you to have a potentially smoother upgrade to lucid. The meta package would contain the following line

Depends: dhc-drbd8-source-hack drbd8-utils

This is similar to what I now have in my HA server meta package.

Building Debian (and Ubuntu) Meta Packages

Over the last few weeks I have been building a bunch of Debian packages (aka debs) for a new Ubuntu server roll out. Most of the packages are either updates to existing packages or meta packages. Building meta packages is pretty easy, once you know how.

I will outline how to build a simple package which pulls in a couple of useful packages.

First off we need to create the directory structures and files. I do all of my packaging work in /home/$USER/packaging, with my meta packages living in a directory called meta.

For your first package run the following command

$ mkdir -p /home/$USER/packaging/meta/my-meta/DEBIAN

The key to creating meta packages is the "control" file. I have a very generic package I use for all of my servers, called dhc-base . This pulls in what I consider to be the minimum dependencies needed for a basic server. My "~/packaging/meta/dhc-base/DEBIAN/control" file looks something like this:

Package: dhc-baseVersion: 0.1Section: mainPriority: standardArchitecture: allDepends: dhc-archive-keyring, fail2ban, iptables, openssh-server, screen, shorewall, ubuntu-minimalMaintainer: Dave Hall <EMAIL-ADDRESS>Description: Base install meta package for boxes administered by Dave Hall Consulting

The fields should all be pretty self explanatory. The key one is "Depends" which lists all of the packages which you want your package to pull in. I try to keep the list alphabetical so it is easier to manage.

In my example I pull in some basic things which I use all the time as well as the the gpg signing key for my packages, which I have also packaged - I may blog how to do that one day too.

Now we are ready to build the package. simply run

$ dpkg-deb -b /home/$USER/packaging/meta/my-meta

and wait for dpkg-deb to work its magic. Now you should have a shiny new deb called my-meta.deb sitting in /home/$USER/packaging/meta

If you have a bunch of meta packages to build, it can become tedious to have run the command over an over again, and each time the packages will overwrite the previous version. To save me some effort I wrote a little shell script which build a package, and gives it a nice version number too.

#!/bin/bash## build-meta - dpkg-deb wrapper script for building meta packages## Developed by Dave Hall Consulting## Copyright (c) 2009 Dave Hall Consulting - http://davehall.com.au## You may freely use and distribute this script as long as the copyright# notice is preserved#function usage {SCRIPT=`basename $0`echo Usage: $SCRIPT package-path output-path}if [ $# != 2 ]; thendpkg-buildpackageusage $0exit 1fiDIR=$1OUT=$2DPKG_DEB=dpkg-debPKGNAME=`basename $DIR`BUILDREV=`date +%Y%m%d$H%I%S`VERSION=`cat $DIR/DEBIAN/control | awk '$1~/^Version:/{print $2}'`echo "Building $PKGNAME"$DPKG_DEB -b $DIR $OUT/${PKGNAME}_$VERSION-${BUILDREV}_all.deb

The script it pretty simple. It takes to arguments, the path for the package and directory to put the final package in, it will even read the version number from the control file.

To process all of the meta packages at once, simply run:

$for pkg in `find /home/$USER/packaging/meta -maxdepth 1 -type d | egrep -v '(.bzr|.svn|.git)'`; do /path/to/build-meta $pkg /home/$USER/packaging/built; done

Now you should have a nice collection of meta packages to deploy.

If you want to setup your own debian repository for your meta packages, I would recommend reading Ian Lawrence's reprepro howto.

I have found meta packages really simplify the tedious task of setting up common package sets - especially for server roll outs.

Update: If you are storing your meta packages under version control, as you should be, there is a problem. If you build the debs direct from a subversion checkout the .svn directory is included - so make sure you svn export your meta packages. Same principle applies for other version control systems.

Hello Planet Ubuntu Australia

Last week my blog was added to Planet Ubuntu Australia, the syndication site for Australian Ubuntu LoCo participants' blogs.

I have been rather busy with work and family commitments lately. I am hoping to give my poor neglected blog a little more TLC.

My New Toy - The Nokia N95

About 7 weeks ago I bought a Nokia N95 and I love it. I considered the Neo 1973 from openMoko, a completely open phone platform was appealing, but at the end of the day it isn't certified for Australia, it doesn't have WIFI or a camera nor does it do HSDPA/3G, all things on must have list. The iPhone was never in the race.

I picked up phone for just over 800AUD via ebay, they have since dropped a little in price. It is an Australia version with full local warranty support. The only downside is that it a 3 branded version, not a generic, but hey it works.

The phone got a real work out during my trip to Norway and it worked well. The GPS is a little slow to lock, but once it gets a lock it is right to go. The wifi works well. It is handy knowing if wifi is available somewhere before booting your laptop. I took a stack of pictures with the 5M pixel camera, the ones in bad light or inside aren't fantastic, but when taking shots outside it works a treat. The "DVD quality video" is pretty good too. It makes better movies than our old DVD based handycam. I am planning to use the phone at the birth of my second child (due any day now).

As I expected the phone "just works" as a standalone device, but the real test is how well it works with a Linux desktop. I can report that with Ubuntu 7.10 (aka Gutsy Gibbon) the N95 works well for all the stuff you really need. Below is a couple of quick mini howtos for a few things that you might want to with your N95. Some of the instructions are generic enough that they may work with little (or no) change with other handsets.

Disclaimer: I accept no responsibility for any data loss or stress caused by you following these instructions. Also you should carefully check your warranty before trying any of this. That said - "I just worked for me".

Pairing

For the bluetooth related stuff below you will need to pair your phone and PC. The quickest and easiest way to do this is using the bluetooth-applet. Here is how to do it:

  • Install the bluez-gnome deb - sudo apt-get install bluez-gnome
  • Once installed you should have a bluetooth icon in your GNOME system tray, if not just run "bluetooth-applet &" from the console
  • Right click on the icon and click "Browse Devices"
  • Your phone should be in the list, click on it and then click the Connect button
  • On your phone enter a 4 digit PIN when prompted - it can be anything you like
  • The bluetooth icon will then flash, click on it and enter the same PIN
  • Now your phone and PC should be paired
  • To make sure they are paired we will connect via obex-ftp
  • Right click on the icon and click "Browse Devices"
  • Your phone should be in the list, click on it and then click the Connect button
  • When prompted on your phone allow the connection
  • Nautilus should now launch and you you 2 folders "C:" (internal phone memory) and "E:" (microSD card)

Your PC and N95 are now paired and should be able to communicate via bluetooth without any problems.

Exchanging Files

Copying files to/from the N95 can be a little slow. Lets go from slowest to fastest.

Bluetooth

Copying files using bluetooth is very simple with a gnome desktop and the N95 using OBEX-FTP. Just install OBEX-FTP support for nautilus - "sudo apt-get install gnome-vfs-obexftp". Anytime you want to access the files on your phone via obexftp, just fire up nautilus and type "obex:///" and wait for a list of devices to be displayed. Double click on your phone and you are right to go. It can be rather slow copying files from your phone to your PC this way, but if you don't want to find cables or card readers it works. By slow I mean 30mins for a 100Mb video to copy.

There is also the gnome-obex-server package, which allows you to push content from your phone onto your PC, but I found this slow and I had to jump through too many hoops on the phone to send a file.

USB Cable

The N95 comes with a USB cable with a mini USB connector for connecting your N95 to your PC. When you plug the cable in the phone asks you which mode you wish to use. If you select Mass Storage it is treated like a usb mass storage device by and gnome-volume-manager, so it is mounted as soon as you plug it in. You are then able to access your microSD card.

I haven't been able to get the "Media Player" mode to work with the desktop music players I have tried it with - Rhythmbox, Banshee and Amarok. When used in "Mass Storage" mode it is possible to use File > Scan removable media in Rhythmbox.

Card reader

This is the fatstest way to read data from the microSD card. On the N95 press the power button for half a second, scroll down the list of options and select "Remove memory card", then remove your card from your phone. Now just put in into the SD card adaptor that came with the phone and use it like a normal SD card. Transfers speeds are quite good using this method.

Sync

Setting up sync with the N95 and opensync was relatively painless. I am syncing contacts with evolution, I have also tried with calendar events, which seemed to work as well, I haven't tried todos as I don't use them.

Start off by installing the bits we need

$ sudo apt-get install multisync-gui opensync-plugin-evolution opensync-plugin-syncml

This should also install all the dependencies needed to make opensync work.

On the N95 go Menu > Tools > Sync > PC Suite > Edit Sync Profile. First start by editing the settings under Applications. Lifeblog, Text messages and Bookmarks aren't supported by opensync, so disable them but setting "Include in sync" to No. You can also disable Calendar, Notes (really ToDos) if you wish.

As I had already transferred contacts from my old SE v600i to the N95 and I wanted to sync with an existing addressbook I had some issues. Namely 2 contacts didn't want to sync - I never found out which ones. So I found the easiest way to setup the sync was to create a new addressbook in evo.

  • Go into contacts ([ctrl]-2)
  • From the menu select File > New > Addressbook
  • Fill in the information - Type: "On This Computer", Name: "Phone" (or something else that makes sense for you
  • Click OK

In your GNOME menu under accessories, select multisync-gui. Now we need to create the sync pair.

  • Click the Add button
  • Give the group a meaningful name, such as "n95-evo" and click apply
  • Click the edit button for your new group
  • Tick the checkboxes for those sources which you don't want to use - you must disabled note as this isn't supported by the N95, this list should match the config on your phone
  • Click the Add Member button
  • Select Evolution 2.x from the list of options and Click Apply
  • Select which addressbook you want to sync with - in our case "Phone" (or which ever one you created above)
  • Click the Add Member button
  • This time select SyncML over OBEX Client
  • This where your XML hacking skills come into it (or you can just use my config

    <config>
    	<bluetooth_address>AD:DR:OF:MY:FO:NE</bluetooth_address>
    	<bluetooth_channel>10</bluetooth_channel>
    	<interface>0</interface>
    	<identifier>PC Suite</identifier>
    	<version>1</version>
    	<wbxml>1</wbxml>
    	<username></username>
    	<password></password>
    	<type>2</type>
    	<usestringtable>1</usestringtable>
    	<onlyreplace>0</onlyreplace>
    	<recvLimit>0</recvLimit>
    	<maxObjSize>0</maxObjSize>
    	<contact_db>Contacts</contact_db>
    	<calendar_db>Calendar</calendar_db>
    	<note_db>Notes</note_db>
    </config>
    
    		

    Change AD:DR:OF:MY:FO:NE to the address of your phone
    Note: I have only been able to get the N95 to sync with opensync using bluetooth.

  • Click Close
  • Click the "Refresh" and the sync should start
  • You have now synced your Nokia N95 with your Linux desktop! YAY!
  • All of your contacts from your phone should now be added to your evo addressbook
  • In evolution, copy any contacts from other addressbooks to the "Phone" addressbook
  • In multisync-gui click the "Refresh" button again and wait for the sync to complete

After I make changes to either either my N95 or evolution contacts I sync them. If you are also syncing your calendar you probably want to sync at least daily

Occasionally you may get conflicts. The GUI allows you to choose which one you want to keep. Having merge support in the GUI would be nice, but I can live with one taking precedence over the other on a per record basis.

Firmware Upgrades and Installing Maps

You need a real box Windows XP to upgrade the firmware or install full maps on the phone. I quickly tried using the usb support in qemu to connect the phone to a virtual version of XP, but I couldn't get it to work. It would be nice if Nokia offered firmware upgrades "over the air" so you could just use WIFI to upgrade the phone's firmware.

You can load map data as you move around, using mobile data, but this is an expensive way of doing it. You only need the map loader software installed on the Windows machine and then you can use the phone in mass storage mode of the microSD card to load the map data. I might try loading map data via qemu one day, but I have all the maps loaded that I currently need.

Software

In terms of what extra software you might want to install on the phone, here is a list of what I am using:

  • PuTTY - SSH on the phone, it is handy when I really need SSH and I don't have my laptop with me. Goota love a phone running SSH2 with public key authentication.
  • VNC. There is a Symbian sponsored port of TightVNC now available for the N95 and other S60 handsets. I am yet to get working properly
  • Fring is a free (as in beer) VoIP and IM app for mobile devices. It works pretty well. I have some issues using it with NodePhone, but I probably just have to tweak something there
  • I am also running the Lotus Sametime client, so I can keep in touch with the ReSight team out on the road. Pidgin is still the best Sametime (or general IM) client I have found, but there is no symbian port (hint hint)

Where is opera mini? I removed it, as I found the WebKit based browser on the N95 nicer in the longer run. It might use more bandwidth, but that is fine when using WIFI for most of your browsing anyway.

Overall

The Nokia N95 is certainly one nice handset. The battery life sucks - mine goes on charge every evening. The phone will never win an award from the FSF for freedom, but it never set out to do that. It sets out to be an all in one device and I think it achieves that goal pretty well. It is certainly usable under Linux, even if it does have some distance to go before it can really be considered truly Linux friendly.

Ubuntu Gutsy

For the last few weeks I have been running the upcoming Ubuntu 7.10 release (aka Gutsy Gibbon) on my laptop, which is also my primary PC. I know the ubuntu team don't recommend this, but I find it the best way for me to test stuff. Here is a quick run down of the things I have noticed. This isn't intended to be a comprehensive review, just a stuff I have noticed highlights.

Evolution

One of the best features I have found so far is in evolution. When sending a message which contains keywords, such as "attachment" or "attached" and you don't have an attachment, evo will nag you about it. It has saved me a few times already.
Evolution warning about lack of attachment screenshot

The other feature I like about evolution is that there is finally a panel notification icon, the annoying thing is that clicking it doesn't give evo focus. The xchat (not the gnome version) panel icon (available since Feisty) gives xchat focus when you click the icon - the same with liferea. I plan to file an RFE for this when I get some time.

Evolution panel notification applet

Another annoyance bug in evolution has been fixed, now when you copy text from an addressbook entry in view mode it only copies the highlighted text, not a whole vCard. YAY!

Desktop Search

The Tracker desktop search tool seems pretty nice. I got sick of beagle about a year ago and ditched it. Initially tracker made my PC unusable as it tried indexing everything in my home directory - including a few gig of legitimately owned ripped music. Tracker seems quicker than beagle and less resource intensive.

Conduit

Conduit finally works for me! The bug I reported was fixed 0.3 and gutsy ships with 0.3.2. I have played with it a bit and like the idea of it. I still need to find a real world useful task for it.

Liferea

Liferea is one of my top 5 apps. There has been no real changes between Feisty and Gutsy, except there are 2 really annoying bugs, feed names keep on being changed back to default and you can no long use "mark as read" for group level folders - I need to check if that one has been reported yet.

Earlier builds had problems with recording which posts had been read, which was driving me crazy - I am glad that it has been fixed.

Printers

The GNOME printer management tool has had a facelift or been replaced. The about dialog box says it is called "sysconfig-config-printer.py" from Red Hat. Although I used to like having a "folder view" of all of my printers, the new layout makes it a lot easier to access everything quickly.

GNOME system-config-printer.py screenshot showing new layout

Network Manager

I know there are some people who love Network Manager and those who hate it. I am mostly in the first camp, but there are somethings which annoy me about it. I need to file an RFE so you can use a VPN while using a PPP connection - currently you need to use a wired or wifi connection to use a VPN. PPP in general is a bit buggy, when you tell it create a PPP connection it won't try again until you click disconnect then connect again. It also lacks all the options you need for using PCMCIA/USB mobile data modem cards. It still does 80% of what I need. I will get around to reporting all this on launchpad.

Other Applications

There doesn't seem to be any significant changes to the other applications I use daily. Gutsy currently has pretty recent versions of most apps. Here is a list of some of them.

  • The GIMP - 2.4.0-rc2
  • Pidgin (formerly GAIM) - 2.2.0
  • OpenOffice.org - 2.3.0
  • Rhytmbox - 0.11.2
  • FSpot - 0.4.0

Look

Every new release of Ubuntu/GNOME I find myself in 2 minds about the look of it. I am finding it increasingly difficult to find icons I am happy with. For example I liked the look of GAIM far more than I do Pidgin, and this is now the 3rd release where the icons in evolution have changed. Maybe I am just getting old, but I think I liked it more the old way. Then again some of the other new icons look very slick. I plan to try using the Tango icons for a week to see if they are better than the gnome default.

I can't run all the Compiz bling on my laptop - damn buggy proprietary drivers. I have better things to do with my CPU cycles anyway.

The new appearance manager takes a little getting used, but I think it is better than having 4 or 5 different menu options.

GNOME appearance manager screenshot

Overall

Overall I think the Gibbon is shaping up to be a solid release for Ubuntu. The team still have a couple of weeks before the release is due. Based on how far things have come in the last 3 week or so I have been using Gutsy, I think it will be a fine release. Once it goes final I think it is a worthwhile upgrade, unless you are a LTS only user - then you have to wait another 6 months for 8.04 aka Hardy Heron.

The Warm Glow of the Sun

Last week I received an email from Sun asking if I had seen a previous email. The previous email was attached. It almost ended up in the same place the previous email did - my spam bucket. The subject was "CONGRADULATIONS: Open Performance Contest WINNER - Dave Hall Consulting - TBWEBI_<random numbers>", which looked pretty spammy to me, just like the various bogus sweepstakes and the other 419 messages I get all too regularly.

As usual I am straying off topic. Back to the main reason for my post. The message from Sun contained the following text

It has been some time since you entered the Open Performance Contest and although you were not the winner for period XX your entry was included in period YY and has been selected. We wish to congratulate and inform you that you've been selected as a potential winner of our Open Performance Contest! Your entry was well written, complete, and highly applicable. To proceed, we first need to verify your eligibility. To aid us in this process, please complete the attached Affidavit of Eligibility/Liability & Publicity Release, and email it to: <someone>@sun.com within 5 business days.

If Noah wasn't asleep I think I would have cranked up some Infected Mushroom and had a big happy dance. I had to be more restrained and just look extremely happy. Then I printed, signed, scanned and emailed the paperwork back to Sun.

The server that Sun is in the process of arranging to ship to me is a Sun Fire T2000, with a list price of over 21,000 USD (or almost 25kAUD). My entry in the Open Performance Contest has yet to be published along with the other winners on sun's site, but I am not holding my breath.

I am still a bit shocked about my win. I am enjoying the warm glow from the Sun :) I was already convinced that I would be settling for an ubuntu t-shirt (thanks Canonical, even though it makes me look like I have put on 10kgs) and some "Cool Threads" temporary tattoos (which last 2-3 weeks) and be able to say that I had a T2000 for a couple of months or so.

I am now stuck with a dilemma, what to do with the box. Putting the box straight on ebay or Grays Online would be pretty rude. At the same time, the money from selling the box would be make up a significant part of a house deposit.

I would welcome any suggestions for what I can do with a noisy, high end SPARC box.

Update: Sun rang today to apologize for the delay in shipping the box and to advise me that it should arrive Thursday (or Friday at the very latest)

Member's Areas and wget

Earlier this evening I was discussing mirroring restricted areas of sites with wget on #ubuntu-au. The solution is pretty simple.

  1. Install the web developer extension for firefox
  2. Login to the target site
  3. On the webdev toolbar select Cookies > View Cookie Information
  4. For each of the cookie entries add the following to a file called wget-cookies.txt which should be saved in your home directory
<.target.domain.name>[tab]FALSE[tab]/[tab]FALSE[tab]1496836642[tab]<key>[tab]<value>

This is what it all means

  • <.target.domain.name> the domain of the site
  • TRUE the domain wide flag, if the domain starts with . this should be TRUE
  • / the path the cookie applies to
  • FALSE is the cookie secure (or available via HTTPS)
  • 496836642 the expiry of the cookie (i am using 11:57:22 UTC on 7-Jun-2017)
  • <key> the name of the cookie
  • <value> the value of the cookie

If you just want to pull down a single page use the following command:

wget  --load-cookies ~/wget-cookies.txt <target-url>

Then you should have the target page

If you want to mirror the whole site as an authenticated user try something like:

wget --mirror -w 2 -p --convert-links  --load-cookies ~/wget-cookies.txt <target-url>

I tested this with a couple of my own sites and it seems to work well.

Before doing something like this, check the term of service and the license of the content to ensure that you are not in violation of either.