How to bulk add an ssh key to multiple servers

If you need to add a colleague’s ssh key to multiple servers that share a similar name, you can do it with a simple one liner. In this post I will show you how.

Assuming the servers you need to add they key to are called:

server1.example.com
server2.example.com
server3.example.com
server4.example.com
etc…

And your colleagues key is in a file called key.pub

To add to a list of consecutive servers, use:

for i in {1..10}; do ssh-copy-id -i key.pub root@server$i.example.com; done

If you wanted to list specific servers, you could use:

for i in {1,4,7,10}; do ssh-copy-id -i key.pub root@server$i.example.com; done

You can then check it worked with the following: (replace colleagues-key-comment with the comment that identifies their public key):

for i in {1..14}; do echo server$i; ssh root@server$i.example.com cat /root/.ssh/authorized_keys | grep colleagues-key-comment; done

Raspberry Pi Measurements & Dimensions

I was asked by Tim Lossen on one of my previous Raspberry Pi posts if I could take some measurements of the Pi board so that he could complete a 3D model of it that he is working on. Unfortunately, we don’t have a ruler in our house, so I’ve printed off some ruler sheets, and taken some photos of the board along side the rulers. Hopefully this will allow someone to take some more precise measurements of the components using Photoshop and it’s rulers.

I’ve also measured the heights to be the following:

  • Ethernet port – 13mm tall
  • Usb 2.0 ports – 15mm
  • Audio jack – 10mm
  • RCA video – 13mm
  • HDMI – 6 mm
  • SD Card – 4.5 mm (underneath)
  • Micro USB power – 2.5 mm

Raspberry Pi playing a 1080p video

In this short clip, I use my Raspberry Pi board to play a 1080p video – Big Buck Bunny. The playback is flawless with no interruptions. The commands used were:

sudo /opt/vc/bin/vcfiled
sudo /opt/vc/bin/ilplayer /home/pi/big_buck_bunny_1080p_h264_ac3.mkv

Big Buck Bunny is a short animated film by the Blender Foundation – (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org.

Raspberry Pi #8 First Photoshoot

I came home from work this evening to find a small brown parcel containing a Raspberry Pi beta board that I had won in an ebay auction earlier this week. It was a charity auction with all the proceeds go to supporting the Raspberry Pi foundation whose aim is to promote computer science and electronics at the school level. I think this is an admirable aim – computer science has enabled me to run my own business, and I feel passionately that we should improve the teaching of it in schools.

The production boards should be going on sale in the next few months for £16 / £25 each depending on the model you choose. For those of you who are looking forward to ordering your own, I have taken some photos of it against my iPhone so you can get a better idea of the size for yourselves.

The first thing that strikes you about the Raspberry Pi board is how small it is. I had seen pictures of it online, but I’m sure it looked bigger! It’s great to see how far computing has evolved since I got my first BBC Model B computer approximately 25 years ago.

You can see the full size Raspberry Pi board diagram here.

Although these boards were designed for schools, I think they will transform the world of computing in myriad other ways. A few years ago the OLTP foundation set out to build a $100 laptop. 2012 marks the beginning of the $20 desktop.

What is the Raspberry Pi?

The Raspberry Pi board is effectively an entire computer on a credit card size board. Like a cut down Mac Mini, all you need is a keyboard and a monitor and you can run a full Linux desktop operating system like Fedora or Debian. It’ll even play Quake 3 and full 1080p films!

Re-using these photos

I’m releasing all these photos under the Creative commons attribution license:

Creative Commons License
Raspberry Pi Beta Board #8 Photos by Paul Maunders is licensed under a Creative Commons Attribution 2.0 UK: England & Wales License.

How to locate a previously submitted P60 or P45 on the HMRC Employers Portal

It always takes me a while to find the list of previously submitted documents on HMRC’s employers portal. So here are the steps for future reference:

  • Login to HMRC Online Services – https://online.hmrc.gov.uk/
  • On the services home page, click through to PAYE for Employers.
  • Click File PAYE return and forms online in the top right hand box.
  • Click Change Tax Year and then select the relevant tax year, e.g. 2010/2011.
  • Click Employee List from the left hand menu if you are not already on that page.
  • Click on the relevant employee name from the list.
  • Click View or Print submitted forms from the bottom of the page.
  • Click on the form you wish to download, and then download it from the following page.

And that’s it! Only 8 clicks 🙂