Skip to content

Instantly share code, notes, and snippets.

View plembo's full-sized avatar

Phil Lembo plembo

View GitHub Profile
@plembo
plembo / ghpwithnamecheap.md
Last active April 8, 2025 03:29
GitHub Pages with Namecheap custom domain

Using GitHub Pages with a custom domain: Namecheap Edition

As often happens, I found the official documentation and forum answers to be "close, but no cigar", and so had to experiment a little to get things working.

The main problem for me was a lack of concrete configuration examples. That's not entirely GitHub's fault: having migrated from Google Domains to Namecheap in the middle of this project, I was once again reminded of how many different ways there are to do things in the name service universe [1].

Although you'd think the simplest setup would be to merely configure for the subdomain case (https://www.example.com), in my experience using the apex domain (https://example.com) instead resulted in fewer complications.

Procedure

So here's my recipe for using a custom domain with GitHub pages where Namecheap is the DNS provider:

@plembo
plembo / scalingubuntufonts.md
Last active July 25, 2022 21:06
Scaling fonts in Ubuntu

Scaling fonts in Ubuntu Linux

Many of us find our eyes have a difficult time changing focus as we get older. As a result, we find the teeny-tiny type sizes employed by many web sites and applications difficult to read. Typography is a big subject for another day, although I'll say that I like the defaults applied by Bootstrap.

One way to deal with the readability problem (which you often notice only after confusing commas and periods a few times) is to increase font scaling from 100% to 125% or more. The clear downside to this on 1K or lower resolution displays is that you lose screen real estate. But it does work. At least it did for me.

Ubuntu Desktop 18.04 only gives you the option of doubling (to 200%) font scaling in Settings... Devices. That's insane. Fortunately, the Gnome Tweak Tool (a/k/a "Tweaks") allows you to raise scaling by whatever fractional amount you want (although the actual result may vary depending on your display card and monitor).

To change font scaling in the Gnome Tweak Tool, go

@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;
@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 / 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 / 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 / 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 / bluelookspurpleinchrome.md
Last active June 8, 2021 00:06
Blue looks purple in Chrome
@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 / 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