Cython – Tips and Tricks

Don’t overthink it – your .pyx is converted to a .c file and then converted into a Python callable extension module. This can be confusing at first – including, what language are you coding in? Essentially you are coding in Python, with some extensions/limitations that allow you to mix in some C like constructs and…

A Brief and Practical Introduction to Cython

What is Cython and what do I use it for? Cython is an extension of the Python programming language that enables C/C++ and Python interop as well as speeding up Python code. There are three main use cases for Cython: Exposing functionality written in Python to native code written in C/C++ – this use case…

TP-Link Kasa HS210 kit and 4-way switch circuits

tl;dr: If you are having problems with the Kasa three-way switch in a four-way circuit where the Kasa app and Alexa don’t see the right state of the circuit (on/off), make sure you replace both three-way switches in the circuit with HS210 switches. That will fix the problem. For a change, I’m writing about some…

Fixing _share_cuda_ Unsupported Operation and Out of Memory Errors with fastai lessons

As mentioned before, I am trying to setup and run the fastai notebooks locally to get some hands-on exposure to deep learning. Unfortunately, if you are running this on Windows or have a very low-end GPU environment like myself you will run into additional problems. First, on Windows, I was hitting the error _share_cuda_ operation…

Setting up and running Jupyter notebooks for the FastAI book locally on Windows or on a Google Cloud Linux Instance

I decided to learn a little bit more about deep learning in practice and bought the Deep Learning for Coders with fastai and PyTorch: AI Applications Without a PhD book to help me get some hands-on exposure to deep learning. I did get the notebook and first examples running on gradient but I was also…

Mounting SMB shares reliably on a Linux WiFi Laptop with AutoFS

As I mentioned here, I have been running Manjaro Linux on my home laptop for almost a year now and for the most part it has worked well. My setup is that most of the useful storage is on my home server and I was mounting these as SMB shares on the laptop. Initially, I…

Fixing slow shutdown in Linux from CIFS/SMB mounts over WiFi

After a pleasant year of using Manjaro Linux on my laptop at home, I started seeing problems with SMB mounts. My setup is that I have all of the main storage on my home server which is shared through SMB shares and these shares are mounted on the laptop through SMB4k. SMB4k started doing strange…

APCUPSD Configuration Issue in Ubuntu 18.04

As part of my home network setup, I have an APC UPS (XS 1500 LCD if you’re curious). I have the UPS monitoring cable hooked up to my Ubuntu home server and run apcupsd to monitor and control the UPS behavior. After I upgraded to Ubuntu 18.04, I didn’t pay attention to the UPS setup…