<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Eugene Teo</title>
    <description>Eugene Teo - This technology blog focuses on data science and security!</description>
    <link>https://temasek.org/</link>
    <atom:link href="https://temasek.org/atom.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>Downgrading Vagrant with Brew</title>
        <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Update Jan 16, 2017&lt;/em&gt;&lt;/strong&gt;
&lt;em&gt;This issue has been addressed in &lt;a href=&quot;https://github.com/mitchellh/vagrant-installers&quot;&gt;vagrant-installers&lt;/a&gt; with commit &lt;a href=&quot;https://github.com/mitchellh/vagrant-installers/pull/98/commits/e1867522e888f861f1de321550aec3f8fc6d47a8&quot;&gt;e1867522&lt;/a&gt;. It’s not always a good idea to downgrade a software, so do make sure you know what you are doing.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I was trying to provision the &lt;a href=&quot;https://github.com/spark-in-action/first-edition&quot;&gt;spark-in-action&lt;/a&gt; &lt;a href=&quot;https://github.com/spark-in-action/first-    edition/blob/master/spark-in-action-box.json&quot;&gt;VM&lt;/a&gt; with Vagrant. When I issued the &lt;code class=&quot;highlighter-rouge&quot;&gt;vagrant box add&lt;/code&gt; command to download the VM, I got the following error message:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vagrant box add spark-in-action-box.json
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;box: Loading metadata &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;box &lt;span class=&quot;s1&quot;&gt;'spark-in-action-box.json'&lt;/span&gt;
    box: URL: file:///Users/eugeneteo/path/to/first-edition/spark-in-action-box.json
An error occurred &lt;span class=&quot;k&quot;&gt;while &lt;/span&gt;downloading the remote file. The error
message, &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;any, is reproduced below. Please fix this error and try
again.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you look at this &lt;a href=&quot;https://github.com/mitchellh/vagrant/issues/8036&quot;&gt;bug report&lt;/a&gt;, it looks like there is an issue with the version of &lt;code class=&quot;highlighter-rouge&quot;&gt;libcurl.4.dylib&lt;/code&gt; in Vagrant 1.8.7:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;/opt/vagrant/embedded/bin/curl -V
dyld: Library not loaded: @rpath/libcurl.4.dylib
  Referenced from: /opt/vagrant/embedded/bin/curl
  Reason: Incompatible library version: curl requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0
Trace/BPT &lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt;: 5
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Fortunately, it is easy to workaround this problem.&lt;/p&gt;

&lt;p&gt;First, run &lt;code class=&quot;highlighter-rouge&quot;&gt;brew cask remove&lt;/code&gt; to uninstall Vagrant. Next, look through &lt;a href=&quot;https://github.com/caskroom/homebrew-cask/commits/master/Casks/vagrant.rb&quot;&gt;Vagrant’s Cask file commits&lt;/a&gt;, find the version of Vagrant you want to downgrade from, and run &lt;code class=&quot;highlighter-rouge&quot;&gt;brew cask install&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;brew cask install https://raw.githubusercontent.com/caskroom/homebrew-cask/60531a2812005dd5f17dc92f3ce7419af3c5d019/Casks/vagrant.rb
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;Downloading https://raw.githubusercontent.com/caskroom/homebrew-cask/60531a2812005dd5f17dc92f3ce
&lt;span class=&quot;c&quot;&gt;######################################################################## 100.0%&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;Downloading https://releases.hashicorp.com/vagrant/1.8.6/vagrant_1.8.6.dmg
&lt;span class=&quot;c&quot;&gt;######################################################################## 100.0%&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;Verifying checksum &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;Cask vagrant
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;Running installer &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;vagrant; your password may be necessary.
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;Package installers may write to any location; options such as --appdir are ignored.
Password:
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;installer: Package name is Vagrant
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;installer: Installing at base path /
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;installer: The install was successful.
🍺  vagrant was successfully installed!
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Issuing the &lt;code class=&quot;highlighter-rouge&quot;&gt;vagrant box add&lt;/code&gt; command should work now!&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;vagrant box add spark-in-action-box.json
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;box: Loading metadata &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;box &lt;span class=&quot;s1&quot;&gt;'spark-in-action-box.json'&lt;/span&gt;
    box: URL: file:///Users/eugeneteo/path/to/first-edition/spark-in-action-box.json
