Goodbye Ubuntu

It’s time. I’ve finally had enough of the workarounds and issues thrown up by Ubuntu’s change to Unity.

So, Linux Mint looks like it will tick most of my boxes and appears to have a growing community around it (quite a few of whom appear to be disgruntled Ubuntu users – odd, eh?). I’m downloading the ISO and after getting a suitable backup done (I need to buy a new external disk) I’ll do a full install to start with a clean slate.

I did try installing the Mate desktop into Ubuntu 11.10, but it failed

There is a problem with the configuration server
(/usr/lib/MateConf/mateconf-sanity-check-2 exited with status 256)

After backing up my existing installation I used the ISO to clear the partition that Ubuntu had been installed in and install Mint. The process was easy enough and worked as well as I expected it would. When it started things looked more familiar than I expected, but after some checking that was because the desktop was Gnome 3. Changing to Mate brought things back in line with my expectations and I could start configuring things to be the way I wanted them. As Mint is based on Ubuntu, using it with the Mate desktop results in a very familiar look/feel – a little like an older Ubuntu release.

However, it’s not perfect and has left me wondering if I’ll be a Linux user for long. For example,

  • After starting Eclipse I was a little alarmed that the panels I have at the top and bottom of my screen vanished! Further investigation shows they are still there, just invisible for some reason :-(
  • To edit the menu you need to install an additional app (alacarte) that isn’t included by default. Surely this something that should either just work or the app should be available from a clean install?

Such issues really shouldn’t be an issue in 2012. I realise that Mint 12 is a new version and still in development, but these problems on top of all the issues with Ubuntu have really led me to wonder about my computer usage.

Posted in General | Leave a comment

Timelapse Processing

I’ve always enjoyed creating timelapse movies and with newer digital cameras it’s easier than ever. I bought Rosie a GoPro Hero2 camera at christmas and this has a dedicated interval shooting mode that works very well. My D300 also has an interval mode, but is limited to 999 frames – a limitation that the GoPro doesn’t have. In fact the biggest limitation of the GoPro appears to be the battery! As an experiment this afternoon I stuck the camera to the outside of one of our windows (the suction attachment works as well as reports say) and set it off on 5 second intervals. A little over 3 hours later the battery finally gave up after 2,297 frames had been captured. At around 5.1M an image, that’s a whopping 11.44G of images to process!

First step is to reduce the image sizes. Maybe I should actually shoot at a reduced size in the first, but in this instance it was at full quality. Having copied them all to the hard drive, it was time for a bulk resize

for i in $(ls *.JPG); do convert -resize x1080 $i re_$i; done

After a suitable period of whirring I ended up with an additional 2,297 images sized at 1440×1080 (the originals were 3840×2880). It’s the first time I’ve done it with the GoPro so in future I may well adjust the sizes.

Next step is to actually try and create a movie form them. For this I’ve been using avidemux. It’s not 100% apparent when you first start using it how to do this, but a bit of digging and it turns out all you do is open the first file in the sequence and it imports the rest! Simple and straightforward. Again, more whirring and waiting and the preview appeared. The reduced image size meant the worked well and the movie was working well.

Avidemux is a great tool, but doesn’t allow for adding titles and an audio track (as far as I can tell) so the resulting movie needs to be edited in a different editor. I’ve yet to find an editor I really like for this, but have been using OpenShot and Pitivi.

This afternoon was just an experiment and much of the resulting footage isn’t worth uploading, but I have uploaded a small piece at the larger resolution and xvid video encoding, which is on flickr.

I’m still finding my way on the processing of timelapses, so comments, suggestions & help always appreciated :-)

Update
The output generated a file of 1.7G. Hmm, this seemed a bit large and after reviewing the video options I saw it was set to ‘Copy’. Changing this to MPEG-4 ASP (xvid) reduced the file size dramatically (to 35M!!).

Posted in Photography | Leave a comment

Building OpenWRT for Bifferboard

Since getting the bifferboard booting and discovering that the opkg python segfaults, I’ve been looking at getting a custom build of OpenWRT (that includes python) built. On the face of it this should be straightforward, but sadly it hasn’t quite turned out that way.

The bifferboard is supported by a small community and there is a lot of information available onine, but some of it is out of date and the board has seen enough development to make some of it irrelevant. Picking the right pieces isn’t as easy as it could be, but after some false starts I’m starting to get there. This is roughly what I’d suggest and is what I’ll do next time…

I started out looking at the code in https://github.com/bifferos/openwrt but this had issues even building whereas the repository listed below seemed to work better. YMMV

1. Checkout the code from github. https://github.com/bifferos/bb
2. Get the MAC address from the label on the bifferboard. This will be printed as 00b3f600xxxx.
3. Go to the ‘bb’ directory where you checked out the repository in step #1.
4. I’m not interested in QEMU, so won’t bother using the supplied Makefile. Hence cd openwrt
5. The kernel you build needs to have a kernel command line set or it’ll hang (this was something that took me a while to figure out), so

