brew update
brew install qrencode zbar
qrencode -t ASCII -o - "${STRING_TO_ENCODE}"
Read QR Codes from file sources
zbarimg /path/to/qr.{png,jpg,..}
Generate a QR code for One Time Password auth example:
#! /bin/bash
export label=" My OTP"
export account=" [email protected] "
export key=" rs2Jre9b5hqd8zWd"
URL=" otpauth://totp/${label} :${account} ?secret=${key} &issuer=${label} "
qrencode -t ASCIIi -o - " ${URL} "
$ ./generate.sh
# #################################################################################
# #################################################################################
# #################################################################################
# #################################################################################
# ####### ################## ## #### #### ########
# ####### ########## ## ## ## ## ## ## ###### ########## ########
# ####### ## ## #### ## #### ######## ######## ## ## ########
# ####### ## ## ## ## ## ######## ###### ## ## ########
# ####### ## ## #### ## #### #### ## ## ########
# ####### ########## ## ######## ## ## ###### ########## ########
# ####### ## ## ## ## ## ## ## ## ## ## ########
# ######################### #### #### #### ## ## ##########################
# ####### ## ## #### #### ## ## ## ##########
# ####### #### ## ## ## ## ## ## ########## ########
# ######### ## #### ## ###### ## ###### ###### ## ##########
# ################# #### ########## #### ## #### ##########
# ####### ## ###### #### ## ## ## ## ## ## ##############
# ####### ###### ## ############ ######## ## ## ## ## ## ########
# ####### ## ## #### #### ########## ###### #### ##########
# ####### ######## #### ######## ###### ## ## ## ## ############
# ####### #### ## ## ## ###### ## ###### ################
# ####### ## ######## ###### ## #### #### ######## ########
# ########### ## #### ## ########## ######## #### ##########
# ####### ## #### #### ######## ## ########## ############
# ########### ## #### #### #### ## #### ## #### ## ##########
# ####### #### ## ############## #### ############## ########
# ####### #### #### ########## #### ## ## #### ##########
# ####### #### ## ## ############## ## ## ## ## ########
# ####### #### #### ## ## ## #### ## #### ########
# ####################### ## ## #### #### ## ###### #### ########
# ####### ## ## ######## ## #### ## ## ## ## ##########
# ####### ########## ###### ###### ######## ## ###### ## ## ########
# ####### ## ## ## ###### #### ## #### ########
# ####### ## ## ## #### #### ## #### ######## ## ##############
# ####### ## ## ## ######## ## ## #### #### ###### ## ##########
# ####### ########## ## ## ## ###### ## ## ############
# ####### ## #### ######## #### ######## ## ##########
# #################################################################################
# #################################################################################
# #################################################################################
# #################################################################################