A new piece is born

I am finally on the final stretch of completing Fadeferra V.2. There is even a short teaser video. This video game piece will be premiered at the Linux Audio Conference 2019 which is hosted by Stanford University this year. The exact date and time is not determined yet but it will be between March 23 and 26, 2019. I will also be presenting two papers. More info to come.

Hosting through gitlab pages

Custom domain

The official documentation for adding a custom domain to gitlab pages is here.

The process is pretty straight forward. I use Gandi as domain name registration service and I had a little hiccup on the registration so I am posting the relevant sections here:

@ 10800 IN A 52.167.214.135
@ 10800 IN TXT "gitlab-pages-verification-code=0000000000000000000000000000"
djiamnot.xyz 10800 IN CNAME djiamnot.gitlab.io.
www 10800 IN CNAME djiamnot.gitlab.io.

Certificates

Let's use letsencrypt via acme.sh because we like to have it easy.

git clone https://github.com/Neilpang/acme.sh.git
cd ./acme.sh
./acme.sh --install

Generate a Gandi API key (admin->Security section)

then:

export GANDI_LIVEDNS_KEY="ffffffff00000000"
acme.sh --issue --dns dns_gandi_livedns -d djiamnot.xyz

Then copy the generated fullchain.cer to GitLab's pages certificate field and your .key to the private key field.

This should do it but you may have to wait a while before it kicks in. Don't forget to change your Nikola configuration (or whatever you use) tu use https as a base url of your site.

My Take at Nikola, orgmode, docker

This site is built with Nikola and runs on GitLab. Moreover, it is deployed automatically using Travis CI. I recently needed to set up for Nikola and orgmode and figured, why not write about it so that I can have my own reference if I had to do it again.

Docker

I use docker in this case. Nikola is written in Python and could be easily installed both system-wide or in virtualenv but I opted for a docker image to keep it streamlined and have the ability to use the same docker image for the Travis CI. Install docker. I used the available at the time dockerfile (https://gitlab.com/paddy-hack/nikola) which needed a small tweak: emacs (and thus orgmode) support. My setup, including .gitlab-ci.yml is here: https://gitlab.com/djiamnot/nikola-docker

Note: At the time, I just wanted to get started on something. Today, I notice that there is another dockerfile using docker-compose available: https://madflex.de/posts/nikola-setup-using-docker/. YMMV, I guess.

Install docker

sudo -S apt-get remove docker docker-engine docker.io

(The added bonus is that the code in the .org source file can be executed directly with C-c C-c)

sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

On Ubuntu:

sudo add-apt-repository \
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
    stable"

(other distributions, see: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-from-a-package)

sudo apt update
sudo apt-get install docker-ce

You will probably want to add your user to docker group.

Nikola

To be honest, I chose Nikola because it's Python. I've considered Jekyll, I've flirted with Pelican (Python as well) but got a good Nikola vibe. I have not yet customized anything, I did not write a line of code. Well, I admit, one feature that tipped over in favor of Nikola was orgmode support.

Orgmode

I have been using orgmode for several years now. I have been using it as a ToDo list, project management, agenda, I have done some writing in it, I toyed with music typesetting with orgmode and Lilypond, literate programming is a bit tempting as well. Orgmode works for me also just as a simple markup language and it will export your sweat into many, many formats.

Workflow

Initial setup

  • Install docker.
  • Get my docker file git clone https://gitlab.com/djiamnot/nikola-docker.git
  • Inside the checked dorectory: docker build -t nikola .
  • Then read about docker registry: https://docs.docker.com/registry/introduction/
    • Once I've figured out my access to the gitlab registry, I do:
    • docker login registry.gitlab.com
    • from the docker repo: docker build -t registry.gitlab.com/djiamnot/djiamnot.gitlab.io . and then docker push registry.gitlab.com/djiamnot/djiamnot.gitlab.io

I can run the nikola docker image locally as such

docker run --rm -v $PWD:/site -w /site -u $(id -u):$(id -g) -p 8877:8000 nikola nikola

Writing, deploying.

To create this post I used the following command

docker run --rm -v $PWD:/site -w /site -u $(id -u):$(id -g) -p 8877:8000 nikola nikola new_post -f orgmode -t "My Take at Nikola, orgmode, docker" -a MiS --tags="orgmode,docker,nikola" -e

This command will serve serve the thing for inspecting locally on port 8877.

docker run --rm -v $PWD:/site -w /site -u $(id -u):$(id -g) -p 8877:8000 nikola nikola serve

Commit and push to gitlab repo, once configured, will automatically build the site.