Thursday, August 24, 2017

Installing Docker on an Ubuntu AWS EC2 machine

sudo apt-get update

# Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

# For "sudo: unable to resolve host ip-x-x-x-x" errors, follow the following link to set "DNS Hostnames" to True:
# http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html#vpc-dns-updating
sudo true

# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
sudo apt-key fingerprint 0EBFCD88

# Use the following command to set up the stable repository.
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

# Install the latest version of Docker CE
sudo apt-get update
sudo apt-get install docker-ce
sudo docker run hello-world

# Ref: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository

Wednesday, August 23, 2017

Set up RVM, Ruby, Gem & Jykll to serve a username.github.io blog

Here are the steps I took to set up RVM, Ruby, Gem & Jykll to serve a username.github.io blog on OSX:

# Install RVM (Ruby version manager) 
# Also read: http://rvm.io/rvm/install and check the script before running
curl -sSL https://get.rvm.io | bash -s stable --ruby

# Install Ruby (replace x.y.z with latest stable version of ruby)
rvm install x.y.z
rvm docs generate-ri
rvm use x.y.z --default

# Check other requirements are available for jekyll and install if missing
gem --version
gcc --version
make --version

# Install jekyll
gem install jekyll

# Install bundler and get all dependencies
gem install bundler
bundle install

# Clone an existing jekyll template, this one from BlackrockDigital is nice
git clone https://github.com/BlackrockDigital/startbootstrap-clean-blog-jekyll.git
cd startbootstrap-clean-blog-jekyll
bundle exec jekyll serve

# Periodically update Jekyll to match the GitHub Pages server
bundle update github-pages

Reference:
https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/
http://jekyllrb.com/docs/installation/
https://jekyllrb.com/docs/posts/
https://github.com/planetjekyll/awesome-jekyll-editors