make kernel_menuconfig
Find the line, Processor type and features --->
Press Enter key to enter the menu
Fine the line [ ] Built-in kernel command line (at the bottom)
Press space so it is marked as [*] (if it’s already got [*] then just leave it)
Go to the line Built-in kernel command string (you may need to press down arrow to find it)
Press Enter key and enter ‘console=uart,io,0x3f8 rootfstype=squashfs,jffs2
Use the right arrow key to highlight Exit and press Enter key to return to main menu
Highlight Exit and press enter again, setting the changed settings as default.

6. At this point simply build the kernel to make sure all is well.
make
7. If it completes OK, you should find the images in the bin/rdc directory. The one I used was
named openwrt-rdc-jffs2-64k-bifferboard.img

With that done, it’s time to try and get the image installed onto the bifferboard. I’ve installed via the serial cable and network, but the network method seems easiest and is certainly the fastest, so that’s what I’m describing below.

1. Have the board connected to power and network, but switched off.
2. Assuming you haven’t changed directory from the above instructions, run this command
sudo ../tools/bb_eth_upload8.py < if> < MAC address> bin/rdc/openwrt-rdc-jffs2-64k-bifferboard.img

< if> is the network interface on your computer, so for me it was wlan0 but could well be eth0 or something totally different if you’re not on linux.
< MAC address> is the MAC address of the board that you recorded in #2 above. (I added the ‘:’ but looking at the code you should be OK just using the number.)
You’ll need to be sudo as the script opens a raw socket and most systems don’t allow regular users to do such things.

3. Switch on the bifferboard. This needs to be done within 10 seconds of starting the script or things won’t happen. This time limit seemed sensible and wasn’t too hard, but it makes sense to be aware of it before trying for the first time :-)
4. If all is well the number will count up and the image will be flashed to the bifferboard!
5. The board will automatically boot into your new image, so no need to power off/on. (Nice touch).
If you have a serial cable plugging it it and monitoring the boot is useful, but if you don’t wait around 5 minutes to give it time to complete.

telnet biffer

If all is well you’ll be in!

Some things I’ve found useful along the way,

  • to record a serial session via minicom, run minicom -C
  • from time to time I had problems with bb_eth_upload8.py seeming to work but not sending any data. Not sure what it was, but waiting a few minutes then trying again fixed it
  • after a few different configurations of OpenWRT a make clean && make was needed to get an image that would install

I’m still playing with configurations to get everything working as I want and will try and post more details when I have it working :-)

Posted in General | Leave a comment

Bifferboard

This post is another of those “this will help me more than you” ones, but you never know, it may help someone other than me!

Today marked the first time I had plugged the Bifferboard into the network and after finding the first wall socket wasn’t connected and moving to the one next to it, the network led showed life. All was good. Next step was to connect to it.

I knew it had DHCP but didn’t realise that they now set a hostname of ‘biffer’ so I went and looked at the DHCP table of our HomeHub to find the IP address. D’oh! All that was needed was

telnet biffer

Et voila, the response came back

=== IMPORTANT ============================
Use ‘passwd’ to set your login password
this will disable telnet and enable SSH
——————————————

BusyBox v1.17.2 (2011-02-06 12:53:15 GMT) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

_______ ________ __
| |.—–.—–.—–.| | | |.—-.| |_
| – || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
Bifferboard port (forked from r23226) ————-
—————————————————

Things were looking up!
Hmm, so how much space do I have?

root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 6.9M 2.8M 4.2M 40% /

Things were looking up!

I’d like to run a small data collection on the box which is in python, so python is a requirement not presently available. Time to figure out opkg.

opkg update
opkg install python-mini

The install went OK and completed after installing zlib (a dependancy). Next, check if all is well

root@OpenWrt:/# python
Segmentation fault

D’oh! That wasn’t really what I wanted to see :-(

Looking at dmesg didn’t show much of help. I’d already looked at Graham Jones blog posts about the bifferboard, so decided to follow his lead and build a new OpenWRT image. Of course as it’s a custom image I can specify what should be built and so hopefully avoid having to install additional packages. Thankfully the good people in the Bifferboard community have made it easy to do this.

https://sites.google.com/site/bifferboard/Home/openwrt-git

As you can imagine, my laptop has a full set of build tools already installed, so after following the instructions, selecting a few additional packages the build is wandering along. Having done this sort of build before the pace isn’t a surprise, but if you’ve not done one before it can seem glacial. Hopefully it’ll be done later tonight and I can try flashing it onto the box.

Posted in General | Leave a comment

Virtual Mail Aliases

When setting up my current servers email system, I managed to get almost everything working via SQL tables that allowed me to use a web interface for the day to day administration. It also allowed users to control most aspects of their accounts, resulting in very low administrative load. The one thing that I never quite managed to get working was setting up more complex aliases – until today.

My configuration provides redirections and aliases as seperate concepts and entities. A redirection is simply redirecting mail from one email address to another with anything more complex being an alias. Users of the system can easily create redirections for addresses they control, but aliases are only created by administrators or those given permission. The distinction has worked well.

Getting the redirections working proved as simple as adding a mysql query to the virtual_alias_maps setting in the main.cf file for postfix. The mysql file looks like

user = ???
password = ???
dbname = ???
query = SELECT destination FROM mbox_redirection WHERE address='%s'
hosts = unix:/var/run/mysqld/mysqld.sock

However, getting the full aliases to work took a bit more effort. In essence I want to replicate the functionality of the /etc/aliases file using mysql. The initial problem is that with a pure virtual setup, as we have, the contents of /etc/aliases are meant to be used by the postfix local daemon, not the virtual daemon that we rely on for the majority of our requirements.

Adding entries to just the local maps will result in an unknown recipient error as they won’t appear in the virtual maps. This means we need to have 2 entries for each alias – one for the virtual map and one for the local map. Adding every entry twice seems like a lot of work, but there are ways round it when we think about how the maps get their data.

The next poblem is that we need to bridge the divide between virtual and local map. This means we need some way of configuring a virtual address to point at a local address. The solution I settled upon was to use localhost for local addresses, so that blah@localhost would point to a ‘blah’ in the local map and would be accepted as a valid redirect internally. To accomplish this I needed to add localhost to the mydestination setting in main.cf,

mydestination = $myhostname, mail.$mydomain, localhost

Creating a table for the aliases in mysql resulted in something that looked like this

CREATE TABLE `mbox_alias` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(50) NOT NULL,
    `address` varchar(75) NOT NULL,
    `alias` varchar(1024) NOT NULL,
);

