Checklist

Charly's Column – Zint

Article from Issue 247/2021
Author(s):

Doing a hardware inventory in a data center is anything but a piece of cake. In order to quickly assign devices to the appropriate database entry, Charly provides each newly acquired system with a QR code sticker with the help of Zint.

When you need to manage large numbers of devices, there is no avoiding centralized data management. In the simplest case, this can be a wiki, with one entry per system. This will include, for example, the date of purchase, the length of the warranty period or maintenance contract, any repairs that have already been made, and the rack number where the device is installed (finding the hardware in a larger data center can be time-consuming). I then encode the URL of the wiki entry as a barcode or QR code, print it on self-adhesive film, and stick it on the device.

I generate the codes for this with Zint [1]. Many distributions have Zint on board; if not, it is quickly compiled from the GitHub repository. You must have libpng in place; otherwise, Zint will not generate images. Those who now want to generate codes are spoiled for choice: Zint knows dozens of variants (Figure 1). With zint -t, I can display their names.

Figure 1: Zint can generate these codes.

I know a few of these codes, like EAN and QR, from everyday life. PDF417 (Figure 2) and its relatives can be found on the boarding passes of many airlines. And there just happens to be a cold medicine bottle on the table in front of me that has a PZN barcode. I can see from a web page [2] for generating barcodes that this is used on pharmaceuticals in Germany. On the same website – funnily enough, it uses Zint itself – there are examples of the other types of code.

Figure 2: PDF417 is the barcode format often used in the transportation industry.

For inventory purposes, I use a classic QR code. I can encode all ASCII characters in it, but I have to avoid nonstandard characters like accents and umlauts. Using the call from Listing 1, I create a QR code as a PNG that reveals the URL for Linux Magazine's website (Figure 3).

Listing 1

QR Code with Zint

$ zint -o ~/qr/linmagurl-qr.png -b 58 -d https://linux-magazine.com
Figure 3: The Linux Magazine URL as a QR code.

In Listing 1, I use -b 58 to select QR as the code type. The parameter -d for data always has to be at the end: Zint blithely ignores all the options that follow. As long as I stick to this, the barcode generation routine works like clockwork, which gives me one less excuse to put off the pesky inventory process.

The Author

Charly Kühnast manages Unix systems in a data center in the Lower Rhine region of Germany. His responsibilities include ensuring the security and availability of firewalls and the DMZ.

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

Related content

  • Thinking in Black and White

    Zint converts text, contact data, URLs, WiFi access credentials, and more into easily distributable barcodes or QR codes at the push of a button.

  • Introduction

    This month in Linux Voice and Elvie.

  • Barcode

    Machine-readable codes aren’t just for big companies anymore. With the right programs and some low-cost hardware, you can create and read the most important codes.

  • gLabels

    Add an individual touch to invitations or cards to help your event start with a bang.

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