Jekyll blog on Amazon S3

February 13, 2015

I've converted my blog from WordPress to Jekyll. Here is some note on what I did to set it up on my Arch Linux computer.

Setting up the working environment

Use WordPress admin tool to export the blog content to XML file, then install:

gem install jekyll-import --pre
gem install hpricot

After that, import the XML file:

ruby -rubygems -e 'require "jekyll-import";
    JekyllImport::Importers::WordpressDotCom.run({
      "source" => "wordpress-everbot.xml",
      "no_fetch_images" => false,
      "assets_folder" => "assets"
    })'

Installing Ruby gem bundler

gem install bundler
Fetching: bundler-1.8.0.gem (100%)
WARNING:  You don't have /home/squallltt/.gem/ruby/2.2.0/bin in your PATH,
          gem executables will not run.
Successfully installed bundler-1.8.0
Parsing documentation for bundler-1.8.0
Installing ri documentation for bundler-1.8.0
Done installing documentation for bundler after 2 seconds
1 gem installed

Create Gemfile with the following content:

source 'https://rubygems.org'

gem 'jekyll'
gem 'coderay'
gem 'sass'
gem 'octopress', '~> 3.0.0.rc.12'
gem 'jekyll-sitemap'

Then install the gems

bundle install --path vendor/bundle

Install nodejs:

sudo pacman -S nodejs

After that, generate static pages and start the server:

bundle exec jekyll serve

Once the server started, the result website can be accessed at http://localhost:4000/ or http://127.0.0.1:4000/.

If you receive the following error

FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info on how to fix this.
jekyll 2.4.0 | Error:  FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info on how to fix this.

then execute the below command to fix it:

sudo sysctl fs.inotify.max_user_watches=1000000

To see the list of installed gems:

gem list

Easy deployment with s3cmd

To easily deploy the static website to my Amazon Simple Storage Service, I use s3cmd. First, go to S3 console page and Enable Website Hosting and then set index document to index.html and set error document to 404.html

Install s3cmd on Arch Linux:

sudo pacman -S s3cmd

Configure and set up Amazon account:

s3cmd --configure

Deploy to Amazon server:

s3cmd sync _site/ s3://www.everbot.com/

(remember to add the slash / at the end of the target bucket name)

My working environment set up with bspwm, zsh, urxvt, tmux and vim on Arch Linux

(Select `720p` (or `1080p`) HD video quality and watch in full screen mode if you want to see the commands)This video showcases my latest...… Continue reading

Full disk encryption on Arch Linux

Published on March 02, 2015