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