Swift FAQs

These Frequently Asked Questions are for those starting to learn Swift. As I start my journey I have a lot of questions. I'm documenting those here from the perspective of someone who has been programming for a long time in Python and has worked in other languages when needed (e.g. bash, Groovy, Go, PowerShell, etc.).

Read more …

Learn Go with Examples

I always wanted to spend more time learning Go. After a long break I finally got a chance to take it up seriously. The best lesson for me was to not learn it from scratch like I did with my first programming language. I learned a few basics first from the official documentation and Learn Go Programming - Golang Tutorial for Beginners. Since I'm already well experienced in writing good sized code bases in Python, I decided to dive right in and implement a project on top of Azure SDK. One big advantage of this approach was that I could learn from working examples in Azure documentation and build my knowledge over time. The second advantage was that I was building something useful right away that kept my motivation up; I wasn't building some abstract thing where I also needed to conjure a problem and solution.

Read more …

Handle SIGHUP with Python asyncio

Python's asyncio enables a variety of use cases and workflows. In this post we'll explore the ability to send a SIGHUP signal so one async task (or more) can reload its configuration and continue. It's similar in concept to the nginx -s reload command where nginx reloads its configuration without restarting.

Read more …

Apply Patch to OpenBSD

Do a search and you'll find very little official comprehensive tutorial-type documentation on how to apply one or more patches to OpenBSD. The information is spread among different manual pages and such.

As described in Security updates FAQ:

While applying fixes from the errata page typically requires less time
than a CVS checkout/update and rebuild, there is no universal set of
instructions to follow. Sometimes you must patch and recompile one
application, sometimes more.

Here's how I patched an OpenBSD 6.3 system running on Cubox i4-pro with 32GB MicroSD card in July of 2018.

Read more …

Package Python in a Snap

Getting newer versions of Python on long term support releases of Linux distributions, such as Ubuntu or CentOS, without interfering with the system Python can be pretty involved. Doing it on multiple instances is even harder. Fortunately, it is possible and quite easy by using snapd.

Read more …