In the vitual_alias_maps I now need to map from an incoming address (address in the above table) to a local address that will then be mapped to the alias (called alias in the above table) I have provided. This I do by using the name field, using the mysql map file shown

user = ???
password = ???
dbname = ???
query = SELECT concat(name, '@localhost') as destination FROM
                             mbox_alias WHERE address='%s'
hosts = unix:/var/run/mysqld/mysqld.sock

This will map address to name@localhost, which will cause postfix to look for name@localhost in it’s local maps. To provide a valid mapping I added the following map file to alias_maps in main.cf

user = ???
password = ???
dbname = ???
query = SELECT alias as destination FROM mbox_alias WHERE name='%s'
hosts = unix:/var/run/mysqld/mysqld.sock
alias_maps = hash:/etc/aliases proxy:mysql:/etc/postfix/mysql/aliases.cf

As sometimes an example makes things simpler (my simple mind often needs one),

  1. Create an entry for an address of myscript@example.com, with a name of myscript and an alias of |/home/me/scripts/hello
  2. Email for myscript@example.com arrives
  3. Virtual lookup resolves myscript@example.com into myscript@localhost
  4. Local lookup for myscript find the alias |/home/me/scripts/hello
  5. Local daemon pipes message to /home/me/scripts/hello

With this in place, I’m able to add aliases via the web interface and have them available immediately. If I need more complex redirections, then I can add a regex file with patterns and redirect those to @localhost addresses in the same way.

There are likely better ways of doing this, but this took me a while to figure out and so maybe this will help someone else.

Posted in General | Leave a comment

NoSQL

NoSQL databases have been around for a while and they offer a lot of attractive features. I’ve been meaning to have a look at CouchDB for a while and having some time I’ve spent some time over the last few days trying to get a basic webapp running using CouchDb and CouchApp. I’d like to say that I’ve been impressed by how easy it is as that would fit with the hype, but sadly I’ve found it annoyingly difficult to get a handle on.

The issue isn’t with CouchDb which really has been as simple to install and setup as I thought it would be. It took me a very short time to install, configure and then write a small script to import the dataset I wanted to use for my test webapp. The Futon interface works as well as others say it does and overall I was very impressed. The CouchDb guys deserve a large amount of praise for their efforts.

The next step is to figure out some way of using the data for a small webapp. CouchApp is the one that gets the most attention and praise, so this was where I went next. Installing it was no problem. Starting a new app was easy and after a simple push I had the sample webapp on my screen. Of course the next step is to start modifying it to do what i wanted and this was where it all went wrong. CouchApp seems to have undergone radical development in the last year and so much of what you find on the web is out of date and no longer works. The sample apps that you get pointed to have little documentation and aren’t clear.

It’s been annoying as CouchDb looks really useful, but CouchApp just doesn’t seem to tick any of the boxes I need and none of the alternatives look as though they do either. If anyone has suggestions, drop me a line :-)

Posted in ASF, development | Leave a comment

This is not the Android you want…

Compared to Apples “one size fits all” iOS, Googles Android comes in a myriad of different guises. By choosing to partner with different firms they have ceded absolute control over how their operating system will look to those how manufacture phones. I’ll leave it to others to debate the relative advantages and disadvantages of this approach, but the result is that my current phone ships with a customised version of Android. If the customisations were only skin deep then they would be easily removable, but the effort put into the Sense interface by HTC means it has its fingers in all of the pies. If this meant my phone worked better I wouldn’t mind, but I find the changes to be obstructive and unwelcome.

One of the features that makes Android stand out from iOS is that new releases and updates can be delivered Over The Air (OTA) thus allowing the mobile devices to remain mobile and untethered from computers – freedom their iOS cousins can only dream of. The theory is great and when a new update is available the process works exactly as advertised, but the updates need to be created by the phone manufacturer to ensure that all their proprietary drivers and software is compatible. Linux kernel modules need to be rebuilt when the kernel changes and changes in Android itself must be incorporated. This all takes time and effort which means that older or less popular phones tend not to receive updates while current models wait months after the official release.

