Thursday, October 28, 2010

Captain Recruiter Learns To Hack

Both my clients and Captain Recruiter itself build web applications. I'm fascinated by the magic that happens behind the scenes of all the websites I visit, especially Google. How do people build this software? How does it run? When it's done, how does it become viewable by everyone on the Internet?

I gave up long ago on a career in software engineering, but I still like to learn about it as a hobby. A few weeks ago I decided I want to know more about how web applications are hosted and deployed. To learn, I decided I was going to set up a virtual private server, also known as an instance, in the cloud. Cloud computing is just a fancy name for renting someone else's computer(s). Given that web applications live on web servers, learning how to set up a server seemed like a good starting point. I'd been told that Amazon Web Services (AWS) is one of the more difficult services to use, at least for a novice, and I decided that trying something hard would be a good learning opportunity.

Signing up for an AWS account is easy. I found my way to their EC2 service and figured out how to rent an instance. After a few minutes I had my own micro-instance up and running. Then the learning began. I had rented a cloud computer in 3000 miles away Virginia that had no monitor, mouse, or keyboard. It didn't take me long to figure out that I had no idea how to even access the computer. After reading the directions on the EC2 website, I started to believe what I'd heard. EC2 isn't for beginners. The directions didn't make any sense to me, and I couldn't figure out how to get started.

I was stuck on the question, "How do I log into EC2?" I felt like I'd rented a car and had never even been behind the wheel. A few weeks went buy and I intermittently tried figuring out the EC2 access problem. Rereading the instructions wasn't helping, and no one I asked was able to shed light on the solution to my challenge without knowing more about which specific part I was struggling with. I needed to put more effort into this problem if I wanted to solve it.

One day last week Sarah Allen asked me if I'd be willing to volunteer for a hack session at Get Satisfaction's office in San Francisco, something about being paid in beer to help... I stopped reading, she had me at beer. Also, this would be the perfect place to find one or more geeks to help me with the EC2 access puzzle. I knew people attending would be the types who could figure this out.

After filling my commitment to volunteer by ferrying people through a maze of locked doors and elevators to get into the office, I got straight to work. I asked every hacker I bumped into the long version of, "How do I log into EC2?" No one at the event that I spoke with knew the steps by heart on a Windows machine (my laptop runs Windows 7). Few people even knew where to get started with Windows at all, they are mostly a Mac crowd.

The fact that a room full of smart people who could solve the EC2 problem couldn't immediately solve the problem was interesting to me. I've discovered that software developers, the people make cool magic things like Google and Microsoft Office, don't know everything. What they do know is how to solve a wide variety of problems by using a predictable, repeatable process. They Google answers to questions and get stuck on things just like I do, but when it comes to software they just have more experience than I do.

I left the hack session without having found an solution to my problem. However, I had learned a trick that would end up being the key to my success.

During my investigation at the hack session, someone taught me how to get my computer to tell me what it was doing as I tried to login into the EC2 instance by using the -v option when using SSH.
    Before -v I was experiencing this:

  • 1. Try logging in.
  • 2. It didn't work.

  • After using -v my experience was like this:

  • 1. Try logging in.
  • 2. OK, I'm trying to connect now.
  • 3. I've found the instance.
  • 4. You told me the password is in this file, let me look it up.
  • 5. Hmm, there seems to be a problem. The password file isn't where I was told it would be.
  • 6. It didn't work.

After getting more information, I was able to spend more time on Google using the error messages to find solutions to the problem I had. Within a couple hours of leaving the hack session, I was found the answer and was able to log into my EC2 instance for the first time.

TL;DR -- I learned how to solve a problem by committing to a path, asking a lot of questions, and achieving MVGS (Minimum Viable Google Savviness).



    Hmm, this guide with screenshots seems to lay out the steps for a Windows server.

    Linux server

  2. I'm literally in the middle of helping a friend set up a new web site on his shared hosting service. Weird things are happening there too. And I've been using this same service for 6+ years.

    I think the big difference between experienced pros and newbies is that the pros know when something goes weird and where they might begin to look to fix the problem. For example, an answer might be on the service's Wiki or it might be better to check StackOverflow. Maybe you can google a salient portion of an error message or it might be better to enter a debugging session.

  3. It might be easy for Mr. Teo, but he's more experience than I am, and it's not like I'd been working on the problem for 3 weeks straight. I just tinker every now and then when I'm in the mood.

    What is simple to you is complicated to someone else. Case and point:

  4. Ssshhh! These are trade secrets :) They made me the techie I am today.

    1> Love to learn. Find the answer to a question. Heck, how to ask a question.
    2> Know how to search. Ah the days of Altavista have faded into the Google-sphere... finding the key search term, whittling it down to your answer.
    3> READ!!! - Keep on trends, technologies, risks.
    4> Converse! - Talk to people, coworkers, family, the guy on the train. You would be surprised what you can learn by just being outgoing.
    5> Share! - Tell of your experieces, successes or failures. You can't be seen if not heard.
    6> Help - If you have expertise or perhaps no expertise and just an interest, it could open up a whole new avenue of thought. Be the goto guy cause you get it done.
    7> ASK!!!!! - The answer you seek could be sitting in the same room as you.

    My 2 cents!