7 Things

It doesn’t seem like that long since the last time this happened, but apparently its been two years and the “tell us something new about yourself” meme has come around again. I was trying to ignore it but now I’ve been tagged by Matthew, Davey and Kathy I guess I can’t.

  1. People often mistake me for being younger than I am. This will be more fun when I’m older but right now I’m 28 and wishing people would take me seriously as a professional. (28!! Pay attention people)
  2. My family has a system called “Family Post” – if you want something transporting, you give it to someone who might see someone who might catch up with someone who has a family member in the same town as the person the item is intended for. Sometimes this system takes years but we can transport almost anything to anyone in the family, free of charge, including plants (and look after them on the way). There is no tracking system however, you just have to throw in your item and hope for the best
  3. My secondary education was at an all-girls grammar school (state-funded, examination entry). I even have a GCSE in Latin to go with it
  4. I have been dating the same man for over 8 years, which probably most people know. What I don’t usually mention is that when we met, he was already in a relationship and we’re now close friends with his then-girlfriend. In fact we’re just about to go to South America for 2 weeks to see her.
  5. I am terribly domesticated. I am a great cook and can feed varying numbers of people with relatively little stress or warning. I can knit and sew, so I can make clothes, soft furnishings, pretty much anything really. I am a competent gardner and an accomplished pianist.
  6. My boyfriend and I bought a 100+ year old house with 4 bedrooms over 4 floors which needed a lot of renovation. Its our first house and we’ve since discovered neither of us is great at or enjoys DIY. We’ll get through this experience but I wouldn’t recommend it
  7. I have no idea what I want to do when I grow up and I don’t have a 5 year plan. If I’d had a 5 year plan 5 years ago, I’d have had a much less interesting life so far.

Last time I did this I refused to tag anyone but this time I’m going to take the opportunity to introduce some of my blog readers to blogs I read myself.

EmmaJane – we have the same middle name and she’s also a geeky knitter
Girls Can’t What – Gretchen has a site full of brilliant female role models, and she’s an ace designer
dotjay – he tagged me last time, and he should blog more
Erik – a cool colleague who will be surprised by this tag
urbanwide – I joke that Deb is “the other girl developer in Leeds”! She’s a camera geek, ruby developer, and she helps me understand how “girl” goes with “geek”
Cally – the then-girlfriend in question
Mark Aitken – ex-colleague, mentor and friend

And now the rules:

  • Link your original tagger(s), and list these rules on your blog.
  • Share seven facts about yourself in the post – some random, some wierd.
  • Tag seven people at the end of your post by leaving their names and the links to their blogs.
  • Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.

Book Review: RESTful PHP

I was recently contacted by the friendly people at Packt Publishing to ask if I’d like a copy of a new addition to their catalogue – RESTful PHP Web Services
, by Samisa Abeysinghe.

When I received and unpacked the book, it was a little lighter than I had expected, however REST really isn’t rocket science and can easily be covered in a tome this size. Overall it was well-written (with only as many spelling mistakes as any other PHP book) and clearly organised. The author begins by skating over why we don’t want to use SOAP, and shows his enthusiasm for REST as a replacement. However before the true elegance and concepts of REST are brought out and revered, we skip straight along and start to look at examples. Very few services that claim to be RESTful actually are, which makes writing anything along these lines very tricky, however I did feel the author could have been clearer about why having a single URL and a parameter for which action should be performed, doesn’t fit well. We do get a sense of excitement about services as ways to “glue together” bits of data on the net, and the possibilities of exposing and consuming information in this way.

Technical Content

Several frameworks are mentioned that can be used with REST, I’ve only heard of one (Zend Framework) – and this book works through a number of examples of working with Zend Framework to provide a REST service. The examples throughout are very thorough – starting with designing the service and getting the semantics of HTTP verbs sensibly applied. We are then taken through building the service using Zend Framework, creating a library class of functionality and then setting up the server to respond to incoming requests. For anyone using this book it is also worth checking for more up to date tutorials; Zend Framework has regular releases and some of the information in the book is already out of date – the dangers of the cutting edge!

Excess Baggage

On a personal level I’m not a big fan of frameworks; Zend Framework is a favourite but the use of it in this setting means that there is a large amount of the book dedicated to Zend Framework, the MVC pattern, and other things that aren’t really anything to do with REST. Call me old-fashioned but for me RESTful services need only HTTP and a data format of some kind, JSON or XML, and a good understanding of the grammar and structure of something that “smells” RESTful. In this book I got bogged down in the cookbook-style examples and lost sight of the bigger picture. The chapter summaries and best practice pointers though were great and I hope readers do take note of these.

Overview

