20250709
每日一谚:Prefer readability over cleverness
你的命令行,即将迎来一场“AI革命”
今天,当我们以为 VS Code 这样轻快、插件丰富的编辑器已经统一江湖时,一股强劲的“复古之风”正悄然刮起。但这一次,它并非简单的怀旧,而是一场由 AI 驱动的、向命令行的“伟大回归”
Go 和 DTrace 的优化和调试故事
作者在工作中优化 Go 应用程序 Kratos 的测试套件时,遇到测试运行时间过长的问题。通过使用 CPU profile 和 DTrace,作者发现问题在于对 SQL 迁移文件的排序操作。文章详细描述了使用 DTrace 进行性能分析和调试的过程,包括如何使用 DTrace 脚本测量函数运行时间,以及如何识别并修复排序算法的低效之处。最终,作者将目标函数的运行时间从 180 毫秒缩短到 11 毫秒,实现了 16 倍的性能提升。文章还讨论了 DTrace 的优缺点,以及如何处理 Go 的多协程并发模型。最后,文章提供了关于 Goroutine 感知 D 脚本的补充说明。
Introducing Docker Hub MCP Server: A New Way to Discover, Inspect, and Manage Container Images
如何快速构建软件
软件的构建受到时间和质量的限制。我们希望编写好的代码并快速完成。本文作者分享了一些经验教训,例如:了解代码对于手头任务的质量要求;从粗略草稿开始;尝试软化需求;避免分心;进行小的改动;练习特定技能等。文章还提到了快速构建软件的一些技巧,例如使用粗略草稿、尝试更改需求、避免在代码中徘徊、进行小的更改以及练习一些有用的技能,例如阅读代码、数据建模、脚本编写、使用调试器等。
uv 缓存清理
如果你磁盘空间不足并且是 uv 用户,不要忘记使用 uv cache prune:uv cache prune 会删除所有未使用的缓存条目。例如,缓存目录可能包含先前 uv 版本中创建的不再需要的条目,可以安全地删除。uv cache prune 可以定期运行,以保持缓存目录的整洁。
介绍 OpenCLI
大约三年前,我被邀请参加微软 System.CommandLine 团队的会议。他们当时正在完成 System.CommandLine 的开发,并希望获得社区成员的意见,由于我在 Spectre.Console 和 Spectre.Console.Cli 上的工作,我也被邀请参加。
在这些会议中,简要讨论的事情之一是制定一个开放规范来描述 CLI 的结构,类似于 OpenAPI,但适用于命令行应用程序。我非常喜欢这个想法,因为我看到了它可以解决的许多问题,不仅包括文档生成,还包括创建强类型包装器以编程方式与 CLI 工具交互。
三年过去了,我还没有看到任何人主动构建这样的东西。
所以我想:是我自己做点什么的时候了。
这就是为什么今天我想介绍 OpenCLI 计划的原因(目前)它在 Spectre.Console GitHub 组织下维护。该规范仍在起草中,并且尚不完整,但我认为它是一个很好的起点。
简单来说,OpenCLI 规范 (OCS) 定义了一个标准的、与平台和语言无关的 CLI 应用程序接口,它允许人和计算机在不访问源代码或文档的情况下理解如何调用 CLI 工具。
googleapis/genai-toolbox
MCP Toolbox for Databases is an open source MCP server for databases.
putyy/res-downloader
视频号、小程序、抖音、快手、小红书、直播流、m3u8、酷狗、QQ音乐等常见网络资源下载!
junegunn/fzf
🌸 A command-line fuzzy finder
open-telemetry/opentelemetry-collector
OpenTelemetry Collector
aldinokemal/go-whatsapp-web-multidevice
GOWA - WhatsApp REST API with support for UI, Webhooks, and MCP. Built with Golang for efficient memory use.
grafana/alloy
OpenTelemetry Collector distribution with programmable pipelines
github/github-mcp-server
GitHub's official MCP Server
bluenviron/mediamtx
Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
gofr-dev/gofr
An opinionated GoLang framework for accelerated microservice development. Built in support for databases and observability.
argoproj/argo-cd
Declarative Continuous Deployment for Kubernetes
grafana/loki
Like Prometheus, but for logs.
influxdata/telegraf
Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
bytedance/sonic
A blazingly fast JSON serializing & deserializing library
usememos/memos
A modern, open-source, self-hosted knowledge management and note-taking platform designed for privacy-conscious users and organizations.
projectdiscovery/nuclei
Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.
vllm-project/aibrix
Cost-efficient and pluggable Infrastructure components for GenAI inference
grpc-ecosystem/grpc-gateway
gRPC to JSON proxy generator following the gRPC HTTP spec
aquasecurity/trivy
Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
ethereum-optimism/optimism
Optimism is Ethereum, scaled.
volcano-sh/volcano
A Cloud Native Batch System (Project under CNCF)
AlexxIT/go2rtc
Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
gofiber/fiber
⚡️ Express inspired web framework written in Go
编辑:Tony Bai
编辑主页:tonybai.com
GopherDaily项目:github.com/bigwhite/gopherdaily
Copyright 2019-2024 GopherDaily