React Hooks: A very brief intro

React Hooks API appears to be a immediate-mode layer on top of the traditional retained-mode style React system. Internally, the library knows which component is currently being rendered and since a hook can only be called from a React component function or another hook, React is able to keep track of function calls to the hook APIs to ‘magically’ manage state without being explicit about function calls across multiple render cycles.

Read More

Trigger bash commands in a Docker container from host

Here is an easy way to trigger a command inside a docker container. One use case of this is to trigger a compiler, which is running inside a container, to recompile sources. Make sure inotify-tools is installed on the container, apt install inotify-tools (Debian/Ubuntu), pacman -S inotify-tools (Arch). It’s also assumed some directory is mounted on the container which the host can write to and container can read. The trick here is a .

Read More

An Implementation of Parallel Shearshort in C using PThreads

This will be a look at a parallel implementation of Shearsort using POSIX Threads (PThreads) in the C programming language. This is not meant to be an efficient or optimal implementation, nor should it be considered production ready code. This is purely an educational exercise. I’m also not a seasoned C/C++ developer, so expect some errors or downright stupidity here and there. If you have any suggestions for improvements feel free to create an issue on GitHub.

Read More

GNOME Mutli-Monitor Workspace Fix (Gnome 3.30)

workspaces_only_on_primary setting is suppose to make workspaces work correctly [1] in a multi-monitor setup. There are older articles on the internet about enabling this option, but they won’t work with newer versions of GNOME. Prior to 3.30, I was using a very similar command which was described by Greg Cordts in his post on the subject. After upgrading to GNOME 3.30, this way of enabling the option stopped working. After reporting this to the GNOME team as a bug, two individuals provided some very useful information,

Read More

Hide YouTube's "Recommended For You" suggestions

One thing I find quite annoying with YouTube is “Recommended For You” spam in the related videos section. I do not sign into YouTube and use Firefox Containers so most “Recommended For You” videos are irrelevant, distracting, and seem suspiciously like they’ve been paid for (I don’t know if this is true). As a user of uBlock Origin, I do have the ability to add custom filters to block DOM elements.

Read More

Using Rsync to efficiently backup (mirror) hard drives

The concepts discussed here are not Raspberry Pi specific and can easily be adapted for other uses. Background I have a Raspberry Pi setup with an external hard drive that is accessible over Samba. It’s be quite reliable so far, but I wanted to backup the data to another external drive hooked up to the same Raspberry Pi. I found a simple solution to this problem using Rsync and Systemd timers (as opposed to installing Cron and learning Cron, but if you wish, you can substitute Systemd with Cron).

Read More