<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>tenfy's blog</title><link>https://tenfy.cn/</link><description>Recent content on tenfy's blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sat, 18 Apr 2026 20:30:00 +0800</lastBuildDate><atom:link href="https://tenfy.cn/index.xml" rel="self" type="application/rss+xml"/><item><title>mem9 原理解析：向量化之后，为什么比原生记忆更适合 AI Agent</title><link>https://tenfy.cn/posts/mem9-how-it-works/</link><pubDate>Sat, 18 Apr 2026 20:30:00 +0800</pubDate><guid>https://tenfy.cn/posts/mem9-how-it-works/</guid><description>&lt;p>如果只看表面，&lt;code>mem9&lt;/code> 很像是在给 AI Agent 的 memory 加一层向量检索。&lt;/p>
&lt;p>但我把 &lt;code>mem9&lt;/code> 仓库当前实现的写入链路、召回链路和数据模型真正看下来以后，越来越确定一件事：它的变化并不是“从关键词搜索换成 embedding”这么简单，而是把记忆从本地文件升级成一套可抽取、可去重、可重塑、可共享的服务端系统。&lt;/p></description></item><item><title>用 Claude Opus 4.7 最新 benchmark 图，一次看懂 AI benchmark 指标</title><link>https://tenfy.cn/posts/anthropic-opus-47-benchmark-guide/</link><pubDate>Thu, 16 Apr 2026 23:02:28 +0800</pubDate><guid>https://tenfy.cn/posts/anthropic-opus-47-benchmark-guide/</guid><description>&lt;p>2026 年 4 月 16 日，Anthropic 正式发布了 &lt;code>Claude Opus 4.7&lt;/code>。和每次大模型发布一样，最先刷屏的往往不是参数表，而是一张 benchmark 成绩图。&lt;/p>
&lt;p>这次也一样。很多人第一眼看到的，是几个醒目的分数：&lt;code>SWE-bench Pro 64.3%&lt;/code>、&lt;code>SWE-Bench Verified 87.6%&lt;/code>、&lt;code>Terminal-Bench 2.0 69.4%&lt;/code>、&lt;code>OSWorld-Verified 78.0%&lt;/code>。但真正有信息量的，不是“哪个数字最大”，而是这些 benchmark 名字本身。&lt;/p></description></item><item><title>用 espanso 给 Codex 补回 prompt 入口：skill/snippet 工作流实战</title><link>https://tenfy.cn/posts/espanso-codex-snippet/</link><pubDate>Tue, 07 Apr 2026 20:30:00 +0800</pubDate><guid>https://tenfy.cn/posts/espanso-codex-snippet/</guid><description>&lt;p>最近在用 Codex 的时候，我碰到一个很现实的问题：现在官方更提倡用 &lt;code>skill&lt;/code> 来承载工作流能力，但不像以前那样可以直接依赖 slash command 作为调用入口。&lt;/p>
&lt;p>这带来的变化是，&lt;code>skill&lt;/code> 解决的是“怎么做”，却没有顺手解决“我怎么快速把这个意图发出去”。如果每次都手写 prompt，不仅麻烦，还很容易出现同一个动作每次描述都不一样的问题。于是我开始找一个更轻量的办法，把这些高频 prompt 固化下来，最后选了 &lt;a href="https://espanso.org/">espanso&lt;/a>。&lt;/p></description></item><item><title>用 Hugging Face Spaces 部署 OpenClaw（含自动备份与恢复）</title><link>https://tenfy.cn/posts/openclaw-hf-space-deploy/</link><pubDate>Wed, 25 Mar 2026 21:39:18 +0800</pubDate><guid>https://tenfy.cn/posts/openclaw-hf-space-deploy/</guid><description>&lt;p>如果你想把 OpenClaw 放到云端，且希望配置尽量少、可恢复、可持续维护，那么 &lt;code>openclaw-hf&lt;/code> 是目前非常省心的一套方案。&lt;/p>
&lt;p>仓库地址：&lt;a href="https://github.com/tenfyzhong/openclaw-hf">https://github.com/tenfyzhong/openclaw-hf&lt;/a>&lt;/p>
&lt;p>本文已按该仓库最新 &lt;code>README.md&lt;/code>（2026-03-27 更新）同步整理为中文部署指南。&lt;/p></description></item><item><title>openclaw-docker：一条命令启动 OpenClaw</title><link>https://tenfy.cn/posts/openclaw-docker-guide/</link><pubDate>Sat, 14 Mar 2026 00:18:12 +0800</pubDate><guid>https://tenfy.cn/posts/openclaw-docker-guide/</guid><description>&lt;p>最近我单独做了一个仓库：&lt;a href="https://github.com/tenfyzhong/openclaw-docker">tenfyzhong/openclaw-docker&lt;/a>。&lt;/p>
&lt;p>这篇文章主要说两件事：为什么要做它，以及你怎么最快把 OpenClaw 跑起来。&lt;/p>
&lt;h2 id="为什么我要做这个仓库">为什么我要做这个仓库&lt;/h2>
&lt;p>我一开始也是按官方方式折腾 Docker 运行 OpenClaw，但实际体验里有几个明显门槛：&lt;/p></description></item><item><title>实测五款 Go JSON 库：谁才是性能之王？</title><link>https://tenfy.cn/posts/json-benchmark/</link><pubDate>Sat, 03 Jan 2026 17:24:31 +0800</pubDate><guid>https://tenfy.cn/posts/json-benchmark/</guid><description>&lt;p>最近在做一个高并发的 API 服务，JSON 序列化成了性能瓶颈。标准库虽然稳定可靠，但在压测时 CPU 占用居高不下。于是我决定做一次彻底的 JSON 库性能对比，看看市面上这些号称&amp;quot;高性能&amp;quot;的库到底有多少真本事。&lt;/p></description></item><item><title>在 Hugging Face 上免费部署自更新的 n8n</title><link>https://tenfy.cn/posts/deploy-n8n-on-hf/</link><pubDate>Sat, 30 Aug 2025 15:45:39 +0800</pubDate><guid>https://tenfy.cn/posts/deploy-n8n-on-hf/</guid><description>&lt;p>您是否正在寻找一种免费、可自托管且功能强大的工作流自动化工具？&lt;a href="https://n8n.io/">n8n&lt;/a> 是一个绝佳的选择，它允许您连接各种应用程序和服务，创建复杂的自动化流程。而现在，借助 Hugging Face 和 Supabase 的免费资源，您可以轻松拥有一个能够自动更新的 n8n 实例，无需花费一分钱。&lt;/p></description></item><item><title>Cloudflare 电子邮件路由配置指南：免费拥有你的域名邮箱</title><link>https://tenfy.cn/posts/cloudflare-email-routing-guide/</link><pubDate>Mon, 04 Aug 2025 13:15:00 +0800</pubDate><guid>https://tenfy.cn/posts/cloudflare-email-routing-guide/</guid><description>&lt;p>您是否拥有一个域名，但又不想为了一个自定义的邮箱地址（例如 &lt;code>info@yourdomain.com&lt;/code>）而支付额外的企业邮箱费用？Cloudflare 的电子邮件路由（Email Routing）功能为您提供了一个完美且免费的解决方案。它允许您创建任意数量的自定义域名邮箱地址，并将收到的邮件无缝转发到您现有的个人邮箱（如 Gmail、Outlook 等）。&lt;/p></description></item><item><title>DNS小白也能轻松搞定！Cloudflare域名解析超详细图文教程</title><link>https://tenfy.cn/posts/cloudflare-dns-tutorial/</link><pubDate>Mon, 04 Aug 2025 10:30:00 +0800</pubDate><guid>https://tenfy.cn/posts/cloudflare-dns-tutorial/</guid><description>&lt;p>你是否曾经购买了一个心仪的域名，却对着一堆A、CNAME、MX记录发愁，感觉自己仿佛在破解什么上古密码？别担心，你不是一个人！域名系统（DNS）听起来高深，但实际上，只要用对工具，它比你想象的要简单得多。&lt;/p></description></item><item><title>告别手写 commit message, gitai-让AI成为你的git贴心助手</title><link>https://tenfy.cn/posts/usage-gitai/</link><pubDate>Sat, 26 Jul 2025 16:24:09 +0800</pubDate><guid>https://tenfy.cn/posts/usage-gitai/</guid><description>&lt;p>作为一名程序员，我们都热爱创造，热衷于用代码改变世界。但不得不承认，在日常的开发流程中，总有一些“烦人”的小事，比如写文档、写注释，以及——写 &lt;code>git commit&lt;/code> 信息。这些任务虽然重要，但往往会打断我们心流，让人觉得索然无味。&lt;/p></description></item><item><title>优雅绕过 Gemini API 速率限制，实现“无限”免费调用</title><link>https://tenfy.cn/posts/using-gemini-balance/</link><pubDate>Thu, 24 Jul 2025 20:09:24 +0800</pubDate><guid>https://tenfy.cn/posts/using-gemini-balance/</guid><description>&lt;p>Google 的 Gemini 2.5 Pro 模型无疑是当今性能最顶尖的 AI 模型之一。更难能可贵的是，Google 提供了相当慷慨的免费使用额度，让广大开发者和 AI 爱好者都能亲身体验其强大功能。然而，这份“免费午餐”并非毫无限制，其严格的速率限制（Rate Limits）常常成为重度使用场景下的瓶颈。&lt;/p></description></item><item><title>AI 赋能生产力：DeepSeek 与常用工具链整合实战</title><link>https://tenfy.cn/posts/tools-with-ai/</link><pubDate>Tue, 08 Apr 2025 20:59:00 +0800</pubDate><guid>https://tenfy.cn/posts/tools-with-ai/</guid><description>&lt;h1 id="引言">引言&lt;/h1>
&lt;p>在现代化的工作流中，效率是关键。通过将人工智能（AI）无缝集成到我们日常使用的生产力工具中，可以极大地提升工作效率。本文将介绍如何将 AI 功能，特别是性价比极高的 DeepSeek 模型，整合到以下四个核心工具中：&lt;/p></description></item><item><title>Golang rpc服务更优雅的error处理和打印日志</title><link>https://tenfy.cn/posts/go-error-handling/</link><pubDate>Fri, 31 May 2024 00:01:36 +0800</pubDate><guid>https://tenfy.cn/posts/go-error-handling/</guid><description>&lt;p>服务器代码中，错误处理占据了大部分的逻辑。特别是C族语言，喜欢使用错误码，而不是异常来处理错误。
错误码比异常的优势是，性能会更好一些。抛出异常的话，因为有异常栈的展开，性能开销会大很多。
在Golang中，有一个error的接口来处理错误。&lt;/p></description></item><item><title>comm-用于做文件比较</title><link>https://tenfy.cn/posts/gnu-comm/</link><pubDate>Thu, 30 May 2024 11:41:05 +0800</pubDate><guid>https://tenfy.cn/posts/gnu-comm/</guid><description>&lt;h1 id="comm工具">comm工具&lt;/h1>
&lt;p>comm工具的主要用途是用来做文件的差集、交集。
工作中，对账是一个频繁的工作项。基本上几十行的数据，人眼就看不过来了。所以使用工具是我们最好的方案。
comm可以为我们很方便的对两个文件做差集、交集。所以我们只要把数据洗成一样的格式后，就可以用comm进行对比了。&lt;/p></description></item><item><title>编写fish-shell自定义补全</title><link>https://tenfy.cn/posts/fish-shell-completion/</link><pubDate>Sun, 05 May 2024 15:50:08 +0800</pubDate><guid>https://tenfy.cn/posts/fish-shell-completion/</guid><description>&lt;p>fish shell的补全是最简单明了的，一个&lt;code>complete&lt;/code>命令就能编写补全。
官方文档参考：&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://fishshell.com/docs/current/completions.html">Writing your own completions&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://fishshell.com/docs/current/cmds/complete.html">complete - edit command-specific tab-completions Synopsis&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>第1个文档说明怎么写补全，第二个文档说明&lt;code>complete&lt;/code>命令的用法。&lt;/p></description></item><item><title>创建homebrew/tap安装规则</title><link>https://tenfy.cn/posts/homebrew-tap-create-formula/</link><pubDate>Sun, 05 May 2024 12:13:52 +0800</pubDate><guid>https://tenfy.cn/posts/homebrew-tap-create-formula/</guid><description>&lt;h1 id="创建自己的homebrewtap">创建自己的homebrew/tap&lt;/h1>
&lt;p>在github上创建一个名为&lt;code>homebrew-tap&lt;/code>的仓库，创建一个&lt;code>Formula&lt;/code>的目录。&lt;/p>
&lt;p>然后就有一个自己的名为&lt;code>username/tap&lt;/code>的homebrew仓库了。username改为自己的Github名字。&lt;/p></description></item><item><title>给dash生成doc文档</title><link>https://tenfy.cn/posts/dashdog-usage/</link><pubDate>Fri, 03 May 2024 11:57:04 +0800</pubDate><guid>https://tenfy.cn/posts/dashdog-usage/</guid><description>&lt;p>本文介绍&lt;a href="https://kapeli.com/dash">dash&lt;/a>如何生成文档以及文档生成工具dashdog的使用。&lt;/p>
&lt;h1 id="dash文档生成指引">dash文档生成指引&lt;/h1>
&lt;p>官方提供了文档的生成指引方式&lt;a href="https://kapeli.com/docsets#dashDocset">Docset Generation Guide&lt;/a>，但是在使用的过程发发现官方指引已经落后了，使用了dash 7下载了一个go的三方文档，并且去看了一下SQLite里的数据。
发现里面的格式跟文档提供的不一样。&lt;/p></description></item><item><title>golang多版本管理</title><link>https://tenfy.cn/posts/gg-golang-version-manager/</link><pubDate>Thu, 28 Dec 2023 13:19:05 +0800</pubDate><guid>https://tenfy.cn/posts/gg-golang-version-manager/</guid><description>&lt;p>在我们的开发环境中，使多个golang版本并存。&lt;/p>
&lt;p>大部分情况下，一个比较新的golang版本就能满足我们的日常的开发需求。
但是项目中，因为协作的原因，或者由于项目启动比较早，可能我们不同的工程需要用不同的golang版本。甚至有些工作用比较新的版本编译不了。
这时候，我们就需要让本地的开发环境支持多个golang版本。&lt;/p></description></item><item><title>中国计算机网络拓扑结构</title><link>https://tenfy.cn/posts/china-topology-of-networks/</link><pubDate>Wed, 27 Dec 2023 21:20:00 +0800</pubDate><guid>https://tenfy.cn/posts/china-topology-of-networks/</guid><description>&lt;h1 id="骨干网">骨干网&lt;/h1>
&lt;h2 id="网络架构">网络架构&lt;/h2>
&lt;p>
 &lt;img class="mx-auto" alt="网络框架" src="https://tenfy.cn/picture/network-architecture.png" /> 
 
