How to use OpenResty to perform health checks

Use OpenResty to perform health checks in your cloud environment as it incorporates Nginx, Lua and comes with batteries included. ...

How to use official RabbitMQ repository on Debian Buster

RabbitMQ uses Bintray to provide official repositories for RabbitMQ message broker and Erlang, but there is a small catch as at this moment repository for Debian Buster does not contain RabbitMQ application… ...

How to generate sequence of numbers

Generate and print sequences of numbers to perform specific operations using command-line or shell script. ...

How to determine how long specified remote server or device was offline

Create a shell script to determine how long a specified remote server or device was offline. It is not designed to substitute monitoring solutions but to determine how long it will take to reboot the server or device. It is using convert seconds to human readable time code to display results. ...

How to check website for broken links

Check website for broken links using HTTrack website copier. ...

How to pretty print size in bytes using AWK

Pretty print size in bytes using AWK. ...

How to display memory used by processes in human readable form using Python script

Display memory used by processes in human readable form using Python script. ...

How to avoid the two most common caveats when using read command

These are easy mistakes to make as the bash builtin read command will terminate with the error exit code on the end-of-file condition and use Internal Field Separator to split the line into words. It is kind of tricky, but it is worth knowing how to deal with such problems. ...

How to display memory used by processes in human readable form

Display memory used by processes in human-readable form using ps and awk utilities. ...

How to erase LUKS header

Learn how to erase the LUKS header on a specific device. ...

How to locate LUKS devices

Discover two distinct and easily sriptable methods and combine features from both of these to locate and identify LUKS devices. ...

How to test LUKS passphrase

Learn how to test LUKS passphrase on a specific device. ...

How to determine maximum LUKS passphrase length

Determine maximum LUKS key file size or maximum interactive passphrase length. ...

How to move files based on specific time criteria

Use find a utility to move files based on specific time criteria. ...

How to assign binary key to LUKS key-slot

Learn how to create and assign binary key instead of passphrase to LUKS key-slot on a specific device. ...

How to mount exFAT filesystem

I am surprised that exFAT is not supported out of the box as it is a default filesystem used on SDXC cards. You need to install a FUSE-based implementation to access data on devices using it. ...

How to non-interactively manage LUKS passphrases

Learn how to non-interactively manage LUKS passphrases on a specific device using files or a named pipe. ...

How to determine what is mounted and where

Determine what filesystem is mounted where, what is using particular options and how much free space is available. ...

How to interactively manage LUKS passphrases

Learn how to interactively manage LUKS passphrases on a specific device. ...

How to build package using directory structure and custom metadata

The simplest possible way to create a Debian package is to use defined package metadata and prepared target directory structure. ...

How to verify fstab file

Verify static filesystem information defined in the fstab file after applying modifications to ensure that system will boot without any problems. It is especially important in remote locations or places where you cannot easily perform emergency operations. ...

How to erase all LUKS key slots

Learn how to erase every defined LUKS key slot on a specific device. ...

How to backup or restore LUKS header

Learn how to create LUKS header backup and restore it in case of emergency. ...

How to convert seconds to human readable time

Create a shell script to convert seconds to human-readable time. I have reused part of an old shell script used to pretty-print system uptime to built it, as this code proved to be useful on several occasions. ...

How to display calendar in terminal with Monday as the start of the week

cal is a nice utility that displays calendar in terminal, but there is a small problem that needs to be fixed as it uses Sunday as the start of the week. ...

How to install Prosody an Open source and modern XMPP communication server

Install Prosody, an Open-source and modern XMPP communication server. ...

How to detect chroot environment

Sometimes it makes me wonder whether I am inside a chroot environment or not, so let’s check it out. ...

How to define backup backend in HAProxy configuration

Define backup backend in HAProxy configuration to choose used backend depending on the number of usable servers. ...

How to schedule one-time task

Schedule a one-time task at a specific time or below defined system load using at utility. ...

How to force user to change password

Alter password expiry date to force user to change password on next login. ...

How to display output of multiple commands using columns

Execute paste utility to merge lines using tab character as a delimiter, expand to convert tabs to spaces, and column to format input into multiple columns. ...

How to display processes using the most CPU or memory

Display processes using the most CPU or memory using nothing more than basic Linux utilities. ...

How to encrypt portable external hard drive

Encrypt portable external hard drive using Linux Unified Key Setup to protect data in transit. ...

How to create artificial package to circumvent dependency checking

Create simple artificial package to work around missing dependencies, ...

How to resolve hostname to IP address within a shell script

Create straightforward shell script to resolve hostname to IPv4/IPv6 address and reuse parts of it for other projects. ...

How to count separate line entries inside a pipe

Use a shell script to count separate line entries inside a pipe to see how many entries got filtered out. It can be useful in some scenarios, especially for testing. ...

