Posts - Linux

Total posts: 9

NGINX conditional logging and responses

01 November, 2020 - 2 min read

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

27 October, 2020 - 2 min read

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

13 September, 2020 - 5 min read

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

25 July, 2020 - 4 min read

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

26 April, 2020 - 2 min read

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

26 June, 2018 - 2 min read

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

17 March, 2016 - 2 min read

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

17 March, 2016 - 1 min read

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

24 September, 2013 - 5 min read

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

© Andy Gock 2009−2021