Android has an open source relative, the Android Open Source Project (AOSP) which appears to be a slightly backdated copy of code used for actual releases. The project pages give instructions to download the source and even build your own version, but after waiting for the large download (2.6 Gb) to complete and following the instructions you’ll likely feel a little let down for unless you have the most recent Google phone you won’t really be able to do much with the results of your endeavours. (With a slightly older Google phone you can extract the binary files you need, but only for the release you have installed on your phone.)

I find it hard to fathom the purpose behind the existence of the AOSP, as it currently exists, is. Releasing the amount of source they have is amazing. The efforts of
Jean-Baptiste Queru in updating the source and making available the source of each version within days of the official release are incredible and he deserves a lot of praise. One of the main beneficiaries of his travails has been the community that has grown up to supply custom versions of Android for virtually every device released. Using a mixture of cunning and determination people have found ways of extracting the proprietary files and merging them with custom built kernels and builds of AOSP to deliver new versions of Android to old and new devices. Given that these projects are based on AOSP, employ the same methodology as AOSP and do their development in an open source style (usually using forked versions of the AOSP source form github), why are their efforts not being incorporated into AOSP? The source trees of these projects contain various fixes and improvements that have been contributed by a large number of people keen to improve their phones. Surely such contributions would be better directed to the AOSP?

I started looking at AOSP as it appeared to offer a way of installing a version of Android on my phone that wasn’t infected by the Sense UI. After spending much of the last decade involved in sections of the open source world, I have a lot of respect the effort it takes to keep projects going and look for opportunities to contribute to those projects I use – an approach that isn’t dissimilar to many people I know. AOSP doesn’t encourage such activity because of the way it’s setup, which probably explains why there the community that exists providing custom versions is so large and seemingly uninvolved in the AOSP itself.

While I might keep an eye on AOSP, I think that directing my effort towards a custom project will be far more rewarding. Maybe they will create the Android I want?

Posted in mobile, Phone | Leave a comment

Kernel Building

First attempt at getting a new kernel for my phone, an HTC Desire HD.

  1. Download the source from http://developer.htc.com/
  2. Expand it into a directory
  3. As we’ll be building for ARM, we need the cross compilation toolchain, so install relevant packages.
  4. Get the config from the phone.
    $ adb pull /proc/config.gz .
    $ gunzip config.gz && mv config .config
  5. Now try and build the kernel.
    $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
  6. Answer questions for the config we’re using
  7. Wait…

This all looks good with the usual progression of messages indicating all is well, until

make[3]: *** No rule to make target `drivers/input/touchscreen/ntrig.o',
    needed by `drivers/input/touchscreen/built-in.o'. Stop.
make[4]: *** No rule to make target `drivers/media/video/msm/s5k6aafx.o',
    needed by `drivers/media/video/msm/built-in.o'. Stop.

The appropriate lines from the Makefile are

drivers/input/touchscreen/Makefile
obj-$(CONFIG_TOUCHSCREEN_NTRIG) += ntrig.o
drivers/media/video/msm/Makefile
obj-$(CONFIG_S5K6AAFX) += s5k6aafx.o s5k6aafx_reg.o

Looks like HTC missed some files from their kernel source archive :-( I’m going to send them an email asking for the files, but suspect there will be no reply as HTC have a long history of obstruction around their source releases.
e.g. http://users.livejournal.com/joshua_/41833.html

Update

HTC have replied to my email. Their initial response was

Thank you for contacting HTC.

In regards to your ROM query, I can help you with that.

We cannot support you on unofficial development of the ROM in any
case. 

I trust that this resolves your query. Please do not hesitate to
contact us again if required.

I replied explaining that all I wanted was 3 additional files that they had omitted from their source release, the following response was received,

My apologies, I misread you original email.

I will forward the details for the missing files to our developers.
Once they release the required files they will be found at 

http://developer.htc.com

Hopefully this means they will release the files, but we’ll wait and see.

Posted in mobile, Phone | 1 Comment

Android

I’ve been using an Android phone since late 2009 and am now on my second phone. I’ve found Android to be easy to use and the over the air updates I’ve experienced from 1.5 to 1.6 and 1.6 to 2.2 have been smooth and effortless. In fact the only times my phone gets connected to a computer is for a charge when I’m travelling :-) Yes, my phone really is a phone.

Of course that’s not to say that all is prefect. My second phone is an HTC Desire HD, which works well but arrived with HTC Sense installed. Having been using “stock android” for a long time I find HTC Sense to be intrusive and would rather revert back to the “stock android”. Sadly, HTC have seemingly made every effort to make this harder than it should be. All of the advertising for current HTC phones features “HTC Sense” and they promote it as an “experience” (as opposed to merely a different interface) so I’m guessing that HTC aren’t about to easily relinquish it from their devices. Samsung have their own interface for their phones, but don’t spend quite as much time focussing on it during their adverts. A simple web search shows just how many people want to know how to remove HTC Sense, so I suspect I’m not the only one who feels this way.

