BER分博客 - taotecode https://blog.berfen.com/author/1/ zh-CN taotecode Wed, 29 Jul 2026 06:24:30 +0000 Wed, 29 Jul 2026 06:24:30 +0000 Android TV 刷入 GSI 后投屏失效:用 ADB 恢复 AirPlay、Cast 和 DLNA https://blog.berfen.com/post/66.html https://blog.berfen.com/post/66.html Wed, 29 Jul 2026 06:24:30 +0000 taotecode 背景

我有一台基于 Amlogic 平台的电视设备。它原本运行较老的厂商 Android TV 系统,后来刷入了 Android 14 GSI。系统能启动、应用也基本可用,但出现了几个很典型的问题:

  • 系统中明明存在 Google Cast 相关组件,手机却搜索不到电视;
  • 视频应用里偶尔能看到投屏入口,但必须打开对应电视应用才能使用;
  • 系统中能看到名为 Miracast 的原生进程,却无法从手机或 Windows 连接;
  • 应用市场安装 APK 曾经失败,容易让人误以为是 SELinux 或权限导致;
  • 系统版本是 Android 14,但底层 Vendor、内核和硬件能力仍来自较老的厂商系统。

[...]

]]>
0 https://blog.berfen.com/post/66.html#comments
虚拟机没有 IP 时,如何通过 SSH 隧道进入 KVM 控制台 https://blog.berfen.com/post/65.html https://blog.berfen.com/post/65.html Fri, 17 Jul 2026 03:55:36 +0000 taotecode 虚拟机没有 IP 时,如何通过 SSH 隧道进入 KVM 控制台

一台 KVM 虚拟机无法通过 SSH 连接,不一定意味着它已经失去控制。虚拟机可能尚未获取 DHCP 地址、静态网络配置错误、系统停在磁盘解密界面,甚至根本还没有启动到网络服务。

[...]

]]>
0 https://blog.berfen.com/post/65.html#comments
CentOS 7.9 修复 VS Code Remote-SSH:用私有 glibc 2.28 绕过 glibc 2.17 限制 https://blog.berfen.com/post/64.html https://blog.berfen.com/post/64.html Wed, 15 Jul 2026 02:24:33 +0000 taotecode 从 VS Code 1.99 开始,Remote - SSH 下载的新版 VS Code Server 要求 glibc 2.28 或更高版本。CentOS 7.9 自带的 glibc 长期停留在 2.17,因此会出现“普通 SSH 可以登录,但 VS Code 无法完成远程连接”的情况。

本文使用开源项目 hsfzxjy/vscode-remote-glibc-patch 提供的预编译 sysroot,为 VS Code Server 单独准备 glibc 2.28、动态链接器和 patchelf。整个过程不会替换 CentOS 的系统 glibc,已经在一台 CentOS 7.9 x86_64 服务器上验证可用。

[...]

]]>
0 https://blog.berfen.com/post/64.html#comments
NewAPI 渠道亲和性实践:为什么旧渠道会被持续命中,以及如何让失败渠道自动切换 https://blog.berfen.com/post/63.html https://blog.berfen.com/post/63.html Sat, 13 Jun 2026 07:41:46 +0000 taotecode 在 AI 中转站或模型网关中,我们通常会同时接入多个上游渠道,并通过优先级、权重、分组、模型映射等策略做调度。但在开启 NewAPI 的“渠道亲和性”之后,你可能会遇到一个看似反直觉的问题:

某个渠道已经失败,甚至已经被关闭了,但请求仍然不断命中旧渠道;新启用的高优先级、高权重渠道没有马上生效。

这并不一定是调度系统失效,而是“渠道亲和性”本身的设计结果:它会优先复用上一次成功的渠道,从而提升同一会话、同一缓存键、同一请求来源的稳定性。本文会解释这个机制的工作方式,并给出一套脱敏后的推荐配置,帮助你在稳定性和故障切换之间取得平衡。

[...]

]]>
0 https://blog.berfen.com/post/63.html#comments
从 macOS 钥匙串弹窗到 GitLab SSH:一次自建 GitLab 访问方式优化实践 https://blog.berfen.com/post/62.html https://blog.berfen.com/post/62.html Sat, 13 Jun 2026 07:38:11 +0000 taotecode 一、问题背景

某些项目在 macOS 上通过 IDE 打开时,会不断弹出类似下面的系统授权窗口:

git-credential-osxkeychain wants to use your confidential information stored in "gitlab.example.internal" in your keychain.

这类弹窗通常不是 GitLab 服务端异常,而是本机 Git 在访问 HTTPS remote 时,调用 macOS Keychain 凭据助手读取用户名、密码或 token。

[...]

]]>
0 https://blog.berfen.com/post/62.html#comments
Ubuntu Server 24.x 在 VMware ESXi 中安装为仅 root 用户的完整指南 https://blog.berfen.com/post/61.html https://blog.berfen.com/post/61.html Thu, 28 May 2026 09:09:46 +0000 taotecode 前言

在服务器场景中,有些虚拟机只用于单一服务、实验环境、GPU/AI 计算节点或内网运维节点,并不需要普通桌面用户目录,也不希望系统自动创建 /home 等额外分区。

