How to display release information

Display release information using command-line.

How to display block devices

Quickly list specific block devices.

How to inspect mount options

Inspect mount options for specific mountpoint or device.

How to display systemd journal since system boot

Display systemd journal since system boot.

How to display basic computer information using DMI table decoder

Display basic computer information using DMI table decoder.

How to keep specific package version

Downgrade and keep specific package version.

How to install user-friendly alternative to find

Install fd as a simple and user-friendly alternative to find.

How to configure Wake-on-LAN using systemd

Configure Wake-on-LAN using systemd.

How to create directory with defined ownership and permissions

Create directory with defined ownership and permissions using a simple single-step command.

How to inspect a path during the troubleshooting process

Inspect a path during the troubleshooting process.

How to manage command history using text-based user interface

Manage command history using text-based user interface.

How to determine when package index was updated

Determine when package index was updated.

How to install and configure NTP server

Install and configure chrony NTP server.

How to display active but disabled systemd services

Display active but disabled systemd services.

How to access service socket as a regular user

Create an exception for a regular user to access service socket using systemd.

How to configure persistent DNS resolver

Configure persistent DNS resolver using systemd resolver or name server information handler.

How to use Dynamic Firewall Manager

Use Dynamic Firewall Manager to configure a basic zone-based firewall.

How to noninteractively configure system locales

Noninteractively configure system locales.

How to create watchdog for systemd service

Create a software watchdog for systemd service.

How to determine fastest server using ICMP

Determine fastest server using the Internet Control Message Protocol (ICMP).

How to alter date format when listing cached Kerberos tickets

Alter date format when listing cached Kerberos tickets.

How to reload network configuration

Reload network configuration on Debian Bullseye.

How to create Virtual eXtensible Local Area Network interfaces

Create and configure Virtual eXtensible Local Area Network interfaces.

How to install recent kernel using experimental Debian distribution

Install the most recent kernel using experimental Debian distribution to see what is coming up.

How to display systemd journal for specific service since it started

Display systemd journal for specific service since it started.

How to follow data appended to a file using tail command

Follow data appended to a file using one of the two possible approaches.

How to determine when service was started and stopped using the systemd journal

Determine when the service was started and stopped using the systemd journal.

How to display boot times and uptime using systemd journal

Display when the operating system was booted and calculate uptime using the systemd journal.

How to read QR Code from an image

Read QR Code from an image.

How to generate QR Code to access the Wi-Fi network

Generate QR code to access the Wi-Fi network.

How to provide custom TXT records in CHAOS class using BIND9

How to provide custom TXT records in class 3 (CHAOS) using BIND9.

How to specify the exact list of enabled PAM profiles

Specify the exact list of enabled PAM profiles using a simple workaround.

How to configure SSH access using Samba Active Directory

Configure SSH access using Samba Active Directory.

How to archive entire web page in a single HTML file

Use SingleFile to archive entire web page in a single HTML file.

How to create Samba Active Directory server

Create Samba Active Directory server using Debian Bullseye.

How to fix failed dynamic DNS update with Samba Active Directory and System Security Services Daemon

Fix failed dynamic DNS update with Samba Active Directory and System Security Services Daemon by upgrading internal Samba DNS to BIND.

How to determine fastest APT server using the ICMP

Determine fastest APT server using the Internet Control Message Protocol (ICMP).

How to determine mountpoint filesystem type

Determine mountpoint filesystem type using core stat utility which is expected to exist on every operating system.

How to install a tiny and unobtrusive terminal file manager

Install n³ a tiny and unobtrusive terminal file manager that will accompany you in your daily tasks.

How to display current bandwidth grouped by a process

Use nethogs utility to display current bandwidth grouped by a process

How to delay the start of the systemd service

Delay the start of the systemd service at boot.

How to colorize command output

Colorize command output using grc a generic colouriser.

How to perform basic operations on zip archives

Perform basic operations on zip archives.

How to use multi-stage build to compile an application

Use Docker or Pod Manager multi-stage build to compile Nginx from source code with additional headers-more-nginx-module module using Debian Bullseye image.

How to install human-friendly apt front-end

Install nala a human-friendly apt front-end using the python-apt API.

How to handle low memory conditions on desktop

Handle low memory conditions on desktop using a nohang a sophisticated low memory handler for Linux in Python.

How to keep a list of permanent ARP entries

Keep a list of permanent ARP entries using the arp utility.

How to use LVM thin provisioning

Configure and use LVM thin provisioning.

How to use tmpfs for temporary directory

How to use tmpfs for temporary directory (/tmp).

How to resize live tmpfs filesystem

Resize live tmpfs filesystem.

How to align simple MariaDB output

Use column utility to align simple MariaDB output like variable list.

How to inspect and improve docker image using dive utility

Inspect and improve docker image using dive utility for exploring each layer in a docker image.

How to install and configure a Kafka cluster without ZooKeeper

Install and configure a Kafka cluster without ZooKeeper to play with it.

How to generate Kafka cluster ID

Generate Kafka cluster ID for Kafka Raft metadata mode.

How to relay all mail to external account

Relay all mail to an external account which can come in handy in your lab environment.

How to protect Samba DNS server against DNS zone transfer

Debian Bullseye currently provides Samba 4.13.5. Using BIND as Samba Active Directory DNS backend opens it to the DNS zone transfer.

How to pretty-print text files inside terminal

Pretty-print text files inside terminal using bat a cat clone with syntax highlighting and Git integration.

How to install SmokePing on Debian Bullseye

Keep track of network latency using SmokePing on Debian Bullseye.

How to limit the number of available processors

Use boot parameters to limit the number of available processors.

How to install DNS lookup utility

Install DNS lookup utility to perform basic DNS lookups.

How to install Cluster Manager for Apache Kafka

Install Cluster Manager for Apache Kafka, previously known as Kafka Manager on Debian Bullseye.

How to determine which SSH public key was uploaded to the web service

Determine which SSH public key was uploaded to the web service.

How to display IP address in a more readable format

Display IP address in a more readable format.

How to create Hadoop cluster

Create a basic Hadoop cluster to play with it.

How to configure MariaDB to log slow queries

Configure MariaDB server to log slow queries.

How to parse apt history log

Use awk to parse apt history log and filter it.

How to concatenate regular and gzip compressed files

Concatenate regular and gzip-compressed files at the same time.

How to increase the maximum permitted connections to MariaDB server

Increase the maximum permitted number of simultaneous connections to the MariaDB server.

How to load time zone tables into MariaDB server

Load time zone tables into MariaDB server.

How to log systemd service state changes

Log systemd service state changes using rsyslog.

How to display current date-time in different timezone

Use date utility to display current date time in different timezone

How to get service PID using systemctl

Use systemctl to get process identifier for specified service.

How to wipe partition-table signatures with one exception

