Skip to content

Instantly share code, notes, and snippets.

@borwickatuw
Created August 29, 2023 22:32
Show Gist options
  • Select an option

  • Save borwickatuw/7f699ec1be98ec7b38bfdeab19c2871b to your computer and use it in GitHub Desktop.

Select an option

Save borwickatuw/7f699ec1be98ec7b38bfdeab19c2871b to your computer and use it in GitHub Desktop.
generate qr codes
#!/bin/bash
URL=$1
if [ "x$URL" == "x" ]
then
echo "Run as: $0 url"
exit 1
fi
SHORT_URL=$(curl -s "http://tinyurl.com/api-create.php?url=$URL")
FILENAME=$(perl -le "\$URL='$URL'; \$URL =~ s|\W+|-|g; \$URL =~ s|-$||g; print qq{\$URL.png}")
qrencode -v3 -S -o $FILENAME $SHORT_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment