<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Phil Chen</title>
	
	<link>http://www.philchen.com</link>
	<description>Phil Chen</description>
	<lastBuildDate>Tue, 14 May 2013 18:53:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/phil_chen" /><feedburner:info uri="phil_chen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>phil_chen</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title />
		<link>http://feedproxy.google.com/~r/phil_chen/~3/Eg2JPI065bA/1278</link>
		<comments>http://www.philchen.com/2013/04/08/1278#comments</comments>
		<pubDate>Mon, 08 Apr 2013 18:05:16 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1278</guid>
		<description><![CDATA[I have recently been working on a open source project (hosted on Github) called Process Watch. It monitors processes and workflows in your Linux system for anomalies or situations which when arise trigger predetermined actions you designate. I wrote this in PERL in 2006 but I am rewriting it in Ruby with a lot more [...]]]></description>
				<content:encoded><![CDATA[<p>I have recently been working on a open source project (hosted on Github) called <a href="https://github.com/nethacker/processwatch" target="_blank">Process Watch</a>. It monitors processes and workflows in your Linux system for anomalies or situations which when arise trigger predetermined actions you designate. I wrote this in PERL in 2006 but I am rewriting it in Ruby with a lot more functionality. It&#8217;s been a lot of fun&#8230;</p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/Eg2JPI065bA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2013/04/08/1278/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2013/04/08/1278</feedburner:origLink></item>
		<item>
		<title>AWS EC2 64-bit CentOS 6.3 Public AMI ‘s (EBS and Instance-Store)</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/4HqdxJp_m-g/aws-ec2-64-bit-centos-6-3-public-ami-s-ebs-and-instance-store</link>
		<comments>http://www.philchen.com/2013/02/04/aws-ec2-64-bit-centos-6-3-public-ami-s-ebs-and-instance-store#comments</comments>
		<pubDate>Mon, 04 Feb 2013 23:27:53 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1160</guid>
		<description><![CDATA[For those of you looking for a 64-bit CentOS 6.3 AMI (Amazon Machine Image) to use or to create your own snapshot or custom AMI from, I have created both Instance-store and EBS backed Public AMI&#8217;s. This is great if you just need a basic clean install of CentOS 6.3 or if you need to [...]]]></description>
				<content:encoded><![CDATA[<p>For those of you looking for a 64-bit CentOS 6.3 AMI (Amazon Machine Image) to use or to create your own snapshot or custom AMI from, I have created both Instance-store and EBS backed Public AMI&#8217;s.<br />
<span id="more-1160"></span><br />
This is great if you just need a basic clean install of CentOS 6.3 or if you need to create your own custom image, read my blog <a href="http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed" target="_blank">How to create an Amazon Elastic Compute Cloud EC2 Machine Image (AMI) CentOS 6 S3 Backed or EBS Backed</a> and skip to &#8220;Steps to create a EBS Backed AMI from your S3 Backed Instance&#8221;.</p>
<p>You can find these AMI&#8217;s available in the Amazon Web Services Dashboard, or via the below links.</p>
<p><strong>Instance-store backed AMI<br />
</strong><a href="https://aws.amazon.com/amis/64bit-centos-6-3-linux-on-public-ami" target="_blank">https://aws.amazon.com/amis/64bit-centos-6-3-linux-on-public-ami</a></p>
<p>US East (Northern Virginia) &#8211; ami-d51d93bc<br />
US West (Northern California) &#8211; ami-34f6d671<br />
US West (Oregon) &#8211; ami-e49d16d4<br />
EU (Ireland) &#8211; ami-605c5314<br />
Asia Pacific (Singapore) &#8211; ami-d1733183<br />
Asia Pacific (Tokyo) &#8211; ami-84b00a85<br />
Asia Pacific (Sydney) &#8211; ami-2726b11d<br />
South America (Sao Paulo) &#8211; ami-433fe75e</p>
<p><strong>40 Gigabyte EBS Backed AMI<br />
</strong><a href="https://aws.amazon.com/amis/centos-6-3-built-on-a-40t-ebs-volume-created-by-phil-chen" target="_blank">https://aws.amazon.com/amis/centos-6-3-built-on-a-40t-ebs-volume-created-by-phil-chen</a></p>
<p>US East (Northern Virginia) &#8211; ami-9dc348f4<br />
US West (Northern California) &#8211; ami-e497b7a1<br />
US West (Oregon) &#8211; ami-b866ed88<br />
EU (Ireland) &#8211; ami-409b9434<br />
Asia Pacific (Singapore) &#8211; ami-9ab4f6c8<br />
Asia Pacific (Tokyo) &#8211; ami-1fd85d1e<br />
Asia Pacific (Sydney) &#8211; ami-d2eb7de8<br />
South America (Sao Paulo) &#8211; ami-df4c94c2</p>
<p><strong>Also a great resource for free Realtime AWS uptime data is <a href="http://www.systemswatch.com" target="_blank">Systems Watch</a></strong></p>
<p><strong>Disclaimer: </strong></p>
<p>You can use it as you like, however we (Phil Chen / www.philchen.com) are not liable for any of your use or misuse of the image. We offer this free image to help the community of cloud users and cloud builders.</p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/4HqdxJp_m-g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2013/02/04/aws-ec2-64-bit-centos-6-3-public-ami-s-ebs-and-instance-store/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2013/02/04/aws-ec2-64-bit-centos-6-3-public-ami-s-ebs-and-instance-store</feedburner:origLink></item>
		<item>
		<title>2012 L-I-V-I-N, A Memorable Year!</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/6c7O6y8zuQY/2012-livin-done-a-memorable-year</link>
		<comments>http://www.philchen.com/2013/01/31/2012-livin-done-a-memorable-year#comments</comments>
		<pubDate>Thu, 31 Jan 2013 22:16:59 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1178</guid>
		<description><![CDATA[The modo for the year 2012 was &#8220;L-I-V-I-N&#8221;, as usual living life to the fullest, with no regrets. Well the year is over and I am happy to say I didn&#8217;t waste any time, and enjoyed every minute of it. The important elements in my life, family, friends, health, self improvement, career, and community all [...]]]></description>
				<content:encoded><![CDATA[<p>The modo for the year 2012 was &#8220;L-I-V-I-N&#8221;, as usual living life to the fullest, with no regrets. Well the year is over and I am happy to say I didn&#8217;t waste any time, and enjoyed every minute of it. The important elements in my life, family, friends, health, self improvement, career, and community all were successful in 2012, in the most fulfilling of ways.<br />
<span id="more-1178"></span><br />
<strong>Family</strong></p>
<p>On August 16, 2012 my life elevated in the most amazing way, I got married to the love of my life Julia. We had our wedding in Vegas at the Mandalay Bay Chapel, with a reception in a penthouse suite amongst close family and friends. It was a day of fun, happiness and love. Here are the <a href="http://www.flickr.com/photos/juliaholland/sets/72157631183230720/" target="_blank">wedding photos</a>.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2013/01/wedding2.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/wedding2-300x199.jpg" alt="Wedding" width="300" height="199" class="alignleft size-medium wp-image-1181" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/wedding1.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/wedding1-300x199.jpg" alt="Wedding" width="300" height="199" class="alignleft size-medium wp-image-1182" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/wedding4.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/wedding4-300x199.jpg" alt="Wedding" width="300" height="199" class="alignleft size-medium wp-image-1184" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/wedding3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/wedding3-300x199.jpg" alt="Wedding" width="300" height="199" class="alignleft size-medium wp-image-1185" /></a></p>
<hr />
<p><strong>Friends</strong></p>
<p>2012 was also the year I got to be a part of a best friend Xan and his wife Kristen&#8217;s wedding. It&#8217;s good to know that time keeps on passing, but my friends and I are still the little kids I remembered horsing around, still trying to grow up.</p>
<p>The past year friends near and far made for a perfect time, a reminder to me to make an effort to hang out more.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2013/01/xanwedding1.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/xanwedding1-300x200.jpg" alt="Xan and Kristen" width="300" height="200" class="alignleft size-medium wp-image-1195" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/friends2.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/friends2-300x225.jpg" alt="Sam and I" width="300" height="225" class="alignleft size-medium wp-image-1191" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/friends1.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/friends1-225x300.jpg" alt="Xan, Jeff and I" width="225" height="300" class="alignleft size-medium wp-image-1193" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/friends3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/friends3-300x225.jpg" alt="Dave and I" width="300" height="225" class="alignleft size-medium wp-image-1192" /></a></p>
<hr />
<p><strong>Health</strong></p>
<p>Working it&#8230; That&#8217;s all I have to say. 2012 exercise and getting in shape had become a part of life, and new goals have pushed me harder. Oh and lots of Muay Thai training.</p>
<p>I ran my fastest Half Marathon 1hr 48min 23sec almost 20 minutes faster then my previous fastest time.<br />
I entered my first Muay Thai Amateur fight at a Team Quest Encinitas IKF tournament video <a href="http://youtu.be/t3j_U038aRc" target="_blank">here</a>.<br />
I cornered my first Muay Thai fight for a friend Stephen and fellow gym rat video <a href="http://youtu.be/ldBfMKaGtOk" target="_blank">here</a>.<br />
I got my body fat down to 13% from 16% (I know getting crazy here, but hey its still cool)</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2013/01/muaythai4.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/muaythai4-300x200.jpg" alt="Muay Thai" width="300" height="200" class="alignleft size-medium wp-image-1205" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/muaythai3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/muaythai3-300x225.jpg" alt="Muay Thai" width="300" height="225" class="alignleft size-medium wp-image-1206" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/muaythai2.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/muaythai2-300x198.jpg" alt="Muay Thai" width="300" height="198" class="alignleft size-medium wp-image-1207" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/muaythai1.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/muaythai1-300x198.jpg" alt="Muay Thai" width="300" height="198" class="alignleft size-medium wp-image-1208" /></a></p>
<hr />
<p><strong>Career</strong></p>
<p>2012 was the year of getting things done. Julia and I were able to launch <a href="http://www.mygraphs.com" target="_blank">mygraphs.com</a> as well as implemented realtime cloud monitoring for <a href="http://www.systemswatch.com" target="_blank">systemswatch.com</a>, both had been in the planning phases for quite sometime. With the magical design and development skills of Julia we were able to successfully bring both products out to the world. So far we have had a strong response and each day we continue to gain ground on making both initiatives better and better.</p>
<p>Also <a href="http://www.givit.com">Givit</a> a company I am a Co-Founder of, went from a cool IOS private sharing app to a easy to use full featured video editing IOS app that makes great highlight reels.</p>
<p>As you can see its been a busy year!</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2013/01/work2.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/work2-300x199.jpg" alt="Work" width="300" height="199" class="alignleft size-medium wp-image-1212" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/work1.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/work1-300x225.jpg" alt="Work" width="300" height="225" class="alignleft size-medium wp-image-1213" /></a></p>
<hr />
<p><strong>Community</strong></p>
<p>Every year I raise money for <a href="https://secure3.convio.net/nmss/site/SPageServer?pagename=WLK_CAS_Landing_Page" target="_blank">Walk MS</a> and 2012 wasn&#8217;t the best year but I did manage to raise $1100 from family and friends. Any amount going to a worth while cause is a good thing. Here is a graph showing the progress of my fundraising year over year, of course using <a href="http://www.mygraphs.com" target="_blank">mygraphs.com</a> <img src='http://www.philchen.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<p><iframe src="https://www.mygraphs.com/graphs/view/981" frameborder="0" width="550" height="318" scrolling="no" allowTransparency="true"></iframe></p>
<p>Also in 2012 with the help of a donation to SDSU, Julia and I became SDSU Aztec Football and Basketball season ticket holders, something we had wanted to do for awhile. We both are Alumni and love eating junk food and watching our teams kick some butt. SDSU Football became Co-Champions of the Mountain West Conference, and got into the Poinsettia Bowl against BYU, which we got to see as well. Currently we are still in the middle of the basketball season but SDSU is doing well with a current ranking of 22 in the nation, not to shabby.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2013/01/sdsufootball3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/sdsufootball3-300x224.jpg" alt="SDSU Football" width="300" height="224" class="alignleft size-medium wp-image-1218" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/sdsufootball2.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/sdsufootball2-300x300.jpg" alt="SDSU Football" width="300" height="300" class="alignleft size-medium wp-image-1219" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/sdsubasketball2.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/sdsubasketball2-300x300.jpg" alt="SDSU Basketball" width="300" height="300" class="alignleft size-medium wp-image-1216" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2013/01/sdsubasketball1.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/sdsubasketball1-300x300.jpg" alt="SDSU Basketball" width="300" height="300" class="alignleft size-medium wp-image-1217" /></a></p>
<hr />
<p><strong>In Conclusion</strong></p>
<p>Looking back on 2012, all I can say is I am a lucky man to have amazing friends and family to share great experiences with. That combined with the fact I love what I do for a living, I can&#8217;t complain and look forward to an even more exciting 2013! Oh yea, and the end of the world didn&#8217;t happen so that is cool too <img src='http://www.philchen.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2013/01/conclusion3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2013/01/conclusion3-192x300.jpg" alt="Me" width="192" height="300" class="aligncenter size-medium wp-image-1238" /></a></p>
<hr />
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/6c7O6y8zuQY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2013/01/31/2012-livin-done-a-memorable-year/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2013/01/31/2012-livin-done-a-memorable-year</feedburner:origLink></item>
		<item>
		<title>How to use netfilter and iptables to stop a DDoS Attack?</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/MhKKs4DKHGg/how-to-use-netfilter-and-iptables-to-stop-a-ddos-attack</link>
		<comments>http://www.philchen.com/2013/01/18/how-to-use-netfilter-and-iptables-to-stop-a-ddos-attack#comments</comments>
		<pubDate>Sat, 19 Jan 2013 00:31:17 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1143</guid>
		<description><![CDATA[This how to article will go over stopping a DDoS attack when all you have access to is the targeted Linux host using netfilter and iptables. The two methods are either to simply drop packets from the offending IP/range or to only allow the offending IP/range X number of requests per second, if the range [...]]]></description>
				<content:encoded><![CDATA[<p>This how to article will go over stopping a DDoS attack when all you have access to is the targeted Linux host using netfilter and iptables. The two methods are either to simply drop packets from the offending IP/range or to only allow the offending IP/range X number of requests per second, if the range exceeds the requests per second rate traffic is dropped from the range.<br />
<span id="more-1143"></span><br />
*NOTE This method is for small attacks on services you are running on your Linux host. For large attacks using your gateway&#8217;s (firewall, load balancer, switch, or router) anti DDoS features maybe necessary or even having your ISP mitigating maybe the only option. I do often see attacks on HTTP from a hundred hosts or so and this article works on that scale.</p>
<p>Here is a example of a script for dropping packets from a offending IP/range lets say for our purposes the range is 206.250.230.0/24</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> INPUT <span style="color: #000000;">1</span> <span style="color: #660033;">-s</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> OUTPUT <span style="color: #000000;">1</span> <span style="color: #660033;">-d</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #000000;">1</span> <span style="color: #660033;">-s</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #000000;">1</span> <span style="color: #660033;">-d</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP</pre></div></div>

<p>Here is a example of a script for dropping packets from a offending IP/range if it exceeds 30 requests per second lets say for our purposes the range is 206.250.230.0/24</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> INPUT <span style="color: #000000;">1</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec <span style="color: #660033;">-s</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> INPUT <span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> OUTPUT <span style="color: #000000;">1</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec <span style="color: #660033;">-d</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> OUTPUT <span style="color: #000000;">2</span> <span style="color: #660033;">-d</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #000000;">1</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec <span style="color: #660033;">-s</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #000000;">1</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec <span style="color: #660033;">-d</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>iptables <span style="color: #660033;">-I</span> FORWARD <span style="color: #000000;">2</span> <span style="color: #660033;">-d</span> 206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span> <span style="color: #660033;">-j</span> DROP</pre></div></div>

<p>You can see your changes applied by running iptables -L command as seen below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">-bash-<span style="color: #000000;">4.1</span><span style="color: #666666; font-style: italic;"># iptables -L</span>
Chain INPUT <span style="color: #7a0874; font-weight: bold;">&#40;</span>policy ACCEPT<span style="color: #7a0874; font-weight: bold;">&#41;</span>
target     prot opt <span style="color: #7a0874; font-weight: bold;">source</span>               destination         
ACCEPT     all  <span style="color: #660033;">--</span>  206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>     anywhere            limit: avg <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec burst <span style="color: #000000;">5</span> 
DROP       all  <span style="color: #660033;">--</span>  206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>     anywhere            
&nbsp;
Chain FORWARD <span style="color: #7a0874; font-weight: bold;">&#40;</span>policy ACCEPT<span style="color: #7a0874; font-weight: bold;">&#41;</span>
target     prot opt <span style="color: #7a0874; font-weight: bold;">source</span>               destination         
ACCEPT     all  <span style="color: #660033;">--</span>  anywhere             206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>    limit: avg <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec burst <span style="color: #000000;">5</span> 
DROP       all  <span style="color: #660033;">--</span>  anywhere             206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>    
ACCEPT     all  <span style="color: #660033;">--</span>  206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>     anywhere            limit: avg <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec burst <span style="color: #000000;">5</span> 
DROP       all  <span style="color: #660033;">--</span>  206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>     anywhere            
&nbsp;
Chain OUTPUT <span style="color: #7a0874; font-weight: bold;">&#40;</span>policy ACCEPT<span style="color: #7a0874; font-weight: bold;">&#41;</span>
target     prot opt <span style="color: #7a0874; font-weight: bold;">source</span>               destination         
ACCEPT     all  <span style="color: #660033;">--</span>  anywhere             206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>    limit: avg <span style="color: #000000;">30</span><span style="color: #000000; font-weight: bold;">/</span>sec burst <span style="color: #000000;">5</span> 
DROP       all  <span style="color: #660033;">--</span>  anywhere             206.250.230.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span></pre></div></div>

<img src="http://feeds.feedburner.com/~r/phil_chen/~4/MhKKs4DKHGg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2013/01/18/how-to-use-netfilter-and-iptables-to-stop-a-ddos-attack/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2013/01/18/how-to-use-netfilter-and-iptables-to-stop-a-ddos-attack</feedburner:origLink></item>
		<item>
		<title>How to Make a Video go Viral</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/P4zghua_ut8/how-to-make-a-video-go-viral</link>
		<comments>http://www.philchen.com/2013/01/11/how-to-make-a-video-go-viral#comments</comments>
		<pubDate>Fri, 11 Jan 2013 22:51:01 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Fun 101]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1119</guid>
		<description><![CDATA[How do you make a video go viral is a question that has been tossed around quite a bit since the advent of video outlets such as YouTube. I am a Co-Founder at Givit and recently had a video go viral on YouTube and decided to share my experience. The video was of San Diego [...]]]></description>
				<content:encoded><![CDATA[<p>How do you make a video go viral is a question that has been tossed around quite a bit since the advent of video outlets such as YouTube. I am a Co-Founder at <a href="http://www.givit.com" target="_blank">Givit</a> and recently had a video go viral on YouTube and decided to share my experience.<span id="more-1119"></span> The video was of San Diego State University star basketball player Jamaal Franklin doing what people are considering the dunk of 2013 and possibly the dunk of the century.</p>
<p>The story goes I was sitting at home watching the SDSU basketball game against Fresno State, which was a close nail biter of a conference game, not to mention SDSU was ranked 15th in the nation and Fresno was unranked. Then it happened the SDSU star player Jamaal Franklin had a fast break with three defenders on him, and while running full speed he threw up a Alley-oop from the three point line against the backboard, leaping into the air like a long jumper and catching it for a slam dunk through three Fresno state defenders.</p>
<p>I couldn’t believe my eyes, so immediately I rewound my DVR and whipped out my iPhone and using <a href="https://itunes.apple.com/us/app/givit/id560803488?mt=8" target="_blank">Givit</a> recorded the dunk on my TV. Using Givit within about 1 minute edited a instant replay slow motion effect and posted it to YouTube, Twitter, and Facebook. I started seeing immediate views! And as I write this 1.5 days later have 132,006 views of my 17 second Givit video on YouTube. The video was embedded on Sports Illustrated, LA Times, the Union Tribune, and a slew of other sites.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/0-stx17fY-I?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>Link to Video: <a href="http://youtu.be/0-stx17fY-I">http://youtu.be/0-stx17fY-I</a></p>
<p>So some key points I learned:</p>
<p>1) Have a App like <a href="https://itunes.apple.com/us/app/givit/id560803488?mt=8" target="_blank">Givit</a> ready on your iPhone to capture an amazing event, Givit works great because you can edit and add effects combining multiple clips in minutes.</p>
<p>2) Share it to all your social media sites, Twitter, YouTube, Facebook, Google+ etc…</p>
<p>3) After sharing to YouTube make sure you have a good title but more importantly for searches YouTube cares most about the Description Section, even more then Tags. So make sure your description has good key words that you think people will search with.</p>
<p>4) Upload your video as soon as the event happens, when the buzz goes out people will start searching for it immediately and the person with the most plays gets the viral effect, later videos of the same event will seem not as good just from the play count number.</p>
<p>5) Add effects to your video to make it better then the others that will follow, with Givit I used the slow motion instant replay effect</p>
<p>I am by no means a expert at creating viral videos, however what I wrote above is all it took for me to have a popular video that has 130K views in 1.5 days and is on track to get 300K views in the next several weeks.</p>
<p>Phil</p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/P4zghua_ut8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2013/01/11/how-to-make-a-video-go-viral/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2013/01/11/how-to-make-a-video-go-viral</feedburner:origLink></item>
		<item>
		<title />
		<link>http://feedproxy.google.com/~r/phil_chen/~3/qy4Xw4pYE4k/1115</link>
		<comments>http://www.philchen.com/2013/01/01/1115#comments</comments>
		<pubDate>Tue, 01 Jan 2013 20:37:13 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1115</guid>
		<description><![CDATA[Happy New Year everyone, hope 2013 brings you happiness and joy. To those who thought 2012 was your last Year here on earth, I guess you can be happy the Mayans just got tired of adding to their calendar and it didn&#8217;t really mean what you thought.]]></description>
				<content:encoded><![CDATA[<p>Happy New Year everyone, hope 2013 brings you happiness and joy. To those who thought 2012 was your last Year here on earth, I guess you can be happy the Mayans just got tired of adding to their calendar and it didn&#8217;t really mean what you thought.</p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/qy4Xw4pYE4k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2013/01/01/1115/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2013/01/01/1115</feedburner:origLink></item>
		<item>
		<title>How to Tell if a MySQL Database is Being Used</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/-xfVuCz9L-k/how-to-tell-if-a-mysql-database-is-being-used</link>
		<comments>http://www.philchen.com/2012/12/19/how-to-tell-if-a-mysql-database-is-being-used#comments</comments>
		<pubDate>Thu, 20 Dec 2012 00:14:49 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1101</guid>
		<description><![CDATA[So the scenario goes you have inherited a some legacy systems and your auditing what is being used or not, since the old person in charge was bad at cleaning up after himself, with legacy servers strewn about and then&#8230; uh oh you come across a MySQL 5.x database server with multiple DB&#8217;s. Assuming you [...]]]></description>
				<content:encoded><![CDATA[<p>So the scenario goes you have inherited a some legacy systems and your auditing what is being used or not, since the old person in charge was bad at cleaning up after himself, with legacy servers strewn about and then&#8230; uh oh you come across a MySQL 5.x database server with multiple DB&#8217;s.<br />
<span id="more-1101"></span></p>
<p>Assuming you can login to MySQL as root or something with similar privileged you can run the following to check the epoch time of the last update on each individual database (using MyISAM tables):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SELECT UNIX_TIMESTAMP<span style="color: #7a0874; font-weight: bold;">&#40;</span>MAX<span style="color: #7a0874; font-weight: bold;">&#40;</span>UPDATE_TIME<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">as</span> last_update FROM information_schema.tables WHERE <span style="color: #007800;">TABLE_SCHEMA</span>=<span style="color: #ff0000;">'replace-with-database-name'</span> GROUP BY TABLE_SCHEMA;</pre></div></div>

<p>Sample output to expect (you will need to convert your epoch time):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">+-------------+
<span style="color: #000000; font-weight: bold;">|</span> last_update <span style="color: #000000; font-weight: bold;">|</span>
+-------------+
<span style="color: #000000; font-weight: bold;">|</span>  <span style="color: #000000;">1316645223</span> <span style="color: #000000; font-weight: bold;">|</span>
+-------------+
<span style="color: #000000;">1</span> row <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>If you happen to be running Innodb you can use the following on a table to table bases:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SELECT update_time FROM information_schema.tables WHERE <span style="color: #007800;">table_schema</span>=<span style="color: #ff0000;">'replace-with-database-name'</span> AND <span style="color: #007800;">table_name</span>=<span style="color: #ff0000;">'replace-with-table-name'</span>;</pre></div></div>

<p>Sample output to expect:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">+---------------------+
<span style="color: #000000; font-weight: bold;">|</span> update_time         <span style="color: #000000; font-weight: bold;">|</span>
+---------------------+
<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2011</span>-09-<span style="color: #000000;">21</span> <span style="color: #000000;">15</span>:<span style="color: #000000;">47</span>:03 <span style="color: #000000; font-weight: bold;">|</span>
+---------------------+
<span style="color: #000000;">1</span> row <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Another good thing to do is check what processes are running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SHOW FULL PROCESSLIST\G</pre></div></div>

<p>Sample output to expect when no processes are happening:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">***************************</span> <span style="color: #000000;">1</span>. row <span style="color: #000000; font-weight: bold;">***************************</span>
           Id: <span style="color: #000000;">20</span>
         User: root
         Host: localhost
           db: NULL
      Command: Query
         Time: <span style="color: #000000;">0</span>
        State: NULL
         Info: SHOW FULL PROCESSLIST
    Rows_sent: <span style="color: #000000;">0</span>
Rows_examined: <span style="color: #000000;">0</span>
    Rows_read: <span style="color: #000000;">150</span>
<span style="color: #000000;">1</span> row <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Another query you can run to find out what tables have changed in the past X hours is:<br />
*Note this can be a intense query so do it when its the right time to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SELECT table_schema,table_name,update_time FROM information_schema.tables WHERE update_time <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>NOW<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> - INTERVAL PUT-NUMBER-HERE HOUR<span style="color: #7a0874; font-weight: bold;">&#41;</span>;</pre></div></div>

<p>Expected output would be something like this:<br />
*Note the information_schema tables will pretty much always pop-up</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">+--------------------+-------------+---------------------+
<span style="color: #000000; font-weight: bold;">|</span> table_schema       <span style="color: #000000; font-weight: bold;">|</span> table_name  <span style="color: #000000; font-weight: bold;">|</span> update_time         <span style="color: #000000; font-weight: bold;">|</span>
+--------------------+-------------+---------------------+
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> COLUMNS     <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> EVENTS      <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> PARTITIONS  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> PLUGINS     <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> PROCESSLIST <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> ROUTINES    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> TRIGGERS    <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> information_schema <span style="color: #000000; font-weight: bold;">|</span> VIEWS       <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:07:<span style="color: #000000;">48</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> your_apps_table1   <span style="color: #000000; font-weight: bold;">|</span> app1        <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:06:<span style="color: #000000;">27</span> <span style="color: #000000; font-weight: bold;">|</span>
<span style="color: #000000; font-weight: bold;">|</span> your_apps_table2   <span style="color: #000000; font-weight: bold;">|</span> app2        <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000;">2012</span>-<span style="color: #000000;">12</span>-<span style="color: #000000;">19</span> <span style="color: #000000;">19</span>:06:<span style="color: #000000;">28</span> <span style="color: #000000; font-weight: bold;">|</span>
+--------------------+-------------+---------------------+
<span style="color: #000000;">10</span> rows <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.00</span> sec<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Hope this gives a little help to your MySQL auditing adventures, obviously there are way more ways to check usage but these are a couple of simple ways.</p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/-xfVuCz9L-k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2012/12/19/how-to-tell-if-a-mysql-database-is-being-used/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2012/12/19/how-to-tell-if-a-mysql-database-is-being-used</feedburner:origLink></item>
		<item>
		<title>How an AWS Outage Can Cause Issues Even When You’re in Multi-Availability Zones</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/Q7dYqaQ4We8/amazon-web-services-outages-even-in-multi-az</link>
		<comments>http://www.philchen.com/2012/10/22/amazon-web-services-outages-even-in-multi-az#comments</comments>
		<pubDate>Tue, 23 Oct 2012 04:47:13 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1087</guid>
		<description><![CDATA[This is reposted from a blog I wrote for Systems Watch Today Amazon Web Services experienced multiple degradations of service in one availability zone in Virginia region (us-east-1), which caused sites like Reddit, Netflix, and many more sites to lose service for several hours. Most posts and comments on the topic on Twitter or various [...]]]></description>
				<content:encoded><![CDATA[<p>This is reposted from a <a href="http://www.systemswatch.com/blog/2012/10/amazon-web-services-outages-even-in-multi-az/">blog</a> I wrote for <a href="http://www.systemswatch.com">Systems Watch</a></p>
<p>Today <a href="http://aws.amazon.com">Amazon Web Services</a> experienced multiple degradations of service in one availability zone in Virginia region (us-east-1), which caused sites like <a href="http://www.reddit.com">Reddit</a>, <a href="http://www.netflix.com">Netflix</a>, and many more sites to lose service for several hours.<span id="more-1087"></span> Most posts and comments on the topic on Twitter or various articles bash developers or systems folks for being architected in a single zone. We have spoken and experienced first hand that a lot of companies regardless of being architected in multi-availability zones have been affected by a so called AWS single zone issue.</p>
<p>How is this possible? One of the most common complaints is that the glue that holds Amazon Web Services together is their management API stack. Some use the literal programmatic API libraries, others maybe AWS Management Console, and some RightScale, however they all are layers built on the AWS API Platform and when that goes all bets are off.</p>
<p class="center"><strong>AWS API Errors and AWS Management Console Errors</strong></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2012/10/apierrors.png"><img src="http://www.philchen.com/wp-content/uploads/2012/10/apierrors-300x168.png" alt="" title="AWS Elevated API Errors" width="300" height="168" class="centered size-medium wp-image-135" /></a></p>
<p><a href="http://www.philchen.com/wp-content/uploads/2012/10/managementawserrors.png"><img src="http://www.philchen.com/wp-content/uploads/2012/10/managementawserrors-300x145.png" alt="" title="AWS Management Error Rates Increased" width="300" height="145" class="centered size-medium wp-image-142" /></a></p>
<p>The problem scenario occurs when you have an architected system across two or more AWS availability zones in Virginia (us-east), one of the biggest and oldest regions of AWS, and AWS has a outage in one zone specifically in that region.</p>
<p>The waterfall effect seems to happen, where the AWS API stack gets overwhelmed to the point of being useless for any management task in the region. Our guess is that either through AWS and client automated failover/scale up or due to the outage itself the API stack cannot handle the request load of all those affected, which leaves AWS users in the region unable to fail-over or increase resources to an unaffected zone.</p>
<p>Typically your organization cannot afford to have 100% capacity redundancy sitting idle all the time, it becomes a money issue. So if you have your resources in two zones with a 50/50 split, and you lose one zone 50% of your resources cannot handle 100% of the load causing degradation of the organizations services. To remedy this whether through automation or manual intervention you spin up the lost 50% of resources in a different unaffected zone to meet your demand.</p>
<p>This is where the problem often occurs when you can&#8217;t manage anything in AWS because their API&#8217;s are unavailable, you can&#8217;t spin up the lost 50% in an unaffected zone and are in big trouble and helpless. In a perfect world organizations are making so much money they have enough resources in one of the two zones to carry the entire load or better yet in multiple regions with mirrored capacity but most of the time this isn&#8217;t the case. This is often because management, not engineering, is willing to take the risk. So organizations feel that degradation is not a full outage and having 50% is better than 0% available resources. To the end user they are angry either way.</p>
<p>So as an AWS client when you lose all control to fail-over, scale up, or rebuild into a healthy zone and any redundancy you have is overwhelmed you have to wait hours for AWS to recover API service in order to gain any control and recover your resources.</p>
<p>This is our opinion of how an AWS outage can cause issues even when you&#8217;re in Multi-Availability Zones.</p>
<p><strong>Also a great resource for free Realtime AWS uptime data is <a href="http://www.systemswatch.com" target="_blank">Systems Watch</a></strong></p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/Q7dYqaQ4We8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2012/10/22/amazon-web-services-outages-even-in-multi-az/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2012/10/22/amazon-web-services-outages-even-in-multi-az</feedburner:origLink></item>
		<item>
		<title>How to create an Amazon Elastic Compute Cloud EC2 Machine Image (AMI) CentOS 6 S3 Backed or EBS Backed</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/5Alp9tBY3Ig/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed</link>
		<comments>http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed#comments</comments>
		<pubDate>Mon, 30 Apr 2012 22:51:43 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[DevOps]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=1002</guid>
		<description><![CDATA[This how to article will go over creating a Amazon Elastic Compute Cloud (EC2) Machine Image (AMI) S3 backed as well as EBS backed. In this particular example we are creating a Centos 6 64bit AMI from beginning to end. I wrote a blog about this topic in 2010 and decided to freshen it up [...]]]></description>
				<content:encoded><![CDATA[<p>This how to article will go over creating a Amazon Elastic Compute Cloud (EC2) Machine Image (AMI) S3 backed as well as EBS backed. In this particular example we are creating a Centos 6 64bit AMI from beginning to end. I wrote a <a href="http://www.philchen.com/2009/02/14/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami">blog</a> about this topic in 2010 and decided to freshen it up a bit with a CentOS 6 build.<br />
<span id="more-1002"></span><br />
First you will want to hop on a CentOS 6 box you have available so that all the yum commands will work below.</p>
<p>This first step is to setup your basic environment to start building.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> e2fsprogs ruby java-1.6.0-openjdk <span style="color: #c20cb9; font-weight: bold;">unzip</span> MAKEDEV
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> amikey.pem <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> amicert.pem <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS <span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM
&nbsp;
curl <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools.zip http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazonaws.com<span style="color: #000000; font-weight: bold;">/</span>ec2-downloads<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools.zip
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools.zip
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-api-tools-<span style="color: #000000; font-weight: bold;">*/*</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS
&nbsp;
curl <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-ami-tools.zip http:<span style="color: #000000; font-weight: bold;">//</span>s3.amazonaws.com<span style="color: #000000; font-weight: bold;">/</span>ec2-downloads<span style="color: #000000; font-weight: bold;">/</span>ec2-ami-tools.zip
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">unzip</span> ec2-ami-tools.zip
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ec2-ami-tools-<span style="color: #000000; font-weight: bold;">*/*</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS</pre></div></div>

<p>Save your X509 certificates in the following directories:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amikey.pem
<span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amicert.pem</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>root<span style="color: #000000; font-weight: bold;">/</span>.bashrc
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=\<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_PRIVATE_KEY</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amikey.pem
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EC2_CERT</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amicert.pem
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>usr
EOT
&nbsp;
<span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">RELEASE</span>=<span style="color: #000000;">6</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ARCH</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -i<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>This step is to create your disk image and filesystem and file structure.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img <span style="color: #007800;">bs</span>=1M <span style="color: #007800;">count</span>=<span style="color: #000000;">10240</span>
&nbsp;
mkfs.ext4 <span style="color: #660033;">-F</span> <span style="color: #660033;">-j</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> loop <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> proc etc dev sys var<span style="color: #000000; font-weight: bold;">/</span>cache var<span style="color: #000000; font-weight: bold;">/</span>log var<span style="color: #000000; font-weight: bold;">/</span>lock var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>rpm</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvde1    <span style="color: #000000; font-weight: bold;">/</span>        ext4        defaults,noatime,nodiratime    <span style="color: #000000;">1</span>    <span style="color: #000000;">1</span>
EOT</pre></div></div>

<p>This step is to create your Yum conf that you will use to install the base OS</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>base<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Base
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=os
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/os/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>updates<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Updates
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=updates
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/updates/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-CentOS-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>extras<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Extras
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=extras
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/extras/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>centosplus<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Plus
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=centosplus
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/centosplus/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">enabled</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-<span style="color: #007800;">$RELEASE</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>contrib<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #007800;">name</span>=CentOS-<span style="color: #007800;">$RELEASE</span> - Contrib
<span style="color: #007800;">mirrorlist</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirrorlist.centos.org<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">release</span>=<span style="color: #007800;">$RELEASE</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">arch</span>=<span style="color: #007800;">$ARCH</span><span style="color: #000000; font-weight: bold;">&amp;</span><span style="color: #007800;">repo</span>=contrib
<span style="color: #666666; font-style: italic;">#baseurl=http://mirror.centos.org/centos/$RELEASE/contrib/$ARCH/</span>
<span style="color: #007800;">gpgcheck</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">enabled</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">gpgkey</span>=http:<span style="color: #000000; font-weight: bold;">//</span>mirror.centos.org<span style="color: #000000; font-weight: bold;">/</span>centos<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY-<span style="color: #007800;">$RELEASE</span>
EOT</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf <span style="color: #660033;">--installroot</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #660033;">-y</span> groupinstall Base</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf <span style="color: #660033;">--installroot</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #660033;">-y</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openssh-server yum-plugin-fastestmirror.noarch e2fsprogs dhclient</pre></div></div>

<p>This step is to allow root login without password, since you will be using your key</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config
UseDNS no
PermitRootLogin without-password
EOT</pre></div></div>

<p>Create devices so we can use chroot for the image</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">MAKEDEV <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-x</span> console
&nbsp;
MAKEDEV <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-x</span> null
&nbsp;
MAKEDEV <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #660033;">-x</span> zero
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>pts <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>pts
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>proc <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>proc
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000; font-weight: bold;">/</span>sys <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>sys</pre></div></div>

<p>Create network settings</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network
<span style="color: #007800;">NETWORKING</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #007800;">HOSTNAME</span>=localhost.localdomain
EOT</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOT <span style="color: #000000; font-weight: bold;">&gt;/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network-scripts<span style="color: #000000; font-weight: bold;">/</span>ifcfg-eth0
<span style="color: #007800;">ONBOOT</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #007800;">DEVICE</span>=eth0
<span style="color: #007800;">BOOTPROTO</span>=dhcp
<span style="color: #007800;">NM_CONTROLLED</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
EOT</pre></div></div>

<p>Create grub.conf and boot settings so the Amazon Kernel Image can boot into the new Kernel</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;&lt;</span>EOL <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf
<span style="color: #007800;">default</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">timeout</span>=<span style="color: #000000;">0</span>
title CentOS<span style="color: #007800;">$RELEASE</span>
root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
kernel <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz ro <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvde1 rd_NO_PLYMOUTH <span style="color: #007800;">selinux</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">console</span>=hvc0 <span style="color: #007800;">loglvl</span>=all sync_console console_to_ring <span style="color: #007800;">earlyprintk</span>=xen nomodeset 
initrd <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs
EOL</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>menu.lst
&nbsp;
<span style="color: #007800;">kern</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlin<span style="color: #000000; font-weight: bold;">*|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">kernver</span>=<span style="color: #800000;">${kern#vmlinuz-}</span>
&nbsp;
<span style="color: #007800;">ird</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initramfs<span style="color: #000000; font-weight: bold;">*</span>.img<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> -F<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #ff0000;">'{print $NF}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-ie</span> <span style="color: #ff0000;">&quot;s/vmlinuz/<span style="color: #007800;">$kern</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-ie</span> <span style="color: #ff0000;">&quot;s/initramfs/<span style="color: #007800;">$ird</span>/&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.conf</pre></div></div>

<p>Create a script that grabs the public key credentials for your root login.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>getssh
&nbsp;
<span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 2345 95 20</span>
<span style="color: #666666; font-style: italic;"># description: getssh</span>
<span style="color: #666666; font-style: italic;"># processname: getssh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>sbin
<span style="color: #666666; font-style: italic;"># Source function library.</span>
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
&nbsp;
<span style="color: #666666; font-style: italic;"># Source networking configuration.</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> . <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysconfig<span style="color: #000000; font-weight: bold;">/</span>network
&nbsp;
<span style="color: #666666; font-style: italic;"># Check that networking is up.</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${NETWORKING}</span>&quot;</span> = <span style="color: #ff0000;">&quot;no&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
&nbsp;
start<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
          <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh
          <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># Fetch public key using HTTP</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #660033;">-f</span> http:<span style="color: #000000; font-weight: bold;">//</span>169.254.169.254<span style="color: #000000; font-weight: bold;">/</span>latest<span style="color: #000000; font-weight: bold;">/</span>meta-data<span style="color: #000000; font-weight: bold;">/</span>public-keys<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span>openssh-key <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>my-key
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
          <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>my-key <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
          <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
          <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>my-key
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;"># or fetch public key using the file in the ephemeral store:</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>openssh_id.pub <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
          <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>openssh_id.pub <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
          <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
stop<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Nothing to do here&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
restart<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  stop
  start
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># See how we were called.</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
  start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    start
    <span style="color: #000000; font-weight: bold;">;;</span>
  stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    stop
    <span style="color: #000000; font-weight: bold;">;;</span>
  restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    restart
    <span style="color: #000000; font-weight: bold;">;;</span>
  <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> $<span style="color: #ff0000;">&quot;Usage: $0 {start|stop}&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span>
<span style="color: #666666; font-style: italic;">###END OF SCRIPT</span></pre></div></div>

<p>Make your script init ready</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>getssh
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chroot</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">34</span> getssh on</pre></div></div>

<p>Clean up after yourself</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2YUM<span style="color: #000000; font-weight: bold;">/</span>yum-ami.conf <span style="color: #660033;">--installroot</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image <span style="color: #660033;">-y</span> clean packages
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.bash_history
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>yum
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ec2-image<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>yum</pre></div></div>

<p>Check for what Amazon AKI&#8217;s are available you will need this info when starting your ec2 instance</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-describe-images <span style="color: #660033;">-H</span> <span style="color: #660033;">--region</span> us-east-<span style="color: #000000;">1</span> <span style="color: #660033;">-x</span> all<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;pv-grub-hd0&quot;</span></pre></div></div>

<p>Bundle your new image</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-bundle-image <span style="color: #660033;">--image</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.img <span style="color: #660033;">--prefix</span> ami-CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base <span style="color: #660033;">--cert</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amicert.pem <span style="color: #660033;">--privatekey</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ec2<span style="color: #000000; font-weight: bold;">/</span>amikey.pem <span style="color: #660033;">--user</span> awsaccountnumber <span style="color: #660033;">--destination</span> <span style="color: #000000; font-weight: bold;">/</span>data <span style="color: #660033;">--arch</span> <span style="color: #007800;">$ARCH</span></pre></div></div>

<p>Upload your new image</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>EC2TOOLS<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ec2-upload-bundle <span style="color: #660033;">--manifest</span> <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>ami-CentOS<span style="color: #007800;">$RELEASE</span>-<span style="color: #007800;">$ARCH</span>-base.manifest.xml <span style="color: #660033;">--bucket</span> yourbucket <span style="color: #660033;">--access-key</span> accesskeyhere <span style="color: #660033;">--secret-key</span> secretkeyhere</pre></div></div>

<p>Register your image</p>
<p>I recommend you do this via the Amazon Web Services Management console, under IMAGES->AMIs &#8220;Register New AMI&#8221; you will just need to enter bucketname/manifest.xml file for your new AMI.</p>
<p><strong>Steps to create a EBS Backed AMI from your S3 Backed Instance. *Only if you want an EBS Backed AMI do these steps<br />
</strong><br />
<strong>Step 1</strong></p>
<p>Start your newly created EC2 instance</p>
<p><strong>Step 2</strong></p>
<p>Go into the Amazon Web Services Management console and create a Volume at whatever size you choose</p>
<p><strong>Step 3</strong></p>
<p>Attach your Volume to your new running EC2 Instance</p>
<p><strong>Step 4</strong></p>
<p>Login to your new instance</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-i</span> yourkey root<span style="color: #000000; font-weight: bold;">@</span>yournewinstance</pre></div></div>

<p><strong>Step 5</strong></p>
<p>Create your filesystem type in this case EXT4 then make a directory and mount it to the newly formated filesystem. After that we rsync the root of your ec2 instance, then unmount.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkfs.ext4 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvdj
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>xvdj <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs
rsync <span style="color: #660033;">-avHx</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs
rsync <span style="color: #660033;">-avHx</span> <span style="color: #000000; font-weight: bold;">/</span>dev <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs
<span style="color: #c20cb9; font-weight: bold;">sync</span>;<span style="color: #c20cb9; font-weight: bold;">sync</span>;<span style="color: #c20cb9; font-weight: bold;">sync</span>;<span style="color: #c20cb9; font-weight: bold;">sync</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>ebs</pre></div></div>

<p><strong>Step 6</strong></p>
<p>Go into the Amazon Web Services Management Console section Volumes and detach the Volume</p>
<p><strong>Step 7</strong></p>
<p>Go into the Amazon Web Services Management Console section Volumes and create a Snapshot of your Volume</p>
<p><strong>Step 8</strong></p>
<p>Go into the Amazon Web Services Management Console section Snapshots and select your new Snapshot and choose &#8220;create image&#8221; Fill in the name and description and the AWS AKI you chose in my case for us-east-1 I chose aki-08ed0761 for x86_64 bit hd0</p>
<p><strong>Step 9</strong></p>
<p>Start your new EBS backed AMI</p>
<p><strong>Also a great resource for free Realtime AWS uptime data is <a href="http://www.systemswatch.com" target="_blank">Systems Watch</a></strong></p>
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/5Alp9tBY3Ig" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2012/04/30/how-to-create-an-amazon-elastic-compute-cloud-ec2-machine-image-ami-centos-6-s3-backed-or-ebs-backed</feedburner:origLink></item>
		<item>
		<title>2011 No Regrets, An Awesome Year!</title>
		<link>http://feedproxy.google.com/~r/phil_chen/~3/V9LvHrGHr5E/2011-no-regrets-an-awesome-year</link>
		<comments>http://www.philchen.com/2012/01/21/2011-no-regrets-an-awesome-year#comments</comments>
		<pubDate>Sun, 22 Jan 2012 05:12:29 +0000</pubDate>
		<dc:creator>Phil Chen</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.philchen.com/?p=875</guid>
		<description><![CDATA[At the beginning of 2011 I had one goal for the year, and that was to live it to the fullest, with no regrets. With the year behind me I am happy to say it has been a great success! All the important elements in my life, family, friends, health, self improvement, career, and community [...]]]></description>
				<content:encoded><![CDATA[<p>At the beginning of 2011 I had one goal for the year, and that was to live it to the fullest, with no regrets. With the year behind me I am happy to say it has been a great success! All the important elements in my life, family, friends, health, self improvement, career, and community moved forward in 2011 in very positive ways.<br />
<span id="more-875"></span><br />
<strong>Family</strong></p>
<p>On May 29th I popped the question on my long time partner in crime Julia Holland and asked her to Marry me, at Pacifica Del Mar and with a small pause due to shock (very cute) she said Yes! This is the biggest thing to happen in my life, and I am looking forward to the future. Julia and I have had a great time experiencing what its like to be engaged. Below are two pictures one of Julia showing off her engagement ring and the other at our engagement party with both our families:</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/5777713204_9fb0baa41d.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/5777713204_9fb0baa41d-300x224.jpg" alt="" title="Proposal" width="300" height="224" class="alignleft size-medium wp-image-878" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6095829952_a1ea2fe55b_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6095829952_a1ea2fe55b_z-300x225.jpg" alt="" title="Engagement Party" width="300" height="225" class="alignleft size-medium wp-image-898" /></a></p>
<hr />
<p>Also on Oct 1 I was honored to be the best man at my brother Eric and his new wife Janine&#8217;s wedding in San Francisco. I am very happy to see him enter a new journey in his life of happiness and excitement. I guess my brother and I are finally growing up a bit, and its nice to see the two of us lucky enough to find people to share our lives with. Below are some pictures from the Wedding:</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/6346815670_6bfde876f3.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6346815670_6bfde876f3-199x300.jpg" alt="" title="Eric and Janine Wedding" width="199" height="300" class="alignleft size-medium wp-image-881" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6229858972_f4e8aef373_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6229858972_f4e8aef373_z-300x225.jpg" alt="" title="Julia and I at Brothers Wedding" width="300" height="225" class="alignleft size-medium wp-image-916" /></a></p>
<hr />
<p><strong>Friends</strong></p>
<p>2011 also has been a year of reconnecting with old life long friends and making new friends. Having a chance to hang out with people you have known since 2nd grade is always an amazing thing. My buddies Jeff and Xan don&#8217;t ever seem to change! Also I got to see my good friend Christie, bringing back old days working in Hermosa Beach.</p>
<p>As for new friends I have managed to meet some great new people after joining <a href="http://laboxing.com/carlsbad/" target="_blank">Carlsbad LA Boxing</a> gym which I will talk about later in this post. As I get older I find trying new things is the perfect way to meet new people and make new friends.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/277738_10150386636968902_623803901_10278386_350617_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/277738_10150386636968902_623803901_10278386_350617_o-300x225.jpg" alt="" title="Jeff Xan and I" width="300" height="225" class="alignleft size-medium wp-image-886" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6091417835_4d56dddbdf_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6091417835_4d56dddbdf_z-224x300.jpg" alt="" title="Christie and Che" width="224" height="300" class="alignleft size-medium wp-image-922" /></a></p>
<hr />
<p><strong>Health</strong></p>
<p>I would have to say 2011 has been the healthiest year I can remember for me. Both in watching what I eat and exercising a lot! The biggest change has been adding both Muay Thai Boxing and Yoga to my already crazy running training.</p>
<p>One of my goals I achieved was to earn the Triple Crown status, basically running 3 San Diego Half Marathons, Carlsbad Half, La Jolla Half, and the AFC Half in one year. In 2011 I had 464 Training Miles of running the most in a single year I believe I have ever run, quite the accomplishment for me, and getting the Triple Crown was pretty awesome.</p>
<p>The biggest change for me was joining <a href="http://laboxing.com/carlsbad/" target="_blank">Carlsbad LA Boxing</a>, already in fairly good shape from all the running or so I thought. My first Cardio class almost brought me to the brink of puking. But 1 Year later I am happy to say I have graduated from just taking the Cardio classes to taking the Advanced Muay Thai classes as well and sparring a slew of fighters, and making some great friends. I went from weighing 155-160 lbs to now weighing 141-145 lbs and increasing my muscle strength and running speed by a huge amount, while having a blast. Special thanks to the <a href="http://laboxing.com/carlsbad/" target="_blank">Carlsbad LA Boxing Staff and new friends</a> Samantha Schmitt, Adam Griffis, Alan Roach, Tony Burnett, and Owners Jeff Nason, Richard Montano. Here are some <a href="http://www.youtube.com/playlist?list=PL15E73DEC5BBB4DE4&#038;feature=plcp" target="_blank">videos</a> of me sparring, and slowly getting better.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/6075663538_c3a46ec0c8_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6075663538_c3a46ec0c8_z-300x225.jpg" alt="" title="Triple Crown" width="300" height="225" class="alignleft size-medium wp-image-928" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/6617889645_72b7525dbd_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/6617889645_72b7525dbd_z-225x300.jpg" alt="" title="Carlsbad LA Boxing" width="225" height="300" class="alignleft size-medium wp-image-930" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/254712_259540937408615_100000581328030_968021_1258687_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/254712_259540937408615_100000581328030_968021_1258687_n-300x205.jpg" alt="" title="Sam First Amateur Muay Thai Fight" width="300" height="205" class="alignleft size-medium wp-image-931" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/298602_1736173983169_1803204923_1110709_1264443_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/298602_1736173983169_1803204923_1110709_1264443_n-284x300.jpg" alt="" title="Adam" width="284" height="300" class="alignleft size-medium wp-image-934" /></a></p>
<hr />
<p><strong>Career</strong></p>
<p>Work is always something that is often regarded as a have to, versus a want to do, but I am lucky enough to do something I love to do, which basically makes me a happy camper.</p>
<p>As a Systems Engineering Architect and Entrepreneur 2011 has brought great things such architecting the cloud computing systems infrastructure for a new Private Video Sharing Service <a href="http://www.givit.com" target="_blank">GIVIT</a> to re-inventing <a href="http://www.systemswatch.com" target="_blank">Systems Watch</a> into a source for cloud computing realtime monitoring and a cross vendor cloud health gauge. Also with Julia leading the development effort we are very close to launching <a href="http://www.mygraphs.com" target="_blank">mygraphs</a> a data visualization and graphing resource for anyone to use. As I have experienced in the past loving what you do definitely ends up showing in the product or service you develop.</p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/220131_10150275984393902_623803901_9305255_7279561_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/220131_10150275984393902_623803901_9305255_7279561_o-300x225.jpg" alt="" title="Pre Meeting" width="300" height="225" class="alignleft size-medium wp-image-971" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/218293_10150275970373902_623803901_9305114_3563321_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/218293_10150275970373902_623803901_9305114_3563321_o-300x225.jpg" alt="" title="Data Center" width="300" height="225" class="alignleft size-medium wp-image-968" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/5412579822_344dd155b8_z.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/5412579822_344dd155b8_z-300x168.jpg" alt="" title="Me" width="300" height="168" class="alignleft size-medium wp-image-972" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/300158_10150506261408902_623803901_11246946_432507572_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/300158_10150506261408902_623803901_11246946_432507572_n-300x222.jpg" alt="" title="Work" width="300" height="222" class="alignleft size-medium wp-image-970" /></a></p>
<hr />
<p><strong>Community</strong></p>
<p>Every year I help raise money for various organizations to help research and fight disease, support animals, protect state and national parks, and more. But 2011 definitely was a year I am proud of for raising money for the <a href="http://www.nationalmssociety.org/index.aspx" target="_blank">National Multiple Sclerosis Society</a>. With the generous donations from good hearted people I was able to raise $1605.00 for the Walk MS event in Carlsbad, and make the 100 top donors list joining the 100 club. Here is a <a href="http://vimeo.com/35444775" target="_blank">video</a> of the event. Giving back to the community I think is very important and I hope I can have the means to continue doing so for years to come.</p>
<p>Also in 2011 Julia and I became <a href="http://www.sdsualumni.org/" target="_blank">SDSU Lifetime Alumni</a>, having both graduated <a href="http://www.sdsu.edu" target="_blank">San Diego State University</a> we felt joining the Alumni Association and giving back to the school that helped shape us as individuals was important.</p>
<p><strong>New Things</strong></p>
<p>Possibly the largest purchase of the year was buying a new 2011 SMART Car. So first off yes its safe with 8 air bags a Tritium Roll Cage that can withstand a 65 mile per hour crash protecting you from being crushed, and yes its fast enough for the HWY I have taken it to 90 mph and it has a performance paddle shifter mode. Best of all you can park it anywhere, the turning radius is ridiculous, it gets 44 mpg and is fun as hell to drive. For those that know me and my 65 Mustang it still my baby and I still drive it a lot <img src='http://www.philchen.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/219848_10150307502638902_623803901_9586943_3566790_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/219848_10150307502638902_623803901_9586943_3566790_o-300x224.jpg" alt="" title="2011 SMART Car" width="300" height="224" class="alignleft size-medium wp-image-956" /></a><a href="http://www.philchen.com/wp-content/uploads/2012/01/220636_10150307648118902_623803901_9587961_6779928_o.jpg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/220636_10150307648118902_623803901_9587961_6779928_o-300x224.jpg" alt="" title="2011 SMART Car Interior" width="300" height="224" class="alignleft size-medium wp-image-957" /></a> </p>
<hr />
<p><strong>In Conclusion</strong></p>
<p>I am happy the way 2011 went but I am even more excited for 2012. I hope to have an even longer blog next year! To conclude my 2011 end of year blog here is where you can see 365 pictures of 2011, a picture everyday. <a href="http://www.flickr.com/photos/nethacker/sets/72157625788887382/" target="_blank">365 Daily Photos of 2011</a></p>
<hr />
<a href="http://www.philchen.com/wp-content/uploads/2012/01/379112_10150713170593902_623803901_12105232_1886250673_n.jpeg"><img src="http://www.philchen.com/wp-content/uploads/2012/01/379112_10150713170593902_623803901_12105232_1886250673_n-300x224.jpg" alt="" title="379112_10150713170593902_623803901_12105232_1886250673_n" width="300" height="224" class="aligncenter size-medium wp-image-969" /></a></p>
<hr />
<img src="http://feeds.feedburner.com/~r/phil_chen/~4/V9LvHrGHr5E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.philchen.com/2012/01/21/2011-no-regrets-an-awesome-year/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.philchen.com/2012/01/21/2011-no-regrets-an-awesome-year</feedburner:origLink></item>
	</channel>
</rss>