How to verify deb package contents

Verify package contents by hand or use simple shell script to automate this process. ...

How to aggregate weekly data to create custom statistics

Recently, I have parsed logs of several applications to generate custom weekly reports. It was a fascinating exercise. ...

How to display deb package contents

I have already described how to list the contents of specified package using apt-file utility, but you do not need it to check the contents of downloaded package. ...

How to create meta-package

Create simplest possible meta-package to install multiple software packages at once and quickly setup familiar environment. ...

How to display reverse package dependencies

Display reverse dependencies to inspect which packages depend on given application or library. ...

How to read and insert new values into the debconf database

I have already described how to copy answers to the configuration questions for Debian packages, but there is an easier way to read and insert new values into the debconf database. ...

How to perform incremental backup using rdiff-backup

Perform simple incremental backup using rdiff-backup utility. ...

How to make iptables configuration persistent

Make iptables configuration persistent using essential system utilities or a designated boot-time loader. ...

How to download in advance the public key used to sign repository signatures

There are those rare situations where you do not know the public key required to verify repository signatures but want to add a repository and a public key used to sign it. Hopefully, there is an easy answer to that question. ...

How to remove useless localizations

Install and configure localepurge package, which provides a fancy shell script to recover disk space used by useless localizations. ...

How to install and configure external dashboard for Icinga2

Install and configure Dashing with Icinga 2 to use the external board for your Icinga2 instance. ...

How to use content-disposition header to determine filename

Use Content-Disposition HTTP response header to determine filename and use it to store downloaded file. ...

How to delete Nextcloud bookmarks using API

Delete Nextcloud bookmarks using API. Notice, data is paginated in this case, so this particular case is more interesting than regular add/remove operations. ...

How to reset admin password on UniFi controller

Reset admin password on UniFi controller to access wireless configuration. ...

How to perform different operations depending on the shell script name

This technique is widespread. To be honest, it is more common than I initially thought, so I will show you how to create a single shell script that will display, create or destroy a temporary file system depending on the name used to execute it. ...

How to download public key used to verify GnuPG signature for the repository

Configuring and using additional repositories requires APT public key management to validate the Release file and downloaded packages. ...

How to find a symbolic link by the target name

Find a symbolic link by the target name. It sounds simple and it definitely is. ...

How to log dropped connections from iptables firewall using netfilter userspace logging daemon

Log dropped connections from iptables firewall using netfilter userspace logging daemon for further analysis and troubleshooting. ...

How to calculate how fast data is copied to the specified directory

Determine how long it would take to copy data between directories. ...

How to verify file integrity using GnuPG signature

Verify file integrity using the GnuPG signature without touching your local GnuPG configuration. ...

How to compute and verify file checksum

Compute SHA message digest of a file to verify that its contents have not been altered. ...

How to create shell script for a cron job with hidden debug information

Create a shell script for a cron job with hidden debug information shown only when executed inside the terminal. ...

How to locate directories that contain one or multiple files with particular content

Use find and grep commands to search for directories that contain one or multiple files with specific content. ...

How to log dropped connections from iptables firewall using rsyslog

Log dropped connections from iptables firewall using rsyslog for further analysis and troubleshooting. ...

How to display package dependencies

Display dependencies to inspect which packages are required for a given application. ...

How to enable HTTPS protocol for package managers using libapt-pkg library

Enable HTTPS (Hypertext Transfer Protocol Secure) for package managers using libapt-pkg library. ...

How to disable USB device

Whitelist or render inoperative any USB device to secure your personal belongings. ...

How to create iptables firewall using custom chains

Create an iptables firewall using custom chains that will be used to control incoming and outgoing traffic. ...

How to display upcoming events in Nextcloud calendar using shell script

Display upcoming events in the Nextcloud calendar using a custom shell script by extending the earlier ideas. ...

How to create iptables firewall

Create iptables firewall that will be used to control incoming and outgoing traffic. ...

How to display upcoming events in Nextcloud calendar using text-based terminal emulator

Display upcoming events in the Nextcloud calendar using a text-based terminal emulator because it is fun and challenging. ...

How to use HTTP host header to choose HAProxy backend

Dynamically choose HAProxy backend depending on the HTTP host header, Lua programming language and environment variable. ...

How to detect and log changes in the list of mounted filesystems

Detect and log changes in the list of mounted filesystems (/proc/self/mountinfo file). ...

How to determine process execution time

Use GNU Bourne-Again SHell builtin or standalone time command to determine process execution time. ...

How to execute additional commands during system startup using cron

Use cron service to execute additional commands as the specified user using cron during system startup. ...

How to redirect every request to defined domain to particular location

Recently, I have moved my personal source code to GitLab. It rendered self-hosted git repository at repository.sleeplessbeastie.eu obsolete, so I have created simple redirection on HAProxy load balanced to cover this specific case. ...