&lt;span class=&quot;gp&quot;&gt;==&amp;gt; &lt;/span&gt;box: Adding box &lt;span class=&quot;s1&quot;&gt;'manning/spark-in-action'&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;v1.0.0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;provider: virtualbox
    box: Downloading: https://s3-us-west-2.amazonaws.com/manning-code/spark-in-action.box
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;...]
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Hopefully, this issue gets resolved soon, and I will upgrade Vagrant back to the current version.&lt;/p&gt;
</description>
        <pubDate>Sun, 27 Nov 2016 00:00:00 +0800</pubDate>
        <link>https://temasek.org/posts/downgrading-vagrant-with-brew/</link>
        <guid isPermaLink="true">https://temasek.org/posts/downgrading-vagrant-with-brew/</guid>
      </item>
    
      <item>
        <title>Replacing Travis CI with Docker</title>
        <description>&lt;p&gt;Since my paid Travis CI subscription has expired and I don’t intend to renew it, I wanted to see if I could use Docker containers to build and deploy my blog instead. It turns out to be an easy exercise, and I can even reuse my &lt;a href=&quot;/posts/using-travis-ci-to-build-and-deploy-sites/&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;cibuild&lt;/code&gt; script&lt;/a&gt; to do exactly the same workflow as I did with Travis CI.&lt;/p&gt;

&lt;p&gt;I used the &lt;a href=&quot;https://hub.docker.com/r/jekyll/jekyll/&quot;&gt;official Jekyll&lt;/a&gt; and &lt;a href=&quot;https://hub.docker.com/u/andthensome/&quot;&gt;Ryan’s&lt;/a&gt; &lt;a href=&quot;https://hub.docker.com/r/andthensome/alpine-surge-bash/&quot;&gt;alpine-surge-bash&lt;/a&gt; Docker images. As of writing, Ryan has &lt;a href=&quot;https://hub.docker.com/search/?isAutomated=0&amp;amp;isOfficial=0&amp;amp;page=1&amp;amp;pullCount=0&amp;amp;q=surge&amp;amp;starCount=0&quot;&gt;over 50K+ pulls&lt;/a&gt;, and it’s &lt;a href=&quot;https://hub.docker.com/r/andthensome/alpine-surge-bash/builds/&quot;&gt;actively maintained&lt;/a&gt;. And even if the alpine-surge-bash image is no longer supported, I can easily build one from his &lt;a href=&quot;https://ryankes.eu/project/docker-alpine-surge-bash/&quot;&gt;Dockerfile&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’re the steps I took:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd source&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# my Jekyll blog&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;docker run --rm -it -v &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;:/srv/jekyll -p 4000:4000 jekyll/jekyll bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll s --force_polling
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;docker run --rm -it -v &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;:/srv/jekyll jekyll/jekyll bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;sh /srv/jekyll/script/cibuild
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;docker run -it --rm andthensome/alpine-surge-bash surge token
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;docker run --rm -it -v &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;/_site/:/srv -e &lt;span class=&quot;nv&quot;&gt;SURGE_LOGIN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=[&lt;/span&gt;email] &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    -e &lt;span class=&quot;nv&quot;&gt;SURGE_TOKEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=[&lt;/span&gt;token] andthensome/alpine-surge-bash surge -p /srv/
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Did you do it differently? Share with me how you did it!&lt;/p&gt;
</description>
        <pubDate>Sat, 26 Nov 2016 00:00:00 +0800</pubDate>
        <link>https://temasek.org/posts/replacing-travis-ci-with-docker/</link>
        <guid isPermaLink="true">https://temasek.org/posts/replacing-travis-ci-with-docker/</guid>
      </item>
    
      <item>
        <title>Using Travis CI to build and deploy sites</title>
        <description>&lt;p&gt;I finally got around the time to use &lt;a href=&quot;https://travis-ci.org/&quot;&gt;Travis CI&lt;/a&gt; for my &lt;a href=&quot;https://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; blog. Travis CI is a continuous integration service for projects hosted on &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For those who have used Jekyll, you would know that each time you make changes to your blog, you have to regenerate the static pages, perhaps test them, and then deploy the changes to your hosting provider, which in my case is &lt;a href=&quot;https://surge.sh/&quot;&gt;Surge&lt;/a&gt;. Now, Travis CI does all that for me automatically whenever I push an update to GitHub!&lt;/p&gt;