Today I will extend the how to fix device excluded by a filter blog post to include information on how to wipe filesystem or partition-table signatures except for LVM2 members, which is a great idea for automation.

How to write an operating system to microSD card using graphical user interface

Write an operating system to microSD card using Raspberry Pi Imaging Utility.

How to display process statistics

Use system performance tools for Linux to display process statistics.

How to manage systemd services remotely

Manage systemd services remotely over SSH protocol.

How to edit file in-place

Use sponge utility to read standard input and safely write it out to the same file.

How to fix device excluded by a filter

Fix “device excluded by a filter” LVM error.

How to create the simplest possible nftables firewall

Create the simplest possible firewall using nftables framework with relaxed rules that will allow all outgoing traffic, incoming ICMP echo requests, and ssh connections.

How to install Nexus Repository Manager 3

Install Nexus Repository Manager (NXRM) 3.

How to use templates inside shell scripts

Use templates inside shell scripts by substituting environment variables.

February 15, 2021 · milosz · Bash · Debian

How to display strace summary

I have already described how to strace PHP-FPM processes, but you can also display a strace summary to get detailed information about count time, calls, and errors for each syscall.

How to restart service on every configuration change

Monitor file system events to restart service on every configuration change.

How to store and visualize playbook events

Use JUnit callback plugin to store and Allure Framework to visualize ansible playbook events.

How to pretty print decimal or binary numbers

Use numfmt command-line utility which is a part of the standard GNU Core Utilities to pretty print decimal or binary numbers.

How to log specific Varnish requests

Use varnishlog to log specific Varnish requests.

How to use virtual memory filesystem to store Varnish Shared memory Log

Varnish Shared memory Log can put a major strain on the disk (I/O write operations). The solution is to store it on the virtual memory filesystem.

How to determine which services need to be restarted

Use needrestart utility to determine which services need to be restarted after the upgrade.

How to install XWiki

Install the Advanced Open Source Enterprise Wiki.

How to access rdiff-backup repository using fuse

Use FUSE (filesystem in userspace) to access rdiff-backup repository.

How to install OpenJDK 8 on Debian

Use AdoptOpenJDK/Eclipse Adoptium to install OpenJDK 8 (LTS)/OpenJDK 11 (LTS) or OpenJDK 15 (Latest) using Eclipse OpenJ9 or HotSpot Java virtual machine.

November 9, 2020 · milosz · Debian · Java

How to execute rc.local shell script during boot using systemd

Execute rc.local shell script during boot using systemd compatibility generator.

How to perform shell script analysis

Perform shell script analysis using shellcheck, a shell script static analysis tool.

How to display packages that are no longer required

Display packages that were installed automatically to satisfy various dependencies and are no longer required.

How to calculate Elasticsearch average documents number in recent days

Calculate Elasticsearch’s average documents number in recent days using a shell script.

How extend existing ext4 filesystem using systemd service

Use systemd service to automatically extend existing ext4 filesystem on boot or on-demand to optimize virtual machine configuration.

How to retry Elasticsearch shard allocation

Retry Elasticsearch shard allocation that was blocked due to too many subsequent allocation failures.

How to calculate Elasticsearch hit ratio

Calculate Elasticsearch hit ratio using command-line curl utility.

How to delete old Elasticsearch indices

Delete old Elasticsearch indices using Elasticsearch Curator utility.

How to determine when the operating system was booted

I have already described how to accurately determine when the system was booted, but there is a simpler solution as you can use /proc filesystem directly.

How to reduce the size of the Docker container log file

Update the docker-compose configuration file to reduce the container log file size before you run out of disk space.

How to specify custom SSH port when using rdiff-backup

Specify a custom SSH port when using rdiff-backup.

How to create swap file

Create swap file to optimize virtual machine configuration or just immediately increase available swap space.

How to extract specific file from tar archive

Extract a specific file from a tar archive.

How to clear bash history on logout

Automatically clear GNU Bourne-Again SHell history when you exit a login shell.

How to inspect parent processes

Inspect parent processes to determine whether shell script or specific process has been executed locally, remotely, or by any other application.

How to determine whether standard input file descriptor is referring to a terminal

Determine whether the standard input file descriptor refers to a terminal which can be useful to ensure that the shell script is executed using an interactive terminal.

How to display default Elasticsearch settings

Display default Elasticsearch settings.

How to limit bandwidth on specific network interface

Limit bandwidth on specific network interface using wondershaper.

How to test TLS/SSL encryption anywhere on any port

Test TLS/SSL encryption anywhere on any port

How to change system hostname

Query and change the system hostname.

How to install SmokePing

Keep track of network latency using SmokePing on Debian Buster.

How to inspect RabbitMQ settings using command-line

Inspect RabbitMQ settings using command-line.

How to calculate real disk capacity

Use basic linux command-line utility to calculate real disk capacity.

How to fix SmokePing SSH probe on Debian Buster

SmokePing 2.7.3 needs an update to use the SSH probe on Debian Buster.

How to determine available authentication methods

Determine available authentication methods on the specified OpenSSH server.

How disable network redirections

Create custom Bourne Again SHell package to disable network redirections and enhance system security.

How to define default Elasticsearch index settings

Use templates to define default Elasticsearch index settings.

How to undo fsck operations performed on the Ext4 filesystem

Undo undo fsck operations performed on the Ext4 filesystem.

How to reindex directories located in the Ext4 filesystem

Reindex directories located in the Ext4 filesystem after removing a huge number of files to optimize directory sizes.

How to serve single file using HAProxy

Use simple HAProxy configuration hacks to serve a single static file.

How to merge multi-process HAProxy statistics using GNU Awk

Merge multi-process HAProxy statistics using GNU Awk. This is a duct tape solution, as you should definitely use Lua.

How to merge multi-process HAProxy statistics using Lua

Merge multi-process HAProxy statistics using Lua.

How to distribute messages to different RabbitMQ node

Distribute messages to different RabbitMQ node using federation plugin.

How to move messages to different RabbitMQ node

Move messages to different RabbitMQ node using shovel plugin which acts as a simple client.

How to copy messages to different RabbitMQ node

Copy messages to different RabbitMQ node using federation plugin.

How to find out whether remote port is open using network redirections

Find out whether remote port is open using Bourne Again SHell network redirections.

How to mirror RabbitMQ queues

Mirror RabbitMQ queues cluster to replicate configuration across multiple nodes.

How to create RabbitMQ cluster

Create RabbitMQ cluster to replicate configuration across multiple nodes.

How to display active Elasticsearch searches

Display active Elasticsearch searches and calculate average value.

How to display RabbitMQ Erlang processes

Use rabbitmq_top plugin to display RabbitMQ Erlang processes.

How to unmount stale NFS share

Unmount not accessible NFS share that still has open files.

How to log every executed command

