Posts - Linux
Encrypting PDF files with free command line tools
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… Read more
NGINX conditional logging and responses
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 the HTTP block. Regexes can also be… Read more
LUKS Encryption Cheat Sheet
Install and create partition Install on a Debian based system Install on a Red Hat based system Creating a new LUKS partition Key management Generate 4096-bit random key file Add a key file to next free key slot. This will prompt for a passphrase. You can have up to 8 slots. Add a key file to… Read more
Raspberry Pi Kiosk HOW-TO
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… Read more
GPG Cheat Sheet
For GPG versions 2.x only. List keys List public keys List all secret keys List public or secret keys, but show subkey fingerprints as well The key ring location is normally shown on the first line on stdout. Use different key ring List keys but use a different home directory for one command only… Read more
Convert multiple images to searchable PDF (OCR) with free command line tools
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… Read more
Set up a signage or kiosk machine with Debian 9 Linux
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… Read more
Generate some easy to remember passwords
Do not use this for sending sensitive data! For that please use a public key encryption scheme like PGP or GnuPG. This below is suitable for things such as online logins etc. Obtain word list Prepare a text file with dictionary words. Here we download some word lists from Scowl. We grab the file… Read more
How to remove old Linux kernel images from /boot
For RedHat based OS e.g RHEL or CentOS Install Check current running kernel version Remove old kernels, but leave the 2 latest ones. Edit and set: This will delete old kernels automatically but leave the latest two next time you perform a For Debian based OS e.g Ubuntu If that doesn’t work, you… Read more
Moving a WordPress blog across domains using the shell
Here’s a rundown, or more accurately a set of personal notes I made, for moving a WordPress blog from one domain name to another. This will also work when moving from one web host to another. First you’ll need to know some details of your old database: database host name, e.g or database name… Read more