<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andrew WC Brown on Medium]]></title>
        <description><![CDATA[Stories by Andrew WC Brown on Medium]]></description>
        <link>https://medium.com/@andrewbrown_78670?source=rss-843351933723------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sprERmhMTcVXxeYxM7lF1g.png</url>
            <title>Stories by Andrew WC Brown on Medium</title>
            <link>https://medium.com/@andrewbrown_78670?source=rss-843351933723------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:23:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andrewbrown_78670/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cloud9 the almost perfect IDE that solves configuration hell for development environments]]></title>
            <link>https://medium.com/exampro/cloud9-the-almost-perfect-ide-that-solves-configuration-hell-for-development-environments-455c0596c593?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/455c0596c593</guid>
            <category><![CDATA[cloud9]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Sun, 25 Nov 2018 16:35:11 GMT</pubDate>
            <atom:updated>2018-11-25T16:41:02.796Z</atom:updated>
            <content:encoded><![CDATA[<p>The idea of using an in-browser IDE sounds gross and using in-browser IDE’s of the past I had this bad-taste in my mouth. I just expect latency, clunky or limited keybindings but I thought it was worth seeing if the technology has improved and I think I can make a home in Cloud9.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hvnQy_6SpaRr8wU-uqvAlQ.png" /></figure><p>I’m a VIM user with powerful plugins and it may sound strange that I would turn the dial from 11 down to 8 on my own productivity just to have an IDE in the cloud but you need to understand the synergies gained even if it means you can’t crank code at neck-brake speeds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNRWSi8s-p9sliLYmSGuTA.png" /></figure><h3>Cloud9 is attached to a running Environment</h3><p>Cloud9 will create by default a EC2 instance with Amazon Linux 1 which comes preloaded with a bunch of programming environments to reduce configuration. Since its an EC2 instance you can backup that instance when needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*Kf-C8Tx20G_dUNKsssZAbA.png" /></figure><h3>Cloud9 only Runs When In Use Saving You $$$</h3><p>You only pay for the environment that is attached to Cloud9. If you choose to create instead of attach an existing EC2 instance to Cloud9 it comes with cost-saving capabilities where it only runs the server while you’re using it. So you can be paying 5–10 USD for your work environment per month and if you’re on Free Tier you can run t2.micro instance and have a free development environment for months.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*Gn46wB8v1gu9kU23dVYjvg.png" /></figure><h3>Cloud9 is real-time collaborative like a Google Doc</h3><p>You can have as many people as you like sitting in the same Cloud9 IDE, see their cursor in any file and share terminal windows. You can give people read or write access.</p><h3>Scenarios of Use</h3><p>You can use Cloud9 to teach a class of 20 people and have them look in the codebase or grant each person write access to take turns coding.</p><p>You can conduct remote pair programming interviews on your codebase and mitigate security risks about sharing code so early on with an new interviewee</p><p>You can spin up new environments in minutes so the “broken configuration / broken computer” excuse never happens or when you have 5 new interns you have 5 new environments</p><p>If you’re hiring contract programmers you don’t have to waste time and money with the them figuring out how to setup your environment.</p><p>You don’t need a beast of computer and as long as you have an internet connection you can develop from anywhere increasing mobility and availability.</p><p>Since you can attach any instance you like to Cloud9 you can get your development environment to be similar to your production environment</p><h3>What’s not great about Cloud9</h3><p>Cloud9 is good but still has some warts and this comes in regards to custom environments and automating the setup of environments.</p><h4>Limited CloudFormation Configuration</h4><p>The first thing that comes to mind is I would want to automate the setup of these new Cloud9 environments using CloudFormation. Currently CloudFormation customization is limited to only being able to create the default EC2 instance with Amazon Linux 2.</p><pre>Type: AWS::Cloud9::EnvironmentEC2<br>Properties:<br>  Repositories: <br>    - Repository<br>  OwnerArn: String<br>  Description: String<br>  AutomaticStopTimeMinutes: Integer<br>  InstanceType: String<br>  Name: String<br>  SubnetId: String</pre><p>I would think or hope that this when !Ref this resource it return the EC2 instance so you could then configure this Amazon Linux 1 but I don’t this for certain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*Kga3koy3QWzSd_ZydwGA4g.png" /><figcaption>This is what !Ref would return</figcaption></figure><p>Only having Amazon Linux 1 doesn’t work for my already existing stack because we are using Postgres 10 and because of systemd or lack their of its very hard or impossible to install Postgres 10 which means I need to use Amazon Linux 2 or downgrade by Postgres version.</p><p>Its frustrating having spent weeks configuring Amazon Linux 2 for Rails 5 and Postgres 10 and to have to roll back postgres versions and change my entire cfn-init configuration.</p><h4>Custom Environments are a Pain</h4><p>Lets say you need to use something other than Amazon Linux 2. You can connect a pre-existing EC2 instance by adding the SSH public key to your EC2 instance that is generated by your Cloud9 ENV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*66UYG-4Fhg8dbG8j_1_XEQ.png" /></figure><p>This now leads to questions such as:</p><ul><li>Why doesn’t Cloud9 integrate with EC2 key pairs?</li><li>How do I restrict access to my EC2 instance only to Cloud9? Since I don’t want to open SSH port to everyone</li><li>Does Cloud9 have a public IP and if so is it static or does it have a DNS? I suppose I could see what address attempts to connect to the EC2 instance and assume I should whitelist that address.</li></ul><p>So now I have to run the CloudFormation template. Create the Cloud9 environment, and then create and run a System Manager Run Command to add the Public SSH Key.</p><p>Also if I want the cost-saving features I have to code that into the environment myself.</p><h3>How do we fix Cloud9?</h3><p>I hope the Cloud9 department at Amazon Web Services is reading this because here are the fixes to makes Cloud9 amazing:</p><ul><li>Be able to choose AMI beyond Amazon Linux 1</li><li>Integrate with EC2 Key Pairs</li><li>Via CloudFormation create an unattached Cloud9 Environment</li><li>Via CloudFormation attach to an existing EC2 instance</li><li>Create a default SSM Run Command to install Key Pair and/or Auto-hibernate for custom servers</li></ul><p>I think the only thing that they couldn’t fix is having Cloud9 have a static IP since we have to pay for ElasticIP and we get so few of them I can’t see them handing out Static IPs for every Cloud9 environment spun up.</p><h3>How do we make Cloud9 work now?</h3><p>You need to make it work with the default Amazon Linux 1 and you might not be able to use the latest and greatest packages. This is hard since most web-development companies have a hard time staying vanilla but here’s me trying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=455c0596c593" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/cloud9-the-almost-perfect-ide-that-solves-configuration-hell-for-development-environments-455c0596c593">Cloud9 the almost perfect IDE that solves configuration hell for development environments</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create AWS Cross-Accounts to Easily Switch Between Roles]]></title>
            <link>https://medium.com/@andrewbrown_78670/how-to-create-aws-cross-accounts-to-easily-switch-between-roles-8936499f5fe?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/8936499f5fe</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[roles]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Tue, 20 Nov 2018 17:20:11 GMT</pubDate>
            <atom:updated>2018-11-20T17:20:11.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*O-vWYth_xQnvIPD-ItQnxg.png" /></figure><p>I manage several AWS account and switching in and out of each account is tedious since my Password Manager (Dashlane) is not great with the AWS sub-account login page. Here I’ll show you how to setup Cross-Accounts so you can quickly toggle between accounts without having to log out.</p><h3><strong>Visualize Cross Accounts</strong></h3><p>So I have two AWS accounts, <strong>Monsterbox</strong> and <strong>ExamPro</strong>. I want to allow my Monsterbox account to quickly switch over to my ExamPro account. So we’re going to create a new user in the ExamPro account called <strong>monsterandrew</strong> and link it back to my <strong>andrewbrown</strong> user in the Monsterbox account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*QdOcg9G6nsE9xKqSnq0X2Q.png" /></figure><h3>Get the Account ID for the Source Account</h3><p>First we are going to need to get the Account ID for the Source Account which you can find under <strong>My Account </strong>and your Account Settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*o_mwYvMVwZX_fH2gBHHwOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*UXHLFmN90Tnlo04voUxusg.png" /><figcaption>Its not my real account number and my password is much longer than 5 characters</figcaption></figure><p>Save that somewhere as we’ll need to use it later.</p><h3>Create New Role in Target Account</h3><p>In the ExamPro account I’m going to create a new role under IAM for the cross-account and grant them PowerUser access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*2dzJrGeP35qSdrKll0hz1w.png" /></figure><p>Here you see that Account ID that’s required</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*F1g8hpOL48m0AcsNz02FNQ.png" /></figure><p>And then add <strong>PowerUserAccess</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*kUIcds5yYl4Es15VsTkB3w.png" /></figure><p>I didn’t bother with tags</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*E_A6BWLseBP8TzTPCp1F6g.png" /></figure><p>I always name my custom roles snake-case to make it easier to identify them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*ZSGSZtxdHEpSfToj5fe-lA.png" /></figure><h3>Grab the Role ARN</h3><p>With our new cross-account role created find it your roles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Lf1eGeOBWltExlYjt6W6Ig.png" /></figure><p>and lets copy the Role ARN for our next step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vY6jIxVKsK7uMkeYatiy9g.png" /></figure><h3>Create New Policy in Source Account</h3><p>In the Monsterbox account we need to create a new policy that will allow the andrewbrown account assume the role created in the ExamPro account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*3OV-XXJ0tKzq3A_mnH4gfQ.png" /></figure><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [{<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Action&quot;: [&quot;sts:AssumeRole&quot;],<br>    &quot;Resource&quot;: &quot;arn:aws:iam::TARGET_ACCOUNT_ID:role/cross-account-power-user-role&quot;<br>  }]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oyp-dB5j4s78JF3EC0ajuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HLUAxfnlD_j8UR7mBE9EwA.png" /></figure><h3>In Source Account Assign New Policy</h3><p>Still in our Monsterbox account we are going to apply to our user <strong>andrewbrown </strong>the policy we just created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3_4_RWhrDtjJUhNMXA4yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*VoNWb7Yrsc5I1T2T6sp4wQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*2MG3uiM47tJy1kG53m6u9w.png" /></figure><h3>Enable Switch Roles</h3><p>Logged into the andrewbrown user from the Monsterbox account I’m going to Switch Role for the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*oyF1wiF-Xzel5jMLhglrcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*ZpuQDr1dvQ8OhOoARkB32A.png" /></figure><h3>Voila!</h3><p>Now you can switch between roles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*-4omUDydthcWPyaZE11jIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*1ZosmvqwgOTtYfdNOvdtrA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8936499f5fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Locally Run Amazon Linux 2 for Ruby on Rails Development]]></title>
            <link>https://medium.com/exampro/locally-run-amazon-linux-2-for-ruby-on-rails-development-4c2f5a22c48e?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c2f5a22c48e</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[virtualbox]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Sun, 14 Oct 2018 20:24:25 GMT</pubDate>
            <atom:updated>2018-10-14T21:45:39.828Z</atom:updated>
            <content:encoded><![CDATA[<h3>Motivation</h3><p>I want to make it easy for other people I collaborate to be up and running with a Ruby on Rails app without having to provision their own machine. Since I’m using an EC2 instance running on Amazon Linux 2, I want to approximate that experience the best I can by downloading and using that virtual image.</p><p>Vagrant and Docker are interesting choices, though I want to be as close to as AWS for knowledge transfer if anyone has to work on the architecture such as updating the user-data that setups on the instance.</p><p>I’ve been using Docker and Vagrant for years and they create lots of friction for small teams without the sunken knowledge, so I think just passing along a VM image that is 1GB in size and it will take up another 1GB in virtual disk space is acceptable. All you need is VirtualBox and you’re ready to go.</p><h3>Considerations</h3><p>This image will be running:</p><ul><li>Ruby on Rails app</li><li>Postgres for database</li><li>Redis for Sidekiq</li></ul><p>In production I use RDS for my database and Elasticache for Redis so its not 1-to-1 the same but this is “good enough” for our use-case to provide the least amount of developer friction.</p><h3>Getting Started</h3><p>To keep things organized I’m going to create a VirtualImages directory in my user’s home directory and place all files in there.</p><pre>mkdir ~/VirtualImages</pre><h3>Install VirtualBox</h3><p>If you have yet to do so already go and install VirtualBox</p><p><a href="https://www.virtualbox.org/wiki/Downloads">https://www.virtualbox.org/wiki/Downloads</a></p><h3><strong>Download the VDI</strong></h3><p>Then we’ll download Amazon Linux 2 VDI file and I’m going to place it in my <strong>VirtualImages</strong> directory.</p><p><a href="https://cdn.amazonlinux.com/os-images/2.0.20180810/virtualbox/">https://cdn.amazonlinux.com/os-images/2.0.20180810/virtualbox/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*xs20OvyCIDEAic1q7JcW4w.png" /></figure><h3>Create boot.iso</h3><p>We need to create a directory called <strong>seedconfig </strong>and within that file we need to create two files called <strong>user-data</strong> and <strong>meta-data</strong>. These will be yaml files though its important you omit the extension.</p><h4>Create the User and Meta Data</h4><p>user-data</p><pre>#cloud-config<br>#vim:syntax=yaml<br>users:<br>  - default<br>chpasswd:<br>  list: |<br>    ec2-user:password</pre><p>meta-data</p><pre>local-hostname: amazonlinux.onprem<br># eth0 is the default network interface enabled in the image. You can configure static network settings with an entry like the following.<br>network-interfaces: |<br>  auto eth0<br>  iface eth0 inet dhcp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*BESUM0zHL7E4IWM1tiT-ew.png" /><figcaption>remember to omit the extensions or you’ll have a bad time.</figcaption></figure><h4>Validate the YAML Files</h4><p>Before we create our boot image lets make sure that our yaml files are valid because if they are not then the user and meta data will not be loaded.</p><p>You can paste the contents of the yaml files into <a href="http://www.yamllint.com/">http://www.yamllint.com/</a> to verify there are no issues with the format of these files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*7ljzSrfAlhYtJbPowlvQGQ.png" /></figure><h4>Create the ISO File</h4><p>Then from the directory <strong>one above</strong> seedconfig directory we’ll run this command in terminal to create the <strong>seed.iso</strong></p><pre>hdiutil makehybrid -o seed.iso -hfs -joliet -iso -default-volume-name cidata seedconfig/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*POzyd-S_8O8Vax_yC72sQQ.png" /><figcaption>There’s an error but I just ignore it since it doesn’t matter.</figcaption></figure><h3>Create and Configure the VM</h3><p>We want to create a <strong>NEW </strong>VM in Virtualbox. You can name the box whatever you wish and leave the default settings. I chose the type as <strong>Linux</strong> and version as <strong>Other Linux (64 bit)</strong>. Then for the hard disk we’ll attach the VDI image.</p><p>You’ll notice it says 25GB, it won’t take up this much space on your hard drive but it should take up 1GB a virtual disk space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*uQ4l-61Nf1XlnvpSVrRdWg.png" /></figure><p>Once we create our box we don’t want to launch it just yet because we need to attach the seed.iso to the optical disk drive so it uses it on boot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*jtO3_2VguGpPtcJkbv4zJg.png" /><figcaption>right click on your box to get to settings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAYPMYxItbJWn0Q5LRGSww.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*wkDJJo3-Qb34gDW3cf3e5w.png" /></figure><p>Also just make sure the optical driver is above the hard drive since we want it to boot the seed.iso first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*QOyzRGbuZNMYbygf8OYHMw.png" /></figure><h4>Port Forwarding</h4><p>Under network we’ll leave the Host and Guest IP blank so they are inferred and forward our host to guest ports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*APBXkxnelNVnfzMNsrgXjw.png" /></figure><h3>SSH into Guest</h3><p>From your local machine SSH with <strong>ec2-user </strong>on port <strong>2222 </strong>and<strong> </strong>when prompted fill in the password, which I have set as <strong>password</strong></p><pre>ssh ec2-user@localhost -p 2222</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*M5X5wqMXbKxOwQucvFy1tg.png" /></figure><h3>Manually Provision Rails</h3><p>Here is the provisioning script I spent tirelessly with AWS Support to craft for Amazon Linux 2. I would suggest running each uncommented line 1 by 1. If these appears very manual don’t fret because we’re going to include this in our user-data file.</p><pre>#!/usr/bin/env bash<br># To run Rails 5 we want the latest ruby version<br># so we need to use amazon linux extras<br><strong>sudo amazon-linux-extras install -y ruby2.4</strong><br># ruby-devel           - needed to compile ruby gem<br># xml2, xstl and patch - is for nokogiri<br># redhat-rpm-config    - in order to install native extensions with gems<br># sqlite-devel         - default database thats configured with Rails<br><strong>sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel patch redhat-rpm-config sqlite-devel</strong><br># Extra Packages for Enterprise Linux (EPEL) <br><strong>sudo yum install -y </strong><a href="https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"><strong>https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm</strong></a><br><strong>sudo yum-config-manager --enable epel</strong><br># Rails required a Javascript Runtime because of of execjs<br># Not in Amazon&#39;s repo so using epel to install<br># <a href="https://github.com/rails/execjs">https://github.com/rails/execjs</a><br><strong>sudo yum install -y nodejs npm --enablerepo=epel</strong><br># For some reason rdoc wasn&#39;t automatically installed <br># and fails the first time but not the second so weird workaround<br><strong>gem install rdoc<br>gem install rdoc</strong><br># Required to use Rails, installs all gems in a Rails project<br><strong>gem install bundler</strong><br># Install Rails<br><strong>gem install rails</strong><br><strong>rails new example</strong><br># !!! You may have to add to your Gemfile Big Decimal<br><strong>echo &quot;gem &#39;bigdecimal&quot; &gt;&gt; /home/ec2-user/example/Gemfile</strong><br><strong>cd example</strong><br><strong>bundle install</strong></pre><h3>Start Rails and View Example Page</h3><p>Once you get through all that you can now start the rails server.</p><pre>rails s</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*DH4SEqYOm0weJkGv4NNzEQ.png" /></figure><p>From our web-brower we should be able to access the server running in the Guest OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*-rXJjq1bqojRnOWM680Ong.png" /></figure><p>If we’re happy with our setup we could snapshot the state of our VM and call it a day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*9Li8Rbia9XSaBmAntkOIXw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c2f5a22c48e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/locally-run-amazon-linux-2-for-ruby-on-rails-development-4c2f5a22c48e">Locally Run Amazon Linux 2 for Ruby on Rails Development</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Setup and SSH into Alpine Linux Virtual Box]]></title>
            <link>https://medium.com/exampro/how-to-setup-and-ssh-into-alpine-linux-virtual-box-51be296ff710?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/51be296ff710</guid>
            <category><![CDATA[virtualbox]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Sun, 14 Oct 2018 20:23:24 GMT</pubDate>
            <atom:updated>2018-10-14T20:23:24.589Z</atom:updated>
            <content:encoded><![CDATA[<h3>Motivation</h3><p>I want a lightweight virtual image that I can share with developers to get them up and running.</p><ul><li>I want things to be dead simple.</li><li>I want to provide the smallest possible download</li><li>I want them to be developer ready in less than 10 mins.</li></ul><p>So we’re going to use Alpine due to its small size. We’re going to use VirtualBox instead of use Docker or Vagrant to keep thing simple, and we’re going to make a snapshot so we can then pass that along to developers.</p><h3>Install VirtualBox</h3><h3>Setup Virtual Image</h3><p>Download <a href="https://alpinelinux.org/downloads/">Alpine Linux Virtual x86_64</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*KQozL2SG9R16vvhxbPD0ZQ.png" /></figure><p>Create a new Virtual Guest and name it whatever you like and proceed to create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*vup3q2tUZ4y78gL3sB6MeA.png" /></figure><p>Create the Virtual Hard Disk, I’ve reduced the file size to 1GB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*kA3vn4MKlopK9ZtuIdqkjQ.png" /></figure><p>Proceed to settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*NNtPg_OHV9NdvHumwM0GFA.png" /></figure><p>and Attach the Alpine ISO to the Optical Driver</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*pn8PdCrLrLI0mtcaW6okSA.png" /></figure><p>Enable Port Forwarding and we’ll forward ports so we can ssh into our server as well as access our web-application from a web browser. Least the Host and Guest IP blank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*rRd01m2MWPNacdgFARqqAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*PQ3J3Z_Dfv4qgWkzKz9Dsg.png" /></figure><p>Launch the instance and to login just type <strong>root</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*iraFiHvLPEynHe1aEFHSZQ.png" /></figure><p>Install ssh</p><pre>apk add openssh<br>rc-update add sshd<br>rc-status<br>/etc/init.d/sshd start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*VYlEkg9uUq2fpBUg_C8NHA.png" /></figure><p>configure ssh</p><pre>vi /etc/ssh/sshd_config</pre><ul><li>Type<strong> /PermitEmpty </strong>and Press <strong>Enter</strong></li><li>Type <strong>/no </strong>and Press Enter</li><li>Type cw (change word)</li><li>Type yes</li><li>Press ESC</li><li>Type <strong>:wq</strong> to save and quit</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*QdGxS87orU6FBDwEByt5dQ.png" /></figure><pre>/etc/init.d/sshd restart</pre><p>configure networking</p><pre>auto eth0  <br>iface eth0 inet dhcp</pre><p>restart networking</p><pre>/etc/init.d/networking restart</pre><p>ensure changes take affect</p><pre>ifconfig</pre><pre>adduser deploy</pre><pre>ssh deploy@localhost -p 2222</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51be296ff710" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/how-to-setup-and-ssh-into-alpine-linux-virtual-box-51be296ff710">How to Setup and SSH into Alpine Linux Virtual Box</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Fundamentals for Startups Part 1 — Set up Billing Alerts to Avoid Unexpected AWS Charges]]></title>
            <link>https://medium.com/exampro/aws-fundamentals-for-startups-part-1-set-up-billing-alerts-to-avoid-unexpected-aws-charges-d5728abccdfe?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5728abccdfe</guid>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[billing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Thu, 27 Sep 2018 15:25:26 GMT</pubDate>
            <atom:updated>2018-09-30T01:52:34.678Z</atom:updated>
            <content:encoded><![CDATA[<h3>Motivation</h3><p>I once received at $3000 USD bill from AWS because I spun up an ElastiCache server where I thought I was using the smallest instance but it was defaulted to use a large instance by default. I never used the server because I thought it had never actually started. AWS was nice enough to forget the bill but ever since than I always make sure I have Billing Alarms set in CloudWatch to catch these billing mishaps.</p><h3>Considerations</h3><p>CloudWatch Alarms are stored in <strong>us-east-1 </strong>US East (N. Virginia) so ensure you’re in this region or you won’t see your alarms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*CKd1cOhJ34QeAnJ11eMK0A.png" /></figure><p>We are going to create a billing alarms that will send an email when exceed $20 USD. If you have a runaway bill its good to set multiple alarms in case you ignore the lower charge. I might suggest $20, $100 and $500 USD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*XHuD91RHEl1K98GaOMVr6A.png" /><figcaption>On my Minecraft Server I have two alarms at $20 and $100 USD</figcaption></figure><h3>Enable Billing Notifications</h3><p>Under your <a href="https://console.aws.amazon.com/billing/home?#/preferences">Account Preferences</a> ensure you have Billing Alerts check boxed and <strong>Save preferences</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*qGfTy0OQk8aJD5OPPmsQRw.png" /></figure><h3>Create a Billing Alaram</h3><p>In the CloudWatch Console under Alarms we’ll create a new Alarm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*7zQW7F4Vjf4HWmxOZ3CbcA.png" /></figure><p>We’ll select <strong>Total Estimated Charge</strong> under<strong> Billing Metrics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*wyS6ZPC3R0Uho7qDTwM3eQ.png" /></figure><p>Then we need to checkbox <strong>EstimatedCharges</strong> and proceed to <strong>Next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*KiM6iYFhjijV8af4XjUcvA.png" /><figcaption>If you don’t see anything graphed it might be because you have no charges.</figcaption></figure><p>Set the <strong>Name</strong> and the <strong>Amount of $</strong> we want to watch. Then lets create a New SNS List to subscribe our email to be alerted when the Billing Threshold is breached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*4ZLbJmLTSoAo8yLHyUpe8g.png" /></figure><p>Naming the SNS Topic <strong>NotifyBilling </strong>and input my email into the Email List and <strong>Create Alarm</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*b9N93Rg8RGKhUaTm69luCw.png" /></figure><p>When you create the alarm you will see under State <strong>INSUFFICENT_DATA.</strong> We just have to wait some time before it starts collecting metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BsFg5bBPkXtUgzy__N7lrw.png" /></figure><p>So here I have 2 alarms and one has exceeded threshold so its ALARM and the other is OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYUMAssuzp0QUvC4ZmKoPw.png" /></figure><p>Here is what the email looks like when you get an email that triggers and ALARM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KTDMMaAfOtGoAaiilwJhIg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5728abccdfe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/aws-fundamentals-for-startups-part-1-set-up-billing-alerts-to-avoid-unexpected-aws-charges-d5728abccdfe">AWS Fundamentals for Startups Part 1 — Set up Billing Alerts to Avoid Unexpected AWS Charges</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Fundamentals for Startups: Part 1 — Is AWS Support Worth it?]]></title>
            <link>https://medium.com/exampro/is-aws-support-worth-it-ed3a55b50bbd?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed3a55b50bbd</guid>
            <category><![CDATA[support]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Wed, 26 Sep 2018 00:07:51 GMT</pubDate>
            <atom:updated>2019-04-07T19:45:20.836Z</atom:updated>
            <content:encoded><![CDATA[<p>At <a href="http://https//www.exampro.co">ExamPro</a> we use AWS Support to help us save hours on resolving mis-configurations mishaps or to improve the quality of written content by asking deeper questions around options that are fuzzy in the AWS documentation. We open about 7 cases a week and <strong>YES</strong> its worth but with considerations.</p><p>This post should give you the confidence to know if you should be using AWS Support and if it will accelerate your AWS development.</p><h3><strong>Developer Support</strong> — 29 USD/mo</h3><p>Developer Support allows you to open as many technical related cases as you like <strong>via email </strong>with a (supposedly) minimum response time of 24 hours.</p><h4>Show All Explored Paths To Avoid Canned Answers</h4><p>If you take the time to write out your case and show</p><ul><li>what AWS documentation you read,</li><li>tutorials you followed,</li><li>stackoverflows you investigated</li><li>provide step by step instructions for replication,</li><li>or have a the AWS service running with example data for them to debug</li></ul><p>then you can avoid getting canned answers where they dump you documentation links by shifting more investigation on to you to delay delivering you a full answer.</p><h4>Sometimes it Feels Like They’re Googling You The First Answer</h4><p>I think another reason to link everything you’ve explored online is so they avoid handing you the first solution they’ve googled. I was one time so disappointed when I provide the link and code inline from the first thing I googled only for support to not read the content of my case and pass off the first thing googled as their own solution. The knowledge of support varies which we’ll talk about in its own section below.</p><h4>Minimum 24 hours Not Always Observed</h4><p>When you have questions that are across multiple AWS services which also integrates with a third party service the response times can be longer than the minimum <strong>24 hours. </strong>I don’t know if it helps but I’ve had to update tickets to state being over 24 hours.</p><h4>Easy Questions Fast Responses</h4><p>If you’re new to AWS and you think you’re questions are run of the mill you can experience reply times as fast in 6 hours or less.</p><h4>General Guidance vs Impaired System</h4><p>You definitely receive faster response times for marking cases as impaired system. I think if you were frame your cases as impairing your system you can gain the case system and get faster response times.</p><h4>Should you bother with Developer Support?</h4><p>If you yourself are a developer who can craft well written cases, and you want to save hours on the basic configurations options that you can wait for a response for tomorrow than Developer Support is money well spent.</p><h3><strong>Business Support — 100 USD/mo</strong></h3><p>Business Support is available 24/7 and allows you to <strong>phone</strong> and <strong>live text chat</strong> with Support. When you create a case their their automated phone system will dial and put you on hold with music.</p><h4>Insanely Fast Response Times via Phone</h4><p>I’ve never had to wait longer than 6 mins before being connected with Support. The audio quality of the calls aren’t great and most of the time I will request to move to chat.</p><h4>Screen sharing and Live Text Chat While On the Phone</h4><p>AWS has screen sharing software which support will send via a single link as reply to the case. Their screen share software has a built in chat and Support can place annotations on your screen to point to things to guide you. When I make cases now I almost always just ask to screen-share immediately</p><h3>Cloud Support Engineer</h3><h4>Limited Knowledge, Not Required to be AWS Certified</h4><p>I’ve read somewhere Support doesn’t have to hold certifications Their practical knowledge is good I noticed but when I veer away from the case into other general questions their knowledge wains. So I think support cherry pick what the cases for what they know. So you just need to break up your questions and open multiple cases to get the best help.</p><h4>3 Layers of Miscommunication</h4><p>I think their phone technical support is in India because I yet to have to talk to someone who doesn’t have a South Asian/East Indian accent.</p><p>The miscommunication issues begin to stack due to poor phone reception with background noise and foggy/fuzzy audio quality.</p><p>Also there is a lack of using full structured sentences to understand the technical context of whats being asked.</p><p>I would say 8/10 calls I will leverage chat to clear up communication or all together hang up and just use chat.</p><h4>Sometimes You Need to Ask The Same Question Twice</h4><p>If you don’t like the solution or you aren’t confident on the correctness of the solution just open another case worded differently and try with a different technical support staff. I only find myself doing this 1/10 cases.</p><h4>They Can See Your Resources</h4><p>If you don’t screen share with them they can still see within your account what services you’ve spun up which is great since they are able to debug things much quicker for you.</p><h4>Should you bother with Business Support?</h4><p><strong>Absolutely Yes</strong>, the fast response times and having someone screen share to help you debug through a problem helps you keep traction on your projects.</p><h3>AWS Support Honeymoon Phase</h3><p>The reason I became AWS Obsessed was because of my experience with AWS Support because AWS really cares about customer support. Everyones first experience with paid support is over joyous. The more you use it you’ll start to see the negative aspects I’ve mentioned. I don’t think it matters because:</p><ul><li>you can open as many cases as you like until you get the answer you want</li><li>chat, screen share, and backdoor visibility mitigates any miscommunication issues</li><li>support plans are reasonably priced</li><li>a large support team to fill in the lack of knowledge of any one support engineer</li></ul><h3>When to use an AWS Certified Consultant over AWS Support?</h3><p>I don’t think one excludes the other and at ExamPro we use both because they serve to solve different things. There are things that AWS Support can’t and won’t do where consultants are the right fit and deserves its own article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed3a55b50bbd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/is-aws-support-worth-it-ed3a55b50bbd">AWS Fundamentals for Startups: Part 1 — Is AWS Support Worth it?</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create and Connect an RDS Postgres Database to TablePlus, Terminal or Rails App]]></title>
            <link>https://medium.com/exampro/how-to-create-and-connect-an-rds-postgres-database-to-tableplus-terminal-or-rails-app-77d51cc9c18c?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/77d51cc9c18c</guid>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Tue, 25 Sep 2018 13:51:29 GMT</pubDate>
            <atom:updated>2018-09-25T13:51:29.240Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Motivation</strong></h3><p>I’m migrating my database from Heroku to RDS and I want to have the same comforts that I’m used to which is being able to supply a connection url to TablePlus or environment variables to configure my Rails web-app.</p><h3>Create RDS Postgres Server</h3><p>We’re going to create an RDS Postgres server for this example with the most inexpensive setting. Proceed to create a database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*dpFeWfjLkGJqmuYPFrkJHg.png" /></figure><p>And select <strong>PostgreSQL</strong> and proceed to <strong>Next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*0lbQd3T3cEMLcpftF7CfYg.png" /></figure><p>Choose <strong>Dev/Test</strong> and proceed to <strong>Next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*8fPyd6IW83EANXFv7qivEA.png" /></figure><p>We’ll set our DB Instance class to <strong>db.t2.micro</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*R5AFLF5CCGSMvozqnxsrmg.png" /></figure><p>I’m using the example credentials for <strong>awsuser </strong>and <strong>mypassword. </strong>I would suggest using an <a href="https://passwordsgenerator.net/">online password generator</a> for both for production. Lets proceed to <strong>Next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*rA7nMDg9Ej0gpTSs1uBT8w.png" /></figure><p>Lets ensure <strong>Public Accessibility</strong> to <strong>Yes </strong>and we’ll let it create a<strong> new VPC Security Group</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*5Uj-JbEOVpk5kDlZwTcf3A.png" /></figure><p>Name your database. I’ve named mine <strong>mydatabase</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*SzWWJVLy6ZsJ6oo3PKcFvQ.png" /></figure><p>I’m going to turn off Backup by setting the retention period to zero. Since this is a test database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*eGbV579FJOKV79bpEmdrLg.png" /></figure><p>We can go ahead and create our database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*SNjKAS6juVcpwOZrm3pbJQ.png" /></figure><p>And then proceed to our DB instance details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*vPftczIB8n3UVcg7UHd0rw.png" /></figure><h3>Assemble Connection URL from Endpoint</h3><h4>Waiting for Endpoint</h4><p>If we visit our <strong>DB</strong> I<strong>nstance details</strong> and the database is yet to be provisioned the endpoint won’t be available. We just need to wait a while and refresh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*_RdVZP5-sVudPwGLZ28yAQ.png" /></figure><p>We know that its still being created because it will tell us in the <strong>DB Instance status </strong>is <strong>creating</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*m8By2JCZEVaYpHbUyKNrZg.png" /></figure><h4>When the Endpoint is Available</h4><p>When the server is <strong>available</strong> then <strong>DB instance status</strong> will say just that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*sf3AngNK9c2uJHV8PerUOQ.png" /></figure><p>And then under <strong>Connect</strong> we should see our <strong>Endpoint</strong> and <strong>Port </strong>and under the <strong>Security group rules </strong>we can see that the inbound rules only allow our own IP address. If you need others machines to connect you’ll have to add them to your inbound rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmlfrDJ9eJvhebb_lZPY5Q.png" /></figure><h4>Sanity Check with Telnet</h4><p>To ensure everything is working as expected lets use <strong>telnet</strong> to see if we can connect to our RDS instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*MPz_ZRfxz-RxiUZhO-zmCQ.png" /></figure><h4>Assembling the Connection URL</h4><p>This is how you make the connection URL</p><pre>postgres://<strong>username</strong>:<strong>password</strong>@<strong>endpoint</strong>:<strong>port</strong>/<strong>database</strong></pre><p>So my in my case it will look like the following</p><pre>postgres://awsuser:<a href="/service/mailto:mypassword@fpsql-database.cglotc3n8hbn.us-east-1.rds.amazonaws.com">mypassword@fpsql-database.cglotc3n8hbn.us-east-1.rds.amazonaws.com</a>:5432/mydatabase</pre><h3>Accessing our Database via TablePlus</h3><p>In TablePlus we can create a new connection from URL and it should populate the Connection form. We can proceed to <strong>Test</strong> the connection and see everything light up green. Then we can continue to <strong>Connect</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*rP72HItJeS6My96dn4K-jA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*ND5WZrS2CMug7D0e6FNA2Q.png" /></figure><p>And we’ll create two tables and insert some data to ensure everything is working as expected.</p><pre>WITH project AS (<br>  INSERT INTO projects (name) VALUES (&#39;Science Fair - Volcano Study&#39;) RETURNING id<br>)<br>INSERT INTO tasks (project_id,name) <br>        SELECT id, &#39;Why do volcanos erupt?&#39;       FROM project<br>  UNION SELECT id, &#39;Why is lava red?&#39;             FROM project<br>  UNION SELECT id, &#39;Where do volcanos come from?&#39; FROM project;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*USTuKwKjRJOTHKz6USy3aA.png" /></figure><h3>Accessing our Database via Terminal</h3><p>This is how we can connect via terminal</p><pre>psql --host <strong>endpoint</strong> --port <strong>port</strong> --username <strong>username</strong> --dbname <strong>db</strong></pre><p>So in my case it will be</p><pre>psql --host psql-database.cglotc3n8hbn.us-east-1.rds.amazonaws.com --port 5432 --username awsuser --dbname mydatabase</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*cUDhKYKf-pTNSUpcyFRMsA.png" /></figure><h3>Accessing our Database via Rails</h3><h4>Configure database.yml to accept Connection URL</h4><p>If we set the DATABASE_URL environment variable with our connection url Rails will automatically use this for the database and we can simplify our database.yml</p><pre>development:<br>  adapter: postgresql<br>  encoding: unicode</pre><pre>test:<br>  adapter: postgresql<br>  encoding: unicode</pre><pre>production:<br>  adapter: postgresql<br>  encoding: unicode</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*M82yfz7_bBN4zfTLnM_LbA.png" /></figure><h4>Loading Env Vars in Development</h4><p>In development we can use <a href="https://github.com/bkeepers/dotenv">DotEnv</a> gem to load our env vars for local development inside the <strong>.env</strong> file that will sit at the root of our Rails app.</p><pre>DATABASE_URL=postgres://<strong>username</strong>:<strong>password</strong>@<strong>endpoint</strong>:<strong>port</strong>/<strong>database</strong></pre><h4>Loading Env Vars Production</h4><p>Most instance providers allow you set the env vars directly or they let you specify a startup script and you would just provide them in there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*AouoKIPIvhd0MDR368SdCg.png" /><figcaption>Example of setting Env Vars in Opsworks</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77d51cc9c18c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/how-to-create-and-connect-an-rds-postgres-database-to-tableplus-terminal-or-rails-app-77d51cc9c18c">How to Create and Connect an RDS Postgres Database to TablePlus, Terminal or Rails App</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2018 Ruby on Rails 5 on AWS]]></title>
            <link>https://medium.com/exampro/2018-ruby-on-rails-5-on-aws-27d2b3783bf2?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/27d2b3783bf2</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Wed, 19 Sep 2018 01:07:52 GMT</pubDate>
            <atom:updated>2018-09-19T11:00:25.795Z</atom:updated>
            <content:encoded><![CDATA[<p>I think Rails is great and I want people to keep using it, so I thought I would write an end-to-end tutorial series to show you how you can make the best of Rails on AWS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_iC2_Xq0kCDzHaMAIlhbQ.png" /></figure><h3>Syllabus</h3><p><strong>Local Development Environment</strong></p><ul><li><strong>Part 1</strong> Configure Amazon Linux 2</li><li><strong>Part 2</strong> Installing Rails, Postgres and Redis</li><li><strong>Part 3</strong> Mounting Host Folder to Guest</li><li><strong>Part 4 </strong>Make SSH into VirtualBox Painlesss</li></ul><p><strong>Embracing AWS for Rails</strong></p><ul><li><strong>Part 1 </strong>Replacing Paperclip and RMagick for Lambda and Sharp</li><li><strong>Part 2 </strong>Replacing Device with Amazon Cognito</li><li><strong>Part 3</strong> Replacing Sidekiq with SQS</li><li><strong>Part 4 </strong>Replacing Sendgrid for SES</li></ul><p><strong>Putting Rails into Production</strong></p><ul><li><strong>Part 1 </strong>Configuring RDS</li><li><strong>Part 2 </strong>Provisioning EC2 with Amazon Linux 2</li><li><strong>Part 3 </strong>Blue / Green Deployment</li><li><strong>Part 4 </strong>Rotation Log Files</li><li><strong>Part 5</strong> Continuous Deployment with CodePipeline</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27d2b3783bf2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/2018-ruby-on-rails-5-on-aws-27d2b3783bf2">2018 Ruby on Rails 5 on AWS</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Fundamentals for Startups]]></title>
            <link>https://medium.com/exampro/aws-fundamentals-for-startups-e1389b131bb?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1389b131bb</guid>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Wed, 19 Sep 2018 00:45:55 GMT</pubDate>
            <atom:updated>2018-09-27T15:26:17.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qyoXFeit9emGDXClwkZdxA.png" /><figcaption>Artwork for an upcoming video I’m producing.</figcaption></figure><h3>Introduction</h3><p>I talk to lots of early startups who want to get moving fast on the AWS platform as little as time as possible. I want to cover the most common questions asked and some things I think you must absolutely learn.</p><h3>Considerations</h3><p>This tutorial series can be applied to any stack but I’m going focus on Ruby on Rails scenarios since I think many people are coming from Heroku with Rails.</p><h3>Syllabus</h3><p>I’m going to break this guide up into part so you can easily digest each section and allow me talk in greater length about each part instead of having one big blob of a tutorial</p><ul><li><a href="https://medium.com/exampro/aws-fundamentals-for-startups-part-1-set-up-billing-alerts-to-avoid-unexpected-aws-charges-d5728abccdfe"><strong>Part 1</strong> Set up Billing Alerts to avoid unexpected charges</a></li><li><a href="https://medium.com/exampro/is-aws-support-worth-it-ed3a55b50bbd"><strong>Part 2</strong> IS AWS Support Worth It?</a></li><li><strong>Part 2</strong> Moving from Heroku to Elastic Beanstalk with RDS</li><li><strong>Part 3 </strong>Authentication with Amazon Cognito</li><li><strong>Part 4 </strong>Easy Local Development Environment with Virtual Box</li><li><strong>Part 5 </strong>Process images with S3, AWS Lambda</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1389b131bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/aws-fundamentals-for-startups-e1389b131bb">AWS Fundamentals for Startups</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2018 Modded Minecraft Server on AWS : Part 3 — Serve Twitch Custom Profile via S3 and a Static…]]></title>
            <link>https://medium.com/exampro/2018-modded-minecraft-server-on-aws-part-3-serve-twitch-custom-profile-via-s3-and-a-static-a76126d3fd27?source=rss-843351933723------2</link>
            <guid isPermaLink="false">https://medium.com/p/a76126d3fd27</guid>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[modded-minecraft]]></category>
            <category><![CDATA[route-53]]></category>
            <dc:creator><![CDATA[Andrew WC Brown]]></dc:creator>
            <pubDate>Wed, 05 Sep 2018 14:52:34 GMT</pubDate>
            <atom:updated>2018-09-05T14:52:34.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>2018 Modded Minecraft Server on AWS : Part 3 — Serve Twitch Custom Profile via S3 and a Static Website and Route53 Custom Domain</h3><p>We want our friends to play on our modded Minecraft server we’re going to need to export our Twitch Custom Profile for Minecraft and share it with them.</p><p>We can use S3 to create a static website which will use for the time being to let them download the Custom Profile and Share with the server’s Static IP.</p><h3>Register Domain Name with Route53</h3><p>So proceeding to Route53 lets Register a domain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*O8YxLLLkNUKaroQCzr-FAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*wXWde1y330Ijg7mXt2PH4g.png" /></figure><p>I’m going search for the domain <strong>Regimontia</strong> because that’s the in-lore name of the world my players and I agreed upon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*gEOjA14_KaaJaTOZQEBCng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DO4xRl6mljTC4zfBFVOqg.png" /></figure><p>You’ll then proceed to fill our your domain information such as address, email and phone. You’ll need to confirm your email address and accept terms of service and proceed to purchase.</p><p>You should now have a domain and we can create an S3 bucket based on our domain.</p><h3>Creating a Static Website with S3</h3><h4>Create two new buckets</h4><p>We need to create two new S3 buckets based on our domain name. So I’m going to create <strong>regimontia.com</strong> and <a href="http://www.regimontia/"><strong>www.regimontia</strong></a><strong>.com</strong> and take note that I have yet to make them public.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*mbJXoE1bD-0mTrKMDpv0HA.png" /></figure><p>We have two buckets but we are only going to be using one and redirecting the traffic to the other.</p><h4>Create and Upload Homepage</h4><p>We’ll create an <strong>index.html </strong>and upload this to our bucket without www so in my case its <strong>regimontia.com</strong></p><pre>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;Minecraft Server&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt;(REPLACE WITH YOUR STATIC IP)&lt;/h1&gt;<br>  &lt;a href=&#39;/mod-profile.zip&#39;&gt;Download Custom Profile&lt;/a&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*skRcFDEeUBEI4LvAy2RYFA.png" /></figure><h4>Export Profile and Upload to S3 Bucket</h4><p>Lets export our profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*S7Th9Q48xQtc7xFs-i7moQ.png" /></figure><p>Just keep the default selected for config and mods, you can rename the profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*fBcSfdRp1uDu6ZFbDFv11w.png" /></figure><p>Then upload to the S3 bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*yfjw3tUV-dpEyBQ_6STwmA.png" /></figure><h4>Turn On Static Website Hosting</h4><p>We want our index.html file to be recognized as the homepage so on the <strong>Properties Tab </strong>lets turn it on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4WIiR4bPIsM0t-yydlyZdg.png" /></figure><p>Take note that it well tell us our website’s public url. If we didn’t want to register a domain we could just share this with our url. Copy this link and after saving visit this url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*Om1pdbSxBE_n5IL_D3c5tw.png" /></figure><p>And we should except to see and error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*li5Fn47wDyU79zz-G3EmLg.png" /></figure><p>This is because everything in a bucket by default is private, so we’re going to have to tell S3 to make everything in this bucket publicly accessible to everyone.</p><h4>Custom Bucket Policy</h4><p>We can achieve this using an custom bucket policy. So plug your domain name into the template below and copy it.</p><pre>{<br>  &quot;Version&quot;:&quot;2012-10-17&quot;,<br>  &quot;Statement&quot;:[{<br> &quot;Sid&quot;:&quot;PublicReadGetObject&quot;,<br>        &quot;Effect&quot;:&quot;Allow&quot;,<br>   &quot;Principal&quot;: &quot;*&quot;,<br>      &quot;Action&quot;:[&quot;s3:GetObject&quot;],<br>      &quot;Resource&quot;:[&quot;arn:aws:s3:::REPLACE-WITH-YOUR-DOMAIN.com/*&quot;<br>      ]<br>    }<br>  ]<br>}</pre><p>We’ll proceed to our bucket’s <strong>Permissions Tab </strong>and add this Bucket Policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*TufFyuDYedPnsQq6NhXPwA.png" /></figure><p>Don’t worry about the public access warning because its not applicable to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*WnwRV8AyQZC61JgmudXsPw.png" /></figure><p>So we’ll check the url provided by our bucket again and we should now see our homepage and we should also be able to download the mod profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*M3Zm5UWGfRYcPd-HSIrhtw.png" /></figure><h4>Custom Domain with Route 53</h4><p>We want to create an alias record so we’ll need to open <a href="https://console.aws.amazon.com/route53/">Route53</a> &gt;<a href="https://console.aws.amazon.com/route53/home?#hosted-zones:"> Hosted Zones</a> &gt; Select Your Domain &gt; Create Record Set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*Es4PiqBwKY_0av5EH17j3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*7XVGse27q3ZnOxoj_C67uA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*xKYVbAq0SFIrflNfkLT-3A.png" /></figure><p>We need to choose <strong>Alias</strong> which will allow us to select possible AWS resources that we can link to our naked domain. So select the your S3 website endpoint and leave the name blank and <strong>Create</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*xKYVbAq0SFIrflNfkLT-3A.png" /></figure><p>I waited a few minutes and then I visited my naked domain and everything works as expected. The website is <strong>Not Secure </strong>since we aren’t yet using an SSL certificate which I think is not important for our requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*XyzFyldUtPBg72vCyIofsw.png" /></figure><h4>Redirect WWW to Naked Domain</h4><p>We want <strong>www </strong>to work as well so we are going to need to redirect our www bucket to our naked domain. We can do this by <strong>redirecting requests </strong>on our www bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*5PpKWx6nc53bH8Jpfxf87w.png" /></figure><p>Then we just need to create another <strong>Alias</strong> to the S3 website endpoint but for our <strong>www</strong> subdomain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*vtBP6c0Og-UGDHp_s_BfXg.png" /></figure><p>When you attempt to visit your domain with www it should redirect to your naked domain.</p><h3>Some Fun Finishing Touches</h3><p>You can make yourself a nice logo at <a href="https://textcraft.net/">https://textcraft.net/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*EQYAcrlf1lONe0Qhifcj3Q.png" /><figcaption><em>FYI rein isn’t a typo, its an inside joke</em></figcaption></figure><p>I also added myself a background and added some styling and here is the end result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*HJCcKmCc51ZDkItcIZnELA.png" /></figure><p>Here’s the HTML. You’ll need to source your own background image and place both your logo and background image alongside your index.html in the naked domain bucket.</p><pre>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;title&gt;Regimontia&lt;/title&gt;<br>  &lt;style&gt;<br>    * {<br>      font-family: arial, sans-serif;<br>    }<br>    html, body {<br>      padding: 0; margin: 0;<br>      background: url(https://medium.com/&#39;dirt.jpg&#39;);<br>    }<br>    main {<br>      text-align: center;<br>      padding: 64px;<br>    }</pre><pre>h1 {<br>      font-size: 42px;<br>      color: rgb(177,169,166);<br>      text-shadow: 2px 2px 3px  rgb(0,0,0);<br>    }</pre><pre>a {<br>      font-size: 28px;<br>      color: rgb(100,100,255);<br>      text-shadow: 2px 2px 3px  rgb(0,0,0);<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;main&gt;<br>    &lt;img src=&#39;logo.png&#39; /&gt;<br>    &lt;h1&gt;34.238.37.39&lt;/h1&gt;<br>    &lt;a href=&#39;/mod-profile.zip&#39;&gt;Download Custom Profile&lt;/a&gt;<br>  &lt;/main&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a76126d3fd27" width="1" height="1" alt=""><hr><p><a href="https://medium.com/exampro/2018-modded-minecraft-server-on-aws-part-3-serve-twitch-custom-profile-via-s3-and-a-static-a76126d3fd27">2018 Modded Minecraft Server on AWS : Part 3 — Serve Twitch Custom Profile via S3 and a Static…</a> was originally published in <a href="https://medium.com/exampro">ExamPro</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>