Atom Feed

Geographic Geometry Simplification

February 2, 2023

Douglas-Peucker Algorithm

Simple explanation: Remove points PX that are less than the distance between the significant points P<X and P>X.

Douglas-Peucker Visualization

Visvalingam Algorithm

Simple explanation: Remove the point PX that forms the minimum area triangle with PX-1 and PX+1. Repeat until the area is above a threshold.

Visvalingam Visualization



January 2, 2023

A list of linters that I use for my projects:

Language Linter
Python black
Python flake8
Go GoVet
Go Staticcheck
Go Errcheck
Go Golangci-lint
Javascript eslint
Bash Shellcheck
Makefile Checkmake
Dockerfile Hadolint
Nginx Gixy
Vimscript vint
LaTeX chktex


Installing Mysqlclient in Python Slim Docker Image

December 29, 2022

Installing the mysqlclient python package in a python:3.11-slim docker container fails because the slim version leaves out the libraries needed to compile mysqlclient. Rather than using the full python:3.11 base image that is much larger, you can install the mysqlclient dependencies manually:

FROM python:3.11-bullseye

# Install mysqlclient debian package dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
   libmariadb-dev-compat gcc                   `: MySQL client` \
&& rm -rf /var/lib/apt/lists/*

# Install mysqlclient python package
RUN pip install --no-cache-dir mysqlclient


Processor Trends

December 19, 2022

42 Years of Processor Data

42 Years of Processor Data


Resizing a Ubuntu Disk in a UTM VM

October 19, 2022

UTM is an awesome virtualization system based on QEMU built for M1 (ARM) Macs. v4.0.8 of UTM, the first v4 stable release, came out today with support for resizing QEMU disk images but while the UTM docs show how to resize the UTM machine, there’s several more steps to get the virtualized file system to recognize the additional disk space.

For an Ubuntu guest OS running a default GPT and LVM partition:

  1. On a shut down VM, in the UTM UI’s configuration, select the disk you wish to expand, resize the disk, and save the VM configuration.
  2. Launch the VM and get a terminal
  3. Run sudo fdisk -l and confirm that there is a GPT PMBR Size Mismatch will be corrected by w(rite) warning
  4. Run sudo parted -l and gparted should ask to automatically fix the size mismatch. Fix the size mismatch.
  5. Run sudo lvm to get an lvm console
  6. Run lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv to expand the lvm logical volume
  7. Exit the lvm console
  8. Run sudo resize2fs /dev/ubuntu-vg/ubuntu-lv to expand the ext4 file system to the logical volume
  9. Run df -h to confirm that the /dev/mapper/ubuntu--vg-ubuntu--lv has been expanded.



Bash File Test Operators

October 5, 2022

Python Generic Type Annotations

May 28, 2022

Mac Menubar Applications

February 17, 2022


February 13, 2022

Python Releases

January 8, 2022

Debian Releases

January 7, 2022

Ubuntu Releases and Support Periods

December 18, 2021

Monitoring System CLIs (Top for X)

December 18, 2021

Fixing "EFI stub: Exiting boot services and installing virtual address map..."

December 11, 2021

ARM Support

November 29, 2021

Map Caps Lock to Escape for Vim

November 24, 2021

Download and Convert Youtube Playlists to MP3 Files

July 15, 2021

Nobody Ever Got Fired for Copying FAANG

June 27, 2021

Removing Token Authentication From Jupyter/iPython Notebooks

May 31, 2021

Debian and Ubuntu Releases

February 13, 2021

Setting Up FastAI Fastbook on a Fresh Ubuntu Instance

January 31, 2021

Tip for Developer Tools Startups

January 30, 2021

A Better Go Defer

October 20, 2020

Covid-19 Economy Predictions

October 13, 2020

Basic Docker Monitoring

July 4, 2020

Switching From Go Dep to Go Mod

May 30, 2020

Upgrading LibMySQLClient in Python MySQLDB/MySQLClient

May 25, 2020

Developing Django in Production

May 15, 2020


March 5, 2020

Sendmail Wrapper for Mailgun

March 1, 2020

Python Release Support Timeline

December 26, 2019

Use the Default Flake8 Ignores

December 14, 2019

Making Pip Require a Virtualenv

December 5, 2019

Engineering Toolbox

November 30, 2019

Node Timezones

November 1, 2019

Sampling Samples

August 21, 2019

Rotating a NxN Matrix in One Line of Python

July 27, 2019

iTerm2 Search History

July 19, 2019

Nginx Auth With IP Whitelists

June 29, 2019

Bash Strict Mode

May 11, 2019

Optimizing Asus Routers for Serving Websites With Cloudflare

May 5, 2019

Browserify, Mochify, Nyc, Envify, and Dotenv

April 1, 2019

Scraping Images From Tumblr

February 24, 2019

There Are Too Many NPM Packages

February 10, 2019

Programmers Writing Legal Documents

January 31, 2019

Solidity Review

November 17, 2018


November 9, 2018

My First Server's IP

November 9, 2018

Installing Netdata

September 23, 2018

Interrobang Versus Shebang

July 10, 2018

Bad Interview Questions

July 8, 2018

Showing Users in Different Databases

July 7, 2018

Some MIT (Undergraduate) Admissions Interview Advice

July 4, 2018

Optimize the Develop-Test-Debug Cycle

April 22, 2018

Example of Python Subprocess

March 23, 2018

Spotted in Taiwan

January 20, 2018

Fixing "Fatal Error: Python.h: No Such File or Directory"

December 16, 2017

Cassandra Primary Keys

December 11, 2017

MyPy Review

November 2, 2017

Griping About Time Zones

October 26, 2017

Bundling Python Packages With PyInstaller and Requests

September 23, 2017

Go Receiver Pointers vs. Values

September 4, 2017

Fixing Latency

September 1, 2017

Showing Schemas in Different Databases

August 26, 2017

Straight Lines

June 2, 2017

Emerson on Intellect

May 29, 2017

Core Metric for Developer Productivity

May 21, 2017

How to Capture a Camera Image With Python

May 7, 2017

Python Has a Ridiculous Number of Inotify Implementations

May 2, 2017

Projects: Gentle-Alerts

April 27, 2017

Creating a New PyPI Release

April 24, 2017

Eva Air USB Ports

April 24, 2017

Projects: Git-Browse

March 18, 2017

Cassandra Compaction Strategies

March 5, 2017

Code Is Like Tissue Paper

January 25, 2017

Seen in a Bathroom Stall at MIT

January 24, 2017

Underused Python Package: Webbrowser

January 21, 2017

Pax ?

January 5, 2017

Golang Review

January 2, 2017

Wadler's Law

December 15, 2016

Tunnel V2

December 8, 2016


December 5, 2016

SSH Tunnel

September 18, 2016

That Time I Was a Whitehat Hacker

September 18, 2016

Comparison of Country and Company GDPs

September 8, 2016

Sketching Science

September 8, 2016

Tech Hiring Misperceptions at Different Companies

July 22, 2016

Calculating Rails Database Connections

June 26, 2016

DevOps Reactions

June 12, 2016

Tuning Postgres

June 9, 2016


June 4, 2016