Tuesday, November 15, 2011

Hello AWS!

So I was vegging out, thumbing through my twitter stream when @robconery linked to this interesting piece. While its always interesting to see people switch dev frameworks and the reaction it causes, I was intrigued by this comment:


biggestJohnson said...
simple solution - get yourself a free environment in AWS and do all your setup there. even can do spot images/backups of the entire server and clone as needed. (now don't get me wrong - I love my mac and it's my go-to dev platform). but now a days, you have connectivity to the net everywhere and therefore a connection into a safe and secure virtual server you can do what ever to in a *nix environment. I've been running over there for several months 4 micro server for a total of $6. Very very inexpensive platform for development.

This lead me to spend around an hour (a very comfortable hour, with plenty of distractions) to get up on AWS, and while I don't have a webserver up yet, I'm already in and coding! In an attempt to further motivate myself, I'm challenging myself to write this blogpost before my laptop battery dies in 5 minutes...

(Thanks 'biggestJohnson'! heh heh...)

AWS Setup For Mostly Animate Objects

Here were my steps:

1. Sign up with AWS & use the "Free Usage Tier", all outlined here:
- FYI: You have to provide a credit card and its a tad long of a process (phone verification etc.) so just be ready...
Make sure you generate & download the key pair when given the chance during setup, you can only download them once
http://docs.amazonwebservices.com/FeaturedArticles/latest/index.html?TestDriveFreeTier.html

2. Download putty (putty.zip, you'll need the keygen part)
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

3. Follow these steps to load the private key & create a ... .. .  .       .
(ok, this is where my laptop died, oh well! that means more screen shots for you!)
LIKE I WAS SAYING:
3. Follow these steps to convert / extract the private key & set the keypair in putty
http://www.powercram.com/2009/07/connecting-to-aws-ec2-instance-linux.html

4. Lookup your instance hostname by going here:
https://console.aws.amazon.com/ec2/ and clicking "instances",
select your instance and the hostname will be shown in the details pane below.


5. Fill in the session details as shown below


5. I created a simple batch file to launch my AWS session with one command
"C:\...\putty.exe" -load "PUT PUTTY SESSION NAME HERE"
Just copy that and save it in a .bat file in a conveninent place. Note that the putty path will have to map to your local one

6. Run that script and you should be prompted with a logon. 
Thanks to this comment on the above article, it seems the default username is ec2-user, logon and you're good to go!


Hello AWS

Now let's say hello, in a very anti-cloud way (if I may...)
1. Crank up vim
$ vim helloaws.c

2. Now just compile it & run it
$ gcc hellowaws.c
*KA BOOM*
Ha, gotcha! you'll need to install it using the provided yup package manager!
$ sudo yum install gcc
then hit 'y' a few times and let the package manager have its way with your system...
now, compile that beautiful program again, then run it
$ gcc hellowaws.c 
$ ./a.out
I know I'm doing something dumb with that a.out path, something with the working directory, i dunno but...


So, yeah, I'm in the cloud now ;) That was great, I know that I don't have anything up now, but this will help me finally learn a bit of *nix, play with different webservers, and actually setup a public website (I know, is it 1998 already?)

For my next act, I'll setup a simple web server to start hosting a website on AWS, stay tuned!

Enjoy & Code it Already!

1 comment:

  1. Freakin Sweet! Definitely gives me an excuse to finally go out and get my vim skills up.

    ReplyDelete