Simula Research Laboratory / Center for Resilient Networks and Applications / NorNet
Homepage of Thomas Dreibholz / System-Tools Homepage


System-Tools
Tools for Basic System Management


πŸ“‘ Quick Navigation


πŸ“° Latest News


πŸ’‘ What is System-Tools?

System-Tools is a collection of helpful tools for basic system management of Linux and FreeBSD systems:

System-Tools provides internationalisation (i18n) support using GNU gettext. That is, translation files for the output of the programs are supported. You can support the project by contributing translations for your language. See Internationalisation (I18N) for details!


πŸ“š System-Info

System-Info displays basic status information about the system: hostname, uptime, CPU, memory statistics, disk space statistics, SSH public key hashes, and networking information. Furthermore, it can be configured to show one or more banners (for example, a project name). System-Info can be configured to be automatically run when logging in, providing the user with an up-to-date overview of the system.

One main purpose of System-Info is to run on login, to particularly show a nice login banner (for example, a project or company logo) and then present the basic system information. For this purpose, System-Info can be configured with banner scripts (by default looked up in /etc/system-info.d or /usr/local/etc/system-info.d), which are processed in alphabetically descending order by file name, like:

The names of all scripts MUST begin with two decimal digits. That is, scripts must be named [0-9][0-9]... to be processed by System-Info!

If one of the scripts exits with a non-zero exit code, the processing of further banner scripts is stopped. This can be used for preconfiguring a system for example with a department and company logo, where the company logo script terminates further processing. A modified system for a certain project can add a project logo as well. The project logo script may terminate further processing, not showing department and company logos. This may be combined with packaging scripts, for example adding an application logo as part of the application’s install package (like adding a script 95-application-logo).

Some examples, using the banner-helper library provided by System-Info:

System-Info Banner Example 1
01-example
The default example.

System-Info Banner Example 2
09-hostname-example
Dynamically showing the hostname of the machine.

System-Info Banner Example 3
10-company-logo-example
A SimulaMet company branding.

System-Info Banner Example 4
10-nornet
A NorNet project branding.

System-Info Banner Example 5
18-neat
A NEAT project branding.

System-Info Banner Example 6
30-rsplib
A RSPLIB project branding.


πŸ“š System-Maintenance

System-Maintenance runs some system maintenance tasks to keep the system clean and up to date. These tasks are:

The typical usage is quite simple, e.g.:

sudo System-Maintenance

The manpage of System-Maintenance contains details and further examples:

man System-Maintenance

πŸ“š Reset-Machine-ID

Reset-Machine-ID resets the machine identity state, particularly for a cloned VM, to make it appear as a new machine. It performs the following tasks:

The changes are made interactively on request only, unless the option --yes-to-all-i-am-really-sure is set.


πŸ“š Fingerprint-SSH-Keys

Fingerprint-SSH-Keys prints the SSH key fingerprints of the local machine in different formats: SSH hash, DNS SSHFP RR, or Python dictionary. Its typical usage is straightforward:

Fingerprint-SSH-Keys

The manpage of Fingerprint-SSH-Keys contains details and further examples:

man Fingerprint-SSH-Keys

πŸ“š Configure-GRUB

Configure-GRUB adjusts a GRUB configuration file by applying a configuration from a template, and merging the existing configurations settings with additional customisations. It can for example be used to set a custom screen resolution (GRUB_GFXMODE option) or startup tune (GRUB_INIT_TUNE option). The Virtual Machine Image Builder and System Installation Scripts use Configure-GRUB to configure the screen resolution and a boot splash image.

The manpage of Configure-GRUB contains details and further examples:

man configure-grub

Print-UTF8 is a simple program to print UTF-8 strings in the console with options for indentation, centering, separator as well as size/length/width information. It can e.g. be utilised for printing System-Info banners, or for displaying error messages like this classic Amiga Guru Meditation example:

