Posts about literate

Setting up a GitLab environment with the GitLab Environment Toolkit

This post is a notebook. It contains instructions to set up and create a GitLab environment in Google Cloud Platform (GCP) using the GitLab Environment Toolkit (GET), installed into a VS Code Dev Container.

The idea is that it's a literate sysadmin runbook, which can be copied and repeated within my get-container.

Notebook instructions

To use this, you must be running Jupyter Notebook with the Bash kernel installed. This is explored in detail on my earlier blog post. Jupyter and the extension should already have been installed when the GET Dev Container was provisioned. If not, then re-run the playbook:

ansible-playbook $WORKSPACE/.devcontainer/get/setup.yaml

Then start jupyter:

jupyter notebook --no-browser --allow-root

(this is aliased to notebook)

Select Kernel

Once jupyter is running in the dev container, you can open this notebook and select the Bash kernel from the Select Kernel button at the top of the buffer. The Bash kernel directly runs bash shell commands, rather than python.

Use Jupyter Notebooks for bash scripting

I'm experimenting with using Jupyter to capture Linux server commands in a Notebook while I figure out doing GitLab Geo setup. It's complicated, so I want to keep good notes, but copy/paste from the terminal to a text editor is a chore I'd rather not deal with. Instead I would like to keep a literate-programming style notebook. I learnt recently that there is a Jupyter kernel for running bash instead of python, and that would be ideal.

This post describes how to set up using Jupyter Notebooks on a remote host, and then running and editing notebooks using Visual Studio Code's support for Jupyter.

You can also do this without VSCode, by SSH tunnelling a local web browser to the host. That would be better in cases where users' /home volume size is restricted. I briefly discuss this too.

4-bit Rules of Computing, Part 3

Here is the forth part of my blog series expanding on my 4-bit rules of computing.

Previously in Milosophical Me: Mike was reflecting on Comments, both in source code and in social media, and had come to the conclusion that they are to be avoided, that they can be more harmful than helpful, and that source codes (and people) should be allowed to speak for them selves.

There is an exception to Rule 5 (Rule 0 allows for this): doc-comments. In this post I explore what they are, how they differ from regular comments, and how to use them to assist your fellow hackers.

Read more…

Exploring Minecraft code in Jupyter

Some breif notes from a lazy Sunday morning spent exploring the minecraft coding environment that I set up using Raspberry Jam earlier. I'm taking my notes in Jupyter while I explore the Minecraft API and poke around with one of the sample programs. Since my blogging engine Nikola also supports Jupyter Notebooks as one of it's import formats, I found that I could do Litterate Programming for Minecraft quite nicely!

Read more…

4-bit Rules of Computing, Part 2

Here is the third part of my blog series expanding on my 4-bit rules of computing.

In this installment: Rules 5, on comments. Rule 5 is a bit contentious and I've taken too long in writing my thoughts on it — which is probably telling. Nonetheless I still want to press ahead and get these words out. I also wanted to include Rule 6 with this post, but I'm taking my own advice and breaking the post into two, because it really was getting quite long.

Read more…