最后一篇blog, 是时候说再见了

我最早用过有道,我觉得有道很烂。 后来我开始用印象笔记,我发现印象笔记更烂。不仅界面做的让人觉得侮辱眼睛,即使你开了会员也要看广告。 印象笔记会员被割了韭菜,充到了2026年,但是我最近一两年我基本没有用过印象笔记。 后来我遇到了文档blog界的new school, notion、语雀、飞书, 就完全抛弃了有道和印象笔记的old school。 做任何事情,都需要动机。 写公开博客也是如此。可能有以下原因 提升个人影响力 提高自己的表达能力 知识积累和分享 公开博客需要三方角力,平台方、内容生产者、内容消费者(读者)。 作为内容生产者,我们从选择一个平台是需要很多理由的。可能是UI界面的颜值,可能是一见钟情界面交互。 就像男女的相亲,首先要被外貌吸引,才能有下文。 然而除了那一见钟情的必然是短暂的,除此之外,我发现了另一个重要原因:迁移成本 我以前决定不用印象的时候,印象笔记上还有我将近一千多篇的笔记。虽说印象笔记有导出工具,但是只有当你用的时候,你才能体会导出工具是多坑爹。 假如你一天决定不用这个平台了,你想把所有你产出的内容都迁移出来,你要花费多少成本呢? 很多人都没有考虑过这件事情。 就像温水煮青蛙,只有感觉到烫的时候,青蛙才会准备跳走,但是青蛙还能跳出去吗? 可能他的腿都已经煮熟了吧? 从另外一个方面来说,作为内容生产者,我们要花时间,花精力来写文章,还要花金钱来买平台的会员,然而平台对内容生产者来说,有什么回报呢? 我们只不过是为他人做嫁衣罢了。就像旧时代的长工,只不过在一个大一点的地主家干活了吧。 再见了,语雀。 新的bolg地址: wdd.js.org 我以前没得选,我现在想选择做个自由人

2022-06-30 22:40:56 · 1 min · Eddie Wang

vfs_cache_pressure和min_free_kbytes对cache的影响

环境 kernal Linux 5.15.48-1-MANJARO #1 SMP PREEMPT Thu Jun 16 12:33:56 UTC 2022 x86_64 GNU/Linux docker 20.10.16 初始内存 total used free shared buff/cache available 内存: 30Gi 1.9Gi 19Gi 2.0Mi 9.6Gi 28Gi 交换: 0B 0B 0B 初始配置 sysctl -n vm.min_free_kbytes 67584 sysctl -n vm.vfs_cache_pressure 200 vfs_cache_pressure的对内存的影响 vfs_cache_pressure设置为200, 理论系统倾向于回收内存

2022-06-29 06:57:56 · 1 min · Eddie Wang

manjaro 安装 packettracer

# 将会下载packettracer到当前目录下 yay -G packettracer cd packettracer # Download PacketTracer_731_amd64.deb to this folder makepkg sudo pacman -U packettracer-7.3.1-2-x86_64.pkg.tar.xz 注意,如果下载的packetraacer包不是PacketTracer_731_amd64.deb, 则需要修改PKGBUILD文件中的, souce对应的文件名。 例如我下载的packettracer是Cisco_Packet_Tracer_811_Ubuntu_64bit_cf200f5851.deb source=('local://Cisco_Packet_Tracer_811_Ubuntu_64bit_cf200f5851.deb' 'packettracer.sh') 注意:最新版的packertracer打开后,必须登陆账号才能使用,有点坑。 花费点时间注册了账号后,才能用。 参考 https://forum.manjaro.org/t/how-to-get-cisco-packet-tracer-on-manjaro/25506/5

2022-06-15 18:54:11 · 1 min · Eddie Wang

mysql placeholder的错误使用方式

