<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Elixir on John Hamelink</title>
    <link>https://johnhame.link/tags/elixir/</link>
    <description>Recent content in Elixir on John Hamelink</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>John hamelink</copyright>
    <lastBuildDate>Thu, 17 Mar 2016 12:41:00 +0000</lastBuildDate>
    <atom:link href="https://johnhame.link/tags/elixir/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>OpenSSL and Elixir</title>
      <link>https://johnhame.link/posts/using-openssl-with-elixir/</link>
      <pubDate>Thu, 17 Mar 2016 12:41:00 +0000</pubDate>
      <guid>https://johnhame.link/posts/using-openssl-with-elixir/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re using the latest OpenSSL package from &lt;a href=&#34;http://brew.sh&#34;&gt;Homebrew&lt;/a&gt;, you might come across&#xA;an error similar to this one from time to time:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:2;-o-tab-size:2;tab-size:2;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;==&lt;/span&gt;&amp;gt; fast_tls &lt;span style=&#34;color:#666&#34;&gt;(&lt;/span&gt;compile&lt;span style=&#34;color:#666&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Compiled src/fast_tls_app.erl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Compiled src/p1_sha.erl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Compiled src/fast_tls_sup.erl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Compiled src/fast_tls.erl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Compiling c_src/fast_tls_drv.c&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;c_src/fast_tls_drv.c:21:10: fatal error: &lt;span style=&#34;color:#b44&#34;&gt;&amp;#39;openssl/err.h&amp;#39;&lt;/span&gt; file not found&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#080;font-style:italic&#34;&gt;#include &amp;lt;openssl/err.h&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;         ^&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;1&lt;/span&gt; error generated.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ERROR: compile failed &lt;span style=&#34;color:#a2f;font-weight:bold&#34;&gt;while&lt;/span&gt; processing /Users/john/Public/fap/api/api-2.1/deps/fast_tls: &lt;span style=&#34;color:#b8860b&#34;&gt;rebar_abort&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#666&#34;&gt;==&lt;/span&gt;&amp;gt; api&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#b62;font-weight:bold&#34;&gt;\*&lt;/span&gt; &lt;span style=&#34;color:#666&#34;&gt;(&lt;/span&gt;Mix&lt;span style=&#34;color:#666&#34;&gt;)&lt;/span&gt; Could not compile dependency :fast_tls, &lt;span style=&#34;color:#b44&#34;&gt;&amp;#34;/Users/john/.asdf/installs/elixir/1.2.3/.mix/rebar compile skip_deps=true deps_dir=&amp;#34;&lt;/span&gt;/Users/john/Public/fap/api/api-2.1/_build/dev/lib&lt;span style=&#34;color:#b44&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#a2f&#34;&gt;command&lt;/span&gt; failed. You can recompile this dependency with &lt;span style=&#34;color:#b44&#34;&gt;&amp;#34;mix deps.compile fast_tls&amp;#34;&lt;/span&gt;, update it with &lt;span style=&#34;color:#b44&#34;&gt;&amp;#34;mix deps.update fast_tls&amp;#34;&lt;/span&gt; or clean it with &lt;span style=&#34;color:#b44&#34;&gt;&amp;#34;mix deps.clean fast_tls&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The reason why this error is happening is because OpenSSL header files required&#xA;to compile this (in this case) rebar module are in homebrew&amp;rsquo;s &lt;code&gt;/usr/local/opt&lt;/code&gt;&#xA;directory. We can simply fix this by setting LDFLAGS and CFLAGS before compiling:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Elixir/Erlang and autoscaled EC2 servers - how to make them best buddies</title>
      <link>https://johnhame.link/posts/elixir-and-ec2/</link>
      <pubDate>Thu, 03 Mar 2016 02:22:00 +0000</pubDate>
      <guid>https://johnhame.link/posts/elixir-and-ec2/</guid>
      <description>&lt;p&gt;At &lt;a href=&#34;https://findaplayer.com&#34;&gt;Find a Player&lt;/a&gt;, we&amp;rsquo;ve been trying to figure out how we want to cluster our&#xA;Elixir servers - so that they can share state between each other - recently.&#xA;Because we come from ruby (ie, not a high-availability background), when we want&#xA;to discover other machines in a network we&amp;rsquo;d traditionally use something like&#xA;&lt;a href=&#34;https://consul.io&#34;&gt;Consul&lt;/a&gt; - of which I wrote a ruby library called &lt;a href=&#34;https://github.com/WeAreFarmGeek/diplomat/&#34;&gt;Diplomat&lt;/a&gt; (which admittedly needs&#xA;some love).&lt;/p&gt;&#xA;&lt;p&gt;However, after chatting with &lt;a href=&#34;https://twitter.com/gordonguthrie&#34;&gt;Gordon Guthrie&lt;/a&gt; - a guy who&amp;rsquo;s been working with&#xA;Erlang for over 13 years - over twitter, he told us to checkout&#xA;&lt;code&gt;:net_adm.world/0&lt;/code&gt;. Which does pretty much exactly what we want, straight out of&#xA;the box.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