Log every executed command to syslog.

How to install CouchDB

Install CouchDB on Debian Buster.

How export or import RabbitMQ configuration

Use RabbitMQ Management API to export or import configuration.

How to reset RabbitMQ node configuration

Reset RabbitMQ node configuration.

How to generate password hash for CouchDB administrator

Generate password hash for CouchDB administrator.

How to display RabbitMQ version

Display RabbitMQ/Erlang version using essential utilities.

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 start service after the system time has been synchronized

Ensure that specific service is started after the system time has been synchronized.

How to prevent systemd service start operation from timing out

Specify systemd startup timeout option to prevent service start operation from timing out.

How to generate password digest for basic authentication of HTTP users

Generate password digest for basic authentication of HTTP users.

How to modify systemd service configuration

Modify systemd service configuration by using drop-in files, which is useful for automation when using ansible or any other provisioning, configuration management, and deployment utility.

How to perform basic Elasticsearch operations

Perform basic Elasticsearch 7.x operations.

How to install Elasticsearch

Install Elasticsearch 7.x on Debian Buster.

How to instruct Ansible to use specific version of Python

Instruct Ansible to use a specific version of Python interpreter on the remote host.

How to keep RabbitMQ data regardless of the node name

Node name is by default part of the location where the RabbitMQ data is stored, so you need to explicitly define static location to ensure that RabbitMQ data is always available in these rare cases when there is a possibility of node name change.

How to specify RabbitMQ node name

Specify RabbitMQ node name to use your own prefix or particular hostname.

How to use HAProxy stats socket

Use HAProxy stats socket to determine current application status.

How to access OneDrive on Debian

Access your files stored in OneDrive using rclone command-line program to sync files and directories to and from cloud storage and FUSE Filesystem in Userspace filesystem.

How to suppress the message of the day

Suppress message of the day for specific or multiple users.

How to mark which backend server is used

There are use cases where you need to know which backend server is used, so use specific header to send target server name to backend.

How to manage and display system news

Manage and display system news using a simple but effective utility.

How to stop requests with empty or incorrect host header

Handle domains that are not defined in the configuration using dedicated backend.

How to visualize blog schedule using terminal

Visualize the blog schedule using a terminal.

How to display LWN news using message of the day framework

Display LWN news using the message of the day framework.

How to install Restyaboard on Debian Buster

Install Restyaboard, an Open Source Kanban board.

How to protect system against accidental shutdown

Protect the operating system against accidental shutdown or reboot.

How to display message after successful login

Display message of the day after successful login.

How to create VLAN interface using the ip utility

I have already described how to create VLAN interface, but things have changed over time, so I decided to update the know-how.

How to get RabbitMQ uptime

Get and display RabbitMQ uptime measured in seconds using three different methods.

How to install RabbitMQ message broker

Install RabbitMQ message broker to queue and exchange messages.

How to convert units using command-line

Use dedicated command-line utility to convert various units to different measurement systems.

How to parse Debian package information

Use to drctl-tools to parse Debian package information using the Debian control file format (the dctrl format).

How to display count and rate statistics for data read on standard input

Use wcs stream meter created by Arno Wagner to display count and rate statistics for data read on standard input.

How to deal with "repository is not valid yet" error

What does “Release file for […] is not valid yet (invalid for another […]). Updates for this repository will not be applied.” error mean?

How to strace PHP-FPM processes

Isolate the problem and strace multiple PHP-FPM (FastCGI Process Manager for PHP) processes to identify the culprit.

How to define default Firefox settings

Define default Firefox settings to always use your preferred configuration.

How to create persistent sysctl configuration

Create persistent sysctl configuration using standard system utilities.

How to fix fusermount – executable file not found

Quickly fix fusermount: exec: "fusermount": executable file not found in $PATH by installing missing Filesystem in Userspace package.

How to mount NFS share using systemd

This is an extension to an older blog post on how to mount WebDAV share using systemd as this proved to be a very reliable method that is easy to mark as a dependency for other services.

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 modify system identification message

Modify system identification message that is printed before the login prompt.

How to update system time using systemd

Update the system time using systemd as a NTP client.

How to create Argo Tunnel

Create Argo Tunnel to expose internal service and securely access it over the internet.

How to export system activity information

You already know how to collect and report system activity information, so it is the best time to learn how to export already collected data.

How to perform suite change

I have recently updated Debian Buster from testing to stable, so it is worth to note how to perform such update non-interactively.

How to count TCP connections

Use netstat, ss or files inside proc filesystem to count TCP connections.

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 configure sysfs during system boot

Configure sysfs during system boot to apply custom configuration using a simple and convenient way.

How to increase Google Cloud virtual machine disk size

Increase Google Cloud virtual machine instance disk size without service interruption.

How to disable Intel Turbo Boost

There are certain situations where I disable Intel Turbo Boost, for example to keep fans quiet during the night time.

How to disable Google Accounts daemon

Enforcing your own security policy that defines users, SSH keys, and sudo configuration inside custom templates based on official images in Google Cloud requires that you disable Google Accounts service, so it won’t get in the way.

How to collect system activity information

Collect and report system activity information using sysstat a system performance tools for the Linux operating system.

How to check website for broken links

Check website for broken links using HTTrack website copier.

How to copy website using HTTrack

Copy website for offline browsing using HTTrack website copier.

How to pretty print size in bytes using AWK

Pretty print size in bytes using AWK.

How to download OpenVPN configuration using NordVPN API

Download OpenVPN configuration using public NordVPN API to specific file.

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 manipulate X clipboard from terminal

Manipulate X clipboard from terminal using xclip utility which is a command line interface to X selections to easily copy and paste text from terminal to GUI applications.

How to display your external IP address using NordVPN API

Display your external IP address using public NordVPN API.

How to drop kernel caches

Free dirty objects, page cache and reclaimable slab objects for troubleshooting or instructional purposes.

How to display user details using NordVPN API

Today, I will show you how to get and display user details using a shell script. This work is based on a Python-based solution by David Green and located at bitbucket/nordapi.

How to remotely execute shell function

Sometimes it is very convenient to define shell function and execute it remotely.

How to perform dictionary attack on LUKS passphrase

Perform a dictionary attack on the forgotten LUKS passphrase to access the encrypted device.

How to compare two files byte by byte

Compare two files byte by byte using cmp file comparison utility.

How to inspect Redis internals using UNIX socket and Python script

Inspect Redis internals using UNIX socket and Python script without external dependencies.

How to instantly add known_hosts entries for host and its IP address

Use simple shell function to instantly create known_hosts entries for specified host, including its IP address and remove outdated public host keys.

How to merge multiple known_hosts entries into single row

