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 …

How to Use Python Virtualenv

A Python virtualenv is an isolated directory that serves as the root filesystem (kind of) for an installation of Python. In simpler terms, Python is installed in a non-privileged directory by a regular user. Anything installed for that instance of Python does not affect any other Python instance installed on the system.

This guide will show you how each instance of a Python interpreter differs from others and how to use this to your advantage.

Read more …