dev

I’ve been using Jekyll for years to generate static site from my blogs. In many cases it’s enough to push the Markdown document but sometimes it does help to see it beforehand to notice broken links or as a general review. So I decided to set up dev environment for my blogs.

The Easy Way

In the past it used to be easy as running the commands below taken from Jekyll docs:

gem install jekyll bundler

Then navigate to blog folder in terminal and run:

bundle exec jekyll serve --drafts

The Hard Way

Turns out in MacOS Mojave (10.14) it doesn’t work anymore. You have run the command as root which is not advised. So I followed the commands listed here:

echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME=$HOME/gems' >> ~/.bashrc
echo 'export PATH=$HOME/gems/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

After this I was able to run the command without root but I was still getting errors. Found the solution to that on this thread:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Ran the command and followed the wizard. After that I was able to install Jekyll and run it on my local machine.

Resources

linux

To enable WSL run the following command in an elevated Powershell prompt and confirm to restart after the installation.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Now we have to install a Linux distro. Launch Microsoft Store app and search for Ubuntu. In my case I used Ubuntu 18.04 LTS version

Once it’s downloaded the installation starts automatically:

And finally set a user:

Resources

docker

To install Docker on Raspberry PI, run the following commands:

sudo apt-get install apt-transport-https ca-certificates software-properties-common -y

curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

sudo usermod -aG docker pi

sudo curl https://download.docker.com/linux/raspbian/gpg

Then edit sources.list

sudo nano /etc/apt/sources.list

and add the following line at the end:

deb https://download.docker.com/linux/raspbian/ buster stable

Make sure to replace your version name (buster above) with the correct one.

Patch and update OS:

sudo apt-get update
sudo apt-get upgrade -y

and start Docker service:

sudo systemctl start docker.service

Reboot pi and when it comes back online, run the line below to test the installation:

docker info

It should print diagnostic information about Docker.

Installing Docker Compose

The commands above don’t install Docker Compose so in order to install that run the commands below:

First the dependencies:

sudo apt-get install libffi-dev

sudo apt-get install -y python python-pip

Then Docket compose:

sudo pip install docker-compose

Resources