print-utf8 -n -s "\e[1;31;40;5mβ–ˆ" "β–€" "β–ˆ\e[0m"
echo -e "Software Failure.   Press left mouse button to continue.\nGuru Meditation #00000004.48454C50" | \
print-utf8 -n -C "\e[1;31;40;5mβ–ˆ\e[25m" "\e[5mβ–ˆ\e[0m"
print-utf8 -n -s "\e[1;31;40;5mβ–ˆ" "β–„" "β–ˆ\e[0m"

A Guru Meditation Example with Print-UTF8

The manpage of Print-UTF8 contains details and various further examples:

man print-utf8

πŸ“š Text-Block

Text-Block is a flexible tool for automated editing operations of text blocks in files or streams. This allows for automated, non-interactive editing of specific sections of a file using begin and end tags or line numbers:

The blocks to be modified can be selected by begin/end tags, or line numbers. The static pages of this website are generated by using Text-Block to insert contents like publications and project lists, add new software releases, etc.

For example, the publications list in index.html is placed between the tags β€˜<!– BEGIN-OF-PUBLICATIONS –>’ and β€˜<!– END-OF-PUBLICATIONS –>’. Text-Block can be used to manipulate this block:


πŸ“š Unix-Timestamp-Tools

The Unix-Timestamp-Tools are utilities for converting Unix timestamps (time since the Unix Epoch, i.e. 1970-01-01 00:00:00.000000000 UTC) to/from human-readable date and time strings. The tools support Unix timestamps in seconds, milliseconds, microseconds, as well as nanoseconds.

Time2UnixTS

Time2UnixTS converts a date/time string in UTC to the corresponding Unix timestamp, with support for fractional seconds.

Example to convert β€œ1976-09-29 12:12:03.123456789”:

The manpage of Time2UnixTS contains details and further examples:

man time2unixts

UnixTS2Time

UnixTS2Time converts a Unix timestamp to a date/time string. The Unix timestamp unit (seconds, milliseconds, microseconds, or nanoseconds) can in most cases be detected automatically by heuristic (see the manpage), if not specified explicitly.

Examples:

The manpage of UnixTS2Time contains details and further examples:

man unixts2time

πŸ“š Try-Hard

Try-Hard runs a command and retries for a given number of times in case of error, with a random or deterministic delay between the trials and possibility to automatically increase the delay. Furthermore, it allows automatically increasing the delay before a new trial, e.g. using a truncated binary exponential backoff.

Examples:

The manpage of Try-Hard contains details and further examples:

man try-hard

πŸ“š Random-Sleep

Random-Sleep waits for a random time, selected from a given interval, with support for fractional seconds.

Examples:

The manpage of Random-Sleep contains details and further examples:

man random-sleep

πŸ“š X.509-Tools

The X.509-Tools are a set of utilities for viewing, verifying and testing X.509 certificates:

View-Certificate

View-Certificate displays basic details of given certificates in Privacy-Enhanced Mail (PEM) or Distinguished Encoding Rules (DER) format, like subject, common name, etc. Examples:

Also see the manpage of View-Certificate for further details and examples:

man view-certificate

View-CRL

View-CRL displays details of given X.509 Certificate Revocation Lists (CRL) in Privacy-Enhanced Mail (PEM) or Distinguished Encoding Rules (DER) format, particularly the revoked certificates. Examples:

Also see the manpage of View-CRL for further details and examples:

man view-crl

Check-Certificate

Check-Certificate verifies a certificate, by verifying its chain from a given Root CA certificate, and optionally a Certificate Revocation List (CRL) for certificate revocations. The checks are made using OpenSSL. If GnuTLS and/or Network Security Services (NSS) are installed as well, the verification is also made by these implementations in addition. This ensures that – in case of success – the certificate and its chain work with all three major X.509 implementations. Examples:

Also see the manpage of Check-Certificate for further details and examples:

man check-certificate

Extract-PEM

Extract-PEM extracts an X.509 certificate bundle from a Privacy-Enhanced Mail (PEM) file into separate files for each entry. The output files are named using a given prefix, with extension according to the entry type (i.e. .crt for a certificate, .key for a key, .crl for a CRL). The first entry (usually: the server, client or user certificate) and/or last entry (usually: the Root CA) may be skipped. Examples:

Also see the manpage of Extract-PEM for further details and examples:

