Claude Code 多设备记忆同步——Syncthing 方案实录
#ClaudeCode #Syncthing #Windows #开发环境 #服务器运维 同一用户在 Mac、N100、Windows 三台设备上使用 Claude Code CLI,各自的 ~/.claude/ 完全独立,导致跨设备会话反复重建上下文、浪费 token。本文记录用 Syncthing 打通三端记忆层的完整方案,以及在会话中主动向同步体系注入信息的方法。 一、问题描述 Claude Code 的跨会话记忆存储在 ~/.claude/ 下,核心是各项目的 memory/ 目录: 123456789~/.claude/ projects/ -Users-lin-Documents-MyBlog/ memory/ MEMORY.md ← 索引 project_homelab_infra.md ← 设备拓扑、服务配置 feedback_openclaw_*.md ← 排查经验 settings.json ← 全局设置 plugi...
5080 主机重装系统快速恢复手册
#Windows #重装恢复 #Ollama #CUDA #SSH #Docker 配套 《RTX 5080 新主机环境配置实录》。记录所有组件的安装目录与可持久化路径,以及重装系统后的最短路径恢复方案。目标:重装后 30 分钟内恢复 SSH + CUDA + Ollama,其余开发工具按需补装。 一、安装目录全览 1.1 C 盘(重装后丢失) 组件 安装路径 重装后 NVIDIA Driver C:\Windows\System32\DriverStore\... 丢失,重装 CUDA Toolkit 12.8 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8 丢失,重装 cuDNN 9.x 同 CUDA 目录(复制进去) 丢失,重装 Ollama 应用 C:\Users\milin\AppData\Local\Programs\Ollama 丢失,重装 Git C:\Program Files\Git 丢失,重装 Node.js C:\Program Files\nodej...
RTX 5080 新主机环境配置实录
#Ollama #RTX5080 #CUDA #Windows #OpenClaw #开发环境 新 9800X3D + RTX 5080 主机组装完成,v2rayA 代理已配置。本文记录完整的环境搭建流程:CUDA 推理栈、开发环境、Docker、SSH,以及接入现有 AI 推理生态(Ollama + OpenClaw)。 一、整机信息与网络架构 项目 值 CPU AMD Ryzen 9 9800X3D GPU NVIDIA RTX 5080 (Blackwell GB203) 系统 Windows 11 局域网 IP 192.168.2.10(WLAN,需设为 Private 网络配置文件) SSH 别名 milin_desktop 代理 v2rayA ✅ 已完成 1234567891011121314151617MacBook Air M1 (192.168.2.13) └── ssh milin_desktop → 192.168.2.10N100 (192.168.2.14) └── Docker: openclaw → ...
家庭服务子域名 HTTPS 改造:frp 复用 + nginx 路由 + Let's Encrypt
#nginx #frp #HTTPS #反向代理 #Docker #服务器运维 背景:N100 上跑了若干 Docker 服务,一直通过 VPS:裸端口 访问。本文记录将它们改造为子域名 HTTPS 访问的完整过程,以及途中遇到的两个坑(certbot 依赖冲突、chicken-and-egg 证书问题)。 一、现状与目标 改造前:每个服务对外暴露一个裸端口,访问方式不统一,无法用标准 443 HTTPS。 服务 原访问方式 MT Photos https://x.x.x.x:18063 WebDAV https://x.x.x.x:4455 qBittorrent https://x.x.x.x:19090 改造后:每个服务对应一个子域名,统一走 443 HTTPS。 服务 新访问方式 MT Photos https://mtphotos.your.domain.example WebDAV https://dav.your.domain.example qBittorrent https://qbt.your.domai...
MT Photos 语义检索接入 RAG 可行性分析
#MTPhotos #RAG #N100 #家庭服务器 记录 N100 上 MT Photos + mt-photos-ai 的部署现状,并分析在现有家庭服务网络架构下,把"文字搜图"升级为完整 RAG(检索+生成)是否有意义、该怎么落地。 相关:N100 网络重构与服务修复记录 · Docker 数据迁移至 HDD 方案 · N100 部署 OpenClaw 与 Hermes Agent 实录 · MT Photos 腾讯地图迁移与容器 TCP DNS 持久化 一、当前部署状态(2026-07-20) N100(MyUbuntuLocal, 192.168.2.14)上以容器形式部署: 容器 镜像 状态 挂载 mt-photos — 运行中 /nfs(照片库) mt-photos-ai mtphotos/mt-photos-ai:onnx-latest(8f6709818fe1) Up 34h,python3 server.py,:8060 — mt-photos-ai 提供 CLIP(文字-图片语义匹配)+ InsightFa...
Headroom — AI Agent 上下文压缩层调研
Headroom (headroomlabs-ai/headroom) — 调研与接入方案 项目概览 Headroom 是一个 LLM 上下文压缩层,在 AI Agent 的请求到达大模型之前,对工具输出、日志、文件内容等进行智能压缩。 仓库:github.com/headroomlabs-ai/headroom 最新版本:v0.28.0 核心语言:Rust(附 Python/TypeScript SDK) 协议:Apache 2.0 核心能力 能力 说明 内容压缩 检测内容类型(代码/JSON/文本),选择合适的压缩器,减少 60-95% token 可逆压缩 (CCR) 原始内容本地缓存,LLM 需要时可恢复 跨 Agent 记忆 共享存储,自动去重 输出 token 缩减 减少模型回复中的冗余内容 学习机制 从失败会话中提取模式自动写入配置 工作模式 Headroom 提供四种接入方式: 1. Library 模式 代码中直接调用 compress() 函数,适合开发者集成。 2. Proxy 模式(推荐) 启动本地代...
Windows ssh-copy-id:跨平台公钥一键安装脚本
#SSH #Windows #PowerShell #运维工具 背景 Linux/Mac 自带 ssh-copy-id,一条命令把本机公钥安装到远端的 authorized_keys,实现免密登录。Windows 没有这个工具。 日常在 Windows 上需要频繁向 Linux 服务器和其他 Windows 主机推送 SSH 公钥,每次都要手动操作很繁琐,因此写了一个 PowerShell 版本的 ssh-copy-id。 实现思路 难点一:判断远端 OS 传统做法是先 SSH 连上去执行探测命令,但如果是新主机、密钥还没装,连接本身就需要密码,探测和安装成了先有鸡还是先有蛋的问题。 解决方案:用 ssh-keyscan 读取 SSH Banner。Banner 在 TCP 握手阶段就会发送,无需任何认证: Windows:SSH-2.0-OpenSSH_for_Windows_10.0p2 Linux:SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13 难点二:Windows 目标的双重 authorized_keys Windows O...
OpenClaw 接入 Headroom:Claude Code 上下文压缩部署与实测
#OpenClaw #Headroom #ClaudeCode #MCP #上下文压缩 接上篇 《OpenClaw 公网访问:FRP + nginx HTTPS 配置实录》,记录第四阶段:为 Claude Code 会话接入 Headroom 上下文压缩层,并实测不同内容类型下的 token 节省效果。 一、Headroom 是什么 headroomlabs-ai/headroom 是一个本地优先的上下文压缩中间层,工作原理: 12345678910Claude Code / OpenClaw / 任何 AI 代理 │ tool outputs · logs · files · RAG 结果 ▼ ┌─────────────────────────────────────────────┐ │ Headroom Proxy(本地运行,数据不出机器) │ │ ContentRouter → SmartCrusher / Kompress │ └──────────────────────────────────────────...
Docker 数据根目录迁移至 HDD 方案
#Docker #磁盘管理 #服务器运维 背景 N100 系统盘(117G SSD)长期维持在 85-91% 使用率,Docker 镜像占用约 10 GB,是主要的可迁移项。 当前磁盘布局: 设备 大小 文件系统 挂载点 使用率 sda2 (SSD) 117G ext4 / ~91% sdc1 (HDD) 1.9T btrfs /nfs ~25% sdb2 (HDD) 3.7T exFAT /smb ~52% 性能影响评估 阶段 影响 说明 容器启动 慢 2-5 秒 从 HDD 读取镜像层,仅启动时一次性 容器运行中 无影响 镜像层被 overlayfs 挂入页面缓存,与存储位置无关 容器写入(可写层) 轻微 取决于应用写入频繁程度 结论:mt-photos、qbittorrent、openclaw 等均为长驻服务,启动多几秒可接受,运行性能无损失。 迁移目标选择 ✅ /nfs(btrfs):完整 Linux 文件系统,支持 Unix 权限、符号链接、硬链接,可行 ❌ /smb(exFAT):不支持 Unix 权...
N100 自托管 OpenClaw + Hermes Agent 部署实录
#OpenClaw #Docker #AI Agent #自托管 #服务器运维 背景 在 N100(Ubuntu, 16GB DDR5)上自托管 AI Agent 网关,目标架构: OpenClaw:AI Agent 网关,负责消息路由与 Agent 编排,对接 Ollama(内网推理机) Hermes Agent:自我进化型个人助手,自动写记忆与技能 推理主机(i9+2070S 或 9800X3D+5080)运行 Ollama,局域网暴露 11434 端口 N100 已有 FRP 加密公网穿透,所有新服务均监听 127.0.0.1 仅限本机访问。 目录结构 12345678910~/dockerfile/├── openclaw/│ ├── docker-compose.yml│ ├── .env│ ├── openclaw.json ← 配置文件(JSON 格式)│ └── data/ ← 容器持久化数据(root 所有)└── hermes/ ├── docker-compose.yml ...
RTX 5080 / 5070Ti 横评:从截图到可交互多维评分工具
#显卡横评 #ECharts #Python #数据可视化 背景 51972 发布了 RTX 5080(31 款)和 RTX 5070Ti(33 款)的大规模横评,覆盖跑分、散热、噪音、超频、体积等维度。原始数据以截图和 Excel 形式存在,不同用户关注点差异很大——性能党和静音党对同一款显卡的评价可能完全相反。 目标是把这批数据整理成一个纯静态网页工具:用户拖动权重滑块,实时看到符合自己优先级的排名,同时能在散点图上直观感受各维度的分布。 一、数据整理 数据源结构 RTX 5070Ti 数据已有完整 Excel(11 个 Sheet);RTX 5080 数据只有截图,需手工录入。两份 Excel 的 Sheet 名称如下: GPU Sheet 5080 基础信息 · BIOS功耗设定 · SpeedWay压力测试性能 · SpeedWay散热排行 · 噪音表现排行 · 超频性能排行 · 垂直吊装散热排行 5070Ti 以上全部 + 静音BIOS测试 · SFF规格散热排行 · 统一散热-大/小尺寸风扇 所有 Sheet 第 1 行为标题、第 2 行为...
DNS 迁移到 Cloudflare 后的一系列部署问题排查
#Git #Cloudflare #acme.sh #部署 背景 博客采用如下部署架构: 123456本地 Mac ──git push──▶ 内网服务器 (hexo.git bare repo) │ post-receive hook ├─ hexo generate └─ rsync ──▶ 公网服务器 │ Nginx 对外提供服务 将域名 DNS 从阿里云迁移到 Cloudflare 后,连锁触发了三个问题:SSL 续签失败、git push 超时、hexo hook 不触发。以下记录完整排查过程。 一、SSL 续签失败 现象 123[ERROR] Le_OrderFinalize[ERROR] error code: 3[ERROR...
acme.sh SSL 证书续签:从手动 DNS 迁移到 Cloudflare 全自动续签
#SSL #acme.sh #Cloudflare #Nginx 背景 博客使用 acme.sh + Let’s Encrypt 签发 ECC 证书,原方案依赖阿里云 DNS API(dns_ali)自动验证。DNS 迁移到 Cloudflare 后需同步更新续签方式,同时记录中途遇到的一次手动续签失败的排查过程。 一、故障:续签时 Finalize 报错 错误现象 123[ERROR] Le_OrderFinalize[ERROR] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 3[ERROR] Signing failed. Finalize code was not 200. 原因 libcurl 错误码 3 为 CURLE_URL_MALFORMAT,即 acme.sh 缓存的 ACME 订单状态中 Le_OrderFinalize URL 损坏,导致签名阶段失败。 解决 删除缓存的域名配置,强制重新发起订单: 123456rm -rf ~/.acme...
SDSC6015 Course 5-Mirror Descent and SDG
#sdsc6015 English / 中文 Mirror Descent Click to expand Mirror Descent review content Motivation Consider the simplex-constrained optimization problem: minx∈△df(x)\min_{x \in \triangle_d} f(x) x∈△dminf(x) where the simplex △d:={x∈Rd:∑i=1dxi=1,xi≥0,∀i}\triangle_d := \{x \in \mathbb{R}^d : \sum_{i=1}^d x_i = 1, x_i \geq 0, \forall i\}△d:={x∈Rd:∑i=1dxi=1,xi≥0,∀i}. Assume the gradient’s infinity norm is bounded: ∥∇f(x)∥∞=maxi=1,…,d∣[∇f(x)]i∣≤1\|\nabla f(x)\|_\infty = \max_{i=1,\ldots,d} |[...
SDSC6015 Course 4-Projected Gradient Descent, Proximal Gradient Desent and Mirror Descent
#sdsc6015 English / 中文 Projected Gradient Descent Projected Gradient Descent is an algorithm for constrained optimization problems that ensures constraint satisfaction by projecting gradient steps back onto the feasible set. Constrained Optimization Problem Definition The constrained optimization problem is formally defined as: minf(x)subject tox∈X\begin{aligned} &\min f(x) \\ &\text{subject to}\quad x \in X \end{aligned} minf(x)subject tox∈X where: f:Rd→Rf: \mathbb{R}^d \righta...
SDSC5001 - Assignment 2
#assignment #sdsc5001 题目链接SDSC5001 - Question of Assignment 2 Question 1 When the number of features p is large, there tends to be a deterioration in the performance of KNN and other local approaches that perform prediction using only observations that are near the test observation for which a prediction must be made. This phenomenon is known as the curse of dimensionality, and it ties into the fact that non-parametric approaches often perform poorly when p is large. We will now investigate t...
SDSC5001 - Question of Assignment 2
#assignment #sdsc5001 Question 1 When the number of features p is large, there tends to be a deterioration in the performance of KNN and other local approaches that perform prediction using only observations that are near the test observation for which a prediction must be made. This phenomenon is known as the curse of dimensionality, and it ties into the fact that non-parametric approaches often perform poorly when p is large. We will now investigate this curse. (a) Suppose tha...
SDSC6015 - Assignment 2
#assignment #sdsc6015 题目链接SDSC6015 - Question of Assignment 2 Problem 1[10 marks] Prove that if the function f:Rd→Rf: \mathbb{R}^{d}\rightarrow \mathbb{R}f:Rd→R has a subgradient at every point in its domain, then fff is convex. Solution: Let x,y∈Rdx, y \in \mathbb{R}^dx,y∈Rd, λ∈[0,1]\lambda \in [0,1]λ∈[0,1], and define z=λx+(1−λ)yz = \lambda x + (1-\lambda)yz=λx+(1−λ)y. Since a subgradient exists at every point, for any gz∈∂f(z)g_z \in \partial f(z)gz∈∂f(z), we have: f(x)≥f(z)+⟨gz,x−z⟩,f(y...
SDSC5002 - Assignment 1
SDSC 5002 - Assignment 1 #assignment #sdsc5002
课程信息概览
📅 TODO SDSC5001 - Assignment 2 SDSC6015 - Assignment 2 SDSC6007 - Assignment 2 SDSC5003 - Assignment 2 SDSC6012 - Assignment 1 SDSC5001 - Assignment 1 SDSC5002 - Assignment 1 SDSC5003 - Assignment 1 SDSC6007 - Assignment 1 SDSC6015 - Assignment 1 其他文件 总课表 作业清单 SDSC5001 Statistical Machine Learning I SDSC5001 课程信息 SDSC5001 课程 1-概率论与数理统计复习 SDSC5001 课程 2-数据探索 SDSC5001 课程 3-统计机器学习概述 SDSC5001 课程 4-线性回归 SDSC5002 Exploratory Data Analysis and Visualization SDSC5002 课程信息 SDSC5002 课程 2-EDA SDSC5003 S...
SDSC6015 - Question of Assignment 2
#assignment #sdsc6015
SDSC5003 - Assignment 2
#assignment #sdsc5003 题目链接 SDSC5003 - Question of Assignment 2 SDSC5003 - Assignment 2 Part 1: Relational Algebra (35 points) a. List the names and ages of employees who work in both the Hardware department and the Software department. (7 points) πename,age(Emp⋈eid(πeid(Works⋈didσdname=’Hardware’(Dept))∩πeid(Works⋈didσdname=’Software’(Dept))))\pi_{\text{ename}, \text{age}} \left( \text{Emp} \bowtie_{\text{eid}} \left( \pi_{\text{eid}} \left( \text{Works} \bowtie_{\text{did}} \sigma_{\text{dna...
SDSC5003 - Question of Assignment 2
#assignment #sdsc5003 原文 NOTE: The university policy on academic dishonesty and plagiarism (cheating) will be taken very seriously in this course. Everything submitted should be your own writing or coding. You must not let other students copy your work. Discussions of the assignment are okay, e.g. understanding the concepts involved. This assignment is an individual one. Upload your work as a single archive file with name A2-XXXX-YYYY.zip where XXXX is your name and YYYY is your student ID. ...
SDSC6015 课程 5-镜像梯度下降与随机梯度下降
#sdsc6015 English / 中文 Mirror Descent 点击展开 Mirror Descent 复习内容 动机 考虑单纯形约束优化问题: minx∈△df(x)\min_{x \in \triangle_d} f(x) x∈△dminf(x) 其中单纯形 △d:={x∈Rd:∑i=1dxi=1,xi≥0,∀i}\triangle_d := \{x \in \mathbb{R}^d : \sum_{i=1}^d x_i = 1, x_i \geq 0, \forall i\}△d:={x∈Rd:∑i=1dxi=1,xi≥0,∀i}。假设梯度无穷范数有界:∥∇f(x)∥∞=maxi=1,…,d∣[∇f(x)]i∣≤1\|\nabla f(x)\|_\infty = \max_{i=1,\ldots,d} |[\nabla f(x)]_i| \leq 1∥∇f(x)∥∞=maxi=1,…,d∣[∇f(x)]i∣≤1。 符号说明:xxx 是优化变量,ddd 是维度,△d\triangle_d△d 是概率单纯形。 几何意义:单纯形是概率...
SDSC6015 课程 4-投影梯度下降、近段梯度下降与镜像梯度下降初步
#sdsc6015 English / 中文 投影梯度下降 (Projected Gradient Descent) 投影梯度下降是处理约束优化问题的算法,通过梯度步后投影回可行集来确保约束满足。 约束优化问题定义 约束优化问题形式化定义为: minf(x)subject tox∈X\begin{aligned} &\min f(x) \\ &\text{subject to}\quad x \in X \end{aligned} minf(x)subject tox∈X 其中: f:Rd→Rf: \mathbb{R}^d \rightarrow \mathbb{R}f:Rd→R 是目标函数 X⊆RdX \subseteq \mathbb{R}^dX⊆Rd 是一个闭凸集(closed convex set) x∈Rdx \in \mathbb{R}^dx∈Rd 是优化变量 几何意义:在满足约束 x∈Xx \in Xx∈X 的前提下,寻找使 f(x)f(x)f(x) 最小的点。 算法描述 投影梯度下降迭代步骤: For t=0,1,2,… ...
