Cookies and Curl

curl is the C URL library – its a command-line tool for making web requests, with libraries available in many languages. Personally I prefer to use it from the command line and recently I have been using it with cookies for a web services which set a cookie at login and then needed this to be supplied on all subsequent requests. This turned out to be really simple so I thought I’d put some notes down on how to do it.

Storing Cookies in a Jar

Quite enchantingly, its traditional to call a cookie storage a “cookie jar” which makes a lot of sense when you think about it! To do this with curl, use the -c switch:

curl -c lj.txt http://www.lornajane.net

If you now examine the resulting file, lj.txt, you’ll see that it contains all the details of the cookie. You can edit this if you want to (health warning: only do this if you know what you are doing! If you need to test something though, its useful), and then submit the next request with that cookie attached – exactly as your browser would.

Making Requests with Cookies

To make the next request with the cookie, simple replace the -c with a -b to dip into the cookie jar and sent all relevant cookies for this domain with your request, like this:

curl -b lj.txt http://www.lornajane.net

As I say, I was using this with a web service, where it made no sense to use a browser as I also needed to pass data with the requests. You might also like to refer to my curl cheat sheet previous post.

New Camera: Fuji Finepix F70

Recently I’ve had a new gadget in my life – a Fuji Finepix F72, which is really an F70 but exclusive to Jessop’s in a different colour (I have no idea why retailers do this but hey, it means mine is shiny black).

The camera is a birthday/christmas gift from my parents, since I’m taking increasing numbers of photos these days and our 3-year-old Fuji Finepix F650 is on its last legs! I have been looking around and although there are a few other things in the same kind of market, I read an astonishingly detailed review of the F70 and, considering how much I had liked the previous fuji, decided that this would be a good bet.

Its smaller than the last one while having a lot more resolution, I’m not really a camera geek but it does some funky things that I quite like. Even left entirely in auto mode, the photos are much better quality – especially in low light which was always an issue for the old camera! The scene presets are there and useful as ever. It has some strange settings where it takes multiple photos of the same thing to provide more detail – for example the mode which is pretending to be shallow depth of field takes a bunch of photos and then sticks them together in software, with interesting results:

Profocus Seagulls

I’m still getting to grips with the different settings, and am attempting to join in with the daily shoot which is an exercise in taking a new photographic assignment every day. I’m running at less than 50% success rate but I am taking more photos than I would have otherwise so its good in any event I think! One thing I really want to crack is taking recognisable photos of people … so far the only person I seem to do well with is my toddler niece (perhaps because she doesn’t fear the camera the way the adults do?)

Natalie in the crate

So, thanks mum and dad – and if you’re interested in following my photographic adventures, my photos are on flickr.

Sound Issues with Kubuntu Karmic Koala

Since upgrading my work machine to karmic koala, I’ve noticed that my sound had stopped working. There were some broken packages in aptitude and Skype knew there was a problem as it notified me when I tried to make a call. I saw some issues reported with karmic, notably this one, so I uninstalled pulseaudio

sudo aptitude remove pulseaudio

When I restarted Skype, everything seemed to work as expected – for reference I have a thinkpad T400, if you’re having the same issues, then hopefully this will help!

Speaking at PHPUK

I’m pleased to announce that this year I’ll be speaking at PHPUK in London in February. I’ve attended this conference for the last three years, and attend its related user group, PHP London whenever I can find a reason to be in London on the right day. My talk this time is a brand new one, “Best Practices for Web Service Design”, which covers the main points (and pitfalls!) of architecting a web service to be as robust and useful as possible. This is something I’ve been doing quite a bit of in my day job lately and I’m hoping to pass on some of what I’ve learned.

This conference is well-established and I’ve had a blast most years I’ve attended! Although their schedule isn’t public yet (it will be soon), the other sessions I’ve heard about on the grapevine sound good. If you want to attend, the date is Friday 26th February and you can buy your tickets on their site. Let me know if I will see you there :)

PHP Advent 2009

I’m very proud to be able to say “I’m a PHP Advent author” – I’ve been invited to take part in this year’s event and my article One Step at a Time is now live!

My post this year is aimed as a reminder to us all that we can all aspire to better things, and lots of “better” eventually adds up to “pretty damn good”! If you read the post and have comments, add them here – and if you’ve chosen what one thing you’d like to change next, I’d be delighted to hear it. Whatever your next step, good luck :)

PHPWomen Calendar 2010

I’m halfway delighted and halfway cringing to announce that the phpwomen calendar is now on sale. This was a project organised by my friend and colleague Johanna Cherry, who saw an opportunity at php|tek 2009 to photograph the majority of the core PHPWomen members all in one place and turn it into a fundraising calendar.

If you’re expecting something “Calendar Girls” then you’ll be disappointed. We are all clothed in the pictures!

I won’t share photos from the calendar itself, if you want to see those you can buy your own, but perhaps to give you a hint I’ll share an outtake of myself:

I must confess that I was rather agitated when the photos were taken – as a woman in a male-dominated industry, the risk of being seen as just my physical appearance is ever-present, and I normally try hard at unremarkable, unrevealing clothes with very little makeup and a pair of jeans. Hanging out in the lobby at the hotel during a technical conference in that dress and those shoes was significantly more terrifying than delivering three sessions during my first trip to the US as a speaker (which, considering the problems I have with speaking nerves, is saying something). Even after I saw the photos I was kind of unhappy with the whole experience, although I loved the outtake linked above!