man extract-pem

DER2PEM and PEM2DER

DER2PEM and PEM2DER are simple scripts to convert between ASCII-encoded Privacy-Enhanced Mail (PEM) and binary-encoded Distinguished Encoding Rules (DER) certificates or CRLs. Examples:

Test-TLS-Connection

Test-TLS-Connection establishes a Transport Layer Security (TLS) connection to a remote TCP server on a given port number. The X.509 certificate is then verified by Check-Certificate. Examples:

Also see the manpage of Test-TLS-Connection for further details and examples:

man test-tls-connection

πŸ“š GIMP-Scripts

The GIMP-Scripts are a collection of scripts using GIMP and GraphicsMagick to render text as well as to apply effects on and resize images.

Examples input images for the following non-rendering examples (click on image for full-size view):

Picture of Bergen, Norway

Picture of Portobello, New Zealand

Mandelbrot Fractal rendered by FractGen

Bergen.webp

Portobello.webp

Fractal.webp
FractGen input file Fractal.fsf

GS-Resize-with-Cropping

GS-Resize-with-Cropping resizes an image, including cropping to fit a changed aspect ratio.

Examples (click on image for full-size view):

Picture of Bergen, Norway; 1:1 aspect ratio

Picture of Portobello, New Zealand; 2:1 aspect ratio

Mandelbrot Fractal; 3:1 aspect ratio

gs-resize-with-cropping Bergen.webp Bergen-Resize-with-Cropping.webp \
   --width 1024 \
   --aspect 1:1
gs-resize-with-cropping Portobello.webp Portobello-Resize-with-Cropping.webp \
   --width 1024 \
   --aspect 2:1
gs-resize-with-cropping Fractal.webp Fractal-Resize-with-Cropping.webp \
   --height 512 \
   --aspect 3:1

Also see the manpage of GS-Resize-with-Cropping for further details and examples:

man gs-resize-with-cropping

GS-BumpMap

GS-BumpMap runs GIMP to load an image, applies the GIMP GEGL β€œBump Map” filter as well as Hue-Saturation adjustment, and stores the result into an output file.

Examples (click on image for full-size view):

Picture of Bergen, Norway; Bump Map effect

Picture of Portobello, New Zealand; Bump Map effect

Mandelbrot Fractal; Bump Map effect

gs-bumpmap Bergen.webp Bergen-BumpMap.webp \
   --azimuth              90.0 \
   --elevation            10.0 \
   --depth                20   \
   --offset-x             4    \
   --offset-y             4    \
   --compensate-darkening on   \
   --waterlevel           0.1  \
   --invert               off  \
   --tiled                on
gs-bumpmap Portobello.webp Portobello-BumpMap.webp \
   --azimuth              135.0 \
   --elevation            20.0  \
   --depth                20    \
   --offset-x             16    \
   --offset-y             16    \
   --compensate-darkening on    \
   --waterlevel           0.1   \
   --invert               off   \
   --tiled                on
gs-bumpmap Fractal.webp Fractal-BumpMap.webp \
   --azimuth              135.0 \
   --elevation            48.0  \
   --depth                32    \
   --offset-x             0     \
   --offset-y             0     \
   --compensate-darkening on    \
   --waterlevel           0.2   \
   --invert               off   \
   --tiled                on

Also see the manpage of GS-BumpMap for further details and examples:

man gs-bumpmap

GS-Clothify

GS-Clothify runs GIMP to load an image, applies the GIMP Script-Fu β€œClothify” filter, and stores the result into an output file. The blurring, bearing, and depth are configurable.

Examples (click on image for full-size view):

Picture of Bergen, Norway; Clothify effect

Picture of Portobello, New Zealand; Clothify effect

Mandelbrot Fractal; Clothify effect

gs-clothify Bergen.webp Bergen-Clothify.webp \
   --blur-x    3    \
   --blur-y    3    \
   --azimuth   90.0 \
   --elevation 60.0 \
   --depth     4
gs-clothify Portobello.webp Portobello-Clothify.webp \
   --blur-x    5     \
   --blur-y    5     \
   --azimuth   135.0 \
   --elevation 50.0  \
   --depth     4