Ubuntu Server 24.x 的安装器基于 Subiquity,默认安装流程会要求创建一个普通用户,并且默认磁盘布局可能会使用 LVM。这对很多通用场景是合理的,但如果目标是一个简洁的服务器系统,常见需求会变成:

  • 只保留 root 用户;
  • 不创建独立 /home 分区;
  • 不使用 LVM;
  • 磁盘只保留 EFI 分区和根分区 /;
  • 安装完成后允许 root 通过 SSH 密码登录。

本文记录一套适用于 Ubuntu Server 24.x live-server 系列镜像 的完整安装流程,例如:

  • ubuntu-24.04-live-server-amd64.iso
  • ubuntu-24.04.1-live-server-amd64.iso
  • ubuntu-24.04.2-live-server-amd64.iso
  • ubuntu-24.04.3-live-server-amd64.iso
  • ubuntu-24.04.4-live-server-amd64.iso
  • 后续 Ubuntu 24.04 LTS 同系列 live-server 镜像

本文以 VMware ESXi 虚拟机为例,但安装器内的步骤同样适用于大多数虚拟化平台。

[...]

]]>
0 https://blog.berfen.com/post/61.html#comments
彻底解决 macOS "git-credential-osxkeychain 想要访问钥匙串" 弹窗问题 https://blog.berfen.com/post/60.html https://blog.berfen.com/post/60.html Fri, 13 Feb 2026 10:22:00 +0000 taotecode 问题现象

在 macOS 系统中使用 Git 时,经常会遇到一个令人困扰的弹窗:

"git-credential-osxkeychain" 想要访问你的钥匙串中的密钥 "gitlab.xxx.cloud"

更糟糕的是,当你打开"钥匙串访问"应用尝试删除这个凭证时,却发现:

  • 找不到对应的条目
  • 或者删除后弹窗依然出现
  • 甚至删除按钮是灰色的,无法操作

这个问题的根本原因是 Git 凭证存储在 macOS 钥匙串中,但权限配置出现了异常,导致 git-credential-osxkeychain 工具无法正常访问凭证。

[...]

]]>
0 https://blog.berfen.com/post/60.html#comments
Linux 策略路由与接口绑定问题深度剖析:为什么 ping -I eno1 会失败? https://blog.berfen.com/post/59.html https://blog.berfen.com/post/59.html Fri, 13 Feb 2026 09:37:31 +0000 taotecode Linux 策略路由与接口绑定问题深度剖析:为什么 ping -I eno1 会失败?

问题背景

在实现静态 IP 多网卡策略路由时,遇到了一个令人困惑的问题:使用 ping -I 192.168.20.10(指定源 IP)可以正常访问外网,但使用 ping -I eno1(指定网卡接口)却完全无法连通。这个问题看似简单,实则涉及 Linux 内核路由查找机制、策略路由、反向路径过滤等多个底层技术细节。

[...]

]]>
0 https://blog.berfen.com/post/59.html#comments
macOS 环境下 PHP-FPM 连接 PostgreSQL 时崩溃(502 Bad Gateway)的排查与解决 https://blog.berfen.com/post/58.html https://blog.berfen.com/post/58.html Sat, 07 Feb 2026 05:58:00 +0000 taotecode 问题描述

在 macOS 开发环境中,使用 Homebrew 安装的 PHP 8.2 + PHP-FPM 连接远程 PostgreSQL 数据库时,频繁出现 502 Bad Gateway 错误。

症状特征

  • CLI 模式完全正常:php artisan tinker 或直接运行 PHP 脚本都能成功连接
  • PHP-FPM 模式崩溃:通过 Nginx 访问时,PHP-FPM worker 进程会崩溃
  • Linux 服务器正常:相同的代码在 Linux 生产服务器上运行完全正常
  • 间歇性发生:有时能成功,有时失败,重启 PHP-FPM 后短暂恢复
  • 并发时更容易触发:多个请求同时访问时崩溃概率更高

[...]

]]>
0 https://blog.berfen.com/post/58.html#comments
深入解读PPPoE原理与拨号通信流程 https://blog.berfen.com/post/57.html https://blog.berfen.com/post/57.html Thu, 30 Oct 2025 07:32:00 +0000 taotecode 一、什么是拨号?为什么要“拨号”?

在计算机网络领域,拨号指的是客户端(如计算机、路由器等)通过一套协议与服务端(例如运营商、宽带终端等)建立临时网络连接过程。这一过程不仅仅是“连上线”那么简单,往往还涉及身份认证、参数分配、链路协商等一整套机制。

目的:

  • 获取网络访问权(如宽带拨号上网)
  • 进行身份认证、确保带宽和资费安全
  • 动态分配 IP 等网络配置

在互联网早期,拨号一般是通过电话线和调制解调器(Modem)使用PSTN/ISDN 网络实现的(如56K猫)。而宽带普及后,主流接入方式转向了DSL、光纤、以太网等,PPPoE 由此成为最广泛采用的接入协议之一。

[...]

]]>
1 https://blog.berfen.com/post/57.html#comments