Setting a remote key through ssh

One of the steps I find myself doing a lot is distributing round an ssh key so that I can login and use different machines automatically. To help in that process I created a small function in my bash profile script (acutally for me it’s in .bash_aliases):

function setremotekey{ OLDDIR=`pwd` if [ -z "$1" ] then echo Need user@host info fi cd $HOME if [ -e "./.ssh/" ] then cat ./.ssh/ |ssh $1 'mkdir -p -m 0700 .ssh && cat >> .ssh/authorized_keys' else ssh-keygen -t rsa cat ./.ssh/ |ssh $1 'mkdir -p -m 0700 .ssh && cat >> .ssh/authorized_keys' fi cd $OLDDIR}

To use, whenever I want to copy my public key to a remote machine I just have to specify the login and machine:

$ setremotekey mc@narcissus

Then type in my password once, and the the function does the rest. How? Well it checks to make sure I’ve entered a user/host (or actually just a string of some kind). Then, if I haven’t created a public key before (which I might not have on a new machine), I run the ssh-keygen to create it. Once the key is in place, I output the key text and then use ssh to pipe append that to the remote authorized_keys file, creating the directory along the way if it doesn’t exist. Short and sweet, but saves me a lot of time.

Designing a Scalable Grid, part 2

The second part of the two part series on designing a scalable grid system is now available at developerWorks. This tutorial looks at the hardware of the individual nodes and then at operating system and application considerations. For example, I take a close look at the optimization of CPU and RAM in your grid node selections, and how to identify and resolve issues with RAM limitations. You can also use CPU selections to help drive and optimize your grid. For the operating system, I look at the different benefits and advantages of operating system choice, including how some operating systems provide a richer security solution out of the box, while others may be better suited for the large memory or storage requirements associated with a grid manage or distribution node. In terms of the application, I cover the use of a component, rather than a single application model, and how the methods of distribution of information can change the way you design and expand your grid and may ultimately affect the scalability. Read: Design a scalable grid, Part 2: Operating system and application

Google adds new transport method to Google Maps [Humour]

OK, a quick little humourous item that can get to with Google maps:

  1. Go to
  2. Enter ‘New York’
  3. Next to ‘Get Directions’ click ‘From here’ and type ‘London’ as your destination.
  4. Check out step 23

Alternatively, try this link.Or view this:


Yes, it really does say ‘Swim across the Atlantic Ocean’. Why, considering the distance, it suggests swimming from New York to Pont Vauban and not to Southampton, or somewhere in the UK instead of going through France is a little bit of a mystery, but I guess if you are going to swim then you are not aversed to a little sight-seeing.

Understanding MySQL Internals

Sash Pachev has written a new guide on Understanding MySQL Internals for O’Reilly. I was one of the technical reviewers on this book and can tell you that it makes a good read if you want to understand more of what is going on under the hood in MySQL. There’s a lot to cover, for example the pluggable storage engine archtiecture, how queries are parsed and executed, and how individual storage engines work. The book is compact, but very readable, and worth a look if you any interest in how databases are programmed, or are thinking about building your own storage engine to plug into MySQL.

Design a scalable grid, Part 1: Network architecture

When you build a new grid one of the elements that will make your grid a success is to build one that scales, because if your grid scales well then it should be able to cope with a wide range of load types and situations. In this first part of a two-part series on designing a scalable grid I look at the main network architecture of your grid and how you can use these different architectures to suit your grid type. Read: Design a scalable grid, Part 1: Network architecture