Blog

Looping through an array in shell script

Generally speaking, when I need to work with an array or dictionary type of variable, I tend to reach for something other than Bash / shell scripting. This primarily stems from the fact that Bash didn't support arrays until version [...]

How to comment source code

One of the biggest offenses that I've seen over my entire software engineering career is a total disregard for code comments. I don't subscribe to the idea that code should be self documenting. I do believe that human are inherently [...]

Splitting a string into two variables

Even though the command-line is like my second home, I still fall short in terms of being able to some basic things. This is primarily because they just don't come up that often so when I do figure out how [...]

How to get the default git branch

As the world has been shifting away from using terms like master and slave in technology, I was left wondering what the heck I was going to do about my git aliases that relied explicitly on the word master. git [...]

VPS Showdown - Germany - August 2020 - DigitalOcean vs. Lightsail vs. Linode vs. UpCloud vs. Vultr

Starting to feel like I'm taking a virtual vacation as I test out different data centers each month. This month we step into Europe to explore Frankfurt. Next month may end up taking us to Australia, but head's up, not [...]

Allow dots in paths with webpack-dev-server

Generally speaking, I don't use dots (periods, full stops, whatever else they may be called) in the URI for a website. That was, until I made the . an allowable character for user names on one of my projects. Allowing [...]

How to get the first and last item from an array in MongoDB

One of the great features of MongoDB is the ability to store an array in a document. While I'm fully aware that there are issues with storing unbounded arrays in MongoDB, due to document size limitations, there are times when [...]

swapon: swapfile has holes

While I do absolutely adore Arch Linux, it wouldn't be Arch without running an upgrade and having a problem crop up out of no where. This time around, the issue showed up after a reboot when I saw the following [...]

VPS Showdown - Singapore - July 2020 - DigitalOcean vs. Lightsail vs. Linode vs. UpCloud vs. Vultr

By request, we're revisiting the Singapore data centers for this month's VPS Showdown. Incidentally, while not part of the benchmarks currently, Linode did expand their S3-compatible Object Storage to the Singapore data center. They also turned 17 in mid-June with [...]

Load pubkey "/path/to/private.key": invalid format when using SSH

Been hitting the lottery with system upgrade related issues as of late. The latest come in the form of ssh barking about an invalid public key when connecting to a server. This wasn't happening on all of my servers, just [...]