I feel that all of these proprietary interfaces detract from Android as a whole.

There has been much written about the “fragmentation of android” – a problem that is likely to get worse as time goes on with the expansion in app stores for the platform – but the hardware vendors seem to be oblivious to the concerns as their policy of layering their own software on top of Android shows. It’s common sense that every custom layer requires time, and therefore money, to convert and update for a new version of Android – slowing the update cycle or even stopping it if the conversion is too hard (as was witnessed by some of the earlier phones being stuck on 1.5 or 1.6).

Google are justifiably proud of each release of Android. The collection of statues in Mountain View keeps growing and every release brings more functionality, speed and better integration. Sadly though, the gap between announcing a new release and updates being rolled out to phones has remained stubbornly long for most users – primarily due to the vendors custom interfaces. In an ideal world the vendors would have unlimited resources and enormous teams of engineers who could spend their time updating all their phones, but we live in the real world where money doesn’t grow on trees :-)

Hardware vendors want to sell phones and so having as many “differentiators” as possible is a good thing for them. Most phones in a given price bracket have virtually identical specification which means that these “differentiators” are becoming crucial as the market becomes more and more crowded. Choice is a good thing for the users and keeps prices down – the ability to make your product stand out is essential for sales and keeping the prices up. The two desires are opposite and at present the balance is a little too far towards the vendors.

I’ve taken the time and have rooted my phone and thus have the ability to flash new ROM’s, but given the complexities of merging the various pieces of software to create a ROM this also takes time and falls to groups of volunteers. The fact these groups can create a ROM quicker than the vendors speaks volumes for me about the complexity they have added.

Please HTC, allow me the option of having a “stock android” instead of your “HTC Sense android”.

Posted in Phone | Tagged , , | Leave a comment

OAuth on the Command Line

Every month I have a different schedule. Not just a few days here or there, but a radically different work pattern. It’s something I’ve grown used to and something that’s second nature to me. It does, however, have it’s problems when it comes to arranging things with anyone who has more normal time constraints (i.e. the majority of the human race). The advent of online shared calendars has helped, but as work don’t provide my schedule as anything other than a text file I’ve had to be creative about getting things integrating :-)

I moved away from running my own CalDev server a while ago and for the last year or so have been more than happy with Google Calendar. The ability to sync across all the devices that we need makes it a good choice and a few homegrown scripts allow me to parse the text file and generate entries. The Python GData library is good and makes it easy. Of course, not every service makes it that easy, as today has proven.

OAuth makes using websites easier and more secure, but it’s very much based around webpages and browsers. This is fine when it’s a webapp I’m working on, but when it’s a simple command line script it poses a few issues. After a period of trial and error – coupled with a liberal amount of abusing the search engine that’s a verb – I eventually solved my problem for TripIt. I’m not convinced it’s the right way to do it, but in case it helps anyone else in a similar situation I’ll outline it below.

Step 1
As usual, step 1 is to get an unauthorised token. This is done as usual with a call to the TripIt API. I used the OAuth Python library rather than the Python tripit.py.

Step 2
Use the TripIt APi to get the authorisation URL.

Step 3
We need the user to use a browser and visit the authorisation page, but as the script runs on Linux and people have choice, I use gnome-open to open the URL in the browser the user is using. The URL is composed of the token and a callback URL – in this case set to localhost and a specified port.

Step 4
Start a simple web server on the specified port on localhost to receive the response from TripIt when the user decides whether to grant access or not. The server is started to accept only a single request and blocks the progress until it has been received.

Step 5
Exchange the token received so far for an authorised token.

I’ve got a simple test class written and working using the BaseHTTPServer and the handle_request() function. As I only need to handle a single GET response I’ve added a simple class that overrides BaseHTTPServer.BaseHTTPRequestHandler to return a simple page that tells the user to close the page. The oauth_token returned is returned and can be checked in this function. Rather than paste all of my code, I’ve pasted the relevant bits below.

import BaseHTTPServer
...

class myTripitClass():
  ...
  class oauthHandler(BaseHTTPServer.BaseHTTPRequestHandler):
    def do_GET(s):
      """Respond to a GET request."""
      ...
      s.send_response(200)
      s.end_headers()
      ...
      [ send a response telling the user to close the page... ]

  def startHttpServer(self):
    server_address = ('', 8123)
    httpd = BaseHTTPServer.HTTPServer(server_address, self.oauthHandler)
    httpd.handle_request()

I’ve omitted the code that’s not relevant. Filling in the blanks is left as an exercise for the reader :-)

Presently I’m still developing so this is being run via a test script which looks as follows

from  subprocess import Popen

t = myTripitClass()
if t.oauthGetUnauthorisedRequestToken():
  url = t.oauthGetAuthorisationUrl()
  Popen(["/usr/bin/gnome-open", url])
  t.startHttpServer()
  if t.oauthExchangeRequestTokenForAccessToken():
    ...
    [ add code to do work here ]

Eventually this will be incorporated into the class (as you’d expect).