If you need to build a RESTful service and you don’t mind Zend Framework, then this book will attempt to guide you through the process and explain plenty of useful stuff along the way. For a mid-level PHP programmer coming in to services for the first time, I consider this book a nice entry point. However if you were hoping to pick up the concepts behind RESTful services and look to apply them in your own work, then your $40 would be better spent on the RESTful Web Services from O’Reilly – you won’t be copying and pasting working PHP code, but you will come away with some great ideas.

Posted in php

2008 Wrapup

Its that time of year again, out with the old and in with the new. And 2008 was in fact a very exciting year, mostly professionally, and almost entirely unexpectedly.

I kicked off my year by getting my ZCE, which seemed like an excellent start. For my next trick, I parted ways with my employers (which sounds radical but really was a long time coming). I had planned on retraining to a “proper job” (accountancy), or going freelance for a while, but this was thwarted by me being offered a job by Ibuildings. They’re effortlessly the coolest employers around here in PHP, and they are happy to have me telecommute from my home in Leeds. Working from home has been a new experience, and if I’ve learned anything, it’s that it isn’t for everyone. But for me, it works. I think I’ve done as much work this year as in probably the previous two combined. And of course there is the slight trap of being able to pop back to my desk any time, but I think the balance is just about balanced so far.

I’d already written a few blog posts and contributed to DevZone, and once I met Ibuildings things began to spiral from there. I spoke at the Dutch PHP Conference in June (large auditorium, no speaking experience, not something I’ll forget in a hurry), and submitted talks to ZendCon. I wasn’t accepted to speak at ZendCon but I did still manage to attend with support from various people, and I spoke in the UnCon while I was there. I also spoke at quite a few more local events, including the girlgeek dinner in Leeds, and the PHPNW User Group. Through the year I also started broadening my skills at work, preparing and delivering training, speaking at a seminar run by Ibuildings, and also speaking at our internal developer meet.

In November I was involved with the PHP North West conference in Manchester. This was huge fun! We didn’t have a whole lot of experience but we just pitched in, begged help from anyone and everyone, and ended up with a very successful event. For me it was all the joy of a conference and seeing my PHP buddies without any of the flying around the world being in another country bits that I’m less keen on. We had a fun weekend, everything went smoothly, and personally I had a blast.

For the last couple of years, I’ve posted little screenshots of my blog stats on here, see one from 2007 (scroll right down) and also from 2006. This year, well, I’ve considered my stats to be “off the scale” numerous times. In fact, at one point I was convinced I’d had some kind of attack or other malfunction when I saw the spike … when actually all that happened was that I wrote a popular article and people clicked through! So here’s this year’s entry.

Its been really exciting to see the y-axis labels change so much over the course of the year on this site, and I have every intention of continuing writing through 2009. I’ve been prolific this year with 195 blog posts; that pace won’t continue, but I hope to continue to find a few minutes on a regular basis to record useful odds and ends that I would have to look up again next time. Perhaps I should be making more of it but I do still use this blog mostly as a replacement for a good memory! I’ve been blogging for almost three years and its been great to take the time to write some words rather than the code I usually work with. I was also delighted to be invited to write an article for php|architect magazine – you can see it in the /etc column in December’s issue.

Looking ahead to 2009, what is in my future? Well after the experiences of the last few years, all I know is: you never know what is around the corner! I’ve a trip to south america starting next week, and I’ll be speaking at php|tek in Chicago in May. All being well, a new niece or nephew will put in an appearance in early July. As for the rest, well, I’m hoping for good health and a quiet life – and the same for you all!

Colourful Tabs in Screen

A while ago I posted about screen, and included my .screenrc file. I got some teasing for this, since the tabs show up pink. In fact this .screenrc file is one I stole from somewhere a few years ago and didn’t really think much about the colours. Since then I’ve fiddled with the colours and now use different colours on different servers, which is a nice little addition.

Its really easy to do – using the .screenrc from my previous post – just replace all the M and m characters in the last line with the colour you’d like. I started off with something like this:

Y is for Yellow

replacing m with y and M with Y I get:

Green and Cyan

I’ve also used g/G and c/C codes for other servers, which looks something like this:

Titles

I seem to be keen on subtitles in blog posts, but I’ve not labelled many of my screen tabs in these examples (I have no idea why, I usually do). The yellow example has one where one of the tabs is named and this is really helpful once you get past about three tabs and start losing which one was tailing the apache logs! To label a tab in screen, go to that tab and then ctrl+a, shift+a and you are typing in the box. Enjoy :)

Christmas Preparations

We’re hosting Christmas for family this year (actually its Kevin’s family, but that’s a technicality), and between preparations for that and having a new camera in the house, I have some nice photos. After all that we’ve done on this house, suddenly it feels like its coming together into a real home.