&lt;p&gt;Here’re what I did:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/continuous-integration/#enabling-travis-and-github&quot;&gt;Enable Travis builds for your GitHub repository&lt;/a&gt;. Enable &lt;code class=&quot;highlighter-rouge&quot;&gt;Build only if .travis.yml is present&lt;/code&gt; in the settings page&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://surge.sh/help/integrating-with-travis-ci&quot;&gt;Create &lt;code class=&quot;highlighter-rouge&quot;&gt;SURGE_LOGIN&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;SURGE_TOKEN&lt;/code&gt; variables with the &lt;code class=&quot;highlighter-rouge&quot;&gt;surge token&lt;/code&gt; command&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/continuous-integration/#the-test-script&quot;&gt;Create a build and test script&lt;/a&gt;, and commit it to your repository. For some reasons, Travis CI had issues with a few of my external links, so I disabled the external link checker with the &lt;code class=&quot;highlighter-rouge&quot;&gt;--disable-external&lt;/code&gt; option. Make sure you fix all the issues that &lt;code class=&quot;highlighter-rouge&quot;&gt;htmlproofer&lt;/code&gt; has found until you see the &lt;code class=&quot;highlighter-rouge&quot;&gt;HTML-Proofer finished successfully&lt;/code&gt; message&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt; -e &lt;span class=&quot;c&quot;&gt;# halt script on error&lt;/span&gt;

bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;jekyll build
bundle &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;htmlproofer ./_site --disable-external
&lt;span class=&quot;c&quot;&gt;# bundle exec htmlproofer ./_site&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;Update your Gemfile so that Travis can automatically install all the Ruby dependencies with &lt;code class=&quot;highlighter-rouge&quot;&gt;bundle install&lt;/code&gt;. For example,&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;grep -v ^# Gemfile
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'https://rubygems.org'&lt;/span&gt;

gem &lt;span class=&quot;s1&quot;&gt;'jemoji'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'jekyll-redirect-from'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'jekyll-paginate'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'kramdown'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'rouge'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'html-proofer'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'minitest'&lt;/span&gt;
gem &lt;span class=&quot;s1&quot;&gt;'html-pipeline'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://jekyllrb.com/docs/continuous-integration/#configuring-your-travis-builds&quot;&gt;Commit the &lt;code class=&quot;highlighter-rouge&quot;&gt;.travis.yml&lt;/code&gt; configuration file&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;s&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;ruby&lt;/span&gt;
&lt;span class=&quot;s&quot;&gt;rvm&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;2.3.0&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;before_script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
 &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;chmod +x ./script/cibuild&lt;/span&gt;
 &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;npm install --global surge&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;./script/cibuild&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;branches&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;only&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;source&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;global&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;NOKOGIRI_USE_SYSTEM_LIBRARIES=true&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# speeds up installation of html-proofer&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# route your build to the container-based infrastructure for a faster build&lt;/span&gt;