Global known_hosts file located in /etc/ssh/ssh_known_hosts and user managed ~/.ssh/known_hosts contains known host public keys. Due to its nature these files can contain multiple entries using the same key. It is not a problem, but merging entries using the same key is the first step that is necessary to inspect it visually and to verify host entries.

How to disconnect idle SSH clients

Disconnect idle SSH clients using built-in client alive mechanism.

How to erase LUKS header

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

How to monitor PHP-FPM pool

Monitor PHP-FPM (FastCGI Process Manager) pool using curl utility, cgi-fcgi application or slightly modified Python script that was used to display PHP-FPM pool information.

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 display PHP-FPM pool information using UNIX socket and Python script

Display PHP-FPM (FastCGI Process Manager) pool information using UNIX socket and Python script. I thought it would be easy to write a simple FCGI client. Apparently not, but it was an exciting and rewarding experience.

How to test LUKS passphrase

Learn how to test LUKS passphrase on a specific device.

How to display PHP-FPM pool information using command-line utilities

Display PHP-FPM (FastCGI Process Manager) pool information using command-line utilities like curl or cgi-fcgi.

How to check external IP address using DNS service

I have already described how to check external IP address using curl or your own SSH service, but you can also use dig utility to take advantage of the OpenDNS, Google or Akamai DNS service.

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 use public NordVPN API

In a blog post a month ago, I described how to use a terminal to display servers recommended by NordVPN, but the same result can be achieved by using public API service. It is not officially documented, so let’s play with it.

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 use NordVPN command-line utility

Use NordVPN command-line utility to easily manage VPN service.

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 control status output of the dd utility

Control the amount of information printed out to standard error by the dd utility.

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 use terminal to display servers recommended by NordVPN

I have already described a simple way to manually configure Network Manager and automatically import NordVPN servers, so today, I will explain how to pretty print servers recommended by NordVPN using terminal instead of web-browser.

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 free disk space from deleted but still referenced file

Very rarely and often by mistake, you can end up with a deleted file that is still used by some process, which is likely writing to it, so the used space cannot be freed.

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 make iptables configuration persistent using systemd

Make iptables configuration persistent using systemd file with additional possibility to disable firewall after defined period of time.

How to display reverse package dependencies

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

How to make iptables configuration persistent using custom service file

Make iptables configuration persistent using custom service file with additional features like configurable wait time, so you can safely interrupt execution and test mode that will disable firewall after defined period of time.

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 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 upgrade pip on Debian Wheezy

Debian Wheezy provides an ancient version of pip utility for installing Python packages. To put it very simply, it does not work anymore as it is not using HTTPS protocol, but fortunately this issue can be quickly fixed.

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 regenerate the boot configuration for mdadm

Alteration of the software RAID arrangement often requires an update to the boot configuration of the mdadm utility for management of Software RAID.

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 install missing init system helpers

The init-system-helpers package that provides a helper tools for all init systems is not available in primary Debian Wheezy repositories. You need to use wheezy-backports repository to install it on that operating system.

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 install packages using repository snapshot

It is rarely mentioned, but you can use repository snapshots to download and install old and obsolete packages on already unsupported or even current Debian distributions.

How to check connection to the RabbitMQ message broker

Use Python script to verify that client can connect to the RabbitMQ message broker.

How to use loop devices

I have a feeling that loop devices are now used less frequently, but these are still relevant and useful.

July 3, 2017 · milosz · Debian

How to fix the missing HPE's public keys

HPE Software Delivery Repository is cryptographically signed, so you can be sure that provided software packages have not been modified by a third party. However, sometimes you can encounter the The following signatures couldn't be verified because the public key is not available error which can be easily fixed.

How to assign an IPv6 address to an interface

Stop running away from this, request and assign an IPv6 address to an external interface to make content available over both IPv4 and IPv6.

How to display network connections using lsof and GNU awk

Two years ago, I described a simple way to display established TCP connections using ss command. Today I will use lsof and gawk to pretty print network connections.

How to setup operating-system-level virtualization solution

Build your first VServer on Debian Wheezy using psand.net public repository.

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.

How to summarize file space usage on Amazon S3 using command line client

Use s3cmd Command Line S3 Client and Backup for Linux and Mac to display disk usage on a particular bucket.

How to install missing firmware for tg3 module

Recently I stumbled upon the missing firmware for Broadcom Tigon3 based gigabit Ethernet card after kernel upgrade process. Simple problem, which was solved by installing firmware-linux-nonfree Binary firmware for various drivers in the Linux kernel package.

How to list configured APT repositories

List configured APT data sources for binary packages using apt-cache utility.

How to remove invalid entries from known hosts file

There are rare cases when known hosts file becomes corrupted, so basic ssh utilities fail within custom built shell scripts due to ~/.ssh/known_hosts is not a valid known_hosts file error.

How to verify package version in shell script

There are circumstances when you want to ensure a particular package version during the setup process. I will show you a simple method to verify the package version suitable for sourcing into a shell script.

How to determine when process was started

There are at least several ways to determine when the process was started to help you investigate and trace potential issues. I will briefly introduce four different methods to choose the most useful one.

How to get name of the source package

There are many applications that share the same source package, so I will show three different ways to print the name of the source package.

How to determine when the last time package index files were updated

Knowing how to determine when the last time package index files were updated can be beneficial when you least expect it. It is not something used every day but can be used to monitor or verify when apt-get update command was executed.

How to upgrade selected packages

It is very easy to upgrade the whole Debian system, but you can also upgrade only selected packages and skip the rest.

How to list available updates using apt

Many years ago I wrote How to display available updates blog post which mainly related to Debian Wheezy. Today I want to extend it by a neat console friendly utility available in Debian Jessie since the milestone apt release thanks to Michael Vogt.

How to build Vagrant Debian base box using VirtualBox

I have already presented an easy way to build Vagrant Debian base box using qemu, but on some platforms it is better to use VitrualBox as it is not possible to use kvm accelerator.

How to build Vagrant Debian base box

It is time to look into build process of Debian Vagrant box, create one using packer utility for creating machine and container images and alter the whole process it a little bit.

How to jump between defined set of locations

I am constantly moving between a fixed list of several directories daily. Using cd can be tedious at times, so I defined a shell function to quickly jump between a defined set of directories.

How to setup apt-cacher-ng Vagrant box

Vagrant is an awesome piece of software, but constantly downloading system packages can be very time-consuming. The simplest solution is to set up an apt caching proxy as a Vagrant box.

How to setup DokuWiki Vagrant box

Today, I will publish Vagrant configuration to set up DokuWiki instance. It is just a handy reference, as described in the earlier blog post.

How to get started with Vagrant

Today I will install Vagrant which provides an easy way to configure reproducible and portable virtual environments. It is just a first step towards this new direction, so stay tuned for more details soon.

How to automatically login user at the console

I have already described a straightforward way to automatically login user at the console without touching the graphical user interface using Debian Wheezy, so today I will post an update for Debian Jessie as the whole process has changed considerably.

