用户工具

站点工具


start

Hshh's Cosmos

踩了个 MySQL 复制的雷

replicate-do-db 和 replicate-ignore-db 是不安全的, 要用 replicate-wild-do-table 和 replicate-wild-ignore-table. 对于数据库的过滤, 用 % 定义表名称.

2024/10/22 16:42

ISRG Root X2 还是很难爱

老 android (<14) 没有root, 即使在系统设置的证书加上 ISRG Root X1 和 ISRG Root X2 的各个证书, 不管是自签名根证书还是交叉签署的根证书, 都无法让非浏览器的 APP 正确识别 ISRG Root X2 链签发的证书.

最后还是为了兼容性回到了 ISRG Root X1 证书链.

2024/10/13 17:16

关于 MS Office 自动更新的 30088-27 报错

安装了6月更新后的 MS Office 的代理功能从 WinInet 切换到了 WinHTTP. 如果在隐私设置中, 禁用了 “开启所有连接体验” 这个选项, 就会导致使用自动更新时报 30088-27 的错误.

重新启用 “开启所有连接体验”, 杀掉 OfficeClickToRun.exe 进程或注销或重启, 自动更新应该就好了.

另外想手动更新某个版本可以用以下命令:

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe" /update user updatetoversion=版本号

版本号范例如 16.0.17932.20058

如果要降级, 需要使用管理员权限运行, 升级则不需要.

2024/08/23 14:28

zstd 完全可以替代掉 gzip, bzip2, xz

要速度有速度, 要压缩比有压缩比, 完全吊打 gzip, bzip2, xz.

另外, 测试下来, tar 直接通过 –zstd 调用来压缩, 速度远不如输出 pipe 到 zstd 压缩再写盘. 其实在很多情况都有用 pipe 的性能好点, 其实是多 cpu 的情况, pipe 后就是多 cpu, 对比原来的单 cpu. 另外就是在 zstd 命令行下控制参数简单点, tar 整合就要通过 options 传进去(FreeBSD tar)

2024/08/16 16:34

关于 Let's Encrypt ECDSA 证书链在 Windows 下的事情

由于 Let's Encrypt 的 ECDSA 中间证书链是交叉签名, 在 Windows(至少是win10) 里默认使用 ISRG Root X1 签署, 其 CA 是 RSA 4096 证书, 非 ECDSA.

如果想看到完整的 ECDSA 证书链, 把 ISRG Root X2 签署的 E5, E6 证书导入中间证书容器.

2024/08/14 02:08

Let’s Encrypt 的 ECDSA 证书链

根据官方文档, Let’s Encrypt 对于 ECDSA 的证书签发, 其默认用兼容性较好的 RSA 的 ISRG Root X1 进行签发.

要切换到降低每次 TLS 握手过程所占据的带宽的 ISRG Root X2 证书链, 则需要指定 PREFERRED_CHAIN (dehydrated) 为 “ISRG Root X2”.

重新设置后重新申请证书.

还碰到 Windows 的证书问题: 根证书和中间证书, 和实际的证书链不符. 解决方法就是, 打开用户证书管理, 把里面的删除一遍, 注销重新登陆.

2024/08/13 03:28

试用 Google 的 ACME 服务

官网文档

简单来说, 如果已有项目, 在 web console 中运行以下命令获取 EAB_KID 和 EAB_HMAC_KEY.

gcloud config set project PROJECT_ID
gcloud publicca external-account-keys create

自己修改了下 dehydrated, 用于支持 Google Trust Services. 首次注册需要指定 CONTACT_EMAIL, EAB_KID 和 EAB_HMAC_KEY.

优点:

  • 国内有 OCSP 服务器.

缺点:

  • CA 国内无法访问.
  • http-01, CA无法访问国内.
  • 如果申请 RSA 证书可能最高只支持 2048, 好在我用 ECDSA.
2024/08/13 01:51

记录一次 ZFS 由于设备名称变更导致故障的修复

发现一台 ubuntu 23.10 的 ZFS 卷降级了

# zpool status stor
  pool: stor
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-4J
  scan: scrub repaired 0B in 19:13:23 with 0 errors on Sun Jun  9 19:37:31 2024
config:

        NAME                        STATE     READ WRITE CKSUM
        stor                        DEGRADED     0     0     0
          raidz2-0                  DEGRADED     0     0     0
            scsi-35000cca260cd1f18  ONLINE       0     0     0
            scsi-35000cca260cc3084  ONLINE       0     0     0
            scsi-35000cca260cc6be0  ONLINE       0     0     0
            13184766210832087855    FAULTED      0     0     0  was /dev/sdf1
            8984617841033776882     FAULTED      0     0     0  was /dev/sdg1
            wwn-0x5000cca2604ac3e0  ONLINE       0     0     0