How to integrate lightline status line plugin for Vim with Solarized theme

I am using the lightline status line with the Solarized color scheme inside Vim text editor. ...

How to store LeaseWeb data traffic in OpenTSDB time series database

Store LeaseWeb data traffic in OpenTSDB time series database using Python script, LeaseWeb API v2 and Python client to OpenTSDB. ...

How to serve files from memory with a fallback using nginx

Serve files from memory with a fallback using the Nginx HTTP server. ...

How to create simplest possible iptables firewall

Create the simplest possible iptables firewall with quite relaxed rules that will allow all outgoing traffic, incoming ICMP packets, and ssh connections on the eth0 interface. ...

How to import Firefox bookmarks to Nextcloud application

I am currently playing with floccus to store bookmarks using Nextcloud, so I have created simple shell scripts to import Nextcloud bookmarks from Firefox using code from my earlier solution to open Firefox bookmarks from the OpenBox menu. ...

How to use variable to choose HAProxy backend

Define and use a variable to dynamically choose HAProxy backend depending on the URL parameter, HTTP header field, and cookie value. ...

How to display LeaseWeb data traffic using API v2

LeaseWeb released a new version of API that will deprecate the old one, so it is the perfect time to update the Python script using v1 api and switch to API v2 before May 31. ...

How to automatically mount directory shared over local network using NFS

Use kernel automonter to automatically mount directory shared over network using NFS. ...

How to add Unsplash background to DokuWiki instance

Use Unsplash Source a simple API for embedding free high-resolution photos from Unsplash to get background for DokuWiki instance. Source code is hosted at GitLab/unsplashdoku and documentation is available on the main DokuWiki/plugin:unsplashdoku website. ...

How to share directory over local network using NFS

Export directory over local network using NFS to easily access data on central server. ...

How to backup and restore Nextcloud bookmarks

There is a bookmark manager for Nextcloud that can be used with the floccus browser extension to synchronize bookmarks using Chrome, Firefox, and Opera. I will show you how to perform API calls to automate the backup process. ...

How to setup private Docker registry

Setup a simple Docker registry to use it privately or share images which a team of developers. ...

How to create base Docker image

Create a base Docker image using debootstrap utility. ...

How to securely change user password using shell script

Securely change user password using shell script to automate this task on these rare occasions. ...

How to execute older version of free utility

I have described the differences between the old and new free output format, so now I want to mention how to execute the former free version on Debian Stretch using LD_LIBRARY_PATH environment variable to temporarily substitute a different library for this particular execution. ...

How to backup and restore Restyaboard boards

Use the extensive API offered by the Restyaboard to backup and restore created boards. ...

How to install Docker on Debian Stretch

Install docker on Debian Stretch to take advantage of the lightweight virtualization. ...

How to add small calendar to DokuWiki page

The truth is that I always return to the DokuWiki to organize personal data, so I have created small calendar as a plugin to perform daily notes. Source code is hosted at GitLab/monthcal and documentation is available on the main DokuWiki/plugin:monthcal website. ...

How to block particular IP addresses on HAProxy

Block particular IP addresses on HAProxy load balancer using simple Access Control List. ...

How to upgrade icinga2 and its web-interface

Upgrade icinga2 and its web-interface using official/dedicated repository and PostgreSQL database. ...

How to fix undefined function utf8_decode error in PHP application

This is just another interesting problem to solve. I have encountered this subtle difference in PHP packages when I moved personal Dokuwiki instance from Debian Jessie to Debian Stretch. ...

How to install Restyaboard on Debian Stretch

Install Restyaboard, an Open Source Kanban board. I am using it daily to manage this blog. ...

How to determine if web-server still supports deprecated TLS 1.0 protocol

Use essential openssl utility to quickly determine if your web-server still supports deprecated TLS 1.0 protocol. ...

How to define basic authentication on HAProxy

Define basic authentication on HAProxy load balancer limit access to specific backends. ...

How to display dependencies for deb package

Use dpkg to pretty print package dependencies. ...

How to define allowed HTTP methods on HAProxy

Define allowed HTTP methods on HAProxy load balancer using simple Access Control Lists. ...

How to encrypt user password

Use encrypted passwords to automatically setup users using configuration management tools like Puppet or Ansible. ...

How to monitor SSL certificates using icinga2

Create custom data field to define multiple domain names and service apply rule to verify those SSL certificates. ...

How to install UniFi controller

Install UniFi controller to configure wireless network using Ubiquiti devices. ...

How to setup icinga2 master-satellite-client using director module

Icinga2 documentation clearly describes the master->satellite->client setup, but as of now everything can be configured using director module and top down approach, so you can easily monitor external remote networks that are not accessible from the master server. ...

How to parse free output to display available memory

