
为了方便信息处理,想在 putty 或者 xShell 这种 ssh 终端下,直接输出所需信息的二维码图形。不知有没有 dalao 司机 做过这个。看了一番,就找到个 dialog 命令可以图形配置一些东西,但不太适合我这个需求。 用屁股想了想,基本肯定是可以实现的[毕竟 dialog 输出图形了,二维码只需要黑白色即可],但不知道这个轮子是不是已经有人造过了呢。
效果大概如下: http://108.61.250.6/qr.jpg 1 GordianZ 2016 年 7 月 21 日 |
3 notolddriver OP @GordianZ 谢谢 dalao ,之前谷歌到过,因为看到 有 node 命令。对 nodejs 不了解,所以看了一眼就关掉了。。 |
4 skydiver 2016 年 7 月 21 日 安装 qrencode 包就可以了。 Fedora 下是 sudo dnf install qrencode 使用方法: echo 'http://108.61.250.6/qr.jpg ‘ | qrencode -o - -t UTF-8 |
5 skydiver 2016 年 7 月 21 日 上面写错字符了,应该是 % echo 'http://108.61.250.6/qr.jpg' | qrencode -o - -t UTF8 |
6 notolddriver OP |
7 notolddriver OP @skydiver 好吧 貌似你是在说 单引号 |
8 Izual_Yang 2016 年 12 月 28 日 github 上找到的: https://github.com/fumiyas/qrc 末尾还列了其他语言的轮子 支持 windows (可能需要 iconv 一下?) 以及某个变态批处理: http://www.dostips.com/forum/viewtopic.php?t=6038 |
9 chao591 2017 年 2 月 10 日 https://github.com/alishtory/qrcode-terminal 这个模块可以在控制台完美打印额 |
10 simerpc 2019 年 6 月 17 日 qrcode-terminal 也是用 qrcode 的,直接使用 qrcode 里面有个方法 print_ascii 即可终端打印,白底黑块加 invert=True |
11 Firxiao 2020 年 1 月 6 日 推荐一个在线使用 api 生成的. http://qrenco.de/ Append the string that you want to encode to qrenco.de/ in the URL or pipe the string into curl -F $ printf "two\nlines" \ $ curl qrenco.de/this | curl -F-=\<- qrenco.de |