How to install and configure DokuWiki instance

Dokuwiki is the best Open Source project I have ever used, so I have prepared a simple step-by-step guide to help you get started. It is relatively brief and concise as most of the code was already described in other blog posts found on this website.

How to add menu to AWStats web-interface

I have described a simple way to configure the AWStats web-interface last month, so I will continue this topic further and tell you how to add a menu to quickly switch between configured sites.

How to check for command inside shell script

Today, I will illustrate a simple way to check for specific command inside a shell script, which is quite simple as it uses only shell built-in command utility.

How to check for package inside shell script

Today, I want to briefly describe a simple way to check for a specific package inside a shell script.

How to configure AWStats web-interface

I will show you how to configure the AWStats web-interface using the uWSGI application server and Nginx HTTP server, which is a very simple and straightforward process.

How to get names of distinct Debian releases

It is easy to get names of distinct Debian releases as you can always examine these on the Debian Releases web page. I will do something more interesting and demonstrate how to do that using a simple shell script.

How to find which package includes specific file

This brief outline explains how to locate specific file within Debian packages using very useful apt-file utility which as opposed to dpkg-query does not only inspect installed packages since it utilizes fetched lists of the contents of packages.

How to generate random password using command-line

I will show you how to generate a random password using the OpenSSL utility, standard command-line utilities, Password Generator (pwgen), and Automated Password Generator (APG).

How to use recent version of Firefox in Debian Jessie