The free utility is used to display the amount of free and used memory in the system. Debian Stretch provides an upgraded package. Output format has changed, and available memory is calculated using a different method, so let’s see what we can do with these modifications at this moment. ...

How to add your first host using icinga2 director

Add your first host using icinga2 director after performing clean installation as I have described earlier this month – icinga2 plus icingaweb2 and director module installation procedure. ...

How to install director module for icingaweb2

Icinga is a great monitoring solution, especially when you use director module to perform configuration in top down environment. It makes application more accessible to more people as you can use web-interface and role based permissions to allow developers and testers to write and use their own checks and notifications. ...

How to install icinga2 and icingaweb2

Install Icinga 2 monitoring instance with web-interface. ...

How to install and configure MariaDB unixODBC driver

MariaDB unixODBC driver is not available in the Debian package repository at this moment, but you can build and configure it on your own. It requires some additional work, but in the end it is really worth the time. ...

How to query APT configuration

Query APT configuration to inspect specific options or create universal Debian utilities. ...

How to display fingerprint for public key file

It is very useful to know how to distinguish between different GnuPG public key files. ...

How to verify IPv4 address

There are many different ways to verify IPv4 address inside a shell script, but many of these are complicated or incomplete. I will describe a simple and verbose way to check IPv4 address using ipcalc utility. ...

How to determine encryption algorithm used to store password

Debian supports DES, MD5, SHA256 and SHA512 algorithms for password encryption. These algorithms can be easily spotted and distinguished by their structure. ...

How to display IPv4 network information

Display IPv4 network information for given address and netmask. Split networks, calculate subnetnetworks and supernetworks and convert address range. ...

How to display LeaseWeb data traffic using command-line

LeaseWeb provides an API that can be used to request information about servers and perform some maintenance tasks like update reverse DNS entries, null route IP addresses, reboot specific server or launch rescue/reinstallation process. I will show you how to request and display identifiable information about servers in each location including data traffic details. ...

How to manage known_hosts file using shell script

I am using a simple shell script to manage OpenSSL known_hosts file as it requires many small updates due to constantly changing host keys on a dynamic virtual server. ...

How to use backports repository

Backports repository provides packages for stable system that are recompiled from testing or unstable distribution. It is important to know that these packages are provided as is without any security support guarantee. ...

How to fix missing dirmngr

Debian Stretch provides gnupg in minimal installation as the package priority is set to important. The command is fully operational, but it requires dirmngr to perform network operations for managing and downloading certificates. ...

How to remove unused dependency packages

Remove package dependencies that are now no longer needed and configure system to perform this task automatically. ...

How to automatically control APT cache

Keeping an eye on a constantly changing APT cache can be quite tedious, so automate this task and free up your time to focus on other projects. ...

How to reverse text file

This is just a brief note on how to reverse a text file. It is not really useful for anything other than fun, but it is stuck in my head, so I need to write it down. ...

How to clear the APT cache

Clear the APT cache to reclaim disk space used by the downloaded packages. ...

How to disable the APT cache

Disable APT cache to conserve disk space on a small Debian based embedded system or a custom-built live USB system that can be easily booted. ...

How to mount WebDAV share using systemd

You can check my earlier blog post on how to mount WebDAV share using command-line or fstab (file systems table), but you are not limited to these two options as you can use systemd to take care of the whole process and automount WebDAV resource on demand. ...

How to execute CGI scripts using fcgiwrap

I am an enthusiast of the uWSGI project. You are still not limited to it as you can use fcgiwrap, a very lightweight and straightforward FastCGI wrapper for CGI scripts that do not require additional configuration. ...

How to keep track of network latency

Keep track of network latency using SmokePing, uWSGI application server, and Nginx HTTP server. SmokePing supports many configurable probes, alerting, and live charts accessible through a web browser. It was created by Tobi Oetiker, which is known for RRDtool an Open Source data logging and graphing system for time series data. ...

How to mount WebDAV share

Nextcloud is a handy self hosted web-based application that can be used to store files, contacts and calendars. It provides the desktop and mobile client. In addition, it supports Web Distributed Authoring and Versioning protocol, so lets mount a WebDAV share. ...

How to install and configure private MoinMoin wiki

Install and configure a private instance of the MoinMoin wiki engine, a full-featured and extensible wiki software written in Python that can store personal notes, knowledge base, or simply share interests. ...

How to configure unixODBC

You can connect custom-built shell script with any database using unixODBC an implementation of the Open Database Connectivity standard and I will show you how to do this for SQLite and PostgreSQL databases. ...

How to use old network device naming convention

It is a matter of personal preference whether you use current or former network device naming convention. I am more accustomed to the latter and will configure the operating system to retain the old behavior. ...

How to install missing ifconfig utility

ifconfig is not installed by default in Debian Stretch. However, it is available in package repository, so applications that depends on it can still be used. ...