gs-clothify Fractal.webp Fractal-Clothify.webp \
   --blur-x    4     \
   --blur-y    4     \
   --azimuth   180.0 \
   --elevation 80.0  \
   --depth     4

Also see the manpage of GS-Clothify for further details and examples:

man gs-clothify

GS-Mosaic

GS-Mosaic runs GIMP to load an image, applies the GIMP GEGL β€œMosaic” filter, and stores the result into an output file. The tile type (triangles, squares, hexagons, octagons), tile size, tile height, tile neatness, tile surface (smooth or rough) tile spacing, coloring and lighting are configurable.

Examples (click on image for full-size view):

Picture of Bergen, Norway; Mosaic effect

Picture of Portobello, New Zealand; Mosaic effect

Mandelbrot Fractal; Mosaic effect

gs-mosaic Bergen.webp Bergen-Mosaic.webp \
   --tile-type        hexagons \
   --tile-size        21.0     \
   --tile-height      3.0      \
   --tile-neatness    0.65     \
   --tile-surface     rough    \
   --tile-spacing     2.0      \
   --tile-allow-split on       \
   --color-variation  0.15     \
   --color-averaging  on       \
   --antialiasing     on       \
   --light-direction  135.0
gs-mosaic Portobello.webp Portobello-Mosaic.webp \
   --tile-type        octagons \
   --tile-size        25.0     \
   --tile-height      4.0      \
   --tile-neatness    0.25     \
   --tile-surface     smooth   \
   --tile-spacing     2.0      \
   --tile-allow-split on       \
   --color-variation  0.35     \
   --color-averaging  on       \
   --antialiasing     on       \
   --light-direction  35.0
gs-mosaic Fractal.webp Fractal-Mosaic.webp \
   --tile-type        triangles \
   --tile-size        32.0      \
   --tile-height      4.0       \
   --tile-neatness    0.65      \
   --tile-surface     rough     \
   --tile-spacing     3.0       \
   --tile-allow-split on        \
   --color-variation  0.15      \
   --color-averaging  on        \
   --antialiasing     on        \
   --light-direction  275.0

Also see the manpage of GS-Mosaic for further details and examples:

man gs-mosaic

GS-Oilify

GS-Oilify runs GIMP to load an image, applies the GIMP GEGL β€œOilify” filter, and stores the result into an output file. The mask size and intensity mode (on or off) are configurable.

Examples (click on image for full-size view):

Picture of Bergen, Norway; Oilify effect

Picture of Portobello, New Zealand; Oilify effect

Mandelbrot Fractal; Oilify effect

gs-oilify Bergen.webp Bergen-Oilify.webp \
   --mask-size      20 \
   --intensity-mode on
gs-oilify Portobello.webp Portobello-Oilify.webp \
   --mask-size      16 \
   --intensity-mode off
gs-oilify Fractal.webp Fractal-Oilify.webp \
   --mask-size      12 \
   --intensity-mode on

Also see the manpage of GS-Oilify for further details and examples:

man gs-oilify

GS-OldPhoto

GS-OldPhoto runs GIMP to load an image, applies the GIMP Script-Fu β€œOld Photo” filter, and stores the result into an output file. The defocus mode (on or off), border size, sepia mode (on or off) and mottle mode (on or off) are configurable.

Examples (click on image for full-size view):

Picture of Bergen, Norway; Old Photo effect

Picture of Portobello, New Zealand; Old Photo effect

Mandelbrot Fractal; Old Photo effect

gs-oldphoto Bergen.webp Bergen-OldPhoto.webp \
   --defocus     on \
   --border-size 24 \
   --sepia       on \
   --mottle      on
gs-oldphoto Portobello.webp Portobello-OldPhoto.webp \
   --defocus     off \
   --border-size 16  \
   --sepia       on  \
   --mottle      off
gs-oldphoto Fractal.webp Fractal-OldPhoto.webp \
   --defocus     on  \
   --border-size 32  \
   --sepia       off \
   --mottle      on

