The sys admin's daily grind – Prettyping and Asciiflow
Block Heroes
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).
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/.
Infos
- Prettyping: http://denilson.sa.nom.br/prettyping/
- Asciiflow: http://asciiflow.com
Buy this article as PDF
(incl. VAT)