It works, but there may be better ways of doing it :-)

Posted in General | 1 Comment

Complacency

Isn’t it amazing how short our collective memories are?

The weather problems that have hit the UK for the last 6 weeks are being talked about in terms of the “worst in living memory” by many media outlets, but the truth is far removed from this. Within the last 30 years there have been winters with more snow and lower temperatures which must surely count as living memory unless you live in the world of Logans Run. Houses built in the last 10 years seem to be suffering worse than those built 50 years ago, which goes against the convention that as technology improves problems diminish. Why?

I think the answer is that we, as a society, have forgotten what winter can be like. A succession of mild winters have led us to believe that houses don’t need as much protection, that snow won’t be an issue and the modern, cheaper alternatives will work better than their old counterparts. The collective memory loss is even ingrained in the industry standards, as evidenced by the NHBC specifications for gutter location.

Living in Scotland it really didn’t come as a surprise that we had snow, but the realisation that our house was built to the same standards as a house from the south coast and that we weren’t considered to be in “an area where snow is likely to accumulate on the roof” was a surprise. The ISO standards require different construction and gutter location for such areas, but those standards are contrary to NHBC. Confused? So were we.

The result was all too evident last year when around 50% of our guttering was damaged or simply ripped off by the snow from our roof. Once again we were told by the builder that our house was not in an area where snow was a consideration and Morley (the designers of the guttering) were adamant that they had not made any mistakes. The changes that were made have allowed us to weather the snow this year with far less damage, but guttering was the least of our problems when we had a pipe burst.

We’re not the only people to have suffered, but both the houses with bursts we’ve been involved in have shared a common issue – poor design. Designing a property to cope with extremes of temperature isn’t rocket science, but it’s an art that has faded away as the winters have been milder. 20 years ago public building in the area were designed with snow guards on their roofs and pipework that was carefully insulated and artificially warmed if there was any concern. Today no such protections are designed in as they increased the complexity and so the cost. The results are self evident with schools and hospitals suffering burst pipes and large snow piles blocking doors.

This winter isn’t over yet and so we don’t know if we’ll have more snow (likely) or more cold snaps, but with each year we are relearning lessons that 30 years ago were well understood. We are planning changes to overcome the design fault that caused our burst pipe and the guttering damage. We’re lucky to be in a position to make the changes.

Posted in General | Leave a comment

dovecot on Ubuntu 10.04

Having just updated one of my servers to Ubuntu 10.04, I’ve had a couple of issues with the dovecot package.

The antispam plugin is for a previous version – though it’s happy enough to install which seems as though it’s a violation of the package dependancy protection. Converting from a previous installation meant I expected to be able to use the same settings – and largely I was able to – with one exception that took me a while to track down.

Basically the dovecot installation has moved to having a conf.d directory for user configuration. It’s a great idea and one that more and more apps are adopting, but sadly the deliver app doesn’t yet support using the seperate directory. This means that if you have used a file in the conf.d directory for your local configuration you need to specify it when calling deliver from the MTA (postfix in my case) using the -c option. Of course, the file needs to have enough information in to enable deliver to work – something that mine initially didn’t.

Posted in General | Leave a comment

New Laptop

I finally took the plunge and ordered a new Lenovo X201 laptop a couple of weeks ago. It arrived yesterday after some fun and games with DHL around the delivery and HBOS around the payment.

I ordered the machine with 6Gb of RAM and a 500Gb HDD as I’m planning on dual booting the pre-installed Windows 7 with Ubuntu. As I travel a lot the large 9-cell battery was a must and doesn’t add too much to the weight. After doing some research I chose the wifi card that appeared to have the best Ubuntu compatibility and the built in webcam as carrying an external camera is something I’d rather not do.

After installing the battery and switching on for the first time I went through the usual Windows 7 install q&a. After starting a few updates were installed (as usual with new software) but far fewer than I had expected (and far, far less than our new iMac required).

Using the current laptop I downloaded the 64-bit Ubuntu 10.10 iso and then used the Ubuntu Startup Disk Creator to create a bootable USB drive. This was the first time I’d used this app and it worked exactly as advertised. (Given some of problems I’ve run into before I was anticipating some trouble creating the USB drive, so the ease with which it was done was very pleasant.)

I rebooted the laptop after inserting the USB drive and used the F12 button to choose the USB drive to boot from. To make sure that I wasn’t going to have any problems with Ubuntu I chose to run the Live version. After a few seconds of disk activity Ubuntu started without any problems. Supplying the wifi network got me online straight away validating my choice of wifi card.

Next step was to resize the Windows 7 partition making room for a new Ubuntu install. The drive arrived with the expected recovery and boot partitions meaning the Windows 7 NTFS partition was around 450Gb so I resized it to 235Gb giving me room for an 8Gb swap partition and the rest for my root ext4 partition to be created. After resizing the partition I rebooted into Windows 7 to check that Windows was happy following the change. chkdsk ran and the boot was normal.

Restarting again I used F12 to choose the USB drive and this time the Install option. I manually set the partitions and then started the installation – crossing my fingers as it started!

Things progressed at a good rate and then it was time to restart.