Error EXTRA *mysql.MySQLError=Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘? ( 然而我仔细看了看sql语句,没有看出来究竟哪里有sql报错。 然而当我把作为placeholder的问号去掉,直接用表的名字,sql是可以直接执行的。我意识到这个可能是和placeholder有关。 搜索了一下,看到一个链接 https://github.com/go-sql-driver/mysql/issues/848 Placeholder can’t be used for table name or column name. It’s MySQL spec. Not bug of this project. 大意是说,placeholder是不能作为表名或者列名的。 在mysql关于prepared文档介绍中,在允许使用prepared的语句里,没有看到create table可以用placeholderhttps://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html prepared语句的优点有以下几个 优化查询速度 防止sql注入 但是也有一些限制 不是所有语句都能用prepared语句。常见的用法应该是作为select where之后的条件,或者INSERT语句之后的值 不支持一个sql中多条查询语句的形式

2022-06-11 23:51:34 · 1 min · Eddie Wang
千与千寻

Hugo博客常见问题以及解决方案

如何在markdown中插入图片 在static 目录中创建 images 目录,然后把图片放到images目录中。 在文章中引用的时候 ![](/images/qianxun.jpeg#center) Warning 我之前创建的文件夹的名字叫做 img, 本地可以正常显示,但是部署之后,就无法显示图片了。 最后我把img改成images才能正常在网页上显示。

2022-05-28 21:08:43 · 1 min · Eddie Wang

Shell 教程技巧

复制文本到剪贴板 sudo apt install xclip vim ~/.zshrc alias copy='xclip -selection clipboard' 这样我们就可以用copy命令来考本文件内容到系统剪贴板了。 copy aaa.txt 判断工作区是否clean if [ -z "$(git status --porcelain)" ]; then # Working directory clean else # Uncommitted changes fi

2022-05-28 12:39:50 · 1 min · Eddie Wang

C和gdb调试

开启coredump #如果该命令的返回值是0,则表示不开启coredump ulimit -c # 开启coredump ulimit -c unlimited 准备c文件 #include<stdio.h> void crash() { char * p = NULL; *p = 0; } int main(){ printf("hello world 1"); int phone [4]; phone[232] = 12; crash(); return 0; } 编译执行 gcc -g hello.c -o hello ./hello 之后程序崩溃,产生core文件。 gdb分析 gdb 启动的二进制文件 core文件 gdb ./hello ./core 之后输入: bt full 可以查看到更详细的信息 ➜ c-sandbox gdb ./hello ./core GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabihf". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./hello...done. [New LWP 25571] Core was generated by `./hello'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0001045c in crash () at hello.c:6 6 *p = 0; (gdb) bt full #0 0x0001045c in crash () at hello.c:6 p = 0x0 #1 0x00010490 in main () at hello.c:13 phone = {66328, 0, 0, 0}

2022-05-28 12:35:26 · 1 min · Eddie Wang

Tmux 常见问题以及解决方案

oh my tmux 关闭第二键ctrl-a ctrl-a可以用来移动光标到行首的,不要作为tmux的第二键 set -gu prefix2 unbind C-a Tmux reload config :source-file ~/.tmux.conf tmux 显示时间 ctrl b + t tmux从当前目录打开新的窗口 bind '"' split-window -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}"

2022-05-28 12:30:58 · 1 min · Eddie Wang

hugo博客增加mermaid 绘图插件

step1 在themes/YourTheme/layouts/partials/extend_footer.html 的最后追加如下内容 {{if .Store.Get "hasMermaid" }} <script type="module"> import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs'; mermaid.initialize({ startOnLoad: true }); </script> {{end }} step2: 在layouts/_default/_markup/render-codeblock-mermaid.html <pre class="mermaid"> {{- .Inner | htmlEscape | safeHTML }} </pre> {{ .Page.Store.Set "hasMermaid" true }} 在blog中增加如下代码 pie title French Words I Know "Merde" : 50 "Oui" : 35 "Alors" : 10 "Non" : 5 sequenceDiagram title French Words I Know autonumber Alice->>Bob: hello Bob-->>Alice: hi Alice->Bob: talking

2022-05-27 11:49:44 · 1 min · Eddie Wang

klogg: 目前我最喜欢的日志查看工具

项目信息 github地址 https://github.com/variar/klogg 1. 安装 klogg是个跨平台软件,windows, mac, linux都可以安装。具体安装方式参考github项目地址 2. 界面布局 文件信息栏 日志栏 过滤器设置栏 过滤后的日志显示栏 3. 文件加载 klogg支持多种方式加载日志文件 将日志文件拖动到klogg中 直接将常见的压缩包文件拖动到klogg中,klogger将会自动将其解压后展示 支持从http url地址下载日志,然后查看 支持从剪贴板复制日志,然后展示 4. 过滤表达式 因为klogg支持正则过滤,所以他的功能就非常强悍了。 逻辑表达式 表达式 例子 备注 与 and “open” and “close” 包含open,并且包含close 或 or “open” or “close” 包含open, 或者 close 非 not not(“open”) 不包含open 与或非同时支持复杂的运算,例如包含open 但是不包含close: "open" and not("close") 5. 快捷方式 klogg的快捷方式很多参考了vim, vim使用者非常高兴。 键 动作 arrows 上下或者左右移动 [number] j/k 支持用j/k上下移动 h/l 支持用h/l左右移动 ^ or $ 滚动到某行的开始或者结尾 [number] g 跳到对应的行 entered G 跳到第一行 Shift+G 跳到最后一行 Alt+G 显示跳到某一行的对话框 ’ or " 在当前屏幕快速搜索 (forward and backward) n or N 向前或者向后跳 * or . search for the next occurrence of the currently selected text / or , search for the previous occurrence of the currently selected text f 流的方式,类似 tail -f m 标记某一行,标记后的行会自动加入过滤结果中 [ or ] 跳转到上一个或者下一标记点 + or - 调整过滤窗口的尺寸 v 循环切换各种显示模式- Matches: 只显式匹配的内容- Marks: 只显式标记的内容- Marks and Matchs:显示匹配和标记的内容 (Marks and Matches -> Marks -> Matches) F5 重新加载文件 Ctrl+S Set focus to search string edit box Ctrl+Shift+O 打开对话框去选择其他文件 参考 https://github.com/variar/klogg/blob/master/DOCUMENTATION.md

2022-04-13 19:41:53 · 1 min · Eddie Wang