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

Parting company with a whimper, not a bark…

It seems like a very long time ago now that Tess joined our family. The small bundle of fur has grown up into a great young lady and while we’d like to take all the credit, we’ve had help.
Peace

Like every puppy owner we wanted to make sure we got started on the correct route with her, so we found a local dog training club that had a puppy class and also promoted dog agility (which we hoped to do with her as she got older). Our initial contacts with them were positive and we learned a lot. After 8 weeks she was deemed to have graduated and we moved “up” to a different class in late January.
Given her age (6 months) and her breed (Border Collie) she soaked up the lessons like a sponge and progressed well in the various tasks set by the classes. We were told we were working towards the “Bronze Good Citizen” as managed by the Kennel Club. Tess continued to improve but all was no longer as positive as it had been.
Our initial positive experiences were replaced by a growing sense of unease at the lack of progress. If we were indeed working toward a test, then surely there should have been a date for it? The class kept changing members and would “reset” back to the start at regular intervals – hardly ideal. The instructors would sometimes change from week to week, with the quality varying from excellent to poor. Months passed and the class was still practising exactly the same things.
As anyone who has done any instruction or teaching will tell you, constant repetition of the same thing has it’s uses and place, but eventually leads to boredom and inattention. So it was for Tess. The class held less and less interest for her and she got bored.
At the start of July we were told the date for the test was to be yesterday, the 31st July. By this point we had decided that the club offered us nothing more, so we wrestled with whether to add Tess to the list. I argued that we may as well given all the effort we had expended to get to the test, and so we added her to the list.
The evening of the test saw 12 dogs appear and it soon became apparent that the club’s usual lack of organisation and incompetence were going to prevail. What should have been a relatively simple series of exercises turned into a long drawn out evening. Tess performed well enough up until the penultimate exercise, but the combination of boredom (we had been there for over 90 minutes by this point) and lack of interest showed through and she couldn’t stay for the required 60 seconds – something 3 months ago she had no problem with!
We’re never going back to the club, and wouldn’t recommend it to anyone :-( As our discomfort with the club grew we started looking around and have found another group that offers us a far better experience – friendlier, less condescending and with an excellent instructor!

Tess - Over!

So, if you’re in Perth, Scotland and are looking for somewhere to train your dog, I’d recommend that you don’t go to the Fair City Dog Training Club.

  • The clubs facilities are in need of a deep clean (all those dogs passing through every week mean accidents do happen!), are noisy all year round and very cold in winter.
  • The instructors are volunteers and while we’re obviously grateful for them giving up their time the club really should ensure that they are of a suitable standard and temperament before allowing them to take a class.
  • Organisation isn’t their strong point and the lack of a structure to the classes means that things were seemingly arranged “on the fly” each Wednesday evening.
  • As with many small clubs, personalities often play a larger role than would be ideal and there is always a split between the “in” people and everyone else.
Posted in General | 2 Comments

Tranquil PC BareBones Server (BBS2)

After a lot of discussion, looking around and general wondering what to do, about 10 days ago I ordered a BBS2 from Tranquil PC. I chose to upgrade the memory to 2G and went for the 3+1 RAID option as it gave me the eSATA port on the rear.

The BBS2 arrived in around 7 days (I was actually away when it was delivered) and was exactly as expected. The drive slots work well and it was very easy to install the initial drive. Being a simple person I decided to use the 2 drive bays with the same colours as a raid pair, which left me with the extra bay for the operating system disk. I installed the OS with just the first disk and then added the first 2 disks as a RAID array purely for storage. After installing the 2nd and 3rd disks I did need to change the boot order in the BIOS due to the numbering, but that wasn’t a huge problem.

I installed Ubuntu Server 9.04 as the OS as it’s what I have Ubuntu of some flavour on the majority of my other servers and the desktop 9.04 on my laptop. This policy has already paid off and has allowed things to progress smoothly. The install was done via a USB memory stick and went without any problems.

The fan on the server is constant speed and takes it’s power directly from the HDD backplate. Given this limit on the amount of cooling I’m keen to get the CPU (an Atom 330) running with CPU scaling so it generates as little heat as possible. The server shouldn’t ever see a huge load (it’s mainly being used as a NAS and media server) so I’m hopeful that once the CPU scaling is working it should spend much of it’s life at less than 100% performance.

One slight annoyance was that the BIOS version was 103 when delivered, even though there have been several updates and the latest version was released earlier this month (rev 171). Installing the update took a little while as I needed to create a bootable USB DOS stick and copy on the correct files. It took 3 attempts to get the update completed, but once done it fixed an issue with the server sitting at 100% CPU.

mt-daapd doesn’t run on Ubuntu 9.04 due to an issue with how it uses avahi, so I built a custom package using the instructions from the patch author (here). Once installed Rosies iTunes was able to see the library and play from it with no problems.

Presently the storage RAID is using 2 old 200Gb hard drives, but they’re not especially cool or quiet, so I’m going to upgrade to using newer and larger drives at some point soon. I’m not yet sure which drives I’ll buy, so if anyone has any suggestions for 1Tb+ drives, let me know! The cooler and quieter the better.

UPDATE: I’ve had some network issues when using Windows for large file transfers, so have swapped to using the realtek 8168 driver. Instructions are here.

Posted in General | 2 Comments

Castle of Park

Another long weekend away, this time with some of Rosies family. We drove 3 hours south and west, arriving just outside Stanraer in a small village called Glenluce. The castle is around 2 minutes drive from the village and sits in a field with a couple of other houses. It’s an impressive sight as you approach – a feeling reinforced by the size and weight of the front door! As it’s a castle, every stairwell is a spiral – though the main stairwell was wider than I thought it would be. The “great hall” has a high ceiling and is a great room for entertaining, despite the rather small kitchen (Rosie deserves a medal for cooking for 6 people in it).

As usual with the Landmark Trust the accommodation was excellent. The crockery and cutlery was showing it’s age a little, but was still more than functional. At night it was incredibly quiet, though we didn’t see any of the ghosts talked about in the log book!

The weather really helped the weekend as there was barely a cloud in the sky for our 4 days. The sun really had some strength in it (as my head attested to) and t-shirts were the order of the day for the first time this year.

Evening meal

Continuing in the tradition of “deckchair pictures” we were once again joined by Tess for this one (taken on self timer by Rosie):-)

