sudo !!的妙用

在ubuntu上执行命令,经常会出现下面的报错: tcpdump: eno1: You don't have permission to capture on that device (socket: Operation not permitted) 这种报错一般是执行命令时,没有加上sudo 快速的解决方案是: 按向上箭头键 ctrl+a 贯标定位到行首 输入sudo 按回车 上面的步骤是比较快的补救方案,但是因为向上的箭头一般布局在键盘的右下角,不移动手掌就够不着。一般输入向上的箭头时,右手会离开键盘的本位,会低头看下键盘,找下向上的箭头的位置。 有没有右手不离开键盘本位,不需要低头看键盘的解决方案呢? 答案就是: sudo !! !!会被解释成为上一条执行的命令。sudo !!就会变成使用sudo执行上一条命令。 快试试看吧 sudo bang bang

2021-04-08 13:27:44 · 1 min · Eddie Wang

iterm2 光标消失了

终端用着用着,光标消失了。 iterm2 仓库issues给出提示,要在设置》高级里面,Use system cursor icons when possile 为 yes. 然而上面的设置并没有用。 然后看了superuser上的question, 给出提示, 直接在终端输入 reset , 光标就会出现。解决了问题。 reset 参考 https://gitlab.com/gnachman/iterm2/-/issues/6623 https://superuser.com/questions/177377/os-x-terminal-cursor-problem

2021-04-02 21:09:46 · 1 min · Eddie Wang

matplotlib图片弹窗没有弹出

学习matplotlib绘图时,代码如下,执行过后,图片弹窗没有弹出。 import matplotlib.pyplot as plt import matplotlib plt.plot([1.6, 2.7]) plt.show() 并且有下面的报错 cannot load backend ‘qt5agg’ which requires the ‘qt5’ interactive framework, as ‘headless’ is currently running 看起来似乎是backend没有设置有关。查了些资料,设置了还是不行。 最后偶然发现,我执行python 都是在tmux里面执行的,如果不再tmux会话里面执行,图片就能正常显示。 问题从设置backend, 切换到tmux的会话。 查到sf上正好有相关的问题,可能是在tmux里面PATH环境变量引起的问题。 问题给的建议是把下面的代码写入.bashrc中, If you’re on a Mac and have been wondering why /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin keeps getting prepended to PATH when you run tmux, it’s because of a utility called path_helper that’s run from your /etc/profile file. You can’t easily persuade tmux (or rather, bash) not to source /etc/profile (for some reason tmux always runs as a login shell, which means /etc/profile will be read), but you can make sure that the effects of path_helper don’t screw with your PATH....

2021-03-31 21:04:53 · 1 min · Eddie Wang

#shazam算法分析

参考 http://coding-geek.com/how-shazam-works/ https://blog.csdn.net/yutianzuijin/article/details/49787551 http://hpac.cs.umu.se/teaching/sem-mus-17/Reports/Froitzheim.pdf https://github.com/sfluor/musig

2021-03-31 09:12:46 · 1 min · Eddie Wang

黑客帝国终端字符瀑布

安装 sudo apt install cmatrix 帮助文档 ➜ ~ cmatrix --help Usage: cmatrix -[abBcfhlsmVx] [-u delay] [-C color] -a: Asynchronous scroll -b: Bold characters on -B: All bold characters (overrides -b) -c: Use Japanese characters as seen in the original matrix. Requires appropriate fonts -f: Force the linux $TERM type to be on -l: Linux mode (uses matrix console font) -L: Lock mode (can be closed from another terminal) -o: Use old-style scrolling -h: Print usage and exit -n: No bold characters (overrides -b and -B, default) -s: "Screensaver" mode, exits on first keystroke -x: X window mode, use if your xterm is using mtx....

2021-03-25 18:48:14 · 1 min · Eddie Wang

命令行笔记本 nb 记笔记何须离开终端?

nb是一个基于命令行的笔记本工具,功能很强大。 记笔记何须离开终端? 特点 plain-text data storage, encryption, filtering and search, Git-backed versioning and syncing, Pandoc-backed conversion, global and local notebooks, customizable color themes, extensibility through plugins, 支持各种编辑器打开笔记, 我自然用VIM了。 A text editor with command line support, such as:Vim,Emacs,Visual Studio Code,Sublime Text,micro,nano,Atom,TextMate,MacDown,some of these,and many of these. 使用体验截图 参考 https://xwmx.github.io/nb/ https://github.com/xwmx/nb

2021-03-25 18:18:41 · 1 min · Eddie Wang

Taskwarrior 命令行下的专业TodoList神器

简介 Taskwarrior是命令行下的todolist, 特点是快速高效且功能强大, 支持项目组 支持燃烧图 支持各种类似SQL的语法过滤 支持各种统计报表 安装 sudo apt-get install taskwarrior 使用说明 增加Todo task add 分机注册测试 due:today Created task 1. 显示TodoList ➜ ~ task list ID Age Due Description Urg 1 5s 2021-03-25 分机注册测试 8.98 开始一个任务 ➜ ~ task 1 start Starting task 1 '分机注册测试'. Started 1 task. ➜ ~ task ls ID A Due Description 1 * 9h 分机注册测试 标记完成一个任务 ➜ ~ task 1 done Completed task 1 '分机注册测试'....

2021-03-25 09:09:01 · 1 min · Eddie Wang

electerm 免费开源跨平台且功能强大的ssh工具

https://electerm.github.io/electerm/ 功能特点 Work as a terminal/file manager or ssh/sftp client(similar to xshell) Global hotkey to toggle window visibility (simliar to guake, default is ctrl + 2) Multi platform(linux, mac, win) 🇺🇸 🇨🇳 🇧🇷 🇷🇺 🇪🇸 🇫🇷 🇹🇷 🇭🇰 🇯🇵 Support multi-language(electerm-locales, contribute/fix welcome) Double click to directly edit remote file(small ones). Edit local file with built-in editor(small ones). Auth with publickey + password. Zmodem(rz, sz). Transparent window(Mac, win). Terminal background image....

2021-03-24 19:30:48 · 1 min · Eddie Wang

mac升级后命令行报错 xcrun: error: invalid active developer path

xcode-select --install 参考 https://www.jianshu.com/p/50b6771eb853

2021-03-24 13:55:51 · 1 min · Eddie Wang

网页分享到微信添加缩略图

header部分 <meta property="og:image" content="http://abc.cc/x.jpg" /> body部分 <div style="display:none"> <img src="http://abc.cc/x.jpg"> </div> 注意,图片的连接,必须是绝对地址。就是格式必需以http开头的地址,不能用相对地址,否则缩略图不会显示。

2021-03-23 10:53:15 · 1 min · Eddie Wang