A couple of warning appeared but the boot continued and then the login screen appeared. :-) I logged in and installed a few packages that I wanted before rebooting to see whether Grub 2 would work as advertised. The Grub menu brought up 2 options for Windows 7 so I chose the first and waited to see the outcome. When the login screen for windows appeared I relaxed. My work was done.

Posted in General | Leave a comment

Tickets Please!

Last weekend we went to the RAF Leuchars airshow. As with many RAF bases, Leuchars isn’t located in an ideal location for getting 45,000 people to and from, resulting in traffic chaos (which was made worse this year by one of their “congestion busting” park and ride facilities being unavailable due to the heavy overnight rain). Not wanting our day to be spoiled by the inevitable hours of sitting in the car, we parked in Dundee and got the train. Buying our tickets was easy and a last minute change of platform meant we caught the train we had hoped to. To get to the train we had to pass our tickets through the electronic barriers. During the short journey to Leuchars (less than 15 minutes) we had our tickets checked by the conductor. On arrival at Leuchars we were slightly surprised to have our tickets checked again! When asked why the extra check, the response was “to make sure everyone has a ticket”.

On our return to the station at the end of the day, we joined a queue and after a few minutes boarded a train. A short journey to Dundee was followed by an easy departure from the platform with open barriers – apparently due to the number of people and the potential for crushing.

This week we were in London and used the Heathrow Express to get from Heathrow to Paddington. It’s a great service, but does seem to be very expensive. After buying our tickets we descended to the platform, boarded a train and were on our way – all without ever needing to show our tickets (this seems to be part of their business model as they advertise the ability to buy tickets on board). Our tickets were checked during the short journey but on arrival at Paddington we just walked straight off the platform without hindrance from the usual electronic barriers. Our return featured no ticket check, but then the train was virtually full and the conductor may simply have run our of time to get to our carriage.

So, basically, during our 4 journeys we only needed tickets on 2 of them!

The UK railway system is a real mess, with differing standards and policies applying across the country. It’s expensive and at peak times overcrowded. Often the carriages are untidy and rubbish facilities are too small and poorly signed resulting in an accumulation of debris. It’s hard not to feel that the great legacy of UK railway development and engineering is being let down by the current state of affairs.

After being named as the most expensive in europe several companies reaffirmed their commitment to “crack down on those travelling without tickets”. Given our recent experiences they seem to have a long way to go and the lack of consistency will probably mean that progress is slow and uneven. Maybe when more people have tickets they will be able to reduce prices – though I suspect this won’t be the case :-(

Posted in General | Leave a comment

Replacement Laptop

It’s getting close to the time that my poor old IBM X40 will need replaced. It’s been a great machine and has served me well for all these years, but its age is starting to show. Like me, it’s starting to go grey around the edges :-)

It arrived with a 40Gb hard drive and some version of Windows (XP if memory serves). During the intervening years it’s had 2 replacement batteries, a new 60Gb HDD installed and all evidence of Windows removed (apart from the “Designed for Windows XP” badge below it’s keyboard). Given the number of miles I travel every year, the laptop has stood the test of time remarkably well, shrugging off the occasional fall or knock with ease. Finding a replacement won’t be easy.

I’ve been thinking that it might be time for a new laptop for a while now – thinking given more haste by the nonsense that Ubuntu has made of the Intel video driver in it’s latest incarnation. Apart form that small annoyance, everything else works fine though the slow disk and processor do sometimes annoy when processing pictures or doing anything that is I/O intensive.

I’m not sure when I’ll be in a position to buy a replacement, but it’s maybe a good time to start looking around at what I’ll be purchasing. It will serve as my main machine but will also be travelling with me for upwards of 200 days a year, so size and weight are important considerations. A good battery life is also useful as I’m often in places without easy access to power outlets. The Lenovo X201 is an obvious candidate, but is there anything else I should be thinking about?

Posted in laptop | 2 Comments

That sinking feeling

At this moment in time we were supposed to be nearing Gatwick en route a few days in Barbados. I’d arranged the trip to coincide with Rosies birthday and we’d both been really looking forward to a few days in the sun.

We were woken by the alarm at 4:20am and quickly got ready to head for the first flight of the day, the 06:25 Edinburgh to Gatwick that was the start of our journey. I was just getting ready to put the bags in the car when I had a final check of my passport – but where was it? The bottom of my stomach fell…

Given how much I travel for work the passport is something I take great care over. It has “its place” in my bag and never leaves except to be given to immigration officials. When I travel without my usual bag the passport is replaced in “its place” as soon as I return home. It’s never out of my possession – so where was it? Even odder, where was the old, defunct passport (with the still valid visas) that wasn’t even removed on our last trip?

After ransacking every concievable place it could be, in the house, the car and all the bags from our last trip, it was nowhere to be found. Phone calls to every airport we last visited and the companies that flew us have turned up no sightings.

