All posts (37)

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
Convert multiple images to searchable PDF (OCR) with free command line tools

Convert multiple images to searchable PDF (OCR) with free command line tools

2020-04-26

In this example, we'll show how to convert multiple PNG images to a multi page searchable PDF file. We'll use the following command line tools: - ImageMagick for converting PNGs into multi page TIFF and PDF files. - Tesseract OCR, an open source OCR engine. - [PDFtk Free](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit... read more
Start a simple React JS app with Parcel bundler

Start a simple React JS app with Parcel bundler

2019-08-11

Here's how to get started with a simple hello world React Javascript app using Parcel. We're going to be using a global install of Parcel here. Install Parcel Install parcel globally npm i -g parcel-bundler The advantage if you install it globally is that is only 4MB and 100 or so files. on the other hand will download about... read more
Loading icon fonts locally when using Ant Design React framework (instead of AliCDN)

Loading icon fonts locally when using Ant Design React framework (instead of AliCDN)

2018-08-05

Don’t use Alibaba’s CDN! By default, when using the Ant Design ReactJS UI framework, icon fonts are loaded from China’s Alibaba Cloud CDN. This may be undesirable behaviour. You might prefer to have a web site that does not call home when you load a page, or leak IP addresses to a third party. You probably just want all your asse... read more
Set up a signage or kiosk machine with Debian 9 Linux

Set up a signage or kiosk machine with Debian 9 Linux

2018-06-26

Installation Install Debian with . Use MBR and create a single root partition filling the entire disk. Choose minimal with no graphical desktop environment. Only choose standard system utilities. Create the default root user and a separate user with username . Install the following packages as root: apt-get install -y... read more
Moving Virtual Box VDI files

Moving Virtual Box VDI files

2017-04-16

Note This works with encrypted VDI disks. The virtual machine must be shut down before proceeding. Backup first! Backup all the and files. Ths is very important! If you're using encryption, these keys are inside the vbox file so make sure you back this up somewhere safe. From now on we don't touch the backups (unless something goes wrong), we're referring to the actual wo... read more
Virtual Box Tips

Virtual Box Tips

2017-04-16

Backing up VirtualBox virtual machine Just make a copy of the and files. Reducing disk space of dynamic disks This doesn't work for encrypted disks. On client virtual machine: - For Windows - Defragment disk, e.g - Zero free space, e.g (sdelete is part of SysInternals) - For... read more
Set up Let’s Encrypt with NGINX web server with certbot webroot plugin

Set up Let’s Encrypt with NGINX web server with certbot webroot plugin

2017-01-26

Introduction This is one (of many) methods to speed up creating free SSL certificates with Let's Encrypt. It configures the NGINX web server to serve for each domain. This path is used by the webroot plugin. We’ll need to make a directory to servie the challenge files from, we’ll call this `/home/www/letsenc... read more
Generate some easy to remember passwords

Generate some easy to remember passwords

2016-03-17

This method is not suitable for transmitting sensitive data. For such purposes, consider using a public key encryption scheme like PGP or GnuPG. The following procedure is appropriate for generating passwords for online logins and similar applications. Word List Acquisition Begin by preparing a text file with dictionary words. We will download word lists from [Scowl](http://wordlist.aspell.n... read more
How to remove old Linux kernel images from /boot

How to remove old Linux kernel images from /boot

2016-03-17

For RedHat based OS e.g RHEL or CentOS Install yum -y install yum-utils Check current running kernel version rpm -q kernel Remove old kernels, but leave the 2 latest ones. package-cleanup --oldkernels --count=2 Edit and set: installonly_limit=2 This will delete old kernels automatically but leave the latest two next time you perform a `yum... read more
How to open Gerber files in AutoCAD with free open source tools

How to open Gerber files in AutoCAD with free open source tools

2015-04-02

This guide provides a detailed procedure for importing Gerber RS-274X files into AutoCAD using open-source tools. This approach offers a cost-effective alternative to proprietary software solutions. Before proceeding, ensure the following software is installed and configured: - gerbv: A tool for viewing Gerber files and exporting them to various formats (exclud... read more
GLCD Library Support for PIC24H with ST7565R / ST7565P / PCD8544 (Nokia 3310 5510) LCDs

GLCD Library Support for PIC24H with ST7565R / ST7565P / PCD8544 (Nokia 3310 5510) LCDs

2013-12-31

My graphic LCD library (glcd on GitHub) now supports PIC24H with the ST7565R, ST7565P and PCD8544 LCD controllers. The code has been tested with the Newhaven display NHD-C12864A1Z-FSW-FBW-HTT and NHD-C12832A1Z-FSW-FBW-3V3. I... read more
Find your camera shutter actuation count using gPhoto2

Find your camera shutter actuation count using gPhoto2

2013-09-27

This guide provides a method to ascertain the shutter actuation count for the following Canon camera models: - Canon 1D Mark II - Canon 50D - Canon 5D Mark II - Canon 5D Mark III - Canon 7D - Canon T2i Additional compatible models may exist. Please share if you have verified this method with other models. Mac OS X gPhoto2 can be installed via [MacPorts](https://ww... read more
Moving a WordPress blog across domains using the shell

Moving a WordPress blog across domains using the shell

2013-09-24

This article provides a comprehensive guide, or more aptly, a set of personal notes, on how to migrate a WordPress blog from one domain name to another. This process is also applicable when transitioning from one web host to another. Initially, you need to gather some details about your old database: - Database host name (e.g., or ) - Database name - Username -... read more
USB datalogging on the Turnigy Accucel 6 Hobby Charger

USB datalogging on the Turnigy Accucel 6 Hobby Charger

2013-08-16

After having utilized the Turnigy Accucel-6 hobby charger for a considerable period, I developed an interest in leveraging its data logging capabilities. Specifically, my objective was to plot discharge curves for certain batteries. A cursory search on Google yielded several articles, albeit with a significant amount of conflicting informati... read more
Arduino Library for DF Robot 16×2 LCD Keypad Shield

Arduino Library for DF Robot 16×2 LCD Keypad Shield

2013-02-24

A few years ago, I purchased one of these 16×2 LCD and Keypad Arduino shields. There are quite a few of them around (including some clones?), but they are similar to this one from DF Robot: I think I bought this one from eBay a few years ago, but none... read more
Custom avrdude with auto DTR reset and custom baud rate for Arduino boards

Custom avrdude with auto DTR reset and custom baud rate for Arduino boards

2013-02-14

In the context of a project involving the utilization of an ATmega2560 with a custom bootloader (predicated on the Arduino Mega bootloader using the stk500v2 protocol), it was found that the optimal baud rate for programming was 38400, given the use of an 8MHz crystal. The default configuration of avrdude, when employing the programmer switch, doe... read more
How to get ICC profiles working with TimThumb

How to get ICC profiles working with TimThumb

2013-01-13

I was working on a web site that used TimThumb, and ran into an issue. TimThumb uses the PHP GD library, which does not support color profiles. It is a very common library used in WordPress themes. This can be an issue with web sites which are for photographers, as sometimes, it may be desired to have embedded color profiles in thumbnails. But when timthumb... read more
GLCD 0.4 Released – ST7565R and NT75451 support, Blueboard LPC11U37 demo

GLCD 0.4 Released – ST7565R and NT75451 support, Blueboard LPC11U37 demo

2012-07-14

August 2019 update: > - All demo code is available on Github project page Version 0.4 of GLCD Graphic LCD Library has been released. It includes added support for: - ST7565R LCD controller with SPI serial interface with AVR8 implementation. This is used in Newhaven Display model [NHD-C12864WC-FSW-... read more
Making custom fonts for GLCD library

Making custom fonts for GLCD library

2012-07-08

Update: I've been developing a handy Qt-based tool named glcd-utils. This tool simplifies the process of creating fonts and bitmaps for GLCDs. Although it's open-source, binaries and extensive documentation are currently unavailable. Feel free to check out the GitHub page. Now, let's dive into the tutorial below. Welcome to a quick guide on craft... read more
Measuring flash durations of speedlight and studio lighting and strobes

Measuring flash durations of speedlight and studio lighting and strobes

2012-01-19

It has been some time since I last delved into a technical article, but today we're delving into the world of flash durations. Despite extensive searching, I couldn't find any comprehensive resources offering real-world measurements of flash durations for speedlights, especially t.1 measurements. Lights Tested... read more
How To Calculate Exposures Quickly at Night Time

How To Calculate Exposures Quickly at Night Time

2010-02-17

Nighttime photography often demands extended exposure times, frequently spanning several minutes. To attain optimal image quality, it's crucial to maintain a low ISO setting to minimize noise, hot pixels, and potential banding artifacts. Many photographers may resort to guessing their exposure times during nighttime shoots, leading to wasted time on "dud exposures" due to incorrect guesses. Her... read more
Photoshop Smart Objects for Photographers – Part 1, Soft Proofing and LAB Color Mode

Photoshop Smart Objects for Photographers – Part 1, Soft Proofing and LAB Color Mode

2009-08-07

Since the release of Photoshop CS2, the introduction of Smart Objects has been a significant development. This article will discuss how photographers who shoot in RAW can leverage smart objects in Photoshop. A highly anticipated feature is soft proofing in Lightroom. Despite Lightroom's efficient workflow tools, it lacks support for one of the most fundamental tools of modern digital editing -... read more
Photoshop Smart Objects for Photographers – Part 2: Gradient and Selective White Balance

Photoshop Smart Objects for Photographers – Part 2: Gradient and Selective White Balance

2009-07-17

Welcome to Part 2 of the Smart Objects for Photographers tutorial. This comprehensive tutorial will guide you through the meticulous process of utilizing smart objects, focusing on selective white balancing. The original image, straight out of the camera, portrays Bronte Baths in Sydney, NSW, Australia. ![O... read more
How to enhance colours in photographs with Photoshop

How to enhance colours in photographs with Photoshop

2009-06-01

Today, we will discuss the art of enhancing colors in a photograph, specifically focusing on increasing saturation or vibrancy while preserving the existing color palette. This is a topic where different photographers may employ various techniques, resulting in diverse approaches. Personally, I rely on two preferred methods for enhancing colors in an existing photo, both of which are accomplished... read more
Multiple Exposure Blending for Landscapes

Multiple Exposure Blending for Landscapes

2009-05-22

Today we will be talking about multiple exposure blending. We will be blending multiple exposure to capture more dynamic range in a scene. This technique is more suited towards landscapes, such as those with sky and water/land structures in them where the scene is bright on one section (e.g up high in the sky) then gradually darker to the other (e.g bottom end of image). Dynamic range [Dynam... read more