Also see the manpage of GS-OldPhoto for further details and examples:

man gs-oldphoto

GS-Caption

GS-Caption runs GIMP to generate a caption image with given text using a specific font. The foreground and background color, transparency, font, and font size are configurable.

Examples (click on image for full-size view):

Caption Example 1

Caption Example 2

Caption Example 3

gs-caption Caption1.webp 1024 42 \
   "Test on $(LC_ALL=C.UTF-8 date)" \
   --font-name "Open Sans Bold" \
   --font-size 70 \
   --foreground "#02266b" --background "#ffd7cc" \
   --transparency 50
gs-caption Caption2.webp 1024 42 \
   "Another Test on $(LC_ALL=C.UTF-8 date)" \
   --font-name "Lobster Two Bold Italic" \
   --font-size 70 \
   --foreground "#02266b" --background "#ffd700" \
   --transparency 26
gs-caption Caption3.webp 1024 42 \
   "Yet Another Test on $(LC_ALL=C.UTF-8 date)" \
   --font-name "URW Gothic Book" \
   --font-size 70 \
   --foreground "#02266b" --background "#777777" \
   --transparency 40

See the manpage of GS-Caption for further details and examples:

man gs-caption

Also see GS-List-Fonts for obtaining a list of available fonts.

GS-GlossyText

GS-GlossyText runs GIMP and the GIMP Script-Fu β€œGlossy” script to render a given text using a specific font. The color gradients, patterns, font, and font size are configurable.

Examples (click on image for full-size view):

Glossy Text Example Β«System-ToolsΒ»

Glossy Text Example Β«SimulaΒ»

Glossy Text Example Β«NorNetΒ»

gs-glossytext GlossyText1.webp "System-Tools" \
   --font-name "Lobster Two Bold Italic" \
   --font-size 64 \
   --outline-size 8 \
   --blend-gradient-text "Brushed Aluminium" \
   --blend-gradient-outline "Golden"
gs-glossytext GlossyText2.webp "Simula" \
   --font-name "Open Sans Bold" \
   --font-size 64 \
   --outline-size 12 \
   --blend-gradient-text "Golden" \
   --blend-gradient-outline "Golden"
gs-glossytext GlossyText3.webp "NorNet" -S 64

See the manpage of GS-GlossyText for further details and examples:

man gs-glossytext

Also see GS-List-Fonts, GS-List-Gradients, and GS-List-Patterns for obtaining lists of available fonts, gradients, and patterns.

GS-Test-Gimp

GS-Test-Gimp runs a short test to verify that GIMP can run a GIMP script in non-GUI mode. If not already initialised, GIMP will create the GIMP directory with configuration files on first startup. The storage location of this directory is provided to GIMP by its environment variables GIMP3_DIRECTORY (Gimp 3.x) and GIMP2_DIRECTORY (Gimp 2.x).

Examples:

Also see the manpage of GS-Test-Gimp for further details and examples:

man gs-test-gimp

Helper Scripts

GS-List-Fonts

GS-List-Fonts lists the available GIMP fonts and their styles as combined strings. These font/style strings are e.g. valid settings for the --font-name parameter of GS-Caption and GS-GlossyText.

Usage:

gs-list-fonts

Also see the manpage of GS-List-Fonts for further information:

man gs-list-fonts

GS-List-Gradients

GS-List-Gradients lists the available GIMP gradients.

Usage:

gs-list-gradients

Also see the manpage of GS-List-Gradients for further information:

man gs-list-gradients

These gradients are e.g. valid settings for the --blend-gradient-* parameters of GS-GlossyText.

GS-List-Patterns

GS-List-Patterns lists the available GIMP patterns. These patterns are e.g. valid settings for the --pattern-* parameters of GS-GlossyText.

Usage:

gs-list-patterns

Also see the manpage of GS-List-Patterns for further information:

man gs-list-patterns

πŸ“¦ Binary Package Installation

Please use the issue tracker at https://github.com/dreibh/system-tools/issues to report bugs and issues!

Ubuntu Linux

For ready-to-install Ubuntu Linux packages of System-Tools, see Launchpad PPA for Thomas Dreibholz!

