Recent posts (12)

VM disk imaging across machines with different sector sizes

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

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

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

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

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

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

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

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

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)

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

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
Netlify vs Vultr VPS hosting speed from Australia

Netlify vs Vultr VPS hosting speed from Australia

2020-04-28

I've been comparing some load speeds from a variety of different web hosting companies. I started out by trying out the free tier of Netlify to compare how the performance is compared with my usual Vultr VPS service. After seeing that the Netlify load times was almost 10x longer than from the VPS from Australia, I decided to investigate further with some testing. I do like the CI and automatic d... read more