Friday, December 31, 2010

Creating a (free) Linux EC2 Instance

This is my first attempt at creating a Linux instance on EC2. No Earth shattering revelations but I figured I'd document the process - hope it helps.

1. Sign up for AWS Free Usage Tier. It’s free for a year. If you already have an AWS account you’ll need to create a new one to take advantage of the freebie. I'm not condoning it but if you need another email address to register and you were so inclined you could use the Gmail plus trick.

2. Login to the AWS Management Console and click "Launch Instance".
3. Select "Basic 64-bit Amazon Linux AMI 1.0." At the time of this writing the AMI Id: ami-2272864b.
4. On the next screen be sure to change change the Instance Type from "Large (m1.large, 7.5 GB)" to "Micro (t1.micro, 613 MB)". The Free Usage Tier only covers a single micro instance and Amazon defaults to large. Click "Continue".
5. Default values on the next screen. Click "Continue"
6. Default values on the next screen. Click "Continue"
7. On the next screen enter a name for your key pair, i chose "rtremainekey". Click "Create & Download your Key Pair". Save it somewhere safe.
8. Select the "quick-start-1" Security Group. Click "Continue".
9. The next screen should look something like this. Click "Launch".
10. Your instance is now launching. Click "Close".
11. Select "Elastic IPs" from the navigation menu on the left. Click "Allocate New Address". Click "Yes, Allocate".
12. Select the id of the instance that we just created. Your id will be different. Click "Associate".
13. Select "Instances" from the left navigation and you should see something similar to this. Note: Instance ids are unique so yours will different than i-efd43683.
14. You should now be able to SSH into your instance as "ec2-user". Use the -i flag to point to the key you downloaded in step 7. Use the IP address that you created in step 12. (Mike Comstock's step 2 has some info on using Putty rather than SSH).
$ sudo chmod 600 ~/rtremainekey.pem
$ ssh ec2-user@ -i ~/rtremainekey.pem
You should see
There you have it.

C#/SQL Pre-Screen Questions

I'm in the market for a couple C# contractors and I was asked by our vendor to put together some basic pre-screen questions. Pretty easy stuff but hopefully it helps filters out some of the riffraff.
  1. A class from which you cannot inherit is what type of class?
    1. Sealed   (Correct)
    2. Private
    3. Virtual
    4. Protected
  2. What is the wild card character in the SQL “like” statement?
    1. *
    2. %   (Correct)
  3. Which method is exposed by the IDisposable interface?
    1. Finalize
    2. Clear
    3. Remove
    4. Dispose   (Correct)
  4. What is the top .NET class from which all classes are derived?
    1. System.Class
    2. System.Object   (Correct)
    3. System.String
    4. System.Type
  5. Can you store multiple data types in a System.Array?
    1. Yes
    2. No   (Correct)
  6. To select all rows from the left table even if there are no matches in the right table what type of join is used?
    1. Inner Join
    2. Right Join
    3. Left Join   (Correct)
    4. Middle Join
  7. What operator do you use to test for a null value?
    1. ??   (Correct)
    2. $
    3. @
    4. ?
Questions 1 & 2 are direct copies from M. Siler's post.