Fast forward 6 months and I had dinner with Derick Rethans, who took the photos in the calendar and arranged the printing, and he showed me the prototype he’d had printed. As I sat and turned the pages, I started to understand why this is so important. The women in these photos are some of the leading lights in the community – respected developers, some of them core developers, key community people, and speakers. Yet I saw them as the women they are … and suddenly remembered that actually, it’s acceptable to be both smart AND beautiful.

So – get your calendar and remember all year that beauties can also be geeks! 10% of every purchase goes to PHPWomen, and we will use those funds to support our women and grow more leading lights like these.

Cobweb Wrap

After around 15 months of ongoing work, I’ve finally finished my cobweb wrap which I initially started (original blog post here, complete with links to yarn sources) to make a good travel project. Well it was certainly that – small and lightweight, I took it on three transatlantic trips all told and am now so attached to it that I’m not sure when I’ll wear it!

For once I (loosely) followed a pattern to make something, which is pretty unusual for me. Another unusual feature of this project is that it is actually for me, I mostly make things for other people, not sure why! The pattern is the “Beaded Cobweb Wrap” from Erika Knight’s Essential Crochet, I have a few of her books and love them. This was a brilliant project, it was tiny to pack and with a 6mm hook it grew despite having rows as long as I am tall! Here’s a couple of pictures of the finished product (thanks Kevin for photographing me):

And to show off the beads:

Speaking at PHP Benelux 2010

I’m delighted to announce that I’m speaking at the inaugural PHP Benelux Conference, to be held on Saturday 30th January in Antwerp, Belgium. The talk will be “Passing the Joel Test in the PHP World”; I gave this talk PHPNW09 in October and it was well-received there, so hopefully I can bring the same insight and inspiration to attendees at this new event as well!

On a personal level I’m very pleased to have a reason to visit the Low Countries – Ibuildings is a dutch company and I’m already making plans to link up with my colleagues there by extending the trip by a few days. I’ve also never been to Antwerp so I’m hoping I’ll see something of the city while I’m there, if time allows. The benelux user group contains many friends so I’m looking forward to what I know will be an excellent event and catching up with all the friends who will be there.

If you are attending, or thinking of it, let me know – and come and say “hi” to me on the day :)

Are Games Just For Gamers?

I’m a keen gamer, or I thought I was – but I’m also female and very busy, which apparently is outside the expected criteria. My preferences are typically for platform style games (Zelda) although I’ll play pretty much anything that’s easy on the eye and doesn’t require superhuman powers of hand-eye co-ordination. I lose interest in the games where you walk around shooting people but I can compete with (and sometimes win against) my colleagues at Mario Kart.

This year, there have been a few games come out that I really liked the look of, some of which I even own. However I only actually played one of them for any length of time. This isn’t because the games weren’t good, but mostly because they can’t be played in small enough chunks of time. While I am perfectly well aware that the target market for games is probably single men with long stretches of spare time – that’s not me. I love all things nintendo and have both a Wii and a DS, and will happily play on either when I can find the time. BUT “time” for me is 20 minutes, maximum, and not every day (sometimes not even every week).

If your game doesn’t allow saving at will, or as a minimum, quit regularly, then its likely that I’ll get frustrated and stop playing. Last time a Zelda title came out (my absolute all-time favourite), I had just moved to a new town, had a flat I could clean in an hour, and a job where I clocked in and clocked out. This year, there’s a new title, and I don’t know when I’ll even buy it, or how much I’ll actually play of it if I did. The recent Mario DS title required you to *complete* 5 levels before saving, never mind play them. I loved the game, but my lifestyle didn’t allow me to get far. The Metroid titles for Wii had exactly the same issues – I like the game but if I can’t pick it up and put it down, it just doesn’t get a look in. On completely the other end of the spectrum was the Professor Layton game, which was puzzle based and could be saved almost at any point!

So, it turns out I’m not a gamer any more, because the game design doesn’t cater for those of us with real lives … when will the manufacturers learn that actually normal people play games too?

Conference Biography Help

I’ve been updating my conference details recently, in order to submit my talks for php|tek in Chicago (the call for papers closes on Monday – get your submissions in!). One thing which I struggled with is my biography, I used to have a paragraph which sort of said “Lorna is a PHP Developer and involved with PHPWomen”, and I used that same entry for every conference for a year or more. However, just like speaker photos, biographies do date. I’ve taken on more responsibilities at work and I’ve been doing more things in the community as well so it was time for a refresh.

I’m quite happy with my new bio:

Lorna Jane Mitchell is a senior developer who speaks, writes and blogs on a variety of technical topics. At Ibuildings she runs the PHP Academy, meaning she’s involved in managing and coaching trainers, hosting seminars and conferences, building a training programme and representing Ibuildings within the PHP community. Lorna is the Editor-in-Chief at Ibuildings techPortal and blogs regularly at lornajane.net. In her spare time she is the European Representative of PHPWomen and is an organiser of the PHPNW user group and conference.

Getting This Far

To get to this point, I started with a list of things I should include. My job, my blog, my community activity, my technical interests. There’s definitely scope for including unexpected information here, I’m seriously thinking of adding my knitting hobby into this paragraph!

I then turned my points into sentences, and emailed the result to a few people to read. Even if you’re secretly hoping someone else will write your bio for you, its often easier for them to criticise something you have written than to start from scratch themselves. I always take this approach even when I know I’m probably making a hash of it, if I’m asking for someone’s input, I take the time to attempt it myself and send them the result. I’m enormously grateful to everyone who has reviewed my biographies and talk proposals, and I’m always happy to do the same for others when I can find the time.

Proofreaders can pick up spelling mistakes and help you put your best foot forward, it might be embarrassing to write about yourself but is it more or less embarrassing than having a lame biography printed in a conference programme?