Sponsor

Probably you have already saw these small black and white image in some sites or while walking around your city, or if you have a smartphone probably you have already used them; they are QR Code.

From Wikipedia: A QR code (short for Quick Response) is a specific matrix barcode
(or two-dimensional code), readable by dedicated QR barcode readers and camera phones.
The code consists of black modules arranged in a square pattern on a white background.
The information encoded can be text, URL or other data.

In this article we’ll see how to create these image in Linux and some uses of these images.

This GPL software is available in Debian, Ubuntu and Fedora repository, so just use your package manager to install it,for me this means aptitude install qrencode (ubuntu 10.10).
Once you have installed the software generate a QR Code is trivial, just write:

qrencode "http://www.linuxaria.com/"-o linuxaria.png

This will create an image that read (with the correct reader) will show the url: http://www.linuxaria.com

But qrencode can be used also with text file, try this:

cat/etc/passwd| qrencode -s10-o -|display

This command take as input your /etc/passwd and send the image to to the standard output where i’ve put in pipe the command display (imagemagick package) that show the result. Note also the flag -s that specify the size of dot (pixel). (default=3),
the greater is this value the bigger your image will be.

There is no GUI interface for qrencode but you can easily mix it with Zenity to create a quick interface that ask the parameters and create the image

This is an example with Zenity and qrencode, ask where to save and the name of the image, after that ask a text to be put in the qr code (thanks to ubuntuforum)

Ok you now can create these nice QR Code, but what to do with them ?
Here are some ideas but i’m sure there are much more ways to use them.

1) Backup on paper.

With QR Code you could create image of important things, like your SSL Certificates keys, or Revocation Certificates or
anything not too big, transform it in a QR Code and print it.
After that put it in your security safe or in your Disaster Recovery site.

Or you can use Zbar , ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. So you can use your Webcam to read the QR Code you produce, or the one that people send to you.

I hope you have liked this introduction to QR Code on Linux and for some “innovative” uses of QR Code check also this link

I’ve been searching for a good QR code generator for Linux. I found Zint, but I couldn’t learn how to compile it. I found qrencode, but I’m not a command line fan. I was looking for a Linux QR code generator WITH A GUI. After days of searching, I just found one. Go here https://launchpad.net/qr-tools/+download and download the python-qrtools_1.2_all.deb and the qtqr_1.2_all.deb. The first one is the backend and the second one is the GUI frontend. It installs like any other debian package and it “just works”. Thank you to the QR Tools team, David Green, Sooraj Sekhar, and Ramiro Algozino for making QR codes in Linux much much easier and for me, possible

PS- If you want to thank me for digging this up, go buy yourself something on Amazon! Thank you. http://amazon.websale.tv