Xmas Living Room

The garland on the mantlepiece (the mantlepiece that I dismantled, sanded down, and restained earlier in the year) is a bit of a craft project. I’ll write a separate post at some point but suffice to say the baubles were in the discounted set that I wanted because it had snowflakes in it. They are attached to a plain garland with cable ties, and a set of lights my sister left behind added in too.

I also have a photo of the Christmas tree, I really like this photo (thanks Kevin!)

Xmas Front Room

Stale NFS File Handle

We had some fun and games with our house server recently, when one of its disks died horribly*. I’ve only just got around to sorting out the backups again now, which use an external USB hard drive and rsnapshot. I started by reading my earlier rsnapshot post and also the one about the gotcha with mounting external drives. And yes, I do use this blog instead of a working human memory, much easier to find things.

When I mounted the drive, I saw I had one of the older daily.* directories with question marks for its name, date, permissions and so on when I ran ls. When I tried to do anything with the directory, I got the error stale NFS file handle, which was interesting since we don’t use NFS. After some looking around, I got the recommendation to run fsck.

Before running fsck, the drive must be unmounted.

Then, since mine was sdb1 I ran:

fsck -y /dev/sdb1

The -y switch asks fsck to try to fix every problem it encounters (this was quite a life saver, there were thousands of them before I stopped holding my finger down on the “y” key!) – it comes with warnings that experts may do better to fix manually, but really that’s not me.

The disk is now fine and the backups run fine, I guess it was just the old disk on its way out copying nonsense onto the external drive during backups.

* The stupid thing then blew up its power supply and took the UPS with it a week later, but that’s the way the cookie crumbles.

Hanging Snowflakes Decoration

Last year in January I bought (actually my dad paid for them, thanks dad!) a whole box of Christmas decorations from IKEA, for about 2 GBP. In the box were some snowflake decorations, and yesterday I made a little hanging snowflake decoration to go over the stairs in the hall. I think it looks cute!

snowflakes

It was just a little crocheted string (to give the hanging snowflakes some texture to get tied onto so they didn’t all slide around on the string), then snowflakes threaded onto the cotton, tied into a loop, and then looped onto the string. You can’t really see in the photos but the snowflakes are all glittery and sparkly. Then we put a few nails into the wood over the stairs, and just hooked crochet stitches over them – here it is from the stairs side:

snowflakes

The whole thing took about 20 minutes … so although the snowflakes have had a long wait, it was worth it!

Relocating a WordPress Installation

WordPress is a fine basic website tool, and I’ve used it for a few different odds and ends. One thing it does have that suprises me every time is that it uses a setting for its web address. So as part of the install, it sets this setting and then everything works. Or rather it does, so long as the web address of the application doesn’t change.

Well I’m working on something that I’m developnig locally, checking in to a subversion repository, and then deploying to another server (and other people will be doing the same when they collaborate with me). WordPress isn’t really designed for that, or for the situation where you have a copy of the database, and the code and need to restore it to a different place for any reason. The admin login form is accessible – but then submits to the old location before you can get in to change the settings.

Anyway it turns out to be really straight forward. The URL is in the database and a one-line query mends the problem. I’m putting it here for the next time I need it :)

update wp_options set option_value = 'http://new.path.to/blog" where option_name = 'siteurl';

I found some complicated instructions for moving a blog too – but this will also work for that scenario. This was wordpress 2.7 (their new and shiny version!), I’m not certain which other versions this would apply to but add a comment if you can expand on this please!

PHP Advent Article Published

I was wildly excited a few weeks ago to receive an email inviting me to be one of the contributors to this year’s PHP Advent. Actually the biggest kick was seeing my name in a list of PHP luminaries! The article was published today, you can find it at http://phpadvent.org/2008/which-web-service-by-lorna-mitchell – its a short overview of various types of web services around with some pros and cons about when each is useful. To be included in the PHP Advent project has been huge fun, in fact I’m so delighted that I’ve broken one of my usual rules and blogged twice in one day :)

Birthday Time Again

I’m not old enough to have stopped counting the years yet – and today is my birthday. I’m another year older and actually I think I am a bit wiser than I was this time last year – its been a busy one with a new job and some new experiences (public speaking, eek!). I’d like to say a huge thankyou to everyone who sent cards, gifts, tweets, emails, or wrote on my facebook wall, its been really nice to receive so many happy thoughts from people. I’ve had the day off and we went to York for a bit of shopping and lunch at one of our favourite spots – we lived in York as students so we know the city well, and it was great to go back. I also bought a few nice things for myself :)