sudo apt-add-repository -sy ppa:dreibh/ppa
sudo apt-get update

For the basic System-Tools (without the dependency-heavy GIMP-Scripts):

sudo apt-get install td-system-tools-basic

For the complete System-Tools (including the GIMP-Scripts):

sudo apt-get install td-system-tools-complete

Fedora Linux

For ready-to-install Fedora Linux packages of System-Tools, see COPR PPA for Thomas Dreibholz!

sudo dnf copr enable -y dreibh/ppa

For the basic System-Tools (without the dependency-heavy GIMP-Scripts):

sudo dnf install td-system-tools-basic

For the complete System-Tools (including the GIMP-Scripts):

sudo dnf install td-system-tools-complete

FreeBSD

For ready-to-install FreeBSD packages of System-Tools, it is included in the ports collection; see FreeBSD ports tree index of net/td-system-tools/!

sudo pkg install td-system-tools

Note: The FreeBSD port package contains the basic System-Tools (without the dependency-heavy GIMP-Scripts, and without Configure-GRUB).

Alternatively, to compile it from the ports sources:

cd /usr/ports/net/td-system-tools
make
sudo make install

Compiling from the port sources provides the optional installation of the GIMP-Scripts and/or Configure-GRUB.


πŸ’Ύ Build from Sources

System-Tools is released under the GNU General Public License (GPL).

Please use the issue tracker at https://github.com/dreibh/system-tools/issues to report bugs and issues!

Development Version

The Git repository of the System-Tools sources can be found at https://github.com/dreibh/system-tools:

git clone https://github.com/dreibh/system-tools
cd system-tools
sudo ci/get-dependencies --install
cmake .
make

Optionally, for installation to the standard paths (usually under /usr/local):

sudo make install

Note: The script ci/get-dependencies automatically installs the build dependencies under Debian/Ubuntu Linux, Fedora Linux, and FreeBSD. For manual handling of the build dependencies, see the packaging configuration in debian/control (Debian/Ubuntu Linux), td-system-tools.spec (Fedora Linux), and Makefile for FreeBSD.

Contributions:

Current Stable Release

The tarball has been signed with my GnuPG key 21412672­518D8B2D­1862EFEF­5CD5D12A­A0877B49. Its authenticity and integrity can be verified by:

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 21412672518D8B2D1862EFEF5CD5D12AA0877B49
gpg --verify td-system-tools-<VERSION>.tar.xz.asc td-system-tools-<VERSION>.tar.xz

Old Stable Releases

The tarballs have been signed with my GnuPG key 21412672­518D8B2D­1862EFEF­5CD5D12A­A0877B49. Its authenticity and integrity can be verified by:

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 21412672518D8B2D1862EFEF5CD5D12AA0877B49
gpg --verify td-system-tools-<VERSION>.tar.xz.asc td-system-tools-<VERSION>.tar.xz

🌏 Internationalisation

To provide a translation of one or more components of System-Tools into your language, apply the following steps:

  1. Build System-Tools from the Git sources (see Development Version), i.e. use the β€œmaster” branch with the latest development version. The build will create .pot (translation template files) under po.

  2. Create a new Git branch for your translations, e.g. my_username/translations_language_XX (with XX the language code for your language, e.g. da for Danish):

    git branch my_username/translations_language_XX
    git checkout my_username/translations_language_XX
  3. Take a look at the existing .po files (translations files) in po/de (German) and po/nb (BokmΓ₯l) as examples, e.g. po/de/System-Info.po or po/nb/System-Info.po for System-Info. Then, prepare a translation for program PROGRAM (e.g. System-Info; see the name of the .pot translation template file) for your language XX under po:

    mkdir -p XX
    msginit --input PROGRAM.pot \
            --locale XX.UTF-8 \
            --output-file XX/PROGRAM.po
    git add XX/PROGRAM.po
  4. Add your translations into XX/PROGRAM.po, with a text editor or PO file editor like Poedit.

  5. Test, commit and push your changes.

  6. Finally, make a pull request: https://github.com/dreibh/system-tools/pulls.