Assign multiple security groups on Amazon EC2 Run Instances (ec2-run-instances)

Recently, I needed to deploy new servers with multiple defined security groups on AWS EC2 using CLI.

Note: Security groups can only be defined on instance launch unless using VPC.

How to copy /etc/hosts to all machines

I recently installed Hadoop CDH4 on a new 10 node test cluster and instead of manually entering all the hosts in /etc/hosts I wrote a quick command to copy the current hosts file to all machines.

Hopefully this saves you some time!