&lt;span class=&quot;s&quot;&gt;after_success&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
   &lt;span class=&quot;s&quot;&gt;surge -p ./_site/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When Travis CI detects a push to GitHub, it will set up a build environment in a clean VM, make &lt;code class=&quot;highlighter-rouge&quot;&gt;./script/cibuild&lt;/code&gt; an executable, install &lt;code class=&quot;highlighter-rouge&quot;&gt;surge&lt;/code&gt;, run the script &lt;em&gt;only&lt;/em&gt; on the &lt;code class=&quot;highlighter-rouge&quot;&gt;source&lt;/code&gt; branch, and if the build is successful, deploy the blog to Surge.&lt;/p&gt;

&lt;p&gt;That’s all you have to do. Hope you find these steps useful.&lt;/p&gt;
</description>
        <pubDate>Tue, 10 May 2016 00:00:00 +0800</pubDate>
        <link>https://temasek.org/posts/using-travis-ci-to-build-and-deploy-sites/</link>
        <guid isPermaLink="true">https://temasek.org/posts/using-travis-ci-to-build-and-deploy-sites/</guid>
      </item>
    
      <item>
        <title>Amazon EMR, Apache Spark, and Apache Zeppelin</title>
        <description>&lt;p&gt;I wrote a couple of guest posts about &lt;a href=&quot;http://www.cloudacademy.com/blog/big-data-amazon-emr-apache-spark-and-apache-zeppelin-part-one-of-two/&quot;&gt;getting started with Apache Spark&lt;/a&gt; and &lt;a href=&quot;http://www.cloudacademy.com/blog/big-data-getting-started-with-amazon-emr-apache-spark-and-apache-zeppelin-part-two-of-two/&quot;&gt;Apache Zeppelin&lt;/a&gt; on &lt;a href=&quot;https://aws.amazon.com/elasticmapreduce/&quot;&gt;Amazon EMR&lt;/a&gt;. These articles assumed that an &lt;a href=&quot;https://aws.amazon.com/iam/&quot;&gt;IAM&lt;/a&gt; user has been created with &lt;code class=&quot;highlighter-rouge&quot;&gt;AmazonElasticMapReduceFullAccess&lt;/code&gt; managed policy attached to it. In this blog post, I will show you how to set up this IAM user for EMR.&lt;/p&gt;

