All posts [39]
This guide shows how to use Clonezilla to image a disk or partition and save the image onto a LUKS-encrypted ext4 filesystem. It covers creating the LUKS container, formatting it with ext4, manually mounting it to /home/partimag/ (required by Clonezilla for local-disk images), running Clonezilla, and safe teardown. This will give maximum write performance and security for storing disk images. It i...
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 gh-pages branch for deployment using Git worktrees. This method is efficient, clean, and helps keep your Git repository well-organized. Special thanks to Sangsoo Nam for his excellent guide, which inspired this process. Other platforms which use a build...
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 parted. 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 parti...
Create a new Vite project pnpm create vite@latest --template [react-swc|react|svelte] myapp cd myapp Copy over /src/ Delete files from src/* of the new project except for main.jsx and vite-env.d.ts. If the main app is not src/App.jsx, rename the import in src/main.jsx to the correct file. Delete following line from src/main.jsx import './index.css' Rename .js with JSX to .jsx If original files are...
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 rollup-plugin-postcss postcss svelte mkdir src Create src/index.js Create src/MyComponent.svelt...
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 be used for splitting and merging files,...
Some tips on how to get back some more density with your menus and booksmarks. Edit about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true Create directory and file %appdata%\Mozilla\Firefox\Profiles\XXX.default-release\chrome\userChrome.css Some of the usual older methods of changing this no longer works since Firefox 91, including - Setting browser.compactmode.show to t...
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 $donotlog using ngx\http\map\_module. This is placed in the HTTP block. map $remoteaddr $logenable { "192.168.4.1" 0; "192.168.4.2" 0; "192.168.4.3" 0; "192.168.4.4" 0; default 1; } Re...
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 passphrase. You can have up to 8 slots....
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 "recommended software". All the following, unless otherwise indicated shoul...
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 List keys but use a different home d...
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 renew SSL certificates as normal. - Use a script like renew-letsencrypt-certificates...
TL;DR Protecting a web site with NGINX by using authentication server via a subrequest. - Use auth_request /auth in NGINX conf. - When user requests protected area, NGINX makes an internal request to /auth. If 200 is returned, protected contents are served. Anything else, NGINX responds with 401. - /auth is reverse proxied to Express app auth-server which handles authentication. Cookies are passed...
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 dep...
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 for overlay joining of PDF files. Assume we have multiple PNG files sorted in order image01.png image02.png image03.png image04.p...
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 node_modules is only 4MB and 100 or so files. create-react-app on the other hand will download about 110 MB and 28,000 files! If you're working...
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 assets hosted on your own services. After some time spent trying to solve...
Installation Install Debian with debian-9.4.0-amd64-netinst.iso. 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 tv. Install the following packages as root: apt-get install -y chromium xorg xinit vim openssh-server less curl...
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 .vdi and .vbox 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 working .vdi and...
Virtual Box Tips
2017-04-16
Backing up VirtualBox virtual machine Just make a copy of the .vbox and .vdi files. Reducing disk space of dynamic disks This doesn't work for encrypted disks. On client virtual machine: - For Windows - Defragment disk, e.g defrag c: - Zero free space, e.g sdelete -z c: (sdelete is part of SysInternals) - For Linux (mounted) - dd if=/dev/zero of=zeroes bs=1M until there is no space left - rm zeroe...
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 /.well-known/acme-challenge/ 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/letsencrypt from now on, and we’ll need to make sure this is set up wi...
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. wget "http://downloads.sourcefo...
For RedHat based OS e.g RHEL or CentOS Install yum-utils 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 /etc/yum.conf and set: installonly_limit=2 This will delete old kernels automatically but leave the latest two next time you perform a yum update For Debian based OS e.g Ubun...
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 (excluding DXF or DWG for AutoCAD). - pstoed...
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 used a Microstick II development board to test these, with demo code available below. I don’t have any PIC24F chips so I wasn’t able to test it with those chips as well (I thi...
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 or Homebrew. The following instructions detail...
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., mysql.yourdomain.com or localhost) - Database name - Username - Passwo...
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 information regarding the connection of the charger to a computer....
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 nonetheless, the different ones around are all based on the same circuit. I wrote my own Arduino Library for the keypad operation, and just wanted to sha...
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 -c stk500v2 programmer switch, does not instigate a pull down of the DTR...
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 processes an images, it strips the embed...
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-FBW-3V3-M (the device tested on). It should also be compatible with many of the DOG series of COG LCDs...
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 crafting custom fonts for my GLCD library. We'll be using...
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 In this endeavor, I set out to measure the flash durations of various lights, including:...
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. Here's...
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 - sof...
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. Exploring Adobe Lightroom Let's begin by examining our image in Adobe Lightroom. Although the s...
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...
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 Dynamic rang...