Back to Bas(h)ics: leaving zsh for now

I’ve used zsh for nearly two years now. I have a custom setup with autocompletion and a good looking prompt. Recently I’ve been diving deeper into bash scripting, following tutorials by rwxrob. He emphasizes all the time that it is much better to stick to bash instead of zsh. Advantages of using bash: the default Linux shell available on any Linux system full documentation available anywhere at all times with man bash free software less dependent on external plugins and configurations more portable practice by working on the command line The fact that working on the commandline is already coding convinced me to leave my beloved customized prompt behind (for now) and go back to the basics. ...

January 8, 2023 Ā· Mischa van den Burg

How to deploy to a Linux VM in Azure with Azure Pipelines

To reach a VM from Azure Pipelines, you need to set up an environment. Create your Linux VM in Azure. In Azure DevOps, click envirnoments, new, and select the Virtual Machine option. A command is generated for you. SSH into your VM and run the command. Now the VM should show up under environments in Azure DevOps. Set up a repo with an azure-pipelines.yml with these contents to test. under environment, set the same name as you did in Azure DevOps for your environment. ...

January 8, 2023 Ā· Mischa van den Burg

Deploying a Linux VM to Azure with Terraform

For a project I’m setting up my environment with Terraform. I used this tutorial, but modified the code to make it simpler and easier to understand for beginners. The original uses a random module to generate random names, and generates a new SSH key. Also, this tutorial uses expensive VM tiers and Premium storage, which are not necessary when you are learning. I also thought the SSH configuration was overcomplicated. My version just takes an SSH keypair stored at ~/.ssh/id_rsa.pub ...

January 7, 2023 Ā· Mischa van den Burg

How to follow symbolic links while searching with Telescope in neovim

I use the Obsidian app, but I mostly write and search my notes with neovim. I added my zet directory from this blog repo into the Obsidian vault as a symbolic link, but I soon discovered that these files were not being searched. Telescope.nvim uses ripgrep (rg) to do the live grepping in its search, and ripgrep does not follow symbolic links by default. You need to pass the -L flag to it. ...

January 6, 2023 Ā· Mischa van den Burg

How to install the Openstack CLI on Linux

Make sure to have pip installed. Run pip install python-openstackclient Pip will install a binary called ā€œopenstackā€ in ~/.local/bin If the openstack command is not available in your session, you might need to add it to your PATH: export PATH="$HOME/.local/bin:$PATH" Add this to your ~/.zshrc or ~/.bashrc to make sure this happens for each shell session. Don’t forget to source your updated ~/.zshrc if you chose to add it: source ~/.zshrc ...

January 5, 2023 Ā· Mischa van den Burg

How to Reset a VM Root Password using the Openstack CLI

Download the Openstack RC file from the Openstack portal. Click your username in the top right corner to find it. Source the RC file to make the environment variables avaialable to your current session: source ~/my_openstack.sh Find the instance ID of your VM from the portal. Run openstack server set --root-password be3xxxx5-8348-418b-xxxb-c4xxxx575cd You will be prompted for the new password which will be set on the virtual machine.

January 5, 2023 Ā· Mischa van den Burg

How to run installed pip packages as binaries

When you install a pip package which is meant to be run from the command line as a command, you might find that it is not available to you after installation. If this happens, it might be that the path is missing from your PATH variable. Therefore, the shell does not source these binaries when initiated, and does not know that these executables exist. You can find the location of your binaries by running pip show package_name ...

January 5, 2023 Ā· Mischa van den Burg

Working on the command line is already coding

Rob Muhlenstein makes an interesting point that using bash on the command line is already coding. When you are running commands in the terminal, you are coding one line at a time. When you put these commands in a file you have a bash script. Therefore, he argues that bash should be your first language. I think this is such an interesting point. I’ve been using Linux and working on the command line for years but it never dawned on me that I, in fact, was coding while working on the command line. However, when I was writing bash scripts, I did consider myself to be coding. There is literally no difference. A bash script is just a string of commands that you would enter manually anyway. ...

January 5, 2023 Ā· Mischa van den Burg

Fall in love with sed.

Sed, it’s so powerful. I remember I struggled with finding practical uses for it when I did my LPIC-1 certification. But now I find myself using it several times a week. It is so powerful to edit multiple files at a time. I use it for work, but also for making changes to my entire second brain in Obsidian with one command. Today I needed to update my /articles/ links to /zet/articles/ links because I’m restructuring my website. Here is the sed expression that is executed for every markdown file that is found by fd: ...

January 4, 2023 Ā· Mischa van den Burg

How This Blog is Created, Written and Hosted

As I alluded to in my article about Obsidian, I am very fond of editing my text in neovim. Naturally, if you want to edit in neovim, you need to have your text as local files. I keep all of my personal notes in markdown. Previously I was using WordPress, but the editing and writing experience became torture which I could not endure any longer. I looked for a different solution that would allow me to edit my files locally instead of in the browser. ...

January 3, 2023 Ā· Mischa van den Burg