ncdu Linux TUI 磁盘使用分析
NCurses Disk Usage
推荐一个 Linux 下 TUI 的磁盘使用分析查看工具 ncdu
- 广泛的发行版支持,brew/yum epel 源可安装,好耶!
- TUI、Colorful,好耶!
- 速度快,有缓存,好耶!
1 | ncdu 1.18 ~ Use the arrow keys to navigate, press ? for help |
推荐一个 Linux 下 TUI 的磁盘使用分析查看工具 ncdu
1 | ncdu 1.18 ~ Use the arrow keys to navigate, press ? for help |
两个问题,原因是一样的
是 systemd-coredump 只是碰巧而已
因为 mysql 容器内的 mysql 用户 ID 是 999
1 | # passwd in mysql container |
而主机上的 999 为 systemd-coredump
1 | # passwd on host |
1 | 2023-07-24T02:47:58.476552-00:00 0 [ERROR] [MY-012592] [InnoDB] Operating system error number 13 in a file operation. |
因为 percona-xtrabackup 容器内的 mysql 用户又是其它 ID
1 | # passwd in xtrabackup container |
可以在 docker run 时指定用户 -u 解决这个问题
1 | docker run --rm -u 999:999 --volumes-from [some-mysql] -v ./backup:/backup percona/percona-xtrabackup xtrabackup --backup --datadir=/var/lib/mysql/ --target-dir=/backup --user=user --password=password |
当然你可以去改各种 syntax.vim, 但是由于复杂的 source 顺序、优先级等等,并不一定能生效
有没有一种方法简单粗暴的自定义高亮关键词
来了!
在vimrc
中添加
1 | augroup myTodo |
REF: https://vi.stackexchange.com/questions/15505/highlight-whole-todo-comment-line
brew 4.0.0 之后运行 doctor 显示
1 | Warning: Some installed kegs have no formulae! |
虽然没什么影响但看着不爽
可以通过brew untap homebrew/core
解决
原因是
It removes the local copy of the tap repository (see manpage). This is fine if you do not work on the repository, because the default option since brew 4.0.0 is to fetch formulae information from the JSON API (see 4.0.0 release notes). If you run brew doctor, you should see that the homebrew/core tap has not been updated for a while.
大致就是走 JSON API 了,homebrew/core 也不维护升级了,所以本地那份也别留着了
参考:
用 pip 从源码安装,pyproject.toml 中的包名不能被正确识别,显示为 UNKNOWN
1 | Collecting git+https://github.com/suno-ai/bark.git |
其中的一个可能的原因是 pip 版本不够新
1 | # pip install -U pip |
更新后正常
1 | Collecting git+https://github.com/suno-ai/bark.git |
同理,也有可能是 setuptools 的版本不够新,升级即可
Kylin Linux Advanced Server 10
chromium 版本仅为 81.0.4044.138
想要编译个新点儿的版本太难了,gcc 仅为 7.3.0
强烈谴责国产操作系统这种只生不养的行为!
undefined symbol: FT_Palette_Select
,需要 kylinos 源中的1 | cat <<EOT >> /etc/yum.repo.d/kylinos.repo |
之前家里的 PC 网卡有一些问题,现象是在打 Dota 的时候网络会崩
排查过程极其复杂与漫长,但可能的结论非常平常,在此记录一下这个令人感概的过程
记录一下,希望有可能帮助到其他人
ssh -v
查看报debug1: send pubkey test: no mutual signature algorithm
Ventura 自带 OpenSSH_9.0p1, LibreSSL 3.3.6 而从 8.2 开始默认不再支持 ssh-rsa
可以在.ssh/config
中临时添加
1 | HostKeyAlgorithms +ssh-rsa |
如果是 ca 签的则需要添加
1 | HostKeyAlgorithms +ssh-rsa-cert-v01@openssh.com |
日常并不写 c++ 项目,看到 Acl 这个库比较有意思,就试着编译了一下 samples
照猫画虎,记录一下遇到的相关问题
https://github.com/acl-dev/acl
Acl – One Advanced C/C++ Library for Unix/Windows
有 BUILD.md 但感觉写的比较简单,还是看了 Makefile
最后用make all_lib && make packinstall
生成 include 和 lib
Sample 代码如下
1 | #include <thread> |
环境为 macOS,g++ 为 clang,vim 编辑会提示一些问题
expected_expression: expected expression
第一个是因为 clang 不知道你的 include 路径
第二个是[=] {}
lambda
表达式是C++11
标准,也需要告诉一下 clang
这两个问题都可以用compile_flags.txt
解决
方法是在本文件同目录下生成compile_flags.txt
文件,内容为
1 | -std=c++11 |
就跟传给 gcc / g++ 的参数一样,但更推荐的是compile_commands.json
的方式,并且是在编译时自动生成
于是我们写CMakeLists.txt
引入 CMake 调整目录结构如下
1 | . |
1 | cmake_minimum_required(VERSION 3.5) |
在 CMakeLists 中指定 C++ 标准 11
指定 include 的头文件地址,include 为第三方库目录,src 为私有代码库目录
指定 libacl_all.a 文件所在路径
最后在 build 目录下
1 | cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. |
会生成compile_commands.json
1 | [ |
这里还会报一个错,ld: entry point (_main) undefined.
原因 clang 没找到入口的 main 函数,把 samples 中的 void run 改成 int main 并修改一下 return 细节就可以了
此时的 vim 中,已经可以正确的根据生成的 compile_commands.json 找到 include 的头文件地址
以及认识[=] {}
这样的 C++11 标准了
可喜可贺