How to burn 🔥 time as an engineer or how to transfer basic data using QR 📱

Building software tools (Photo by Dmitriy Demidov on Unsplash)

How it starts

It’s Friday and as it appears to be, I’m working on this app (I’m an app developer). Now, I don’t have many test mobile devices at hand. And those that I use for this purpose are wiped clean. So that means, no google account, no google play (Huawei 🤦).

How it gets down the hill

From now on, this goes down the hill. Once I got this so easily, I’m thinking — “This is so smart, why not make it a tool”. Surely, there, is already a tool for that.

#!/bin/bash
INPUT=$1
if [[ $# -eq 0 ]] ; then
echo "Paste in QR to generate"
exit 1
fi

echo "-- Generating QR..."
echo "$INPUT" | qrencode -t PNG -o /tmp/qrencode.png
LAST_CMD_STATUS=$?
if [[ $LAST_CMD_STATUS -ne 0 ]] ; then
echo "Error: Could not generate QR code: ${LAST_CMD_STATUS}"
exit $LAST_CMD_STATUS
fi
open /tmp/qrencode.png
  • Save it to qrcode.sh
  • Make the file executable by chmod +x qrcode.sh
  • Generate QR code by ./qrcode.sh "Hello world"
Using the tool

Finish off assembly

Now the only thing that is missing, is putting it at your quickest disposal. There are truly a lot of approaches whichever work, but here’s my set-up on MacOS.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store