The sys admin's daily grind – Prettyping and Asciiflow

Block Heroes

Article from Issue 188/2016
Author(s):

Columnist Charly is delighted that people still program useful tools for the terminal. Here, he looks at one tool that transforms boring ping data into colorful statistics and another that publishes a construction set for ASCII graphics on the network.

One weapon for command-line warriors is Prettyping [1], a shell script that wraps around the ping command. It reads its tasks, keeps a record of run times and packet losses, and shows at the command line in block graphics the average values since starting the tool and for the past 60 seconds (Figure 1).

Figure 1: It's a colorful world folks: Prettyping visualizing ping statistics in the terminal.

The script runs on any system with Bash and Awk (i.e., also on OS X and probably also in the new Linux environment on Windows 10). Prettyping detects whether it is running in a terminal and how wide the terminal is, then scales the output accordingly. If you think the output is a little too clownish, you can switch to a more staid monochrome display using --nocolor. Prettyping passes on to ping any parameters that it isn't familiar with.

Everything <--|__ASCII__|

If you read RFCs, you will occasionally see small ASCII graphics that show connections more compactly than is possible with sentences. Authors typically painstakingly create such charts with boxes and arrows with ASCII symbols, such as plus and minus signs, (back-)slashes, and pipes. Naturally, at some point, various ASCII graphic victims have written tools – but none are as easy and intuitive to use as Asciiflow [2].

Asciiflow is a website that at first looks like a blank sheet of graph paper. In a toolbar at the top, you can select boxes, lines, arrows, text, and so on, and then simply draw on the blank sheet using the mouse (Figure 2). Once you are happy with your work, you just press the export symbol and – hey, presto – the finished ASCII graphic appears in your clipboard. Asciiflow also has an import function. My verdict on it: \o/.

Figure 2: A few boxes drawn in Asciiflow often say more than a thousand words.

The Author

Charly Kühnast is a Unix operating system administrator at the Data Center in Moers, Germany. His tasks include firewall and DMZ security and availability. He divides his leisure time into hot, wet, and eastern sectors, where he enjoys cooking, freshwater aquariums, and learning Japanese, respectively.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News