As a result of my carelessness we’ve missed the holiday. There is a dark mood of depression filling the house and Rosies eyes that will take a long time to clear. Even worse, I know I’m to blame :-(

I’ve tried everything, phoned everyone I can think of and am sitting desperately hoping for a solution that deep down I know will not come. Knowing what happened to my passports would help in some small way, but I know nothing can make this right.

Posted in General | 1 Comment

38 Degrees

I think you’d be hard pressed to find voters in the UK who disagree that political reform is needed. Finding voters who had clear ideas and workable suggestions on how to do it would be harder, but that’s where sites such as 38 Degrees come in – or at least it used to.
Campaigning for political change is a delicate tightrope as a very high degree of impartiality is needed for it to be effective. I was initially impressed by the way that the 38 Degrees team had handled it, but their recent posts and offerings have led me to have doubts.
We all know the media reporting is biased, but launching a campaign targetting only one political leaning isn’t impartial, especially given the stated reason is that “over 90% of us want to stop the scaremongering about a hung parliament“. All the papers I’ve seen have carried such stories, so singling out one subset fails the impartiality test at the first hurdle.
It may have been a “knee jerk reaction” to events, but it’s one that should have been stopped by those running the site.

Posted in General | Leave a comment

Bikes

A pleasant day in March saw 3 of us heading to the Alpine Bikes Winter DH Series round 3 at Innerleithen (a downhill bike race) for an afternoons photography. Neil is a mountain biker and has covered such events before, but for Dave & I it was a first. The weather was good and it even stayed dry!

The event took place on a track that snaked between trees, down drops, over jumps and generally challenged the riders – though given the speed they travelled at I’m not sure they really noticed the trees!

We arrived in time to walk up a fair bit of the course and were just about in position as the first riders appeared. The only real indication of their arrival was the stewards whistles and given their speed vigilence was the order of the day.

Their speed also meant that the autofocus systems couldn’t keep up – even the 3D matrix focussing – so it was back to the old school manual prefocus and press the button at the right time. Having done this before it only took me a few attempts to get close. I tried to keep the aperture around f8 or higher to give myself a more tolerant depth of field, but given that I also needed a fast shutter speed of 1/250th this wasn’t always possible.

It didn’t take long for me to realise that the conditions would need a higher ISO than the D300 can really use without noise/grain becoming an issue, so I started using one of the SB800′s I’d brought to provide some extra light. This limited me to a shutter speed of 1/250th but the pocket wizards provided me with the range and meant I could forget about line of sight.

The initial results were OK, but I felt that I could improve by moving out from under the trees, so I started down the hill.

bike1

The problem when using flashes is that they need to be setup. Spending a little time and thought on the setup is generally a good idea, so while trying to find I carried on taking pictures without the flash.

bike2

As I moved further down the course I found a sharp corner where I could get close to the riders without distracting them. The sun was high and to my right so I set the flash to my left for a little fill light. Sadly I had no lighting stands and this was a rocky bend without anything to rest the flash on, so the flash was just on the ground.

bike3

While the pictures were OK, they lacked drama and didn’t really convey the speed and daring of the riders, so I moved on looking for a jump. This time I had my back to the sun and the flash was attached to a tree to provide the fill as the riders went airborne over the jump.

bike4
bike5
bike6

After shooting there for a while, I decided to move along to a point where I could see the riders head on. This meant moving the flash, which almost cost me an SB800 when it fell onto the track as a rider approached. His landing missed it by less than 2″, so I’ll count myself lucky :-)

bike8
bike9

The setup I was using for my final location allowed me some flexibility to move around, which I used once the gaps between riders grew and it was safer to move along the course.

bike10

Overall I had a good day. It felt good to be out and about with the camera and tackling a subject that isn’t really my usual added a nice extra twist.

Thanks to the marshalls for being so patient and understanding with my moving around so much.

Posted in Photography | 2 Comments

I name thee…

By default fuppes advertises it as ‘FUPPES xxx’ which isn’t especially friendly. Adding this to the config for the default device will allow you to give a more meaningful and friendly name.

      <description_values>
        <friendly_name>Friendly Server Name Here</friendly_name>
      </description_values>
Posted in General | Leave a comment

uPnP?

The BBS2 has a large store of music, pictures and will eventually also have some video on it. There are plenty of ways of accessing it via a computer, but I wanted a solution that would allow other devices to also access it. Given the huge amount of media coverage and use in advertising I figured that using a uPnP server would be the easiest way.

Finding a uPnP server to install wasn’t hard, but finding one that worked with the various clients and devices proved harder.

uShare
This installed easily and was very lightweight. It provided easy access, but quite a few clients didn’t work with it. Coupled with the fact that the project seems dead I decided it wasn’t worth too much effort.

MediaTomb
This seemed more promising and seemed to work better at first, but once again several clients had issues with it. After using it for a while I decided that it wasn’t for me.

fuppes
I looked at fuppes quite early on in my serach, but it appeared to be a dead project. Then I stumbled across this thread which gave me pause and encouraged me to try it. Following the instructions and some extra details on the original wiki it didn’t take long to build and install and once configured worked straight away.

The project is similar to a lot of open source projects, but the directions that the current active developers intend to take it seem like good ones and as it already works I’m using it for serving the media at home.

For more on the new development there’s a blog :-)

Posted in General | 3 Comments