主要分层汇接方式。纵向分为骨干网、城域网、接入网三个层级。
骨干网是最顶层的省际高速网络，基础电信运营商在各省会及主要城市设置骨干节点，并在节点间设置直联路，共同构成骨干网。
骨干网内分了核心节点和接入节点。&lt;/p></description></item><item><title>fdump tcp抓包框架</title><link>https://tenfy.cn/posts/introduce-fdump/</link><pubDate>Tue, 25 Jun 2019 13:21:30 +0000</pubDate><guid>https://tenfy.cn/posts/introduce-fdump/</guid><description>&lt;p>fdump是一个创建抓二进制包解析程序的框架。
对于自定义的二进制通信协议，在调试的时候会很困难。无论tcpdump还是wireshark抓到包都不能直接看到里面的内容。&lt;/p></description></item><item><title>redis geohash的性能测试</title><link>https://tenfy.cn/posts/redis-geo-bench/</link><pubDate>Mon, 24 Jun 2019 14:28:19 +0000</pubDate><guid>https://tenfy.cn/posts/redis-geo-bench/</guid><description>&lt;p>redis于3.2版本加入了geohash的数据库结构。使坐标的计算变得非常方便。
下面对redis的geohash做性能测试，看可以支持怎样的并发。&lt;/p></description></item><item><title>ntp客户端同步时间</title><link>https://tenfy.cn/posts/ntp-client/</link><pubDate>Mon, 13 May 2019 10:03:52 +0000</pubDate><guid>https://tenfy.cn/posts/ntp-client/</guid><description>&lt;p>linux使用ntp客户端自动更新时间。&lt;/p>
&lt;p>使用ntp客户端工具ntpdate定期执行来进行同步时间。ntpdate只需要加ntp服务器的机器即可。
假如ntp的服务器为10.1.2.3，则同步命令为&lt;code>ntpdate 10.1.2.3&lt;/code>。同步完时间后，
还可以使用&lt;code>hwclock -w&lt;/code>来同步到硬件时间。&lt;/p></description></item><item><title>服务器超时时间和请求队列大小设置</title><link>https://tenfy.cn/posts/server-timeout-queue-size/</link><pubDate>Sat, 09 Mar 2019 12:17:31 +0000</pubDate><guid>https://tenfy.cn/posts/server-timeout-queue-size/</guid><description>&lt;p>服务器超时时间和请求列表大小关乎程序的健壮性。设置过小，会导致有效的请求被丢掉。
设置过大，严重的情况下会引起雪崩。&lt;/p>
&lt;h1 id="超时">超时&lt;/h1>
&lt;p>很多后台码农对超时时间的设置都没什么概念，特别是刚毕业的后台码农。
一般都是参照前人的代码，设置一个相同的超时，而且一般都是比较大的超时，只要程序能跑就没问题了。&lt;/p></description></item><item><title>nf_conntrack调优</title><link>https://tenfy.cn/posts/conntrack-tuning/</link><pubDate>Mon, 03 Dec 2018 20:00:55 +0000</pubDate><guid>https://tenfy.cn/posts/conntrack-tuning/</guid><description>&lt;p>深入了解conntrack调优。&lt;/p>
&lt;h1 id="netfilter">netfilter&lt;/h1>
&lt;p>netfilter是linux内在的一个软件框架，用来管理网络数据包。&lt;/p>
&lt;p>netfilter提供了5个hook来进行管理网络包。如下图：

 &lt;img class="mx-auto" alt="netfilter-hooks" src="https://tenfy.cn/picture/netfilter-hooks.png" /> 
 &lt;/p></description></item><item><title>libpcap入门教程</title><link>https://tenfy.cn/posts/libpcap-tutorial/</link><pubDate>Sat, 01 Dec 2018 18:25:04 +0000</pubDate><guid>https://tenfy.cn/posts/libpcap-tutorial/</guid><description>&lt;p>libpcap是一个开源的，用于捕捉网络包的库。可以在大部分&lt;code>*nix&lt;/code>系统下运行。另外，