errors: No known data errors

# zpool status -L stor
  pool: stor
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-4J
  scan: scrub repaired 0B in 19:13:23 with 0 errors on Sun Jun  9 19:37:31 2024
config:

        NAME                      STATE     READ WRITE CKSUM
        stor                      DEGRADED     0     0     0
          raidz2-0                DEGRADED     0     0     0
            sdc                   ONLINE       0     0     0
            sdd                   ONLINE       0     0     0
            sde                   ONLINE       0     0     0
            13184766210832087855  FAULTED      0     0     0  was /dev/sdf1
            8984617841033776882   FAULTED      0     0     0  was /dev/sdg1
            sdg                   ONLINE       0     0     0

errors: No known data errors

我的天, raidz2 掉了2个盘!

经检查, 硬盘并没有问题, 只是重启后设备名变了(从上面 sdg 在列里, 但是却说曾经的 sdg1 出错了可以看出), 这样 ZFS 就出问题了??!! 我在 FreeBSD 下重来没碰到过.

试着用 zpool replace, 报错

# zpool replace stor 13184766210832087855 /dev/sdf
invalid vdev specification
use '-f' to override the following errors:
/dev/sdf1 is part of active pool 'stor'

# zpool replace -f stor 13184766210832087855 /dev/sdf
invalid vdev specification
the following errors must be manually repaired:
/dev/sdf1 is part of active pool 'stor'

尝试zpool labelclear, 报错. wipefs 掉再 replace, 还是报错

# zpool labelclear /dev/sdf                       
failed to clear label for /dev/sdf

# wipefs -a /dev/sdf
/dev/sdf: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdf: 8 bytes were erased at offset 0x74702555e00 (gpt): 45 46 49 20 50 41 52 54
/dev/sdf: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdf: calling ioctl to re-read partition table: Success

# zpool replace stor 13184766210832087855 /dev/sdf
cannot replace 13184766210832087855 with /dev/sdf: /dev/sdf is busy, or device removal is in progress

艹! 已经不能描述我当前的心情了.

最后查了下网上的一些案例, 先 export, 然后用 import -d 的方式. 但是如果只用 -d /dev/disk/by-id/ 是不行的, 直接用多次 -d 来解决.

将有问题的设备离线, 导出池后, 用 -d /dev/disk/by-id/ 加上多个 -d 设备名导入池. 然后将有问题的设备重新上线.

# zpool offline stor 13184766210832087855
# zpool offline stor 8984617841033776882 
# zpool export stor
# zpool import -d /dev/disk/by-id/ -d /dev/sdc -d /dev/sdd -d /dev/sde -d /dev/sdg -d /dev/sdf -d /dev/sdi stor
# zpool online stor 13184766210832087855
# zpool online stor 8984617841033776882 

最后终于池在线了, 并且对2个有问题的设备重建.

# zpool status stor
  pool: stor
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Sun Jul  7 01:17:01 2024
        44.7G / 32.3T scanned at 1.09G/s, 0B / 32.3T issued
        0B resilvered, 0.00% done, no estimated completion time
config:

        NAME                        STATE     READ WRITE CKSUM
        stor                        ONLINE       0     0     0
          raidz2-0                  ONLINE       0     0     0
            scsi-35000cca260cd1f18  ONLINE       0     0     0
            scsi-35000cca260cc3084  ONLINE       0     0     0
            scsi-35000cca260cc6be0  ONLINE       0     0     0
            wwn-0x5000cca260cc504c  ONLINE       0     0     0
            wwn-0x5000cca260cc32d0  ONLINE       0     0     0  (awaiting resilver)
            wwn-0x5000cca2604ac3e0  ONLINE       0     0     0

errors: No known data errors

实际重建速度在后面是很快的, 前面做扫描用了一段很长的时间.

2024/07/07 05:20

又是鸡飞蛋打的时间

一堆 Linux 需要更新 OpenSSH: CVE-2024-6387.

2024/07/02 03:13

rustdesk

现在 TeamViewer 越来越恶心, 国内用还会提示绑手机号. AnyDesk 连接服务器慢, 中继服务器国内连接不快, 直接端口连接对于同一个ip地址不同端口支持不好.

改用 RustDesk, 自己搭了个服务端, 连接速度真够快的.

2024/06/25 15:39

其他变动

start.txt · 最后更改: 2024/06/22 02:21 由 Hshh