I was recently pointed out by Piotr Gabryjeluk that Iceweasel name was dropped (see Debian Bug report #815006). This caused a major inconsistency in the previous blog post. This is an updated version for Debian Jessie

How to reload PostgreSQL configuration

Today, I will describe how to cause PostgreSQL clusters to reload their configuration files using four simple methods.

How to install and configure private Seafile cloud storage server

Since the beginning of this year, I have started using Seafile, and I absolutely love it as it offers simple data organization using libraries and reliable file synchronization between multiple devices with built-in encryption. Check for yourself as it is undoubtedly worth it.

How to perform PostgreSQL point-in-time recovery

This blog post is an update to the earlier PostgreSQL entries in which I will show you how to use continuous Write Ahead Log archiving to take advantage of the point-in-time recovery.

How to perform base PostgreSQL backup using pg_basebackup utility

I have already described a simple way to perform base PostgreSQL backup using file system utilities. Now I want to show you a different approach using pg_basebackup utility.

How to parse and process Linux Software RAID events

It is an interesting thing to know how to parse and process Linux Software RAID events. It is also beneficial as you can automatically take appropriate action immediately after a certain event occurs.

How to perform base PostgreSQL backup using standard file system utilities

Today I want to show you how to perform base PostgreSQL backup using standard file system utilities. It is great example as it briefly describes basics required before moving to more advanced topics.

How to set NOOP scheduler at system boot

There are many different ways to set NOOP scheduler on the first hard drive at system boot. I have decided to use simple systemd service, but alternatively you can use udev to automatically configure every SSD device (see References section).

How to temporarily disable user logins

Sometimes, I want to prevent regular users from logging into the system to perform more complex operations. To achieve that, I am using Pluggable Authentication Modules for Linux to temporarily disable user logins.

How to boot Debian ISO from USB flash drive

This is a follow up to the previous article. I will briefly describe a way to boot Debian installation ISO image from USB flash drive using syslinux bootloader.

How to create bootable USB flash drive

Today, I will show you how to create customized USB flash drive to boot selected ISO images using Syslinux bootloader for Linux ext4 filesystem. It is very handy and useful, so let’s begin immediately.

How to schedule system reboot

It is a short entry, but an useful one, as it is important to have a basic knowledge of how to schedule system reboot or power it down automatically at specified time.

How to use recent version of Iceweasel in Debian Jessie

Do you want to use the latest version of Iceweasel, also known as Firefox? Then add the repository provided by the Debian Mozilla team and choose between release, beta and aurora version. This blog post is obsolete. Please read How to use a recent version of Firefox in Debian Jessie instead.

How to add new device to hddtemp database

Recently described hddtemp application does not contain every possible hard drive in its database. I’ll be honest here, its development stopped many years ago, but it is still very useful, so I will shortly describe how to add new hard drive to the database.

How to monitor hard drive temperature

It is often overlooked that hard drives which are available on the market provide temperature measurements. This temperature can be effortlessly monitored using hddtemp application by Emmanuel Varagnat.

How to install Debian remotely

It is possible to install Debian over network with a little help of another person in remote location. I performed it only once and it was some time ago, but the whole procedure is quite easy and straightforward.

How to create shadow directory of symbolic links

There are times when it is handy to know how to create shadow directory of symbolic links. I am thinking in particular of the software compilation process, as I have used this technique in very distant past to build X Window System.

October 5, 2015 · milosz · Debian

How to programmatically create system user with defined password

It is very easy to add users by hand, but sometimes such actions needs to be automated.

How to determine whether the operating system is 32-bit or 64-bit

Two years ago I have described three simple ways to determine whether the processor supports 64-bit instruction set. Today, I will show you how to determine whether any Debian-based operating system is 32-bit or 64-bit.

How to extract the cover image from an e-book

I have successfully used Google Drive and Insync to organize all of the e-books that I have acquired during the last years. Currently plan to upload them to a personal DokuWiki instance since I use it more every day. Before I can start, I need to extract cover images to ensure that I will get a decent outcome.

How to use nearest Debian mirror

Today, I will explain how to automatically choose nearest mirror based on geographic and network location using Debian mirrors HTTP redirector to solve the common problem of choosing an appropriate mirror.

How to replace failed software RAID device

I had an unexpected incident last week as one of the hard disks in my server failed. This device was a part of a software RAID mirror, which created an opportunity to describe the whole process.

How to record terminal session

Maybe it is rarely needed, but recently, I found it very useful to know how to record an interactive session, so I could reference to it later or just examine it further.

How to lock Linux console session

It is easy to lock screen when using any of the available desktop environment or even basic X Window utilities. The more interesting thing is to achieve the same functionality on text only based system.

How to crack archive password faster

A week ago I wrote about a couple of interesting applications that can crack passwords, but they were not as fast as I thought. After investigating this topic further, I ended up using a community-enhanced version of John the Ripper.

How to crack archive password

I have recovered old backup only to learn that I do not remember password to the found archive. As a result, I checked out two command-line applications to crack passwords used to encrypt zip, 7z or rar archives.

How to enforce read-only mode on every connected USB storage device

Today, I will show you how to put every connected USB storage device in read-only mode using udev dynamic device management, blockdev utility, and systemd service unit configuration.

How to copy answers to the configuration questions for Debian packages

Human memory is sometimes unreliable, so it is not always possible to answer in the same way to the configuration questions. Fortunately, this process can be automated using debconf utilities.

How to manage system services on Debian Jessie

Debian Jessie is using systemd as the default system and service manager. I will not argue about it, but instead, I will briefly introduce the whole thing.

How to use chkconfig on Debian Wheezy

I have already described chkconfig utility in CentOS – How to manage system services blog post, but today I want to mention that you can also use it to manage services on Debian Wheezy.

How to clear up pending resync on RAID array

I have already wrote a couple of posts about software RAID setup and recovery. Today I will briefly describe how to switch array to read-write state and begin resync process.

How to exclude data from certain tables during PostgreSQL backup

I often want to omit data from certain tables during PostgreSQL database backup. Today I will look into this and post my findings for further reference.

How to terminate active ssh sessions

Several months ago I have shortly described how to close a non-responsive ssh session, which comes in handy at times. Today I will describe how to close every active ssh session by inspecting existing pseudoterminals.

How to verify installed packages

I have unexpectedly experienced an issue with a couple of broken packages, which was easily solved using debsums utility.

How to search for files by date

Today I would like to tell you how to search for files by date, which is very useful skill when you spend most of your time on the command-line.

How to automatically logout user from the login shell after period of inactivity

I want to automatically log out the user from the login shell after a defined period of inactivity but leave X Window Terminals untouched. This will allow me to enhance security slightly, as I will not accidentally leave the superuser session running for a long time.

How to find orphaned files

It is easy to overlook orphaned files without an assigned existing owner or group after moving large amounts of data. Fortunately, it is easy to spot these files using the find utility.

How to store last command from history

I often want to save a recently executed command to the personal log file for further reference, so let’s do it.

How to check the progress of dd using proc filesystem

On Sunday 29th April 2012, I have described How to check dd’s progress using User-defined signal 1. Today, I will extend this topic further using the proc filesystem.

How to quickly and securely search for files

Using find command is not always the fastest way to search for specific files. The better method is to use mlocate utility, which uses its own file database and provides only user-accessible results.

How to inspect PostgreSQL queries

Sometimes I want to inspect and verify queries made by an application or hunt a bug that involves more complex queries. The essential part of this process requires altering PostgreSQL server configuration to log SQL statements.

How to locate scripts in the PATH

Simple shell script that will iterate through the directories in the PATH variable and print only files identified as scripts.

How to check external IP address

I am constantly on the move, so sometimes I need to quickly verify my external IP address, as I do not want to accidentally block myself on some kind of firewall.

How to password protect GRUB entries

I always asked myself how to password protect GRUB entries on an encrypted notebook to lock down the boot loader and protect it from unauthorized access.

How to perform unattended upgrades

I have been using unattended upgrades on development machines since the end of last November, when I installed Debian Jessie release.

How to check file metadata using shell script

It is well described how to verify file existence or type, but there is much more information that can be easily verified inside shell script using nothing more than simple stat command.

GNOME Terminal, Midnight Commander and function keys

I have updated desktop computer to Debian Jessie. After that I have quickly encountered an issue with GNOME Terminal, Midnight Commander and already assigned F1 and F10 function keys.

How to create persistent reverse SSH tunnel

Sometimes I want to access a private server at home from a different network while being on the go. The easiest way to do this is to use autossh utility to create a secure and persistent reverse SSH tunnel to the publicly available server.

How to use recent version of Iceweasel in Debian Wheezy

Do you want to use the latest version of Iceweasel, also known as Firefox? Then add the repository provided by the Debian Mozilla team and choose between release, beta and aurora version.

How to check package version

Sometimes I need to check the installed package version, compare it with the available version, or verify that the correct version is already installed. I will show you how to quickly perform these checks.

How to enable VPN connections inside Network Manager

Default Debian installation does not include VPN support inside the Network Manager applet. The reason behind this decision is probably the variety of available solutions.

How to take control over configuration files

Take control over configuration files and store them in version control system using etckeeper utility created by Joey Hess, which seamlessly integrates with package management tools inside Debian operating system.

How to automatically share X session using VNC

Today, I will briefly describe how to automatically share X session on Debian Wheezy using VNC protocol.

i915 and "Hangcheck timer elapsed" error

Since Debian Jessie installation, I have encountered Hangcheck timer elapsed error. It is a really nasty bug as the only way to escape frozen X Window System is to reboot the whole operating system.

How to create simple bar charts in terminal using awk

Today, I tried to visualize how many processes each user is running using a bar chart. The catch is that I want to see results in a plain terminal, which makes things more interesting.

How to verify copy process

Yesterday, I left a long-running copy process between two external USB hard-drives. I did not want to assume anything, so I created a simple shell script to ensure that the whole process went smoothly.

How to handle Bash history

I have already written a blog post about useful Bourne Again SHell key sequences, so today, I will touch on another important aspect of the daily routine – the history.

How to monitor TigerVNC service using Monit

Recently, I was searching for an easy to manage VNC service to use it at home. After a short while of consideration, I decided to install TigerVNC and manage it using Monit.

How to handle Bash command-line

The default interactive shell in Debian is Bourne Again SHell, so it worth to invest some time to at least skim through the available readline key sequences to gain higher proficiency at the command-line.

How to fix error when moving events between calendars

Recently, I noticed “Failed to save changes” error when tried to move events between distinct calendars. After a short investigation I found that this bug is already fixed, but not packaged for an easy upgrade, so I will shortly describe how to apply fix for Debian Wheezy and Kolab 3.3.

How to check whether the process ID still exists

Not well documented, but a quick and simple operation.

How to configure TF2234MC multi-touch monitor

I had a little experience with multi-touch devices, so I was happy to use for a while iiyama TF2234MC multi-touch monitor with Debian Wheezy. It was quite pleasant experience with a little bit of adventure.

How to get PID of the background process

It is a very simple operation that can be effectively used inside shell scripts.

Debian Jessie and a little change during installation process

There was an interesting change in the tasksel announced on the October 5th, 2014, as it provides an opportunity to choose desktop environment during installation process.

How to monitor Kolab processes

I have been using self hosted Kolab Groupware everyday for quite a while now. Therefore the need arose to monitor process activity and system resources using Monit utility.

How to compare the contents of two directories

This weekend I encountered a simple, but interesting topic, which concerns comparing the contents of two directories. The fun part is that you don’t need any additional utilities as standard diff command is fully sufficient.

How to extract an ISO image

During my recent activity I have noted to check out how to extract an ISO image in a traditional way using only shell utilities. It turned out to be easier than I thought, so I will present you three different solutions.

21st anniversary of the Debian project

Debian was founded exactly twenty-one years ago by Ian Murdock, you can even find original newsgroup subject New release under development; suggestions requested.

August 16, 2014 · milosz · Debian

How to terminate PostgreSQL sessions

Recently, I have encountered an interesting issue, as I could not perform specific database operations due to unwanted and active sessions using the database. Thus, I will briefly note the solution for further reference.

Kolab – SSL certificate authentication (web-based interface)

This weekend, I have spent some time investigating SSL certificate-based authentication and implementing it in Kolab web-based user interface. This topic is fascinating but definitely too broad to be briefly described in a single blog post, so do not look at it as a complete solution, but treat it only as a proof of concept.

How to forbid script execution from different directory

Today I have found an interesting issue as I tried to forbid shell script execution from different directory.

Kolab 3.1.5, Debian 7.5 and issue during setup process

After a longer period of time, I have decided to install Kolab and use it as a personal information manager. The installation process went as expected until the setup process tried to install the Roundcube database and failed miserably.

How to terminate SSH connection

Currently, I am working over an unstable network connection, so my SSH session is constantly disconnected. It is very uncomfortable situation as dropped SSH connection freeze the whole terminal.

How to use Solarized theme in Emacs

You may have noticed that I became a fan of solarized color palette by Ethan Schoonover used for terminal and gui applications. You will therefore not be too surprised when I describe how to install it and use in Emacs text editor.

Amazing Emacs org-mode

I have discovered org-mode in the last year but have been using it for the last two months with increasing enthusiasm and commitment. I will be honest and tell you that it is the sole reason to learn and use Emacs on daily basics.

How to archive every directory in current location

Today I needed to archive every non-hidden directory in several different locations. I do not like to repeat myself so after a while I quickly created shell script to accomplish this task.

How to setup Jekyll virtual private server

It is not a secret that I am using Gandi Simple Hosting to host sleeplessbeastie’s notes website. This solution is almost maintenance-free and does not require any additional work to use Jekyll, as hosting static content is dead simple (see shell script to automate build and upload process).

How to access single-user mode without password

Recently I was asked to reset root password on some long forgotten Debian box. It was an easy and straightforward task, but, as there are some interesting pitfalls, I will describe the whole process of acquiring root shell without password using single-user mode and a couple of ways to prevent it.

Where to download Debian minimal CD?

I am used to install Debian using minimal CD, however, I always forget to download it in advance, so I need to take a note and store its location here for further reference.

How to count local user accounts

If you are wondering how to count only local users ignoring system accounts, I will give you a concise and straight answer.

How to remotely check PostgreSQL version

Today I will shortly describe how you can remotely check the PostgreSQL version and use it inside shell scripts. This ability comes in handy at times, as it can be used to perform different tasks depending on the returned database version.

How to setup KVM full virtualization solution

Today I want to install Debian on an older but quite capable Dell machine so I will shortly describe how to setup KVM full virtualization solution.

How to manage packages on an off-line Debian system

There are plenty of off-line Debian systems just waiting to update index files, upgrade or install additional packages. This can be easily achieved by using apt-offline utility. I will shortly describe common usage scenario as it is very handy application.

How to reliably use Serial port within the local network

The easiest way to reliably use Serial port within the local network is to use RS-232/422/485 NPort Device Server produced by Moxa company. I will shortly describe how to install NPort 5110 (1-port RS-232 serial device server) on Debian Wheezy.

How to upload Jekyll blog to the Gandi Simple Hosting

I am using Jekyll to generate this website for a half a year and Gandi for an even longer period of time so at the beginning of this year I revisited How to quickly download or upload directory tree over FTP post and created simple but useful shell script to automate build and upload process.

How to open Firefox bookmarks from OpenBox menu

I have recently switched to OpenBox, so today, I will use dynamic menus to integrate Firefox bookmarks with an existing OpenBox menu.

Fresh install of the Debian Wheezy

End of the year is the best time to reinstall operating system and change encryption keys due to couple of additional free days at home so today I will shortly present my setup.

uGet download manager for Linux desktop

A couple of days on the road made me realize that I need a simple desktop utility that will download files when I sleep.

Logitech Unifying Receiver

Several months ago, I have acquired wireless keyboard using tiny Logitech Unifying Receiver. Since that time I was a little worried by the lack of appropriate management options, however recently I found Solaar – a Linux device manager for such peripherals, which solves my doubts.

How to accurately determine when the system was booted

It is very easy to tell how long the system has been running using uptime command, but the information when exactly it was booted is not so apparent, so I will show you two different ways to get it.

How to automatically login user at the console

Whenever I see auto-login feature implemented by using X login manager, I immediately think about how to automatically login user at the console without even touching graphical user interface.

How to tell to which package the specified file belongs to

It is good to know how to tell to which package the specified file belongs to as this knowledge could be very useful during system upgrade or unexpected system failure.

How to determine whether the processor supports 64-bit instruction set

If you ever wondered how to determine whether the processor is 64-bit capable, then I have a simple and straight answer for you.

How to configure software RAID1 during installation process

Recently I needed to setup software RAID1 during Debian installation process. As it turned out, this process was simpler then I initially expected. I will shortly describe it here using screen-shots captured during initial tests.

Handy way to beep within a shell script

Sometimes I need to explicitly indicate execution of specified shell script or just action taken inside it. My favorite way is to use advanced pc-speaker beeper, which is directly available in Debian repository.

How to backup and restore installed packages

If you ever wondered about how to backup list of installed packages and then restore it on another machine then you need to know that it does not require anything more then three basic utilities – dpkg to import/export list of packages, apt-get to install selected packages and apt-mark to restore extended package states.

Apt-Cacher NG and Debian minimal CD

Generally I prefer to install Debian using minimal CD so Apt-Cacher NG is an integral part of this process as I don’t like to wait during installation process.

How to setup apt caching proxy

I am currently using cellular connection most of the time. Thus, it is obvious that I prefer to reduce the amount of data transferred over the network. Significant portion of it is reduced by the apt caching proxy apt-cacher-ng as I use Debian Linux distribution and VirtualBox on daily basis.

How to read the kernel's start-up parameters

Simply dive into proc filesystem and read /proc/cmdline file to determine the kernel’s start-up parameters.

How to check last mount time of the ext2/ext3/ext4 filesystem

A couple of days ago, I was asked how to check the last mount time of the ext2/ext3/ext4 filesystem. The solution is straightforward as it does not require anything more then tune2fs utility.

How to setup point-to-point OpenVPN tunnel

Static key configuration is the easiest and shortest way to set up OpenVPN tunnel.

How to perform automated backup using rsync over ssh

Today I will describe how to use rsync over ssh using four simple examples as it is very convinient way to perform secure and automated backup.

How to display available updates

It is straightforward to display available updates using an application with a graphical user interface, but not so obvious to do it by using shell commands only. I will shed some useful light on the subject so we could both benefit from it.

How to create browser sandbox

I am using Firefox web browser most of the time, but you need to know that I have drawn a clear line between daily browsing and strictly private usage by using browser sandbox. I will shortly describe whole process so you could also benefit from it.

How to list local displays

I was always curious about how to list local displays as it is quite interesting issue. Solution is not immediately apparent, but easy enough to spot after a while as it does not require anything more than little observations.

Debian – How to hold specific package

There are at least couple ways to hold specific package and prevent it from being updated as you can use apt, dpkg, aptitude, dselect, apt preferences, but only the last one is effective in every case.

Debian – How to quickly disable IPv6

I am playing with Linux Virtual Servers in the Linode Cloud for the last several days and a couple of times wanted to disable IPv6 for testing purposes.

Kolab 3 and Debian Wheezy – Small LDAP issue and quick fix

Yesterday I experienced strange problem after Kolab 3 installation on Debian Wheezy as I couldn’t add an initial user account using admin interface.

How to open manual page at the specific page section

After writing the previous blog entry, I started to think about how to specify page section when opening the manual page. It is a simple but quite interesting issue, so I quickly got curious and wrote this post to describe a straight solution. Just to be clear – I need to mention that I am not writing about section numbers describing distinct subject areas but just page sections, such as NAME, SYNOPSIS, DESCRIPTION, AUTHORS, and so on.

How to read total CPU usage of the group of processes

I was wondering how to read the total CPU usage of the group of processes. Then I came with a straightforward solution using top and awk commands.

Keep a pulse on the Address Resolution Protocol traffic

Today I will mention about arpwatch utility (developed by LBNL’s Network Research Group) as it is a small and very useful tool that will keep track of the Ethernet/IP address pairings and log every change which you can monitor and analyze.

How to easily access files over SSH protocol

I am constantly using SSH to transfer files between home notebook and remote servers. Basic scp tool is great but sometimes it is more convenient to mount remote file-system to easily access files over SSH protocol.

How to get number of days in a month using shell commands

Today I was writing a shell script that performs different actions depending on the day of the month. Nothing fancy but then I came across an interesting issue, which is how to get number of days in a month. I got interested and started playing with shell commands, namely cal and awk utilities.

How to re-read partition table

Re-read partition table without machine reboot using partprobe utility which is a part of parted package.

How to easily install Steam on Debian Wheezy

I was wondering how to easily install Steam on Debian Wheezy and unexpectedly found solution on GitHub. To download and play Linux games available on Steam without any hassle you need to download and install Steam installer for Wheezy package.

Semi-intelligent screensaver

A couple of days ago, I described a couple of interesting ways to interact with KDE using the D-Bus message bus. Today I will show how to set up a semi-intelligent screensaver to just wait during YouTube video playback.

How to automate KDE using D-Bus

Today I was playing with D-Bus message bus and KDE so I will describe here couple of basic actions that can be quickly automated by using shell commands. It shouldn’t matter much but I need to mention that I am using KDE 4.9.5.

How to quickly maximize particular window

Around three weeks ago I wrote an article on how to automate mouse and keyboard. It was very fun experience but as the former article was quite long I didn’t mentioned about wmctrl tool. It is an excellent complement to the previously described tools.

Long term battery capacity graphs

Month ago I wrote an article – Debian – How to monitor battery capacity. Today I will publish long term battery capacity graphs so you could see them for yourself.

How to automatically wake up notebook

I came across ACPI wakeup wiki article while writing previous post, got interested and checked how to automatically wake up notebook. It is really simple as you can quickly set wake up time using date command, just remember to use Unix time.

How to automate mouse and keyboard

Recently I was wondering if it would be possible to automate mouse and keyboard actions. The answer is obviously yes as you can use xautomation and xdotool tools. I will describe them in a couple of simple examples.

How to change the MAC address of an Ethernet interface

Change the MAC address of an Ethernet interface and make this change permanent. I will briefly explain how to do this using standard commands and one particularly useful tool MAC Changer.

How to automatically set up external monitor

Recently I was wondering how to automatically set up an external monitor without using desktop utilities as I don’t like to configure it each time. This question provided me a lot of fun as it opens a couple of interesting possibilities.

How to monitor battery capacity

Recently battery in my notebook started to behave erratically. It will charge only to 70-80% of its maximum capacity. I suspect that it is probably slowly dying, so I will have to replace it soon, but at first, I will look at several utilities to monitor battery capacity.

Debian – How to turn off the system bell

It is very annoying to hear loud beeps at home especially at night or when listening to music. To turn off the system bell just follow a couple of steps below and enjoy pure silence.

Debian – How to transparently bridge Ethernet interfaces

Yesterday, I wrote a short note about VLAN interfaces. Today, I want to write a short entry on how to bridge Ethernet interfaces to keep things complete as I need to mention about creating ACCESS port to tag packets on desired interface.

How to create VLAN interface

VLAN (virtual local area network) is very useful concept as you can easily separate device management from users by using appropriate network devices and configuration. I will describe here in a form of a short note how to create VLAN interface using Debian system.

The Debian Administrator’s Handbook

If you are searching for a book about Debian then look at The Debian Administrator’s Handbook. It is a great open source project so feel free to check it out and support it at the official The Debian Administrator’s Handbook website.

Debian – How to install PCI-1610 4-port RS-232 PCI communication card

PCI-1610 is an Advantech 4-port RS-232 Universal PCI Communication Card with comes very handy if you need to connect more devices using serial port.

Debian – How to read DHCP packets

I am playing with DHCP option 82 so I need to read DHCP packets. The easiest way to do this is to use dhcpdump by Edwin Groothuis because of very simple usage and friendly output.

Debian – How to change time zone

This is rarely performed task but an easy one. To change time zone you need to reconfigure tzdata package.

Debian – How to replicate data over network using GlusterFS

Recently I needed to replicate data between two Linux servers so I could mitigate potential hardware failure. To achieve this goal I used GlusterFS – an Open Source distributed file system. In this example I will use Debian Wheezy as I want to try more recent version of GlusterFS.

PlayOnLinux – Easy way to run Windows apps on Linux

From time to time I play older games on my notebook. I download them from Good Old Games and play on Linux as most of them works and it is easy to check which one are supported using WineHQ website. Recently I installed PlayOnLinux and I like it because it allows to keep and manage all Windows applications in one place.

How to mount software RAID1 member using mdadm

Just a moment ago I connected my old hard drive and realized that it was a RAID member.

How to quickly download or upload directory tree over FTP

The fastest way to download or upload directory tree over FTP using just plain console is to execute lftp command.

How to determine current run-level using Linux

To print current run-level execute: $ who -r run-level 3 2012-01-17 17:06 To print previous and current run-level execute: $ sudo runlevel N 3

How to check established TCP connections

Display established TCP connections inside the terminal.

VLC – quick solution for problems with HTTPS certs

Certificate could not be verified error.