<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Gray Soft / Tags / AWS</title>
  <id>tag:graysoftinc.com,2014-03-20:/tags/AWS</id>
  <updated>2014-04-18T20:14:18Z</updated>
  <link rel="self" href="http://graysoftinc.com/tags/AWS/feed.xml"/>
  <link rel="alternate" href="http://graysoftinc.com/tags/AWS"/>
  <author>
    <name>James Edward Gray II</name>
  </author>
  <entry>
    <title>Load an EC2 GUI on Your Mac OS X Box</title>
    <link rel="alternate" href="http://graysoftinc.com/tools-of-the-trade/load-an-ec2-gui-on-your-mac-os-x-box"/>
    <id>tag:graysoftinc.com,2009-07-11:/posts/85</id>
    <updated>2014-04-18T20:14:18Z</updated>
    <summary>This is just a quick tip on how to play with EC2 instances using more than just a boring shell.</summary>
    <content type="html">&lt;p&gt;Using straight shell access on EC2 servers works just fine, of course, but there are images available that include the full desktop environment.  If you use one of those, you can activate GUI programs on the EC2 server.  Now you can't plug a monitor into your EC2 instance, so you will need to tunnel the GUI bits down to your local box.  Luckily, Unix pretty much just handles all of this for you and if you can SSH into an EC2 instance and you have Apple's X11 installed, you are all set to try this.&lt;/p&gt;

&lt;p&gt;I know at one time Apple's X11 environment was an optional install.  I can't remember if it still is, but you can see if you have it by looking for a program called X11 in &lt;code&gt;/Applications/Utilities/&lt;/code&gt;.  Or, just fire up a Terminal and enter the command &lt;code&gt;xterm&lt;/code&gt;.  If a rather plain white shell window eventually appears, you are in business.  If you do need to add the optional install, it should be on the disk that came with your computer (or the OS install disks).&lt;/p&gt;

&lt;p&gt;Once you've confirmed X11 is ready, you need to fire up an EC2 instance.  &lt;a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-instance_linux.html"&gt;Create a Key Pair and configure a Security Group to at least allow SSH access&lt;/a&gt;.  Then just launch an EC2 instance (I use the &lt;a href="https://console.aws.amazon.com/ec2/"&gt;AWS Managment Console&lt;/a&gt; for that) with the needed desktop environment tools.  I chose &lt;a href="http://thecloudmarket.com/owner/063491364108--alestic-com-eric-hammond-?owner=Alestic.com%20(Eric%20Hammond)&amp;amp;search_term=&amp;amp;order=created_at%20desc"&gt;one of the wonderful Ubuntu Images by Eric Hammond&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once the instance is running you are past all the hard parts!  All that's left is to connect to the instance, with a few more options than you probably use normally.  Here's the full command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ssh -X -C -c blowfish -i KEY_FILE_PATH -l root INSTANCE_PUBLIC_DNS
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Replace &lt;code&gt;KEY_FILE_PATH&lt;/code&gt; with the path to the &lt;code&gt;.pem&lt;/code&gt; file Amazon had you download while creating your Key Pair.  Also replace &lt;code&gt;INSTANCE_PUBLIC_DNS&lt;/code&gt; with the address listed as Public DNS in the AWS Management Console for the instance you launched.&lt;/p&gt;

&lt;p&gt;Just FYI, here are the meanings of all the switches I used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-X&lt;/code&gt; is the magic switch that turns on &lt;em&gt;X11 forwarding&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-C&lt;/code&gt; activates compression, which usually speeds up GUI interactions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-c blowfish&lt;/code&gt; switches to a faster encryption method, for even more speed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-i …&lt;/code&gt; allows you to specify your identity file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-l …&lt;/code&gt; allows you to specify your login (which a lot of people prefer to add to the front of the server address with an &lt;code&gt;@&lt;/code&gt; between the two)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;When you're done playing around and plan to use an instance long term, I recommend creating a user, switching your &lt;code&gt;-l&lt;/code&gt; username to that identity, and uploading your standard public key so you can drop the &lt;code&gt;-i&lt;/code&gt; switch altogether.  That's all work though and we're just trying things out here.&lt;/p&gt;

&lt;p&gt;Enough setup, let's get to playing!  Want to browse the instance files using a GUI browser?  This command will launch Nautilis:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;nautilus --no-desktop --browser
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Need to download something to the instance?  You could &lt;code&gt;curl&lt;/code&gt; or &lt;code&gt;wget&lt;/code&gt; the URL or you can just launch Firefox and browse normally:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;firefox-3.0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You get the idea.&lt;/p&gt;

