Using gnome-keybinding-properties

ubuntu netbook logoLast week I reinstalled my aspireone, which I’ve had for quite a while but which is really excellent for events. I put the latest Ubuntu Netbook Remix onto it and it installed like a dream, with peripherals and powersaving all working correctly. It says something about the positive experiences I’ve had with *buntu installs lately that I even did this over the wifi!

The weird thing was that I don’t really use Gnome on other machines as I prefer KDE, and I hadn’t seen the Unity desktop before (as I understand it, this is a lightweight gnome replacement – it still looks and smells like gnome to me), so there were a few things that were “missing” as far as I was concerned. Easily the most annoying is the Alt+F2 shortcut, I don’t really care what GUI I’m using, I mostly just run things from that! I also realised that I now had workspaces, but that there was no keyboard shortcut to switch between them (I don’t use a mouse, so it’s keyboard or nothing for me).

Enter a wonderful utility called gnome-keybinding-properties.
Continue reading

27 Ways To Be A Better PHP Developer

Last weekend I was at the PHPBenelux 2011 conference in Antwerp. As conferences go it was pretty awesome, completely surpassing my expectations in many ways! The schedule was published in advance but I somehow forgot how many friends I have in that part of the world and what a wonderful crowd there is at this event. My hearty congratulations to all the organisers and my thanks to everyone who attended – they used joind.in for the feedback and there are plenty of comments on there too, which I now consider a metric of how engaged a community is!

I was at the conference to give a keynote with ex-colleague and good friend Ivo Jansch. We gave our new talk “27 Ways To Be a Better Developer” in the opening keynote slot, which was a lot of fun (even if I did freak out slightly and hide in the middle). Ivo and I have lots of experience of working with developers, recruiting, running teams, and we had a great time working out *which* 27 items to include and how to tell the story. It was a little bit hectic since we had about 50 minutes to give the talk but we had some generous reviews and so many people have come and told me about one or two points that have made a big impact on them. These are the slides:

Thanks again to all who made this event what it was – organisers, sponsors, speakers and attendees!

Number System Primer

I regularly teach the Zend Certification course and one thing that really splits those with a Computer Science background from those without is handling number systems other than decimal. Personally I don’t see it as a major omission, I certainly don’t work with those systems very often in web development! However, ZCE includes decimal, binary, octal and hexadecimal numbers in its syllabus, so I always make sure to stop and teach it. Here’s a quick round-up of how they work:

Continue reading

Using s3cmd To Manage Files on Amazon S3

Recently I moved some podcasts on to Amazon Simple Storage Service, or S3, which I know is great and easy to use, and I’ve used it with some wrappers, but never directly until now. It turns out, unsurprisingly, that S3 is great and easy to use :) I used s3cmd from s3tools – a collection of python scripts that made this really really easy. Even better, I’m an Ubuntu user so s3cmd is already packaged for me and I simply installed with:

sudo aptitude install s3cmd

Once installed, I found s3cmd --help was surprisingly helpful. To start with you need to set up an access key on AWS (Amazon Web Services) using your amazon user credentials, then supply this to s3cmd by using s3cmd --configure and following the prompts.

Continue reading

Blanket for Reuben

Some very good friends of ours recently had their first child, a son named Reuben, and this is the blanket I made for him:

DSCF4224.JPG

It’s a very traditional granny square crochet blanket, I love these because I can take a ball of wool and a hook with me to anywhere and just make another square or two when nothing else is happening, but I never have to carry around the full project until I’m assembling it right at the end. The border is one round of trebles and another of double crochet – as simple as anything!

5 Years of Blogging

I’ve just realised that today marks 5 years since the very first post on this blog. I’m not sure how 5 years came around, the blog began because I was just leaving a job and every time I did that, I lost my directory of useful scripts that I collected. I also didn’t know how to use grep 5 years ago (or linux, or vim …) and so I couldn’t find things in the directory anyway. So I started to blog things, in the hope of finding them again when I wanted them.

Continue reading

Quick-Start Guide for Google Charts API

Google Charts API is a nice, freely available tool for creating really good-looking graphs very painlessly. Don’t be fooled by the “API” bit though, there is no need for advanced understanding of HTTP here – you generate most graphs just by adding parameters to a URL! In this post we’ll take a look at a few different ways to generate charts.

One-Off Charts

If you just need a beautiful graph to put into a document or post, then the Chart Wizard is the best place to start. You simply choose the type of chart you want, input your data and choose the colours, labels, settings etc, and the wizard generates the URL for you to copy and paste!

The charts are highly configurable and can easily be changed by editing the URL to the image (view the source of this page to see the URL for the chart shown above). This makes it really easy to generate similar-but-different charts in your web applications, by using the wizard and then replacing some relevant parts of it.

Dynamic Charts

As mentioned above, it is very simple to generate charts with Google Charts API – and all the information for generating the chart is on a URL which returns a png file of the resulting chart. This makes it ideal for integrating into our dynamic web applications and charts that are generated are almost overwhelmingly configurable. That said, there are a few key options that will get you started quickly so let’s take a quick tour.

Continue reading

Navigating Bash History with Ctrl+R

I spend a lot of time at command line, and bash records the history of all the commands I’ve typed and puts it in .bash_history (there’s a limit on how many it stores but for me it goes back a few days). I find it really useful to look back at the history to use the same commands again or edit them slightly. You can press the up arrow to go through your history but it can take a really long time to find what you’re looking for. So instead, try Ctrl + r.

To do this: first press Ctrl + r, then start typing the command or any part of the command that you are looking for. You’ll see an autocomplete of a past command at your prompt. If you keep typing, you’ll get more specific options appear. You can also press Ctrl + r again as many times as you want to, this goes back in your history to the previous matching command each time.

Once you see a command you like, you can either run it by pressing return, or start editing it by pressing arrows or other movement keys. I find this a really useful trick for going back to a command I know I used recently, but which I can’t remember or don’t want to look up again. I hope this is a useful trick for you too!

Github API: Issues List

I’m deeply involved with an open source development project (joind.in, the event feedback site) and we recently made the decision to move our issue tracking away from GitHub (because it’s awful and meets none of the requirements for a bug tracker, but that’s a post for another day). In order to make this happen more smoothly, we wanted to migrate our open issues from github (to JIRA Studio, since Atlassian generously provides accounts here for worthy open source projects – thanks Atlassian!).

I looked around for some export functionality for github but I got a lot of posts complaining it wasn’t there. Since I hate applications that take your data and refuse to let you remove it, I was disappointed by this news but further inspection showed that although there might be no “export from github” button, there’s an API that more than has it covered. The API returns JSON which is easy to work with from many programming languages, and is perhaps even more powerful and flexible than the simple export I initially expected, so here are some examples.

Continue reading