Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / gngpgupdatefiles.md
Last active March 13, 2021 16:41
Updating gnupg keychain from gpg to kbx

Bringing gnupg up to date: from gpg to kbx

GNU Privacy Guard made a change to its keystore with version 2.1 in 2014, including removal of the separate private keystore. The main difference users may notice is that the public keyring is now called "pubring.kbx" instead of "pubring.gpg". Its new keybox format is supposed to improve performance.

After continuing to use the old format through several upgrades, I finally decided to bring my evironment up to date.

The steps are in the GNUPg doc:

@plembo
plembo / reverttowsl1.md
Last active March 9, 2025 21:50
Revert to WSL 1

Revert to WSL 1 from WSL 2

I'll spare everyone the rant. This gist will be an all business how to revert to WSL (Windows Subsystem for Linux) on Windows 10 from version 2 back to version 1.

Note that enabling Hyper-V destabilized the (highly managed) system my company provides me. This is probably unique to the image used for the machine and the updates that base has received. So I'm not surprised by the issues people are having with Hyper-V and the Virtual Machine Platform.

My personal Windows virtual machines remain on WSL 1 because I just don't have the energy to deal with all the drama when I've already put in a full shift at work.

@plembo
plembo / motioneyehomesec.md
Last active November 6, 2024 18:56
Motioneye for home security

Motioneye for home security

NOTE: This is an old post. After moving on from motion to the docker-wyze-bridge with podman and a systemd user service, newer, incompatible Wyze hardware sent me down the path of replacing Wyze altogether. I'm still on track to do that next year (2025). Ultimately, the closed, proprietary nature of everything in the security camera space will probably lead me to just rely on some motion sensors and a backyard nature cam.

OK, so the "home security" part is probably overdone, but lately I've been experimenting with motioneye as the motion capture backend to the small flotilla of wifi cameras we have outside. All but one are Wyze v2 models, not rated for the outdoors but doing well in spite of that. Up until recently I largely relied on Wyze's own motion capture and cloud (AWS) storage arrangement, but decided moving to my own infrastructure would make the basis for a ni

@plembo
plembo / quickpsqlsetup.md
Last active April 10, 2023 12:23
Quick setup local postgresql for remote access

Quick setup local PostgreSQL for remote access

Needed to set up a local instance of postgresql on my home workstation for a project, but knew that I'd be accessing it remotely from a laptop on a regular basis (time away from the work area is important). Given my rule that "if you're going to do it more than once, document it", I decided to write up this gist.

Install postgresql

My workstation is on Ubuntu 20.04 LTS, so I first configured the package manager to use the appropriate postgresql.org repo:

@plembo
plembo / bluelookspurpleinchrome.md
Last active June 8, 2021 00:06
Blue looks purple in Chrome
@plembo
plembo / dockeriptablescompromise.md
Last active January 24, 2025 15:21
Docker iptables compromise

Docker iptables compromise: workaround

During installation of Docker on Linux, the service makes modifications to iptables that allow Docker to bypass the host firewall, exposing container ports even without an explicit rule on the firewall.

Many solutions have been proposed for this but none of them are entirely satisfying. For example, a common recommendation is to prevent Docker from altering iptables by placing a daemon.json file under /etc/docker:

{
 "iptables": false
@plembo
plembo / installfontslinuxwin.md
Last active December 31, 2021 21:55
Manually installing fonts on Linux and Windows

Manually installing fonts on Linux and Windows

Linux

Chris Simpkins. "How to Manually Install, Update and Uninstall Fonts on Linux". Source Words, 12 March 2018.

This will install the fonts for the logged in user and not globally.

Download your fonts. In the example below, they're the TrueType font files for FiraCode.

@plembo
plembo / usefulsoftwarelist.md
Last active April 30, 2025 13:08
List of useful software

List of useful software

This is the software I like to have on various platforms, and is a work in progress (and so may morph wildly over time according to my personal whims) that I've started mostly for my own use. Recently I used this list in rebuilding my personal workstation after an awful day. Documentation saves (as do backups)!

Linux desktop

My personal workstation and laptop are currently running Ubuntu Desktop 22.04 LTS, moderately tailored for my own use.

Installation Sources and Methods

I prefer vendor official binaries or package(s) when I can can them (except where it would be too disruptive: like where they overwrite critical dependencies), but distro packages still form the backbone of my software loadout. Otherwise, I may use an AppImage or vendor flatpak (if I don't intend to use a CLI). Third-party PPAs and source installs are my last resort. I do not use snaps. NOTE: You can removed snapd, although doing so may im

@plembo
plembo / letsencryptwithpython.md
Last active August 1, 2021 22:29
Letsencrypt Manual with Python

Let's Encrypt with Python

Let's Encrypt has been a wildly successful campaing to move the world onto HTTPS... for free.

There are a number of options for installing certbot, the Let's Encrypt client. For Ubuntu there are three: a snap, a docker container and a python library. I've used each of these over time, but found that for my workflow (where I use the manual plugin to create wildcard certs on my workstation) the python library works best.

This process was tested on Ubuntu 18.04 LTS Desktop with Python 3.9.

Here's how to set it up:

@plembo
plembo / setpsqluserpath.md
Last active August 8, 2021 18:47
Postgres and user search paths

Set the search path for a postgresql user

By default, the search path for a PostgreSQL user is set to the "public" schema. Even if you create a new schema (say, "import") any tables you create in it will not show up in a dt listing of tables without also specifying the schema (e,g,, \dt import.*).

Fix is to update the user's path to include the new schema:

postgres=# alter role myuser set search_path = '$user',public,import;