Skip to content

Commit d1a6732

Browse files
committed
Merge remote-tracking branch 'upstream/master' into ui_revamp
* upstream/master: Add event tracking to the filters Added the ignore file for real this time Added ignore file for google analytics Fixed some mistakes in controlling-ec2-from-the-console Added controlling-ec2-from-the-console tutorial
2 parents 646f392 + 4bd0e1d commit d1a6732

File tree

5 files changed

+117
-5
lines changed

5 files changed

+117
-5
lines changed

ignore.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script type="text/javascript">
5+
var _gaq = _gaq || [];
6+
_gaq.push(['_setAccount', 'UA-30727234-1']);
7+
_gaq.push(['_setVar', 'test_value']);
8+
(function() {
9+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
10+
ga.src = ('https:' == document.___location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
11+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
12+
})();
13+
</script>
14+
</head>
15+
<body>
16+
Google Analytics will now ignore you.
17+
</body>
18+
</html>

index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ This project originated as a full-blown rails app backed by a database, and I re
1717

1818
All Tutorials
1919
-------------
20-
You can [browse all tutorials here](/pages/table-of-contents.html?1340248769).
20+
You can [browse all tutorials here](/pages/table-of-contents.html?1340490172).
2121

2222
Newest Tutorials
2323
----------------
24-
* [Creating a Production Storm Cluster](/pages/creating-a-production-storm-cluster.html?1340487118)
24+
* [Controlling EC2 from the Console](/pages/controlling-ec2-from-the-console.html?1340490172)
25+
* [Creating a Production Storm Cluster](/pages/creating-a-production-storm-cluster.html?1340487894)
2526
* [Retrieving Storm Cluster Statistics from Nimbus](/pages/retrieving-storm-data-from-nimbus.html?1340398351)
2627
* [Installing MySQL](/pages/installing-mysql.html?1339980010)
2728
* [Hello, World!](/pages/hello-world.html?1339978842)

javascripts/sidebar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ $(function() {
8383
return filter.name === target.name && filter.value === target.value;
8484
});
8585
if(existing_filter) {
86+
_gaq.push(['_trackEvent', 'filters', 'remove', existing_filter.name, filters.size]);
8687
filters = _(filters).without(existing_filter);
8788
} else {
89+
_gaq.push(['_trackEvent', 'filters', 'apply', target.name, filters.size]);
8890
filters = _(filters).reject(function(filter) { return filter.name === target.name && filter.value === target.value; });
8991
filters.push(target);
9092
}
@@ -146,4 +148,4 @@ function update_sidebar() {
146148
counts[key] = _(val).keys().length;
147149
});
148150
visible_counts = counts;
149-
};
151+
};
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
layout: default
3+
title: Controlling EC2 from the Console
4+
---
5+
6+
# Controlling EC2 from the Console
7+
8+
[Amazon Web Services'](http://aws.amazon.com/) [Elastic Compute Cloud](http://aws.amazon.com/ec2/) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.
9+
10+
You can control your EC2 instances through the [AWS Management Console](https://console.aws.amazon.com/ec2/), but clicking around can be a chore. This tutorial will help you setup your machine so you can spawn new instances, query existing instances, and do general maintainence without leaving the comfort of a terminal.
11+
12+
<div
13+
markdown="1"
14+
class="tutorial"
15+
data-author-github="Whitespace"
16+
data-license="http://creativecommons.org/licenses/by/3.0/"
17+
data-facets='{"Operating System": "OS X", "Package Management": "Homebrew", "Shell": "bash"}'>
18+
19+
## Assumptions
20+
We assume you've [signed up for EC2](https://aws-portal.amazon.com/gp/aws/developer/registration). We also assume your machine has a public key setup (commonly `~/.ssh/id_rsa` and `~/id_rsa.pub`).
21+
22+
## Download Credential Files
23+
First, you need to download some credential files to your machine. Go to the [AWS Security Credentials](https://portal.aws.amazon.com/gp/aws/securityCredentials) page, click "X.509 Certificates", create a new certificate if you need to, download the files when prompted, and then put them into your `~/.ec2` directory:
24+
25+
{% highlight sh %}
26+
mkdir ~/.ec2
27+
cp ~/Downloads/{cert,pk}-*.pem ~/.ec2
28+
{% endhighlight %}
29+
30+
## Install the EC2 Command Line Tools
31+
Now let's install the two packages we need:
32+
33+
{% highlight sh %}
34+
brew install ec2-{api,ami}-tools
35+
{% endhighlight %}
36+
37+
Copy the following to your `~/.bash_profile`:
38+
39+
{% highlight sh %}
40+
export JAVA_HOME="$(/usr/libexec/java_home)"
41+
export EC2_PRIVATE_KEY="$(/bin/ls "$HOME"/.ec2/pk-*.pem | /usr/bin/head -1)"
42+
export EC2_CERT="$(/bin/ls "$HOME"/.ec2/cert-*.pem | /usr/bin/head -1)"
43+
export EC2_HOME="/usr/local/Library/LinkedKegs/ec2-api-tools/jars"
44+
export AWS_ACCESS_KEY_ID="..."
45+
export AWS_SECRET_ACCESS_KEY"=..."
46+
{% endhighlight %}
47+
48+
Where `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are available from the "Access Keys" tab on the [https://portal.aws.amazon.com/gp/aws/securityCredentials](Amazon Security Credentials page).
49+
50+
Don't forget to reload your `.bash_profile`:
51+
52+
{% highlight sh %}
53+
source ~/.bash_profile
54+
{% endhighlight %}
55+
56+
## Uploading your Access Keys
57+
Some people use the public/private keys that Amazon gives them, but I find it easier to use the same public key on my laptop that I already use for things like Github and servers at work. To upload, you can use [this helpful script from Eric Hammond](http://alestic.com/2010/10/ec2-ssh-keys) (slightly modified):
58+
59+
{% highlight sh %}
60+
keypair=macbook # Choose something that makes sense, like your computer name
61+
publickeyfile=$HOME/.ssh/id_rsa.pub # Point this to the public key you want to use
62+
regions=$(ec2-describe-regions | cut -f2)
63+
64+
for region in $regions; do
65+
echo $region
66+
ec2-import-keypair --region $region --public-key-file $publickeyfile $keypair
67+
done
68+
{% endhighlight %}
69+
70+
If you get an error like this, you have to wait a little while until Amazon processes your account:
71+
72+
Client.OptInRequired: You are not subscribed to this service. Please go to http://aws.amazon.com to subscribe.
73+
74+
## Test it All Works
75+
Once we've done all that, we can test it by doing:
76+
77+
{% highlight sh %}
78+
ec2-describe-instances
79+
{% endhighlight %}
80+
81+
If you don't see an error, you're all set!
82+
83+
## References
84+
These links were helpful in getting my machine setup and writing this tutorial:
85+
86+
* [Starting Amazon EC2 with Mac OS X](http://www.robertsosinski.com/2008/01/26/starting-amazon-ec2-with-mac-os-x/)
87+
* [Uploading Personal ssh Keys to Amazon EC2](http://alestic.com/2010/10/ec2-ssh-keys)
88+
</div>

pages/table-of-contents.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ title: Table of Contents
44
ignore: true
55
---
66

7-
This is the TOC. It should not be edited
7+
# All Tutorials
8+
9+
<!-- THIS FILE IS GENERATED; PLEASE DO NOT EDIT THIS FILE BY HAND -->
810

911
<!--- BEGIN TOC -->
10-
* [Creating a Production Storm Cluster](/pages/creating-a-production-storm-cluster.html?1340487118)
12+
* [Controlling EC2 from the Console](/pages/controlling-ec2-from-the-console.html?1340492287)
13+
* [Creating a Production Storm Cluster](/pages/creating-a-production-storm-cluster.html?1340487894)
1114
* [Retrieving Storm Cluster Statistics from Nimbus](/pages/retrieving-storm-data-from-nimbus.html?1340398351)
1215
* [Installing MySQL](/pages/installing-mysql.html?1339980010)
1316
* [Hello, World!](/pages/hello-world.html?1339978842)

0 commit comments

Comments
 (0)