&lt;p&gt;To begin using the &lt;a href=&quot;https://aws.amazon.com/cli/&quot;&gt;AWS CLI&lt;/a&gt;, you need to &lt;a href=&quot;http://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html&quot;&gt;create an administrative IAM user&lt;/a&gt; and &lt;a href=&quot;http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html&quot;&gt;configure it to use its access keys&lt;/a&gt;. After that, we can then create the IAM user for EMR. We will call this user &lt;code class=&quot;highlighter-rouge&quot;&gt;emr&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam create-user --user-name emr
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;User&quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;UserName&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;emr&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Path&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;CreateDate&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;2016-03-11T14:32:08.782Z&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;UserId&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;AIDAID746LKJUJI5SGLOC&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Arn&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;arn:aws:iam::548698731369:user/emr&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;To attach a policy to user &lt;code class=&quot;highlighter-rouge&quot;&gt;emr&lt;/code&gt;, we can call the &lt;code class=&quot;highlighter-rouge&quot;&gt;aws iam attach-user-policy&lt;/code&gt; command with the policy ARN.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AmazonElasticMapReduceFullAccess --user-name emr
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We also want to grant the user with the &lt;code class=&quot;highlighter-rouge&quot;&gt;iam:GetUser&lt;/code&gt; action. This way, we can verify that we are executing the AWS CLI commands as user &lt;code class=&quot;highlighter-rouge&quot;&gt;emr&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;cat iam-get-user.json
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;Version&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;2012-10-17&quot;&lt;/span&gt;,
  &lt;span class=&quot;s2&quot;&gt;&quot;Statement&quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&quot;Action&quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
	&lt;span class=&quot;s2&quot;&gt;&quot;iam:GetUser&quot;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;,
      &lt;span class=&quot;s2&quot;&gt;&quot;Effect&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;Allow&quot;&lt;/span&gt;,
      &lt;span class=&quot;s2&quot;&gt;&quot;Resource&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;arn:aws:iam::548698731369:user/emr&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam create-policy --policy-name make-emr-get-user --policy-document file://iam-get-user.json
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;Policy&quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;PolicyName&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;make-emr-get-user&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;CreateDate&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;2016-03-11T15:05:22.936Z&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;AttachmentCount&quot;&lt;/span&gt;: 0,
        &lt;span class=&quot;s2&quot;&gt;&quot;IsAttachable&quot;&lt;/span&gt;: &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;PolicyId&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;ANPAJ3I5BYXIMET5E5UVC&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;DefaultVersionId&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;v1&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Path&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Arn&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;arn:aws:iam::548698731369:policy/make-emr-get-user&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;UpdateDate&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;2016-03-11T15:05:22.936Z&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam attach-user-policy --user-name emr --policy-arn arn:aws:iam::548698731369:policy/make-emr-get-user
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Once this is done, we can go ahead and create an access key for user &lt;code class=&quot;highlighter-rouge&quot;&gt;emr&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam create-access-key --user-name emr
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;AccessKey&quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;UserName&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;emr&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Status&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;Active&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;CreateDate&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;2016-03-11T14:37:03.144Z&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;SecretAccessKey&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;AccessKeyId&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;ABCDEFGHIJKLMNOPQRST&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We will export two environment variables. After that, run &lt;code class=&quot;highlighter-rouge&quot;&gt;aws iam get-user&lt;/code&gt; and it should show you information about user &lt;code class=&quot;highlighter-rouge&quot;&gt;emr&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ABCDEFGHIJKLMNOPQRST
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam get-user
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;User&quot;&lt;/span&gt;: &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;UserName&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;emr&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Path&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;CreateDate&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;2016-03-11T14:32:08Z&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;UserId&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;AIDAID746LKJUJI5SGLOC&quot;&lt;/span&gt;,
        &lt;span class=&quot;s2&quot;&gt;&quot;Arn&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;arn:aws:iam::548698731369:user/emr&quot;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you see this error, that means that you did not grant the user with the &lt;code class=&quot;highlighter-rouge&quot;&gt;iam:GetUser&lt;/code&gt; action.&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;aws iam get-user

A client error &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;AccessDenied&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; occurred when calling the GetUser operation: User: arn:aws:iam::548698731369:user/emr is not authorized to perform: iam:GetUser on resource: arn:aws:iam::548698731369:user/emr
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;After performing all these steps, you can now follow along with my articles to create your own EMR cluster. Have fun!&lt;/p&gt;

</description>
        <pubDate>Sat, 12 Mar 2016 00:00:00 +0800</pubDate>
        <link>https://temasek.org/posts/amazon-emr-apache-spark-and-apache-zeppelin/</link>
        <guid isPermaLink="true">https://temasek.org/posts/amazon-emr-apache-spark-and-apache-zeppelin/</guid>
      </item>
    
      <item>
        <title>Hello World</title>
        <description>&lt;p&gt;What better way to start the year than beginning a new blog?&lt;/p&gt;

&lt;p&gt;I plan to use this space to build my portfolio of data science and data engineering projects. I also intend to write about my technology and business endeavours as I tackle them. More importantly, I want to get into a writing habit. I do &lt;a href=&quot;http://www.cloudacademy.com/blog/author/eugene/&quot;&gt;occasionally write&lt;/a&gt;, but I should write more.&lt;/p&gt;

&lt;p&gt;Join me as I embark on a new journey to reinvent myself to become a better technology leader.&lt;/p&gt;

&lt;p&gt;To infinity and beyond!&lt;/p&gt;

</description>
        <pubDate>Sat, 02 Jan 2016 00:00:00 +0800</pubDate>
        <link>https://temasek.org/posts/hello-world/</link>
        <guid isPermaLink="true">https://temasek.org/posts/hello-world/</guid>
      </item>
    
  </channel>
</rss>
