aliquote.org

lost+found 2016

December 21, 2017

Here are some draft notes, written in 2016, unfilled but not lost forever. With slight edits to accomodate a proper archive blog post.

Docker

(August 2016)

Docker allows to wrap software into a dedicated filesystem available on a server without having to build a complete virtual machine (VM) with its own operating system (OS). Docker containers can thus run as isolated processes on any computer and any OS.

Getting started with Docker

There are actually two options to install Docker on a Mac: Docker Toolbox and Docker for Mac. The latter does not need to have Virtual Box installed since it relies on Hyperkit instead.

If everything went fine, we should be able to query Docker version at the shell prompt:

% docker --version
Docker version 1.12.0, build 8eab29e

(Omitting the -- results in a more verbose output.)

Now, with docker run hello-world we can confirm that everything is working as expected. Finally, to check that the ngynx server is also working we can just type:

% docker run -d -p 80:80 --name webserver nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx

As in the previous case, Docker will pull the relevant image from the internet, or more precisely the Docker Hub. This may take some time depending on your internet connection. The VMs are installed in ~/Library/Containers/com.docker.docker/. It should be noted that this is not reported by docker info. We now have a running instance of Docker as shown below:

% docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                         NAMES
706c4d957b24        nginx               "nginx -g 'daemon off"   13 minutes ago      Up 13 minutes       0.0.0.0:80->80/tcp, 443/tcp   webserver

(For whatever reason, I couldn’t check that ngynx is working on http://localhost using Emacs eww and I had to launch my browser.)

To stop the running container, we just use the following command:

% docker stop 706c4d957b24

where 706c4d957b24 is the contained id that docker ps displayed (assuming we didn’t set a name–using the --name switch–when launching the container).

Well, that’s pretty all we need to know to start from scratch with Docker.

Spacemacs

(March 2016)

As discussed in many posts of mine, I am a big fond of GNU Emacs. I use it all the time in my daily work. Last year I was just saying that I will stay with my Homebrewed Emacs and my own configuration. I finally resign, like I did before when I decided to switch to Homebrew instead of compiling everything from scratch on my Mac. The main reasons are: I no longer need to keep an eye on what best packages do exist for specific tasks since Spacemacs, Prelude or other Emacs distribution will likely include them in their core packages; I also don’t need to worry about updating my whole emacs.d, since those same distributions usually allow to update everything quite easily.

In the mean time, I found interesting blog posts like Spacemacs for 2016 or Org mode and Pandoc where authors describe their experience with Spacemacs.

Everything seems to work right out of the box. A quick check allowed me to confirm that Slime and CIDER can be directly fired from a Lisp or Clojure buffer, while IPython is the default REPL that is launched when visiting a Python file. Spacemacs relies on anaconda mode (not to be confused with Anaconda Python) which was a little bit tricky to configure (I ran into trouble with Homebrew Python and then once I installed Anaconda Python, with pip itself1; but see this discussion). Most important to me is the ability to use ESS to manage my statistical projects, and it also proved to work quite smoothly.

Spacemacs in 2016

Some key features are highlighted below:

Oups, it looks like this has yet to be written.

  1. And then with Python 3.5, which was installed as the default Python interpreter by conda, because I use offlineimap to fetch my email on my local HD (and process them with mu4e) and it is not compatible with Python 3.5, sigh. Maybe I should just switch to mbsync or imapfw, which might replace offlineimap at some point. ↩︎

See Also

» lost+found 2015 » Why I am still using Emacs » lost+found 2014 » Fixing some critical keyboard shortcuts in OS X terminal » Emacs Org-mode and literate programming