There are 352 posts published with this tag. ↑ Return to tags

How to display kernel slab cache information

You can directly inspect kernel slab allocator statistics (/proc/slabinfo file) for detailed information on buffer, inode, dentry, or other caches in the Linux kernel, though slabtop utility will sort and pretty-print information in real-time.

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 solve pipeline mysteries

I have already described how to inspect a pipeline, but today I will show you how to write a shell script that will help you reconstruct a whole pipeline when all you got is a process ID that is part of the pipeline.

How to inspect a pipeline

A pipeline is a sequence of multiple commands separated by the control operators. It is easy to understand as long as you see the whole picture, but I will show you how to inspect it when you have a single process ID.

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 contain 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 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 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 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 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 configure command-line tab completion for known SSH hosts

Configure and enable command-line tab completion for known SSH hosts to ease day-to-day operations. You do not need to configure or enable this on Debian-based distributions, but it is good to know how to do this as you will never know when it will come in handy. This article is an extension of adding the SSH menu to the Unity launcher blog post.

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 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 generate and decode CSR

Create a certificate signing request and use it to generate an SSL certificate. I strongly suggest reading my two earlier blog posts about self-signed SSL certificates and private keys as these contain useful information. I will describe three different ways to generate a certificate signing request.

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. The 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 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 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 fix broken uwsgi package on Ubuntu Xenial

Recently, I tried to update uwsgi package on Ubuntu Xenial, but received an error about broken package. It looks like the mentioned package was pushed to the repository before its dependencies. This issue is thoroughly described in <a href=“https://bugs.launchpad.net/ubuntu/+source/uwsgi/+bug/1719363" target=_blank” rel=“external”>#1719363 bug report.

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 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.

October 12, 2017 · 2 min · 278 words · Command-line · Debian · Debian Stretch

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 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 let’s mount a WebDAV share.

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 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.

December 7, 2015 · 5 min · 949 words · Command-line · Debian · Debian Jessie

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 search for files by date

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

February 27, 2015 · 1 min · 195 words · Command-line · Debian · Debian Jessie

How to find orphaned files

When managing large datasets, it is remarkably easy to end up with orphaned files, those without an assigned owner or group. These files can persist unseen, potentially creating security vulnerabilities or just contributing to system clutter. Fortunately, the find utility provides a direct method to locate them.

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 handle Bash command-line

The default interactive shell in Debian is Bourne Again SHell, so it is 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 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.

How to terminate SSH connection

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

How to colorize text in terminal

Seven days ago I have published a shell script to highlight text in the terminal using sed or ssed. Today I want to extend the idea and colorize specified strings or simple regular expressions using just bash, getopts and ssed respectively.

How to highlight text in terminal

I have been working on a simple shell script to highlight text in the terminal for the last hour. At first, I looked at it from the wrong angle, but after a short break, I finally realized the simplest possible solution.

Handy way to beep within a shell script

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

How to list local displays

I was always curious about how to list local displays as it is a 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.

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.

Console based task manager

Recently I discovered console based task manager – devtodo. It is a very useful tool as you can easily use it over an SSH connection, create multiple different lists and combine them together. I will shortly describe devtodo utility available in Debian package repository but you need to know that you can use newer version – devtodo 2.

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 quickly maximize particular window

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

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 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.

How to generate QR Codes

Quick Response Codes are appearing everywhere. You can see them in museums, near the tourist attractions or all over the web. There is no doubt that QR Codes are useful as they can contain any information within reasonable limits.

How to backup DOS-type partition table/GPT and LVM metadata?

DOS partition table We can use sfdisk to dump partition table in usable format and store it: $ sudo sfdisk -d /dev/sda > sda_partitions Partition table can be restored using stored backup: $ sudo sfdisk /dev/sda < sda_partitions Partition table can be easily cloned (from sda to sdz in this example): $ sudo sfdisk -d /dev/sda | sfdisk /dev/sdz GPT To backup GUID partition table use sgdisk command (from gdisk package): $ sudo sgdisk -b sda_gpt_backup /dev/sda Restore it in similar way:

How to get disk UUID

I recently needed to know the UUID (universally unique identifier) of my bootable USB root partition. It is a better way to distinguish storage devices because device names can change depending on the connection order.

How to convert Mbox mailboxes to Maildir format

Download mb2md.pl script and run as described in the manual. For example to convert /old/mbox to /new/maildir you can execute: # perl ./mb2md.pl -s /old/mbox -d /new/maildir Converting /old/mbox to maildir: /new/maildir Source Mbox is /old/mbox Target Maildir is /new/maildir Dummy mail system first message detected and not saved. 40 messages.

How to count files or directories

For this example I will use such a tree: . ├── dir1/ │ ├── dir6/ │ ├── dir7/ │ ├── dir8/ │ ├── file4 │ └── file5 ├── dir2/ │ └── dir9/ │ ├── dir10/ │ │ ├── file9 │ │ └── file10 │ ├── file6 │ ├── file7 │ └── file8 ├── dir3/ ├── dir4/ ├── dir5/ ├── file1 ├── file2 └── file3 List of all files and directories: $ find . | sort | grep -v ^.$ ./dir1 ./dir1/dir6 ./dir1/dir7 ./dir1/dir8 ./dir1/file4 ./dir1/file5 ./dir2 ./dir2/dir9 ./dir2/dir9/dir10 ./dir2/dir9/dir10/file9 ./dir2/dir9/dir10/file10 ./dir2/dir9/file6 ./dir2/dir9/file7 ./dir2/dir9/file8 ./dir3 ./dir4 ./dir5 ./file1 ./file2 ./file3 Number of all files and directories:

← Return to tags