One girl, her man and their dog

We’re already looking for our next landmark to visit :-)

Posted in General | Leave a comment

Saddell Lodge

This weekend we were both off, so we tried to book a sort getaway. Finding somewhere that appealled and ticked all of our boxes was no easy task and we left it a little late (again) – what’s new eh? In the end we decided not to go too far and booked what we hoped would be a weekend of peace and tranquility – on Kintyre! Neither of us had ever visited the area before,so it presented a lot of new places to explore.

Our accommodation came courtesy of the Landmark Trust, an organisation I can recommend without reservation for anyone in the UK. We stayed in Saddell Lodge, which as it allows dogs meant we didn’t need to find anyone to dogsit Tess. I suspect she enjoyed it as much as we did, or even more given how muddy she ended up :-)

Relaxing Weekend

More pictures will follow over the next few days.

We returned home today after a thoroughly relaxing weekend.

Posted in General | Leave a comment

Django & Apache Auth

Over the last week I’ve been working on another small django site. It’s mainly the usual stuff but one aspect that proved trickier than I expected was using the django maintained authentication system to control access to another service. The other service is run via an apache2 installation and so I figured that mod_authn_dbd configured to use mysql would be all that I needed. Bzzzzt.

Django stores the passwords in a different format than mod_authn_dbd expects. It also uses salts for it’s SHA1 generation, which further complicates the simple password matching that APR does (and is the checking implemented in mod_authn_dbd). I tried a few different ways round it using mysql queries, but all to avail.

The eventual solution I came up with was to adapt mod_authn_dbd into mod_authn_django, with a password checking routine that understands how django stores the passwords and can do the correct things to compare them.

Not sure if it’ll help anyone else, but if there’s any interest I can make it available :-)

Posted in General | 3 Comments

Rotten Apple

All that is necessary for the triumph of evil is that good men do nothing.

Edmund Burke

The US PTO really does make some dramatically poor decisions.

Of course, the patents have to be filed in the first place, so some of the blame must lie with the companies or individuals that make the applications. Surely an organisation like Apple has done a lot of work on the possible ramifications of being granted the patent – otherwise why would they have taken the time and effort to file it?

This patent screams of protectionism and a desire to make money while placing obstacles in their competitors way.

I believe the quote from Edmund Burke sums up my feelings nicely. If you’re contemplating buying anything from Apple, which side of that equation do you see yourself on?

Posted in General | 1 Comment

The River House

We went for lunch today at “The River House“. It’s a restaurant in Stirling that is part of the chain that owns and runs “The Doll’s House” in St Andrews.

It was a great meal, with a nice atmosphere, superb food and great value for money. Parking for their St Andrews locations can be tricky, but The River House has a large car park.

If you’re in the area and want a meal, I’d highly recommend it!

Posted in General | Leave a comment

LNT Battery Change

After a long period of running out of time, the sight of the moon as we drove home this evening was enough to drive me to change the battery in the LNT module sitting atop my Meade LX90. It didn’t take long and was easier than the instructions had led me to think it would be. The change was followed by some recalibration (as required) and all seemed to work quite well.

The alignment wasn’t perfect, but it was done in a rush and I hope it’ll get better as I’m able to take more time.

I also tried attaching the D300 to the scope. The proved to be a huge improvement over the D70 as the exposure metering works – which proved useful in saving time and wasted images :-) Once again, the biggest problem was getting the focus spot on – but that’s something I need to work on.

Wensleydale?

Posted in General | Leave a comment

Considerate & Supporting

Those are the two words that I’d use to sum up the response of work to the family problems I’ve been dealing with for the last few weeks. It’s been an enormous relief and they have been as supportive as I could have hoped for :-)

Posted in General | Leave a comment