Recent posts (12)
Deploying Your React Project to GitHub Pages Using Git Worktrees
2024-10-14
Deploying a React project to GitHub Pages can be quite straightforward once you know the steps. In this post, I'll guide you through setting up a branch for deployment using Git worktrees. This method is efficient, clean, and helps keep your Git repository well-organized. Special thanks to [Sangsoo Nam](https://sangsoonam.github.io/2019/02/08/using-git-worktree-to-deploy-github-pages.h... read more
VM disk imaging across machines with different sector sizes
2023-12-12
When transferring VM images between machines with different sector sizes (for example, one machine uses 512-byte sectors and another uses 4096-byte sectors), you may need to edit the partition table of the target device using a tool like . This ensures that the start and end positions align with the actual physical positions on the disk. Additionally, you may need to create a BIOS boot pa... read more
Converting React or Svelte project from Parcel to Vite
2023-05-21
Create a new Vite project
pnpm create vite@latest --template [react-swc|react|svelte] myapp
cd myapp
Copy over
Delete files from of the new project except for and .
If the main app is not , rename the import in to the correct file.
Delete following line from
import './index.css'
Rename `.... read more
Create a Svelte component module
2022-10-23
Using pnpm, Svelte, rollup.js, create a Svelte component module, test it, and publish to npm.
This is a quick cheat sheet for developers without the distractions. Modify as needed.
Create component
mkdir my-svelte-component
pnpm init
pnpm install -D rollup rollup-plugin-node-resolve rollup-plugin-svelte... read more
Encrypting PDF files with free command line tools
2021-11-20
PDF files can be encrypted using command line tools QPDF and PDFtk. These are available for Windows and Linux.
Using QPDF
Description from QPDF:
> This is the QPDF package. QPDF is a command-line tool and C++ library that performs content-preserving transformations on PDF files. It supports linearization, encryption, and numerous other features. It can also b... read more
Reduce bookmark menu spacing in Firefox 91
2021-08-10
Some tips on how to get back some more density with your menus and booksmarks.
Edit and set to
Create directory and file
```css
/ Bookmark and context menu spacing /
menupopup > menuitem, menupopup > menu {
padding-block: 0px !importan... read more
NGINX conditional logging and responses
2020-11-01
Here are some examples on how to configure NGINX to conditionally log requests based on certain conditions like remote IP address, URI etc by using the map module and variables.
Conditional logging
Create a variable using ngx\http\map\_module.
This is placed in... read more
LUKS Encryption Cheat Sheet
2020-10-27
Install and create partition
Install on a Debian based system
apt-get install cryptsetup
Install on a Red Hat based system
yum install cryptsetup
Creating a new LUKS partition
cryptsetup -y -v luksFormat /dev/$DEVICE
Key management
Generate 4096-bit random key file
head -c 512 /dev/random > KEYFILE
Add a key file to next free key slot. This will prompt for a pass... read more
Raspberry Pi Kiosk HOW-TO
2020-09-13
Tested with Raspberry Pi 3 and 4, but should work on some older models too.
For Ethernet connected kiosk machines.
Download and install Raspberry Pi OS
Download img file and image to micro SD card.
- Raspberry Pi OS (32-bit) with desktop, Image with desktop based on Debian Buster. Warning: This is not the distribution with "recomm... read more
GPG Cheat Sheet
2020-07-25
For GPG versions 2.x only.
List keys
List public keys
gpg --list-keys
List all secret keys
gpg --list-secret-keys
List public or secret keys, but show subkey fingerprints as well
gpg --list-keys --with-subkey-fingerprints
gpg --list-secret-keys --with-subkey-fingerprints
The key ring location is normally shown on the first line on stdout.
Use different key ring
Lis... read more
Using Let's Encrypt with internal web servers (without DNS challenge)
2020-07-05
TL;DR
- Use internet facing domain on an internal network, I normally use subdomains for this.
- Domain must have a DNS A record pointing to a public facing web server so Let's Encrypt can find it for the HTTP-01 challenge. This can be served as an empty site or just as a 404 response.
- Remote VPS uses certbot to re... read more
Protecting web sites with NGINX subrequest authentication
2020-06-30
TL;DR
Protecting a web site with NGINX by using authentication server via a subrequest.
- Use in NGINX conf.
- When user requests protected area, NGINX makes an internal request to . If 201 is returned, protected contents are served. Anything else, NGINX responds w... read more