<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[There's always a silver lining in the cloud]]></title>
  <link href="http://agwind.net/atom.xml" rel="self"/>
  <link href="http://agwind.net/"/>
  <updated>2015-09-06T14:38:18-04:00</updated>
  <id>http://agwind.net/</id>
  <author>
    <name><![CDATA[Ben]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Novel Journeys]]></title>
    <link href="http://agwind.net/blog/2015/09/06/novel-journeys/"/>
    <updated>2015-09-06T12:04:00-04:00</updated>
    <id>http://agwind.net/blog/2015/09/06/novel-journeys</id>
    <content type="html"><![CDATA[<p>It&rsquo;s been a little quiet lately, and for good reason: a new job in a new state.  It&rsquo;s been a bit hectic, but things are settled and I&rsquo;m getting back to my personal projects.</p>

<p>I did get my first MongoDB and AngularJS app working before the chaos.  I didn&rsquo;t get much written down and my mini cluster has not been brought back to life from the move.  I&rsquo;ll have to decide whether to revive it or to just move on.</p>

<p>In the meantime, something a bit more mundane.  I was getting a lot of lost packets at home, and I needed to figure out what was causing it.  In the past I&rsquo;ve just used <a href="http://oss.oetiker.ch/smokeping/">Smokeping</a> to give me a baseline for the network.  I really didn&rsquo;t feel like fussing with configurations and permissions.  It is 2015 is it not?  Surely I can just add a couple of IP&rsquo;s into some kind of app and have it do everything for me.</p>

<p>I dusted off one of my machines from the cluster, installed CentOS 7 on it, and proceeded to install Zabbix.  Zabbix has gotten a bit better; I only had to make one SELinux policy change to get it up and going.  The navigation is still horrible though.  After it took me way longer than it should, I plugged in a couple of IP&rsquo;s and had some monitoring going.  The only problem was that the values where getting rounded off.  After the navigation frustration, I was starting to wonder if there was something easier.  I looked for Docker container for Smokeping and sure enough, one <a href="https://hub.docker.com/r/dperson/smokeping/">existed</a>.</p>

<p>Next, I looked for a UI for docker since my last few 10 minute forays into it didn&rsquo;t bear a lot of fruit.  I chose <a href="http://www.projectatomic.io/docs/cockpit/">Cockpit</a>, but I wasted a bit of time trying the CentOS version of Atomic Host.  In my naiveness, I would say that it is <strong>not</strong> ready for playing with, or at the very least it does not have cockpit baked in.  I installed the Fedora version of Atmoic Host, and I finally had something to work with.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ sudo atomic run cockpit/ws</span></code></pre></td></tr></table></div></figure>


<p>In the end though, I rarely used the interface, and this was all a lot easier without all of the side trips.</p>

<ul>
<li>Install a minimal version of CentOS 7.</li>
<li>Install and start up libvirtd</li>
</ul>


<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>$ yum install libvirt-daemon libvirt-daemon-kvm
</span><span class='line'>$ systemctl start libvirtd.service
</span><span class='line'>$ systemctl enable libvirt-guests.service</span></code></pre></td></tr></table></div></figure>


<ul>
<li>Download the Fedora Atmoic host image to your /var/lib/libvirt/images/</li>
<li><p>Install the image.  I used this <a href="http://www.projectatomic.io/docs/quickstart/">guide</a>.</p>

<p>  You&rsquo;ll need a <code>yum install genisoimage</code> for the authorizaion iso image.  I also did install the extra storage for my instance, but I don&rsquo;t know if it was strictly necessary.  It was a little confusing but ROOT_SIZE is not for your docker storage, so you shouldn&rsquo;t need to touch that.</p></li>
<li><p>SSH to your atomic host</p></li>
<li><p>Install the docker container</p>

<p>  <code>$ sudo docker run --name smokeping -p 8000:80 -d dperson/smokeping</code></p></li>
<li><p>Add the IP&rsquo;s that you want to monitor.</p>

<p>  <code>$ sudo docker exec smokeping smokeping.sh -t "&lt;Group&gt;;&lt;Name&gt;;&lt;Hostname or IP&gt;"</code></p>

<p>   An example:</p>

<pre><code class="``">  $ sudo docker exec smokeping smokeping.sh -t "Local;LocalHost;localhost"

  $ sudo docker exec smokeping smokeping.sh -t "External;Level3_DNS;4.2.2.1"
</code></pre>

<p>  Do not put spaces in the name section.  I did this the first time, and then I tried fixing it using the &ldquo;docker cp&rdquo; command, but apperently this version of docker doesn&rsquo;t allow cp back into the container.  In the end I wiped my config with a &ldquo;docker exec smokeping smokeping.sh -w&rdquo; and just used under scores.</p></li>
<li><p>Restart the container.</p>

<p>  <code>$ sudo docker restart smokeping</code></p></li>
<li><p>Enjoy.  <img src="http://agwind.net/images/smokeping.png" alt="Smokeping running" /></p></li>
</ul>


<p>In the end it&rsquo;s pretty simple once you have a docker host going as long as you avoided the side trips.  Run a few commands, to configure your app, and off you go.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Importing]]></title>
    <link href="http://agwind.net/blog/2014/04/30/importing/"/>
    <updated>2014-04-30T23:29:00-04:00</updated>
    <id>http://agwind.net/blog/2014/04/30/importing</id>
    <content type="html"><![CDATA[<p>I wanted to try my hand at a MongoDB and AngularJS app.  First things first, I wanted to find a dataset that would do MongoDB justice.  The best thing that I came up with was Google&rsquo;s <a href="https://code.google.com/p/wiki-links/downloads/list">wiki-links</a> data set.  Something big enough to not sit in RAM, but not to overwhelming, and something with a little bit of structure to it.</p>

<p>I made a simple parsing and importing script.  I setup my MongoDB instances on my Eucalyptus cluster (that has very slow IO), and I&rsquo;m using a 3 node replication setup.  The dataset is split up into 10 files, each about 550M.  Inserts where taking about 120s per 1000 records (safe inserts, and write majority).  A few demotions, and we selected the master node to be the node on our Euclyptus cluster with the least contention.  That got us down to about 95s per 1000 records.  At this rate it was taking several days to import just 1 file in the dataset.  I looked around and noticed that we weren&rsquo;t really bottlenecked on CPU or IO, so I figured we could make the inserts in parallel and go a bit faster.</p>

<p>I&rsquo;ve done the standard forking method in the past, so I wanted to try something new.  I figured I would see what I could do with a message queue or something similar.  I started with <a href="http://nanomsg.org/">nanomsg</a>, but the Perl bindings weren&rsquo;t up to date with the latest beta (the beta just came out last month).  I fussed with 0MQ for a bit, but when I started losing messages, I decided I could get lost down that rabbit hole pretty quick.  Looking at a few benchmarks, I knew I was looking at either <a href="https://www.rabbitmq.com/">RabbitMQ</a> or <a href="http://qpid.apache.org/">Qpid</a>.  After looking at some of the coding samples, I picked Qpid.  It was in the distro repo&rsquo;s and very easy to setup.   It had examples in multiple languages including Perl.  It had some easy to use command line tools for setting up queues, and even a script to do a quick performance test.  On my workstation it was something like 200,000 messages a second with transient storage and 32,000 messages a second with persistent message storage.  Easily enough that the queuing and dequeuing wasn&rsquo;t going to be my bottleneck.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>yum install qpid*
</span><span class='line'>/bin/systemctl start qpidd
</span><span class='line'>qpid-config add queue q0 --max-queue-size=2147483648 --max-queue-count=2147483648
</span><span class='line'>qpid-stat -q q0</span></code></pre></td></tr></table></div></figure>


<p>I ripped apart my parser and inserter, and merged it with some of the example scripts, and now I have the <a href="https://github.com/agwind/misc/blob/master/qparse.pl">parser</a> queueing up records to be inserted, and an <a href="https://github.com/agwind/misc/blob/master/qimport.pl">import</a> for dequeuing and inserting into MongoDB.  The parsing and queueing took about 2 minutes, and I have 5 copies of the importer script running each taking about 106s per 1000 records, with a bit more room to push it further.</p>

<p>As a side note, I should mention that I had to reboot my nodes in my Eucalyptus cluster, and I had lost my setup and data because I&rsquo;m not using a block storage volume to store things in.  So that prompted me to do a little bit more <a href="http://www.ansible.com/home">Ansible</a> work, and now setup is a breeze.  See my Ansible MongoDB playbook <a href="https://github.com/agwind/ansible/tree/master/mongo">here</a>.  It needs a few tweaks to be better, but works for me at the moment.</p>

<p>Now time to finish up that AngularJS tutorial while these import.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A Jack, Fuzz, and Two Bits]]></title>
    <link href="http://agwind.net/blog/2014/03/25/a-jack/"/>
    <updated>2014-03-25T23:45:00-04:00</updated>
    <id>http://agwind.net/blog/2014/03/25/a-jack</id>
    <content type="html"><![CDATA[<p>A couple if miscellaneous updates while I&rsquo;m in between a couple of projects.</p>

<h3>Ansible</h3>

<p>I started working up an Ansible playbook for installing my RSS reader.  I got stalled as I filled the root partition in my Eucalyptus vm.  So either recreate the image or get the playbook to install the supporting software on the ephemeral partition.  I&rsquo;m going to try recreating the image, as I think it should keep the playbook more applicable in different situations.</p>

<h3>RSS Reader bug</h3>

<p>A security update came across for PostgreSQL a few weeks back. After the upgrade I noticed the RSS reader wasn&rsquo;t handling the disconnects as well as it should.  Adding to the todo.</p>

<h3>Books</h3>

<p>We finally got through <a href="http://en.wikipedia.org/wiki/The_Five_Dysfunctions_of_a_Team">The Five Dysfunctions of a Team</a> at work.  So obvious, so meaningful.  Definitely helpful in reminding us teams are more than a collection of people.  The follow up book, <em>Overcoming the Five Dysfunctions of a Team</em> wasn&rsquo;t worth it for me at this juncture.  It&rsquo;s funny, some people were really annoyed by the fable format.  I loved the casual nuances that it brought to the subject at hand.</p>

<p>I&rsquo;m most of the way through <a href="http://www.amazon.com/Scaling-Up-Excellence-Getting-Settling/dp/0385347022">Scaling up excellence</a>.  In pursuit of a sparing partner for this one, as the team isn&rsquo;t ready yet.  It&rsquo;s good material, but for some reason, it wasn&rsquo;t sitting right with me.  As it&rsquo;s wrapping up I think I&rsquo;m warming up to it more.</p>

<p>More on both later.</p>

<h3>The Future</h3>

<ul>
<li>My commentary on the whole CentOS + Red Hat deal (Yes, I know I&rsquo;m late!).</li>
<li>I got pulled into another project that I&rsquo;m using my Eucalyptus cluster for.  <a href="https://code.google.com/p/wiki-links/">Google&rsquo;s Wikipedia links</a> an easy dataset to get started with.  It turns out that the Eucalyptus disk subsytem is slower than I thought.  I&rsquo;ll need to do a benchmark on it.  More on this later.</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Journey]]></title>
    <link href="http://agwind.net/blog/2014/03/02/the-journey/"/>
    <updated>2014-03-02T21:13:00-05:00</updated>
    <id>http://agwind.net/blog/2014/03/02/the-journey</id>
    <content type="html"><![CDATA[<p>A week ago was another <a href="http://www.agileandbeyond.com">Agile and Beyond conference</a>.  Even though we had some excellent talks such as Joshua Kerievsky <a href="http://www.industriallogic.com/blog/techsafety/">TechSaftey</a> keynote, it wasn&rsquo;t as impactful as years past.  To be fair, I had seen Joshua&rsquo;s talk last year at the <a href="http://lkna.leankanban.com/">Lean Kanban conference</a>.  I&rsquo;m glad it wasn&rsquo;t as impactful; I think it means I&rsquo;m starting to gain a more foundational understanding of things.  It is funny, my first time at the conference it wasn&rsquo;t about being impactful, it was about being relevant.  But let&rsquo;s start at the beginning.</p>

<p>I&rsquo;ve always been drawn to people that have mastered their craft.  The insights you could draw from their work seemed more meaningful.  Their bravado given off when talking about their domain charmed me.  When I graduated college and set off on my programing career full time, I fully intended to master my domain.  My opportunities landed me at company that was rapidly growing, and an environment where I could grow along with it.  Looking back, my folly was not realizing I was devoid of a mentor, and doing what I needed to do to seek one out.  I soon found the addictive grove of &ldquo;getting things done&rdquo;, with a waining regards to mastery of my craft.  In the back of my mind it bothered me.  As years passed, responsibilities grew, my time spent on my craft got thinner and thinner.  The backlog grew and grew, and I needed help.  There were always people around willing to lend a helping hand, but I needed more.  Someone with more insights than casually looking at problems.  In part it was my craving to get back to my craft, in part it did seem like without professional help, the backlog would never be tamed.  A long story short, I learned lessons about interviewing, and putting together a team.  We hired, and we grew.</p>

<p>Ignorance is bliss.  Except that it wasn&rsquo;t.  Now that there is a team, there needs to be direction, coordination, and organization.  I didn&rsquo;t see it coming, and I didn&rsquo;t embrace that I needed to master a new domain.  Again after a while the mastery craving kicked in, and I found a local and cheap conference to go to.  Not having a mentor to help push me when I needed it, or a work environment that strived for continuous improvement, this was long overdue.  I found myself at my first agile conference, Agile and Beyond.  In part I loved it because I was immersed with people that were trying to perfect their craft.  In part, I hated it because I still viewed myself as a developer and I didn&rsquo;t have a true understanding of the Agile Manifesto.  It was another way to &ldquo;get stuff done&rdquo;, but there didn&rsquo;t seem to be a way to for a developer to master their craft.  When you work on a library, you just worked on the parts you needed.  Your frameworks where always going to be half done.  Your work driven by what the customer wanted, and not what you know needed to be done.  It was naive and frankly a little embarrassing that those thoughts are not farther in my review mirror.  Even as off kilter as I was, my agile mastery had begun.</p>

<p>Back to current day. The conference wasn&rsquo;t as impactful to me, but it was a good experience, and I was happy to be continuing to learn.  What&rsquo;s finally starting to sink in is that if I&rsquo;m reaching for mastery, I will certainly be a lot closer if I&rsquo;m incorporating others feedback.  Agile and Lean certainly strive to do just that.  You start to realize that others can help you validate your ideas.  Others can help you with things that you would have never thought of.  Intelligence will get you far, but being humble, understanding other peoples perspectives, and using their intelligence will get you farther.  It&rsquo;s not that I ever viewed feedback with disdain, but it&rsquo;s certain that I didn&rsquo;t interpret it appropriately.  I keep coming back to thinking about that code library that you want to perfect.  You plan things out, but eventually run into a problem.  How many times after pulling out your profiling tools did you refactor code where you thought you would have to refactor.  Feedback from your tests, from your profiling, from your crash reports, and feedback from your users.  They all drive that well crafted library.  So when you work on your library, there is less to refactor, and less to debug.  You have just what you need.  You end up listening to the users of your framework, and it becomes complete in their eyes.  What you work on rarely feels wasted.</p>

<p>So that&rsquo;s my journey so far.  One traveled by many people wanting to perfect their craft.  Feedback and mastery are more intertwined then what you naively think in the beginning.  Be mindful of what you should be mastering.  Have a mentor.  Their feedback will be good, and their help with navigating other feedback will be beneficial.  Nothing is ever finished.  Just like the journey.</p>

<p>P.S.  My twitter feed is a pseudo-mentor right?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Micro cloud]]></title>
    <link href="http://agwind.net/blog/2014/02/01/micro-cloud/"/>
    <updated>2014-02-01T20:16:00-05:00</updated>
    <id>http://agwind.net/blog/2014/02/01/micro-cloud</id>
    <content type="html"><![CDATA[<h3>A 3 node cluster for under $1000.</h3>

<p>I have a few projects that I wanted to work on that would be easier if I had multiple machines for.  One project was getting <a href="https://www.eucalyptus.com/eucalyptus-cloud/iaas">Eucalyptus</a> up and running, and that required physical machines.  I also have space constraints, so picking up some old servers on ebay wasn&rsquo;t an option.  So I needed something relatively new that had hardware virtualization support, enough RAM to run VM&rsquo;s, and something cheap enough that I wasn&rsquo;t breaking the budget.</p>

<p><br /></p>

<table class="table table-striped">
<tr><th>Part</th><th>Quantity</th><th>Price</th><th>Total Price</th></tr>
<tr><td><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16883103785">Acer Veriton Nettop Computer - Intel Celeron 887 1.50 GHz - Gray, Black</a></td><td>3</td><td>222.99</td><td>668.97</td></tr>
<tr><td><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16833122381">NETGEAR 8 Port Gigabit Smart Switch - Lifetime Warranty (GS108T)</a></td><td>1</td><td>79.99</td><td>79.99</td></tr>
<tr><td><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820191523">Crucial 8GB (2 x 4GB) 204-Pin DDR3 SO-DIMM DDR3 1600</a></td><td>2</td><td>89.99</td><td>179.98</td></tr>
<tr><td>Total</td><td></td><td></td><td>928.94</td></tr>
</table>


<p><br /></p>

<p>The little nettop&rsquo;s are great.  Small enough for a couple of them to sit on my desk with out looking overwhelming, quiet, low powered, and easy to upgrade the memory and disk (also includes a mSATA slot).  I also picked them up on sale for $180 each, which made it even a better deal.  The switch is necessary because I would like to do a &ldquo;Managed&rdquo; network setup with Eucalyptus and I need VLAN support.  It&rsquo;s is limited to 64 VLAN&rsquo;s, but that will be plenty for this setup.</p>

<ol>
<li>Install the switch, connecting it to my home router.</li>
<li>Install the RAM, run memtest.

<ul>
<li>8GB in the first node, and split the memory for the other nodes so they have 6GB each.</li>
</ul>
</li>
<li>Install CentOS, getting rid of that awful Linpus distro.

<ul>
<li>Creating an USB netboot was the easiest thing for me.</li>
</ul>
</li>
<li>Prep the network

<ul>
<li>Configure the router.

<ul>
<li>Shorten the DHCP Range to give a few IP&rsquo;s for our new &ldquo;public&rdquo; range.</li>
<li>I&rsquo;m using the routers MAC->IP assignment in DHCP to set some &ldquo;static&rdquo; IP&rsquo;s for the switch, and nodes.</li>
</ul>
</li>
<li>Configure the switch

<ul>
<li>Quite possibly one of the hardest steps since the web interface is so painful.</li>
<li>Go to Switching -> VLAN and add VLAN&rsquo;s 10-13</li>
<li>Verify that VLAN 1 is set to untagged for all of the ports.</li>
<li>Go through VLAN 10 through 13 and set them to &ldquo;T&rdquo; for tagged on all of the ports.  (Yes, the little triangle is overly difficult to toggle to show the ports).  <img src="http://agwind.net/images/vlantagged.png" alt="Tagged Ports" /></li>
</ul>
</li>
</ul>
</li>
<li>Install Eucalyptus

<ul>
<li>For the most part, just follow the directions.

<ul>
<li>Put your CLC, CC, SC, and Walrus on the first node with the most ram.</li>
<li>Make sure you let Eucalyptus know which VLAN&rsquo;s it can use
<div class="highlight">
<code>euca-modify-property -p cloud.network.global_min_network=10
euca-modify-property -p cloud.network.global_max_network=13
</code>
</div></li>
</ul>
</li>
<li>The IP&rsquo;s that you took away from your router&rsquo;s DHCP range.  Add them to your config:
<div class="highlight">
<code>VNET_PUBLICIPS="192.168.1.240-192.168.1.250"
</code>
</div></li>
</ul>
</li>
</ol>


<h3>A couple of issues needed to be dealt with before I was ready to go.</h3>

<ol>
<li>I do not run a DNS server on my local network.

<ul>
<li>I got tripped up using euca2ools until I figured out there were a bunch of subdomains that it was looking for.  I simply added hosts to /etc/hosts on my workstation.  I&rsquo;ll need to do this on any workstation I&rsquo;m using euca2ools from, or get around to setting up a local dns server.
<div class="highlight">
<code>192.168.1.210  node1 eucalyptus.cluster.&lt;domain&gt;   walrus.cluster.&lt;domain&gt; euare.cluster.&lt;domain&gt; tokens.cluster.&lt;domain&gt; autoscaling.cluster.&lt;domain&gt; cloudwatch.cluster.&lt;domain&gt; loadbalancing.cluster.&lt;domain&gt;
192.168.1.211  node2
192.168.1.212  node3
</code>
</div></li>
</ul>
</li>
<li>I do not run an email server on my local network.

<ul>
<li>The cloud controller likes to send you emails to register accounts.  You can probably get around this, but I have an email server on my colo, I figured this wouldn&rsquo;t be to bad to get going.

<ul>
<li>For the most part it was pretty simple.  I use self-signed certs on my mail server, and it took my a while to figure out I needed to remove the &ldquo;noplaintext&rdquo; option from smtp_sasl_security_options, even though it wasn&rsquo;t being transported over plain text.</li>
<li>I created a user on my email server.</li>
<li>I put the credentials in /etc/postfix/relay_auth on node1 (see docs for smtp_sasl_password_maps for syntax)</li>
<li>I configured the mail server (postfix) to relay to my server, and use sasl_auth.
<div class="highlight">
<code>relayhost = [mail.example.com]:submission
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_auth
smtp_use_tls = yes
smtp_tls_security_level = may
smtp_sasl_security_options = noanonymous
</code>
</div></li>
<li>I believe with newer versions of postfix, you might be able to whitelist the self-signed cert, and can make sure your TLS settings are a little tighter.</li>
</ul>
</li>
</ul>
</li>
<li><p>euca2ools was out of date on my distribution.</p>

<ul>
<li>I was running into a strange problem trying to create images from my workstation using euca2ools (from eustore).  I was getting this error message:
<div class="highlight">
<code>InvalidAMIName.Malformed: AMI names must be between 3 and 128 characters long, and may contain letters, numbers, '(', ')', '.', '-', '/' and '_'
</code>
</div></li>
</ul>


<p> A little digging, and I realized my euca2ools was version 2.x and it was 3.x on all my nodes (where I successfully imported my first image from eustore).  A quick upgrade to the latest version, adjusting my path, and I was importing and uploading my images.</p></li>
<li><p>It booted!  Wait.. where did it go?</p>

<p> I successfully booted my first instance, and everything worked!  I SSH'ed into my virtualized CentOS 6.4 instance via the &ldquo;public&rdquo; IP 192.168.1.240.  I verified that it had a 10.101.x.x IP on the backend, and was using a VLAN.  So, things are working, let&rsquo;s get this instance up to date.  &ldquo;yum upgrade&rdquo; got me to 6.5, I rebooted an suddenly found I could no longer reach the instance.  For some reason, I&rsquo;ve always thought it was going to be the networking that was the hardest part in all of this, and I jumped to the conclusion that it had failed me.  The instance was still up on my node after all.  Long story short, after spending waaay too much time on iptable LOG insertions, I realized that this was actually something on the instance.  I destroyed it, and started again.  This time I paid closer attention, and found some SELinux errors after the upgrade (but before the reboot!).  I haven&rsquo;t found exactly what is wrong, but a &ldquo;restorecon -Rv /&rdquo; fixed things for now so that it survives a reboot.</p></li>
</ol>


<h3>Next steps</h3>

<p>Right now to launch an instance it&rsquo;s a simple:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>euca-run-instances &lt;image&gt; -k &lt;key&gt; -t m1.xlarge</span></code></pre></td></tr></table></div></figure>


<p>I need to learn a little bit more about the security groups to really get going though, as I&rsquo;m sure I&rsquo;ll need something other than port 22.  Once I figure that out, it&rsquo;s off to Ansible, to see if I can deploy my RSS app automatically.</p>

<p>Happy clouding!</p>

<p><img src="http://agwind.net/images/mcluster.png" alt="micro cluster" /></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Ain't exactly a 'who']]></title>
    <link href="http://agwind.net/blog/2014/01/19/aint-exactly-a-who/"/>
    <updated>2014-01-19T20:34:00-05:00</updated>
    <id>http://agwind.net/blog/2014/01/19/aint-exactly-a-who</id>
    <content type="html"><![CDATA[<p>Disclaimers first off.  I&rsquo;ve never used MongoDB.  I&rsquo;ve known about Tim Bunce for a while, saw him speak at a Perl Mongers meeting, and decided to follow him on twitter.  In general he&rsquo;s positive, and I enjoy the CompSci tweets.  Also, bonus points for people that can connect the title of this article without looking.</p>

<p>Tim has retweeted a couple of posts to articles like <a href="http://hackingdistributed.com/2013/01/29/mongo-ft/">this one</a> and <a href="http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/">this one</a> and it peaked my interested.  People seem to really love or hate MongoDB (and even that is heavily blogged about).  I misplaced another blog post that did a good job of explaining why being a mmap based system can be bad.  In the end I probably can&rsquo;t say anything better than this <a href="http://nyeggen.com/blog/2013/10/18/the-genius-and-folly-of-mongodb/">post</a>.</p>

<p>My advice is always to remain skeptical, read the source code, and test everything.  It was open source, and it was fast, surely nothing can be wrong with it.  I don&rsquo;t know if people were intentionally trying to deceive the users, or whether it was just naive coding.  Most of the angst now seems to stem from the fact that the defaults where not durable, and there wasn&rsquo;t enough proactive communication about it.  Thankfully they&rsquo;ve had pressures being a VC backed company, and have had to listen to their community.  It seems like 2.2 and 2.4 they&rsquo;ve tried to be a bit better about the durability issues.  My only thing is that once they&rsquo;ve addressed everything, will they be that blazing fast document database that they started out as?</p>

<p>I have a couple of other projects I have as a higher priority, but I think I&rsquo;ll put CouchDB, Riak Basho, and Elasticsearch through their paces.  Maybe I&rsquo;ll throw MongoDB in there too, but I&rsquo;m still skeptical.  And now not so much of the code, but of the people putting it out.  In the end though, some well planned tests should cut through all of the noise.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[It's Alive!]]></title>
    <link href="http://agwind.net/blog/2013/10/28/its-alive-slash/"/>
    <updated>2013-10-28T23:48:00-04:00</updated>
    <id>http://agwind.net/blog/2013/10/28/its-alive-slash</id>
    <content type="html"><![CDATA[<p>I&rsquo;ve finally pushed my RSS reader up to <a href="https://github.com/agwind/mRSS">github</a>.</p>

<p>There is a huge list of things <a href="https://github.com/agwind/mRSS/blob/master/docs/todo">todo</a>.</p>

<p>As most RSS Readers during these times, it was born out of Google Readers death.  When I started I decided this was just going to be a project that I was going to play with, and I found an alternative reader until I could finish mine.  As it turned out, the reader I picked made a few horrible updates, and it forced my hand to push out something that is usable for me.  I&rsquo;ve been using it every day for over two months now.  There are a lot of rough edges, but the daily routine of reading articles works just fine.</p>

<p>I&rsquo;ve really come to love this project in so many ways.  One way, only my own bad UI choices will be forced upon me.  Another is it let&rsquo;s me code, as it&rsquo;s no longer one of my job duties.  But the greatest part about this is that it&rsquo;s just such a wonderful playground for everything.  You can tinker with so many areas and still have something completely usable.  You could focus in on parsing, and write your own XML parser.  You could play with ORM&rsquo;s like <a href="https://metacpan.org/pod/DBIx::Class">DBIx::Class</a>, or <a href="https://metacpan.org/pod/Moose">Moose-ify</a> your internals.  Want to work on your UI skills?  It&rsquo;s easy to tackle some <a href="http://getbootstrap.com/">Bootstrap</a> and <a href="http://jquery.com/">jQuery</a>.  Maybe backends are more your thing.  Think about how your articles will fit into NoSQL database.  Use <a href="http://lucene.apache.org">Lucene</a> to provide a nice search.  Write a daemon that predicts the most optimal times to retrieve new articles based on past history.  Maybe you&rsquo;ve heard about configuration management tools, and you wan to try out something like <a href="https://github.com/ansible/ansible">Ansible</a>.  So many facets can be explored.  But it&rsquo;s not <em>just</em> about exploring.  All of these things are easy to combine in a working system that you can use every day.  That&rsquo;s why it&rsquo;s so great.</p>

<p>I knew it was going to be fun.  I didn&rsquo;t realize <em>how</em> much fun it was going to be.  I would encourage everyone to write a RSS reader; It&rsquo;s quite an adventure.</p>

<p>Gratuitous screenshot:
<img src="http://agwind.net/images/mrss.png" alt="mRSS web app" /></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Only tricks]]></title>
    <link href="http://agwind.net/blog/2013/10/18/only-tricks/"/>
    <updated>2013-10-18T00:00:00-04:00</updated>
    <id>http://agwind.net/blog/2013/10/18/only-tricks</id>
    <content type="html"><![CDATA[<p>I saw this interview tips and tricks <a href="http://www.interviewcake.com/tips-and-tricks">link</a> from <a href="https://news.ycombinator.com/">Hacker News</a> and thought it was really good.</p>

<ul>
<li>Chitchat like a pro</li>
<li>Communicate</li>
<li>Get unstuck</li>
<li>Get your thoughts down</li>
<li>Clean up when you&rsquo;re done</li>
</ul>


<p>Over the past 7 or so years I&rsquo;ve probably done around 100 interviews.  Many of the candidates could have benefited from those tips.  When I ask you about something you know, I&rsquo;m looking to see how well you communicate.  When I give you a hypothetical situation, I&rsquo;m looking to see how you break something down, how you approach a problem.  When you get stuck, I can&rsquo;t do either or those things.  Any of those points under getting unstuck are great.  I&rsquo;m never looking for an exact answer, so doing something like naïve solution is fine.  You&rsquo;ll feel better about giving some sort of answer, and you can focus on the next question.</p>

<p>I looked at the first practice question.  In general I&rsquo;m not a fan.  You have such little time for everything you&rsquo;re trying to fit into an interview, and the amount of insight you get out of those questions about algorithms is pretty low.</p>

<p>My tip: As an interviewee, make sure you&rsquo;re interviewing the company, and the people you&rsquo;re going to work with.  Interview&rsquo;s are two way streets.  I&rsquo;m not looking for people to fill a job, I&rsquo;m looking for people to continue their career with us.  If you don&rsquo;t care how we work, what our goals are, or how we support our employees, it definitely raises some red flags for me.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Iceberg!]]></title>
    <link href="http://agwind.net/blog/2013/10/02/iceberg/"/>
    <updated>2013-10-02T20:56:00-04:00</updated>
    <id>http://agwind.net/blog/2013/10/02/iceberg</id>
    <content type="html"><![CDATA[<p>As I was flushing out some tests for my RSS reader, and I realized I had not really thought through my update interval settings for feeds.  I had used an interval data type, and I run a postgresql database on my server, but a sqlite db when I&rsquo;m doing things locally.  I also haven&rsquo;t even started on my daemon to do updates; I&rsquo;ve just cron'ed things for now.  So I haven&rsquo;t really used the field but I&rsquo;m still planning to once I flush out the update daemon.  Since I&rsquo;m writing tests I might as well address the issue.</p>

<p>The issue was that I didn&rsquo;t really pay homage to SQLite&rsquo;s type system.  My &lsquo;interval&rsquo; typed column in sqlite is using the text storage class.  I don&rsquo;t really want focus my time on tackling formatting/parsing issues, and I like being able to use multiple databases.  For columns with date types, I&rsquo;m just using <a href="https://metacpan.org/module/DBIx::Class::InflateColumn::DateTime">DBIx::Class::InflateColumn::DateTime</a>, so I was happy to see that there was an InflateColumn for Durations also <a href="https://metacpan.org/module/DBIx::Class::InflateColumn::DateTime::Duration">DBIx::Class::InflateColumn::DateTime::Duration</a>.  I soon found out that things were not as simple with InflateColumn::Datetime::Duration (ICDD).  Unlike ICD, you need to mark each column with a &lsquo;is_duration&rsquo; attribute in your schema files.  I&rsquo;ve been in the mode of using dbicdump to write out my schemas, so that wasn&rsquo;t going to work.  Plus ICD picked up things automatically for datetime fields, why couldn&rsquo;t ICDD do the dame with interval fields?  It turns out it can, it&rsquo;s an easy 1 line change.  When peering into the code though, I noticed that the parser/formatter was hard coded.  This was getting to be a bit more than I wanted to tackle at the moment, so I&rsquo;ve published the simple change to <a href="https://github.com/agwind/DBIx-Class-InflateColumn-DateTime-Duration">github</a>.  I think I want to see if I can get it to be a bit more flexible with the parser it&rsquo;s using before I circle back and see if anyone else likes the changes, or if I should just find a new namespace for the module. So back to integrating ICDD, I just need to adjust my format to match ICDD&rsquo;s hard coded one.  Turns out that it isn&rsquo;t too bad either, a simple command to run on connection in my DB config file:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class=''><span class='line'># connection string
</span><span class='line'>&lt;connect_info&gt;
</span><span class='line'>  dsn     dbi:Pg:database=rss
</span><span class='line'>  user    rss
</span><span class='line'>  pass    passwordgoeshere
</span><span class='line'>  &lt;extra&gt;
</span><span class='line'>    on_connect_do =  set intervalstyle='iso_8601';
</span><span class='line'>  &lt;/extra&gt;
</span><span class='line'>&lt;/connect_info&gt;</span></code></pre></td></tr></table></div></figure>


<p>and a quick addition to the connection:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='perl'><span class='line'>  <span class="nv">$schema</span> <span class="o">=</span> <span class="nn">mRSS::</span><span class="n">Schema</span><span class="o">-&gt;</span><span class="nb">connect</span><span class="p">(</span> <span class="nv">$dsn</span><span class="p">,</span> <span class="nv">$user</span><span class="p">,</span> <span class="nv">$pass</span><span class="p">,</span> <span class="nv">$options</span><span class="p">,</span> <span class="nv">$extra</span><span class="p">);</span>
</span></code></pre></td></tr></table></div></figure>


<p>I add ICDD to my loader_options components, rerun dbicdump, and presto.. I&rsquo;m getting back DateTime::Duration objects from that field.</p>

<p>Now back to tests.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Litmus Tests]]></title>
    <link href="http://agwind.net/blog/2013/09/24/litmus-tests/"/>
    <updated>2013-09-24T23:16:00-04:00</updated>
    <id>http://agwind.net/blog/2013/09/24/litmus-tests</id>
    <content type="html"><![CDATA[<p>I&rsquo;ve been working on my RSS reader (more on that later), and I noticed a strange problem.  Long articles were being cut off.  Content was being abruptly stopped, as in the footer wasn&rsquo;t even showing up.  I did a quick check of the logs, nothing there.  I checked my content, nothing suspicious, and seemed complete.  A quick script confirms it&rsquo;s not the libraries.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='perl'><span class='line'><span class="k">my</span> <span class="nv">$article</span> <span class="o">=</span> <span class="nn">mRSS::</span><span class="n">Article</span><span class="o">-&gt;</span><span class="n">find</span><span class="p">(</span><span class="mi">4447</span><span class="p">);</span>
</span><span class='line'><span class="n">say</span> <span class="nv">$article</span><span class="o">-&gt;</span><span class="n">description</span><span class="o">.</span>
</span></code></pre></td></tr></table></div></figure>


<p>My template engine <a href="http://xslate.org">Xslate</a> is new to me, so I&rsquo;m quick to blame that.  Time to pull it out of the Dancer app.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class='perl'><span class='line'><span class="k">my</span> <span class="nv">$tx</span> <span class="o">=</span> <span class="nn">Text::</span><span class="n">Xslate</span><span class="o">-&gt;</span><span class="k">new</span><span class="p">(</span> <span class="n">path</span> <span class="o">=&gt;</span> <span class="p">[</span> <span class="s">&#39;/code/rss/views&#39;</span> <span class="p">]);</span>
</span><span class='line'><span class="k">my</span> <span class="nv">$article</span> <span class="o">=</span> <span class="nn">mRSS::</span><span class="n">Article</span><span class="o">-&gt;</span><span class="n">find</span><span class="p">(</span><span class="mi">4447</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'><span class="k">my</span> <span class="nv">%vars</span> <span class="o">=</span> <span class="p">(</span>
</span><span class='line'>  <span class="n">article</span> <span class="o">=&gt;</span> <span class="nv">$article</span><span class="p">,</span>
</span><span class='line'><span class="p">);</span>
</span><span class='line'>
</span><span class='line'><span class="k">print</span> <span class="nv">$tx</span><span class="o">-&gt;</span><span class="n">render</span><span class="p">(</span><span class="s">&#39;article.tx&#39;</span><span class="p">,</span> <span class="o">\</span><span class="nv">%vars</span><span class="p">),</span><span class="s">&quot;\n&quot;</span><span class="p">;</span>
</span></code></pre></td></tr></table></div></figure>


<p>That of coarse produced the complete article.  So, the other parts of my stack that are new to me.. Dancer and Starman.  I load Dancer as a standalone app, and it works too.</p>

<p>A quick check at the changelog for Starman, and we find the culprit.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='perl'><span class='line'><span class="mf">0.4005</span>  <span class="mi">2013</span><span class="o">-</span><span class="mi">08</span><span class="o">-</span><span class="mi">13</span> <span class="mi">22</span><span class="p">:</span><span class="mi">12</span><span class="p">:</span><span class="mi">11</span> <span class="n">PDT</span>
</span><span class='line'>        <span class="o">-</span> <span class="n">Fix</span> <span class="n">SSL</span> <span class="n">implementation</span> <span class="n">bug</span> <span class="n">where</span> <span class="n">body</span> <span class="n">longer</span> <span class="n">than</span> <span class="mi">16</span><span class="n">K</span> <span class="n">doesn</span><span class="err">&#39;</span><span class="n">t</span> <span class="n">get</span> <span class="n">written</span> <span class="n">correctly</span> <span class="c1">#78 (kazeburo, siracusa) </span>
</span></code></pre></td></tr></table></div></figure>


<p>A quick..</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='perl'><span class='line'><span class="n">cpanm</span> <span class="n">Starman</span>
</span></code></pre></td></tr></table></div></figure>


<p>And everything is fixed.  I love the simple ones.</p>

<p>Being able to pull out a few lines of your project into some one off script is a great litmus test for if your building things right.  Having trouble setting up that action your trying to test?  Then it&rsquo;s time to sit back and think about your code.  Yes, sometimes it is just a matter of a complex sequence of data manipulations and you just need a set up helper functions to wrap common sequences.  It also can be an indicator that your flow of data isn&rsquo;t optimal, or your view on your abstractions needs a fresh look.</p>

<p>As a side note, is there anything that Tatsuhiko Miyagawa does that isn&rsquo;t awesome?  Remember when you were using cpan because cpanm wasn&rsquo;t around?  cpanm is such a pleasure to use.  I was at his polyglot talk at YAPC::NA 2012, so I understand that he pulls ideas from all of the programming communities.  It&rsquo;s still an impressive track record to pull the right things, translate them, and iterate through them through more community feedback.</p>

<p>On that note, I&rsquo;m off to look at <a href="https://github.com/miyagawa/cpanfile">cpanfile</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Crux]]></title>
    <link href="http://agwind.net/blog/2013/09/23/the-crux/"/>
    <updated>2013-09-23T19:48:00-04:00</updated>
    <id>http://agwind.net/blog/2013/09/23/the-crux</id>
    <content type="html"><![CDATA[<p>At work we often share articles that we think are insightful, and are relevant to challenges that we&rsquo;re taking on.  I saw this article <a href="http://firstround.com/article/How-Medium-is-building-a-new-kind-of-company-with-no-managers">No Managers</a>, and thought it was interesting.  My co-worker opinion was that it was rather trite, and pointed me to more apropos article (now behind a paywall) at WSJ.  After reading the article and thinking about how they related, I started to really appreciate that view point.  The first article wasn&rsquo;t all a wash though.  One of the things that really caught my attention was the SCARF approach to understanding motivation.  As a manager I certainly could improve how I am reaching out towards the people I work with.  I also thought that I might be able to pull on some of my fellow managers experience, so I fired off an email, and started up some conversations.</p>

<p>A few days later, someone mentioned that they had read the book, <a href="http://www.amazon.com/Your-Brain-Work-Strategies-Distraction/dp/0061771295">Your Brain at Work</a>, mentioned in the article where the SCARF idea originated.  Alas, I couldn&rsquo;t have a decent conversation, since I had not read it yet.  I have a long commute, and my reading queue was empty, so off to Audible I went.  The book is about how the brain works, and how you can use that knowledge to maximize your mental resources.  One of the key tenets is that your brain has limited resources for your more advanced thinking, and you should conserve it.  And here is my crux of the matter:  If I should be conserving my brain, I should probably let it do something less strenuous like listing to music on my drive home.  Since my life is pretty full otherwise, how shall I ever finish the book?</p>

<p>So while I ponder this conundrum, I leave you with this gem found in our <del>QA channel</del>  Tester Channel:</p>

<p>Why can&rsquo;t two doctors be in the same room at a time?</p>

<p>Because they would be a pair &lsquo;o docs.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Blog go]]></title>
    <link href="http://agwind.net/blog/2013/09/19/blog-go/"/>
    <updated>2013-09-19T01:59:00-04:00</updated>
    <id>http://agwind.net/blog/2013/09/19/blog-go</id>
    <content type="html"><![CDATA[<p>3..2..1&hellip;</p>
]]></content>
  </entry>
  
</feed>