&lt;h4&gt;Notes&lt;/h4&gt;

&lt;p&gt;Avoid the Mac conventions of going after a &lt;code&gt;Quit&lt;/code&gt; command in the menus.  That will shutdown all of X11 and not just the current program.  Instead, close the window of the program you wish to stop and your SSH session should give your prompt back.&lt;/p&gt;

&lt;p&gt;I also seem to need to kill my SSH session (with a control-C) after I've been using GUI applications, even though I logout normally.  I'm not sure why that is.&lt;/p&gt;</content>
    <author>
      <name>James Edward Gray II</name>
    </author>
  </entry>
  <entry>
    <title>Programming Amazon Web Services</title>
    <link rel="alternate" href="http://graysoftinc.com/book-reviews/programming-amazon-web-services"/>
    <id>tag:graysoftinc.com,2008-06-08:/posts/51</id>
    <updated>2021-08-22T16:34:17Z</updated>
    <summary>My not-too-nice take on the new manual for the suite of Amazon's Web service.</summary>
    <content type="html">&lt;p&gt;I really wanted to love &lt;cite&gt;Programming Amazon Web Services&lt;/cite&gt; and it does have some things going for it, but there are enough minuses to keep me from giving it full marks.  Let me start by talking about what the book covers, then we will take a look at what it did well and not so well.&lt;/p&gt;

&lt;p&gt;This book provides full coverage of Amazon's suite of Web services.  You'll find detailed chapters on Amazon's file storage service S3, their cloud computing service EC2, their messaging service SQS, their payment gateway FPS, and their document database service SimpleDB.  The book begins by explaining Amazon's philosophies for these services, how they affect the suite as a whole, and why that should be important to you.  For each service you will find detailed information about the design and intent of the service, how to interact with the API (including a full client implementation), and example applications making use of the service.  The larger and more complicated services span multiple chapters to make sure all key aspects of using that service are covered.&lt;/p&gt;

&lt;p&gt;The description above really hints at what the book does very well.  It's fantastic coverage of all the Amazon services from design to implementation and including practical usage.  You'll have no doubt as you read that the author is a domain expert who really knows his stuff.  He'll walk you through basic usage for the service, strengths and weaknesses, and even give suggestions for how to use the service in exciting new ways.  This is all top notch.&lt;/p&gt;

&lt;p&gt;As I've mentioned though, the book has downsides and they are significant.  The first is that the content is definitely time sensitive and the clock is already ticking.  As Amazon makes changes to these API's, the content will become less and less relevant.  While that's to be expected of most computer manuals, it may be a little more significant here as most of these services are still beta releases undergoing significant development.  This hits home most in the SQS chapter which received a significant upgrade just as the book went to press.  The author does mention the differences, but he admits that it invalidated much of his content.  Keep that in mind if you are readying this review a long time after I've written it.&lt;/p&gt;

&lt;p&gt;I'm afraid the other minus is worse.  The book uses Ruby for most of the code examples and I hate to judge the code of a language I know we all write differently, but the fact is that this Ruby is pretty bad.  It's clear Ruby is not the author's forte and it really feels like it was selected just to score more points with the popular crowd.  The code shows poor programming practices like never closing file handles, a total misunderstanding of the purpose and usage of IRb, poor use of Ruby's modules in an attempt to avoid subclassing, and much more.  That's just in the first few examples too.  At one point, after developing a full client library for a service, the author downloads an alternative client implementation to show examples with.  Hint, hint.  The code is just bad.&lt;/p&gt;

&lt;p&gt;Amazon provides these Web services to enable us developers to lean on the world-famous infrastructure of &lt;a href="http://www.amazon.com/"&gt;Amazon.com&lt;/a&gt; in our own applications.  There are some very real advantages to integrating these solutions and thus it's very valuable for developers to be familiar with what they can offer you.  This book will give you that and thus is probably worth a read.  It would be a rare developer indeed who cannot think up many uses for S3 and EC2 at the very least.  If you don't know what those two services are and what they could do for you, I strongly recommend you learn a little more about them.  Just don't take the code in the book too seriously.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.oreilly.com/library/view/programming-amazon-web/9780596515812/"&gt;Programming Amazon Web Services&lt;/a&gt;&lt;/p&gt;</content>
    <author>
      <name>James Edward Gray II</name>
    </author>
  </entry>
</feed>
