现象

对端版本为 OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

ssh 报错

1
no matching host key type found. Their offer: ssh-rsa,ssh-dss

在 ssh config 中添加

1
HostKeyAlgorithms +ssh-rsa

后仍报错

1
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

查看对端 secure 日志

1
2
3
4
Jul 31 11:46:53 sshd[11845]: error: ssh_rsa_verify: cannot handle type rsa-sha2-512
Jul 31 11:46:53 sshd[11845]: error: cert_parse: Certificate signature verification failed
Jul 31 11:46:53 sshd[11845]: error: key_from_blob: can't parse cert data
Jul 31 11:46:53 sshd[11845]: error: userauth_pubkey: cannot decode key: ssh-rsa-cert-v01@openssh.com

还需在 ssh config 中添加

1
PubkeyAcceptedKeyTypes +ssh-rsa

总结

需要添加如下两条配置

1
2
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

NCurses Disk Usage

推荐一个 Linux 下 TUI 的磁盘使用分析查看工具 ncdu

https://dev.yorhel.nl/ncdu

  • 广泛的发行版支持,brew/yum epel 源可安装,好耶!
  • TUI、Colorful,好耶!
  • 速度快,有缓存,好耶!
1
2
3
4
5
6
7
8
9
10
11
ncdu 1.18 ~ Use the arrow keys to navigate, press ? for help
--- /root ----------------------------------------------------------------------------------------------------------------
2.2 GiB [#################] /insight
1.1 GiB [######## ] /pkg
268.1 MiB [## ] /.cargo
209.5 MiB [# ] /.nvm
182.2 MiB [# ] /.pm2
80.2 MiB [ ] /.vim
50.9 MiB [ ] /.cache
22.4 MiB [ ] /.npm
8.5 MiB [ ] /backup

两个问题,原因是一样的

为什么 docker mysql 建出来的 /var/lib/mysql 用户是 systemd-coredump

是 systemd-coredump 只是碰巧而已

因为 mysql 容器内的 mysql 用户 ID 是 999

1
2
# passwd in mysql container
mysql:x:999:999::/var/lib/mysql:/bin/bash

而主机上的 999 为 systemd-coredump

1
2
# passwd on host
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin

为什么 percona-xtrabackup 备份容器中的 mysql 显示无权限

1
2
3
2023-07-24T02:47:58.476552-00:00 0 [ERROR] [MY-012592] [InnoDB] Operating system error number 13 in a file operation.
2023-07-24T02:47:58.476735-00:00 0 [ERROR] [MY-012595] [InnoDB] The error means mysqld does not have the access rights to the directory.
2023-07-24T02:47:58.490978-00:00 0 [ERROR] [MY-013861] [InnoDB] Failed to list redo log files in the redo log directory ./#innodb_redo/

因为 percona-xtrabackup 容器内的 mysql 用户又是其它 ID

1
2
3
# passwd in xtrabackup container
systemd-coredump:x:999:997:systemd Core Dumper:/:/sbin/nologin
mysql:x:1001:1001:Default Application User:/home/mysql:/sbin/nologin

可以在 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

如何简单粗暴的在 Vim 中自定义高亮的关键词

当然你可以去改各种 syntax.vim, 但是由于复杂的 source 顺序、优先级等等,并不一定能生效

有没有一种方法简单粗暴的自定义高亮关键词

来了!

vimrc中添加

1
2
3
4
5
augroup myTodo
autocmd!
autocmd Syntax * syntax match myTodo /\v\c(fuck|hbspy)/ containedin=.*Comment
augroup END
highlight link myTodo Todo

REF: https://vi.stackexchange.com/questions/15505/highlight-whole-todo-comment-line

brew 4.0.0 之后运行 doctor 显示

1
2
3
4
5
6
Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
pycparser
cffi
erdtree

虽然没什么影响但看着不爽

可以通过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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Collecting git+https://github.com/suno-ai/bark.git
Cloning https://github.com/suno-ai/bark.git to /tmp/pip-req-build-t_euvdls
Running command git clone --filter=blob:none --quiet https://github.com/suno-ai/bark.git /tmp/pip-req-build-t_euvdls
Resolved https://github.com/suno-ai/bark.git to commit 97c6019ecdf1a70fdb313835c3bb3f770a0459e4
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
Building wheel for UNKNOWN (pyproject.toml) ... done
Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=7276 sha256=a30755a229112b321e0b4ee3f6cc35ef61cbc02bedde64ac4c5c147f51ae64f8
Stored in directory: /tmp/pip-ephem-wheel-cache-54oie7jn/wheels/e6/6d/c2/107ed849afe600f905bb4049a026df3c7c5aa75d86c2721ec7
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Successfully installed UNKNOWN-0.0.0

其中的一个可能的原因是 pip 版本不够新

1
2
3
4
5
6
7
8
9
10
11
# pip install -U pip
Requirement already satisfied: pip in /usr/lib/python3/dist-packages (22.0.2)
Collecting pip
Downloading pip-23.1.1-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 3.5 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.2
Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'pip'. No files were found to uninstall.
Successfully installed pip-23.1.1

更新后正常

1
2
3
4
5
6
7
8
9
Collecting git+https://github.com/suno-ai/bark.git
Cloning https://github.com/suno-ai/bark.git to /tmp/pip-req-build-gsgifvjp
Running command git clone --filter=blob:none --quiet https://github.com/suno-ai/bark.git /tmp/pip-req-build-gsgifvjp
Resolved https://github.com/suno-ai/bark.git to commit 97c6019ecdf1a70fdb313835c3bb3f770a0459e4
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting boto3 (from suno-bark==0.0.1a0)

同理,也有可能是 setuptools 的版本不够新,升级即可

我们赚哪部分钱?

高校的网络管理是各成一派的,我们又不愿意投入研发成本,打造有技术壁垒甚至门槛的产品
结果就是赚辛苦钱

chromium(aarch64)

Kylin Linux Advanced Server 10

chromium 版本仅为 81.0.4044.138

想要编译个新点儿的版本太难了,gcc 仅为 7.3.0

强烈谴责国产操作系统这种只生不养的行为!

  • chromium-headless: 不能只装 headless,rpm 内只有一个 headless_shell,许多本体其实在 chromium 中
  • freetype: 自带的 freetype 会报错 undefined symbol: FT_Palette_Select,需要 kylinos 源中的
  • google-droid-sans-fonts: 解决截图中文乱码问题
1
2
3
4
5
6
7
8
9
cat <<EOT >> /etc/yum.repo.d/kylinos.repo
[kylinos]
name = kylinos
baseurl = http://archive2.kylinos.cn/rpm/kylin/Library/custom/kylin-server/KY10-GFB-aarch64/
enabled = 0
gpgcheck = 0
EOT

dnf install -y --enablerepo=kylinos chromium chromium-headless freetype google-droid-sans-fonts

之前家里的 PC 网卡有一些问题,现象是在打 Dota 的时候网络会崩

排查过程极其复杂与漫长,但可能的结论非常平常,在此记录一下这个令人感概的过程

过程

  • PC 是 Win11,早听说 Win11 有各种网络问题,包括排查时还遇到了把微软用于 Internet 探测的网址给墙了,造成误报
  • 基本排除了操作系统原因之后,看向网卡。由于中美贸易战,2.5G 的芯片一直不太成熟,Google 了之后发现板载的这个 RTL8125B 也是问题不断,开始怀疑是不是速率协商的问题。因为问题出现时,总是在重新协商速率,并且不一定能协商到 2.5G,有时只到 100M,或是 10M。在交换机侧看到 RTL8125B 并没有在 Advertising 写入 2.5G full,但在两边都固定 2.5G 之后,现象也没有改善
  • Google 了一圈发现可能是 2.5G 方案在处理某些特定帧时,有 BUG,网卡侧包括 RTL 和 Intel 都有,也都出过一些固件来修复。这个问题的复杂在于,交换机和网卡都可以改一下兼容这个问题,但有些国外交换机厂商认为这不是他们的问题,可能不会修改。正巧,我的 PC 上联是 MikroBug (MikroTik) 的 RB5009,之前是基本型,RB5009UG+S+,后面又添了一台RB5009UPr+S+。我开始怀疑是这个特定帧的问题,因为到目前为止,正常上网没问题,只有在打 Dota 时出现问题。
  • 连续跟了几版 RTL8125B 的固件更新之后,问题依旧。甚至又入了 Intel 的方案,一块 PCI-E Intel I225-V,但还是无济于事。
  • 在 MikroTik 的论坛上有看到早期 5009 的 2.5G 口有其它问题,在 2.5G 速率下的速度还不如 1G 下,猜测交换机侧有问题,于是把 2.5G Advertising 从 5009 上去掉,双方协商在 1G 下工作。
  • 这次终于有了改善,双方在 1G 下稳定工作了许久。
  • 但还在偶发,十天半个月一次的频率,忍了。
  • 问题扩散了,另一个屋的 AppleTV 也时不时的出现无网络连接,再次协商跑在 100M。
  • 结合了这两个设备的情况之后,再综合全屋的有线连接情况,我突然开窍的想到了换个网线。两个屋到交换机是我自己选的日线万兆,到每个屋的面板上,各做了一对日线的万兆模块。俩屋的 AP,直接在网线上做的头,很稳定。机柜里连 NAS 等的网线是 NAS 送的,两根做的聚合,也很稳定。现在最大的可能就是这几根《最后一米》,从模块到终端设备的秋叶原(CHOSEAL)七类扁平网线带镀金水晶头
  • 这几根算是凑单商品,每根也不算便宜,看说明和到手的感觉都还过的去,想来只要你 8 根都正确接上了,跑个 千兆应该不成什么问题,所以一直没有怀疑过。链接在此:https://item.jd.com/7247538.html
  • 这是屏蔽线,屏蔽线跟一般常用的设备兼容性也不太好,非必要不要上屏蔽线
  • 怒而买了日线的成品跳线,日线DNSPG6-PC-10G超六类cat6A细径万兆utp非屏蔽网络跳线,真的贵,一根 62
  • 换上,好了!!!2.5G 打个 Dota 什么问题没有!交换机上看相关的 Link Downs 计数也都符合正常的开关机引起的 10M 切换。
  • 于是又把剩下的几根全都换成了日线SPG6六类千兆网络跳线,一根 36,便宜一些。

总结

  • win 的排查真的太难了
  • 网卡突然就寄了,两边都没什么日志,但中间过程却是非常的多。交换机,到自己做的头,到墙里的线,到屋里的模块,到这次出问题的线,到终端网卡,每一步不太可能有日志,测线仪也问题
  • 协商成 1G 之后,问题缓解了,但还出现,这种可缓解的偶发问题,很容易让人误导,以为再向这个方向深入就可以解决。犯了一个类似局部最优解当成全局最优解的问题。
  • 可能出错的问题太多,win11, RTL8125B, I225-V, 2.5G, RB5009,一堆新设备,每个看起来都不够成熟稳定,都有可能是问题源,在这种印象之下,忘了最后这根网线

记录一下,希望有可能帮助到其他人

现象

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
2
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

如果是 ca 签的则需要添加

1
2
HostKeyAlgorithms +ssh-rsa-cert-v01@openssh.com
PubkeyAcceptedAlgorithms +ssh-rsa-cert-v01@openssh.com

REF

0%