Skip to content

Instantly share code, notes, and snippets.

View n-WN's full-sized avatar
:shipit:
~DevSecOps~ AI

Zoee n-WN

:shipit:
~DevSecOps~ AI
View GitHub Profile
@n-WN
n-WN / GIST_README.md
Created December 31, 2025 02:50
Sage version comparison and package recovery tools

Sage Version Comparison Tool

Analysis and recovery tools for comparing Sage package versions across different releases.

Files

  1. analyze_sage.py - Python analyzer script to compare package versions
  2. sage_install_recovery.sh - Shell script to recover/reinstall removed packages

Quick Start

@n-WN
n-WN / README.md
Last active December 23, 2025 23:10
Codex 分析 (codex-cli 0.77.0)

Codex 分析 (codex-cli 0.77.0)

Codex 上下文如何管理


1. 上下文存储与提取机制

  • 存储实体 会话内的完整上下文由 ContextManager 维护,其核心数据结构为 items: Vec<ResponseItem>
  • 提取逻辑
@n-WN
n-WN / README.md
Created December 23, 2025 09:57
Claude Code: 对 Agent 暴露 LSP 的实现链路分析 (v2.0.76)

Claude Code: 对 Agent 暴露 LSP 的实现链路分析 (v2.0.76)


一、 配置入口与加载机制

  • 插件侧配置 (Schema: wWA) 支持通过 .lsp.jsonmanifest.lspServers 进行定义。核心字段包含 commandargsextensionToLanguageenvinitializationOptionsworkspaceFolder
  • 传输层协议 代码中声明支持 stdiosocket 两种 transport 模式,但当前版本实现中仅观察到 stdio 分支的具体处理逻辑。 (参考: external/claude-code-pkg/package/cli.js:1148)
@n-WN
n-WN / kitty-session-analysis.md
Created December 23, 2025 09:51
Kitty 会话/恢复/自动保存:调研与实现思路

Kitty 会话/恢复/自动保存:调研与实现思路

目标:回答「kitty 终端的日志在哪、如何恢复此前会话」并进一步调研社区/官方方案,给出可实现的“自动保存 + 恢复工作现场”的设计。

结论(先说人话)

  • Kitty 默认不会把终端输出持久化为“日志文件”;窗口关闭后 scrollback 也会丢失(除非你自己导出/录制)。
  • Kitty 的 session 本质是“重建布局 + 重跑命令”:能恢复 tabs/windows/layout/cwd/要启动的程序,但不能做到 tmux-resurrect 那种“进程不断、断线重连”
  • 避免误关导致任务中断:官方建议用 confirm_os_window_close(见 issue #5448 回复)。
@n-WN
n-WN / IPv6-Blackhole.md
Last active December 7, 2025 18:05
Kimi CLI Connectivity Investigation: IPv6 Blackhole And Session IPv4 Fallback Strategy

Kimi CLI Connectivity Investigation: IPv6 Blackhole And Session IPv4 Fallback Strategy

Date: 2025-12-07

Host: macOS 15.5 (arm64)

Repo: MoonshotAI/kimi-cli (local working copy)

Current HEAD: b2af75a (refactor: enable Pyright strict type checking for kimi_cli/ui/shell (#427))

@n-WN
n-WN / gist:4f776914becb6430a1608e72a31c8696
Created November 26, 2025 10:06
mimic_multi_rank_cli.py
#!/usr/bin/env python3
"""
多赛道排行榜 CLI(基于 rich 优雅显示),支持查看每个题目的解出情况。
赛道接口:
- 云网互联赛道: /api/ct/web/bwm_race/master/rank/cloudnetwork_detail/
- CTF 赛道: /api/ct/web/bwm_race/master/rank/jeo/
- 车联网/低空/物联等赛道: /api/ct/web/bwm_race/master/rank/iov_detail/
- 人工智能赛道: /api/ct/web/bwm_race/master/rank/ai_detail/
- 韧性安全赛道: /api/ct/web/bwm_race/master/rank/resilience_detail/
# Kitty 最小边框配置
# hide_window_decorations 控制窗口装饰
# titlebar-only: 只隐藏标题栏文字,保留控制按钮和可拖动区域
# yes: 完全隐藏所有装饰(无法拖动)
# no: 显示完整标题栏
hide_window_decorations titlebar-only
# 在macOS上标题栏设置
# titlebar-only 模式下仍可拖动窗口
macos_hide_titlebar no
@n-WN
n-WN / AuthyToOtherAuthenticator.md
Created July 11, 2025 19:46 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@n-WN
n-WN / mi_flash_all_platform.sh
Created April 28, 2025 07:02
mi_flash_all_platform
#!/bin/bash
# 检查产品是否匹配
fastboot getvar product 2>&1 | grep -E "^product: *gauguin" || { echo "Mismatch image and device"; exit 1; }
# 刷写镜像
fastboot flash super "$(dirname "$0")/images/super.img" || { echo "Flash super error"; exit 1; }
fastboot flash cust "$(dirname "$0")/images/cust.img" || { echo "Flash cust error"; exit 1; }
# 擦除和刷写其他镜像
#/bin/bash
declare -a remote_dirs=("sdcard/inshot/"
"sdcard/DCIM/"
"sdcard/Pictures/"
"sdcard/Download"
"sdcard/Movies/")
bak=bak_$(date +"%Y%m%d-%H%M%S")
for dir in "${remote_dirs[@]}"