还有一个windows版本的叫做winpcap。&lt;/p>
&lt;h1 id="包捕获">包捕获&lt;/h1>
&lt;p>包捕获是收集网络上数据的过程。&lt;/p></description></item><item><title>nginx平滑的基于权重轮询算法分析</title><link>https://tenfy.cn/posts/smooth-weighted-round-robin/</link><pubDate>Mon, 12 Nov 2018 19:54:47 +0000</pubDate><guid>https://tenfy.cn/posts/smooth-weighted-round-robin/</guid><description>&lt;p>nginx使用的平滑权重轮询算法介绍以及原理分析。&lt;/p>
&lt;h1 id="轮询调度">轮询调度&lt;/h1>
&lt;p>轮询调度非常简单，就是每次选择下一个节点进行调度。比如&lt;code>{a, b, c}&lt;/code>三个节点，第一次选择a，
第二次选择b，第三次选择c，接下来又从头开始。&lt;/p></description></item><item><title>mongo跨集群复制集同步</title><link>https://tenfy.cn/posts/mongo-connector/</link><pubDate>Tue, 06 Feb 2018 16:39:10 +0000</pubDate><guid>https://tenfy.cn/posts/mongo-connector/</guid><description>&lt;p>mongo的跨集群复制集同步方案。&lt;/p>
&lt;p>在生产环境上使用mongo，需要考虑容灾。在跨idc的容灾方案上，我们需要把数据库同步到其他的idc去，
这样即使一个idc挂了，另一个idc还可以服务，而且数据不会丢。&lt;/p></description></item><item><title>tcpdump 与 pcap-filter 使用手册</title><link>https://tenfy.cn/posts/man-tcpdump/</link><pubDate>Tue, 24 Oct 2017 18:48:09 +0000</pubDate><guid>https://tenfy.cn/posts/man-tcpdump/</guid><description>&lt;p>&lt;code>tcpdump&lt;/code> 是最常用的命令行抓包工具，&lt;code>pcap-filter&lt;/code> 是它使用的过滤表达式语法。实际排查网络问题时，两者总是一起出现：先决定在哪里抓包，再用过滤表达式把无关流量排除掉，最后根据协议输出或者 pcap 文件继续分析。&lt;/p></description></item><item><title>tenfyzhong/goenv库介绍</title><link>https://tenfy.cn/posts/introduce-goenv/</link><pubDate>Tue, 17 Oct 2017 18:57:26 +0000</pubDate><guid>https://tenfy.cn/posts/introduce-goenv/</guid><description>&lt;p>&lt;a href="https://github.com/tenfyzhong/goenv">goenv&lt;/a>库将环境变量的值设置到一个结构体里，
以方便使用。类似于encoding/json解析到结构体。&lt;/p>
&lt;h1 id="背景">背景&lt;/h1>
&lt;p>为了简化docker的发布，把配置从配置文件里抽取出来，设置到环境变量里。然后发布docker
容器的时候就不需要再带一个配置文件了。&lt;/p></description></item><item><title>golang交叉编译</title><link>https://tenfy.cn/posts/golang-cross-compile/</link><pubDate>Tue, 17 Oct 2017 09:00:35 +0000</pubDate><guid>https://tenfy.cn/posts/golang-cross-compile/</guid><description>&lt;p>golang的交叉编译。&lt;/p>
&lt;p>golang的交叉编译非常简单，只要配好对应的环境变量后再&lt;code>go build&lt;/code>就可以了。
需要配置以下的环境变量。&lt;/p>
&lt;h1 id="cgo_enabled">&lt;code>CGO_ENABLED&lt;/code>&lt;/h1>
&lt;p>默认情况下这个变量为1。
交叉编译不支持cgo，所以需要关闭cgo。
linux/unix下为&lt;code>CGO_ENABLED=0&lt;/code>。
windows下为&lt;code>set CGO_ENABLED=0&lt;/code>。&lt;/p></description></item><item><title>vim宏的使用</title><link>https://tenfy.cn/posts/vim-macro/</link><pubDate>Wed, 27 Sep 2017 14:37:20 +0000</pubDate><guid>https://tenfy.cn/posts/vim-macro/</guid><description>&lt;p>本文介绍vim宏以及它的魔法。&lt;/p>
&lt;h1 id="宏是什么">宏是什么&lt;/h1>
&lt;p>vim的宏就是把一系列动作录制起来，然后可以进行播放可以执行同样动作的功能。
它是vim中最具有魔法的操作了。可能会有人觉得&lt;code>.&lt;/code>重复操作更具有魔法，但是&lt;code>.&lt;/code>只能记
重复上一次命令，能做的事情有限，所以它最多就是最经常使用的命令而已，并没有魔法。&lt;/p></description></item><item><title>制作U盘启动盘</title><link>https://tenfy.cn/posts/udisk-booter/</link><pubDate>Tue, 26 Sep 2017 17:09:54 +0000</pubDate><guid>https://tenfy.cn/posts/udisk-booter/</guid><description>&lt;p>本文介绍在osx和linux下制作U盘启动盘的方法。&lt;/p>
&lt;p>假如要把ubuntu.iso做成启动盘。&lt;/p>
&lt;h1 id="osx下制作启动盘">osx下制作启动盘&lt;/h1>
&lt;p>osx下制作启动盘，需要先将iso转成dmg格式的镜像。然后再把dmg dd到U盘里&lt;/p></description></item><item><title>nginx旁路</title><link>https://tenfy.cn/posts/nginx-capture-multi/</link><pubDate>Fri, 22 Sep 2017 17:50:16 +0000</pubDate><guid>https://tenfy.cn/posts/nginx-capture-multi/</guid><description>&lt;p>旁路的目的是为了把请求复制一份发到另外的服务上去。这样就可以不影响主流程的情况下
处理额外的逻辑了。最简单的方式就是让nginx把请求发出去，这样我们只要改配置就行了，
而不用改代码。相对于开发，测试回归的成本往往要高很多。&lt;/p></description></item><item><title>nginx配置http basic认证</title><link>https://tenfy.cn/posts/http-basic-access-authentication/</link><pubDate>Thu, 21 Sep 2017 19:37:26 +0000</pubDate><guid>https://tenfy.cn/posts/http-basic-access-authentication/</guid><description>&lt;p>http basic认证允许我们对自己的web服务器做简单的认证。可以适当的防止别人浏览器我们
的页面。&lt;/p>
&lt;h1 id="为什么需要http-basic认证">为什么需要http basic认证&lt;/h1>
&lt;p>对于一些简单的web服务需要做简单的认证。比如:&lt;/p></description></item><item><title>golang channel有没buffer的区别</title><link>https://tenfy.cn/posts/golang-unbuffered-channel/</link><pubDate>Wed, 20 Sep 2017 17:40:57 +0000</pubDate><guid>https://tenfy.cn/posts/golang-unbuffered-channel/</guid><description>&lt;p>初学golang的很多人对buffer大小为0和1的channel都不了解。&lt;/p>
&lt;p>下面通过&lt;code>make(chan bool)&lt;/code>和&lt;code>make(chan bool, 1)&lt;/code>的例子说明它们的区别。&lt;/p></description></item><item><title>linux只允许程序的一个进程实例运行</title><link>https://tenfy.cn/posts/only-one-instance/</link><pubDate>Sat, 16 Sep 2017 16:06:16 +0000</pubDate><guid>https://tenfy.cn/posts/only-one-instance/</guid><description>&lt;p>有的时候，我们需要确保当前只有一个进程实例在运行。特别是定时跑定时任务的时候。&lt;/p>
&lt;p>unix/linux的cron可以配置定时任务，让它在指定的时间运行。但是，只要到任务指定的时
间，cron就会fork一个新的进程来执行任务，它不会保证前一个任务运行完成了，下一个任
务才开始。而有时我们却需要只能有一个实例运行。&lt;/p></description></item><item><title>introduce-docker</title><link>https://tenfy.cn/posts/introduce-docker/</link><pubDate>Fri, 08 Sep 2017 09:14:21 +0000</pubDate><guid>https://tenfy.cn/posts/introduce-docker/</guid><description>&lt;p>这篇文章是只是简单的入门，所以这里会教你怎么可以简单的上手。比如以前完全没有用过
docker，现在要跑一个服务要用docker来跑。&lt;/p>
&lt;h1 id="什么是docker">什么是docker&lt;/h1>
&lt;p>以下是docker官网的介绍&lt;/p></description></item><item><title>psftp,pscp自动与服务器进行sftp,scp通信python库</title><link>https://tenfy.cn/posts/psftp-and-pscp/</link><pubDate>Mon, 04 Sep 2017 20:32:34 +0000</pubDate><guid>https://tenfy.cn/posts/psftp-and-pscp/</guid><description>&lt;p>懒是程序猿的本性。一切重复的东西，程序猿都可以写成脚本来让它自己运行。很多时候程
序猿要写脚本去连到服务器上去执行些命令，其中还包含上传文件到服务器或者从服务器上
下载文件下来。&lt;/p></description></item><item><title>vim函数feedkeys使用说明</title><link>https://tenfy.cn/posts/vim-feedkeys/</link><pubDate>Sat, 02 Sep 2017 17:42:23 +0000</pubDate><guid>https://tenfy.cn/posts/vim-feedkeys/</guid><description>&lt;p>很多人在使用feedkeys函数的时候会得取不预期的输出，怎么折腾也搞不明白为什么会得到
这样的结果。这篇文章来给大家解疑一下。&lt;/p>
&lt;h1 id="feedkeys函数文档">feedkeys函数文档&lt;/h1>
&lt;pre tabindex="0">&lt;code>feedkeys({string} [, {mode}])				*feedkeys()*
		Characters in {string} are queued for processing as if they
		come from a mapping or were typed by the user.
		By default the string is added to the end of the typeahead
		buffer, thus if a mapping is still being executed the
		characters come after them. Use the &amp;#39;i&amp;#39; flag to insert before
		other characters, they will be executed next, before any
		characters from a mapping.
		The function does not wait for processing of keys contained in
		{string}.
		To include special keys into {string}, use double-quotes
		and &amp;#34;\...&amp;#34; notation |expr-quote|. For example,
		feedkeys(&amp;#34;\&amp;lt;CR&amp;gt;&amp;#34;) simulates pressing of the &amp;lt;Enter&amp;gt; key. But
		feedkeys(&amp;#39;\&amp;lt;CR&amp;gt;&amp;#39;) pushes 5 characters.
		If {mode} is absent, keys are remapped.
		{mode} is a String, which can contain these character flags:
		&amp;#39;m&amp;#39;	Remap keys. This is default.
		&amp;#39;n&amp;#39;	Do not remap keys.
		&amp;#39;t&amp;#39;	Handle keys as if typed; otherwise they are handled as
			if coming from a mapping. This matters for undo,
			opening folds, etc.
		&amp;#39;i&amp;#39;	Insert the string instead of appending (see above).
		&amp;#39;x&amp;#39;	Execute commands until typeahead is empty. This is
			similar to using &amp;#34;:normal!&amp;#34;. You can call feedkeys()
			several times without &amp;#39;x&amp;#39; and then one time with &amp;#39;x&amp;#39;
			(possibly with an empty {string}) to execute all the
			typeahead. Note that when Vim ends in Insert mode it
			will behave as if &amp;lt;Esc&amp;gt; is typed, to avoid getting
			stuck, waiting for a character to be typed before the
			script continues.
		&amp;#39;!&amp;#39;	When used with &amp;#39;x&amp;#39; will not end Insert mode. Can be
			used in a test when a timer is set to exit Insert mode
			a little later. Useful for testing CursorHoldI.

		Return value is always 0.
&lt;/code>&lt;/pre>&lt;p>说明文档说了这个函数的使用方式，但是对于大部分人，只理解了一部分，帮而会产生很多
不解的行为。这个函数会把参数中的&lt;code>{string}&lt;/code>当前是用户输入的。默认的，它会把string
的内容放到预输入的buffer(下面直接引用说明文档中的typeahead buffer)中。
对于不解行为，主要都是由这个typeahead buffer产生了。这个typeahead buffer并不是我
们所熟悉的vim与文档内容关联的buffer，下面会对它进行详细的说明。很多人认为，只要
一调用feedkeys，它就立刻产生作用。例如下面这个例子：&lt;/p></description></item><item><title>prometheus丢数据调试与处理</title><link>https://tenfy.cn/posts/prometheus-lost-data/</link><pubDate>Sat, 02 Sep 2017 17:38:57 +0000</pubDate><guid>https://tenfy.cn/posts/prometheus-lost-data/</guid><description>&lt;p>influxdb数据旁路一份到prometheus后，prometheus的图有时延时很大，主要是在业务忙的
时候，闲的时候是可以处理到数据的。而influxdb的数据是可以正常显示的。而且这时牛逼
的google并帮不了忙，各种关键字去搜索都找不到相关的问题。&lt;/p></description></item><item><title>Golang直接操作共享内存</title><link>https://tenfy.cn/posts/golang-share-memory/</link><pubDate>Sat, 02 Sep 2017 16:58:51 +0000</pubDate><guid>https://tenfy.cn/posts/golang-share-memory/</guid><description>&lt;p>Golang不使用cgo，直接操作共享内存。&lt;/p>
&lt;h1 id="前言">前言&lt;/h1>
&lt;p>故事起源于要搭一个高性能的日志中心。当然使用了elk这一套。但是，对于logstash来说，
它主要使用的是文件日志的方式了捕捉log。而写文件日志的话会非常慢。对于实时日志要
处理滚动的日志更是这样，每次检查是否需要流动日志，然后打开日志，然后写入，然后
关闭，当然这中间可以优化。这一切都是那么慢，发起了n个系统调用，硬盘寻道等。这时
候想到了用共享内存来通信。&lt;/p></description></item></channel></rss>