[LINUX] Command to generate QR code

Installation

#Confirmed on CentOS 6(Not in CentOS 5)
yum install -y qrencode
# Ubuntu 20.Confirmed at 04
apt install -y qrencode

How to use

When making an image


qrencode -o a.png "http://qiita.com"

When outputting to the terminal


qrencode -t ansi "http://qiita.com"

Run in php and view the result

qr.php


<?php
function echo_qrcode($str) {
        $command = sprintf('/usr/bin/qrencode "%s" -o -', $str);
        $qrcode = `$command`;
        header("Content-type: image/png");
        echo $qrcode;
}
echo_qrcode("https://www.google.com/search?client=ubuntu&hs=M8b&channel=fs");

Recommended Posts

Command to generate QR code
Generate QR code in Python
Code to randomly generate a score
Generate QR code using Python's "qrcode"
Shell command to visualize line feed code
QR code display
Rewrite Python2 code to Python3 (2to3)
QR code camera preview
Excel tried to summon QR code with black magic
Part 1 Attempt to code mathematics (∈)
Alternative to django's dumpdata command
Tool to check code style
I made a command to generate a table comment in Django
Set VS Code to PyCharm.
[systemd] Command to delete service
Convert python 3.x code to python 2.x
Introduction to vi command (memorandum)
Generate error correction code to restore data corruption with zfec library
Decrypt the QR code with CNN
Mac80211_hwsim to generate virtual wireless NIC
Command to create Linux Live USB
In the python command python points to python3.8
How to use MBDyn (command setting)
[python] Copy script to generate copy log
[linux] kill command to kill the process
Added code snippet functionality to django-ckeditor
To maintain code quality in PyCharm
[Django] Command to output QuerySet to csv
Metaclass (wip) to generate a dictionary
Linux commands related to character code
How to run TensorFlow 1.0 code in 2.0
Migrate from VS Code to PyCharm
Try to write python code to generate go code --Try porting JSON-to-Go and so on