用 Go 語言輕鬆構建 MCP 客戶端與服務器
★ 該文章已被 Model Context Protocol(MCP) 中文教程講解 收錄,歡迎 star 收藏。 若想獲取可執行的完整項目代碼,可關注本公衆號,回覆 MCP。前言模型上下文協議(Model Context Protocol,簡稱 MCP)是一種開放標準,旨在標準化大型語言模型(LLM)與外部數據源和工具之間的交互方式。隨着 MCP 越來越受歡迎,Go MCP 庫 ⌘ Read more
golang 每日一庫之 aceld-zinx
aceld/zinx 是一個基於 Go 語言開發的輕量級、高併發 TCP 服務器框架,專注於簡化遊戲服務器、長連接應用及消息中轉服務的開發。其設計目標是提供清晰的結構和高度可擴展性,幫助開發者快速構建高性能網絡服務。以下從核心特性、架構設計、應用場景等方面詳細介紹:一、核心特性輕量級與高併發 基於 Go 的 Goroutine 協程模型,實現高效併發處理,支持海量連接。 提供線程池(W ⌘ Read more
Conduwit is set to archive on GitHub. It was my favourite Matrix server, which I still self host. I think I am going to get off Matrix altogether now.
Maybe go back to Jabber?
What we know about rumors Trump admin ordered ‘loyalists’ to wear golden lapel pins of president’s face
Laerke Christensen, Contributing Writer - Snopes
_Stephan: Between 1981 and 1993 I spent about three months each year in communist dictator countries; the worst of which culturally was Romania. But even in Romania, I didn’t see his people going around with gold Nicolae Ceaușescu pins in the labels of their jackets. This … ⌘ Read more
Wall Street execs worried ‘erratic’ Trump ‘maybe isn’t all there’: CNN
Tom Boggioni, Senior Editor - Raw Story
Stephan: I have been telling you for months that based on the Hare psychopathology scale Trump is a psychopath, and may have other mental disorders as well. Others are also beginning to think this. I predict we are going to see more of this.
_Cr … ⌘ Read more“Move to iOS” app continuously refused to run as intended and expected, so couldn’t migrate mum’s Android based phone data. Most of her stuff is on a Google account, but not the SMS/MMS/RCS messages. Haven’t found a way to export, then import those into iOS.
She isn’t too happy having to keep the old phone just for the messages. Need to find a way to go through them, export multimedia attachments, and import them into iOS. I don’t think it’s going to happen, but I am not letting her know yet. 😅
Based on a recent study of the brains of mice I estimated the human brain to have 200B cells/neurons and 50,000T connections. We have several orders of magnitude to go before we reach that kind of scale with these fucking stupid Big LLMs 🤣 And the best part of all? 🧐 It is estimated that the human brain only consumes the equivalent of 5 Watts of power !!! 🤣🤣🤣
Security updates for Friday
Security updates have been issued by AlmaLinux (delve and golang and go-toolset:rhel8), Debian (webkit2gtk), Fedora (openvpn, thunderbird, uboot-tools, and zabbix), SUSE (expat, fontforge, govulncheck-vulndb, and kernel), and Ubuntu (haproxy and libsoup2.4, libsoup3). ⌘ Read more
Anker Raises Prices on Amazon Due to Tariffs
Chinese company Anker is one of many companies that will be raising prices due to the tariffs put in place by U.S. President Donald Trump, and prices are already starting to go up on Amazon.
 memory is not like the ordinary RAM that one might
install into a computer; it can come and go at any time and is often not
present when the kernel is booting. That complicates the management of
this memory. During the memory-management track of the 2025 Linux Storage,
Filesystem, Memory-Management, and BPF Summit, Gregory Price ran a session
on the challenges posed by CXL and how they might be addressed. ⌘ Read more
Hit by the arvo sun rays behind the window I was convinced that it is t-shirt weather. Deep blue sky, yeah, for sure! It turned out to be just 15°C and declining, though. So, I had to wear my jacket on today’s windy stroll. Pretty nice. Didn’t take many photos, but there you go: https://lyse.isobeef.org/waldspaziergang-2025-04-10/
@movq@www.uninformativ.de Holy crap, that’s really crazy!
Hahaha, you got me. When I read your first sentence I thought you were going to tell about your Wayland experience in comparison to X11. :-D
One was able to purchase iPhones on instalments (and interest free), whether they were associated with a carrier, or not. The only way to buy them on instalments now is if the are associated with a carrier; otherwise one gets charged the full amount up front.
So, yeah, going to return a couple of those this weekend.
@aelaraji@aelaraji.com oh yeah! You will feel in heaven, me thinks, because that new machine will go around the Pi a few laps. Have fun, mate!
Security updates for Thursday
Security updates have been issued by AlmaLinux (tomcat and webkit2gtk3), Debian (chromium), Fedora (ghostscript), Mageia (atop, docker-containerd, and xz), Red Hat (go-toolset:rhel8), SUSE (apache2-mod_auth_openidc, apparmor, etcd, expat, firefox, kernel, libmozjs-128-0, and libpoppler-cpp2), and Ubuntu (dino-im, linux, linux-aws, linux-aws-hwe, linux-azure, linux-azure-4.15, linux-gcp,
linux-gcp-4.15, linux-hwe, linux-kvm, linux-oracle, linux, linux-aws, linux-kvm, linux-l … ⌘ Read more
@prologic@twtxt.net sweet! Is it going to be your new all-around desktop, or the hobbyist server, or all of the above?
Trump’s justice department to disband unit investigating crypto fraud
Anna Betts, - The Guardian (U.K.)
_Stephan: I think history is going to record this period of American history as the most corrupt in 250 years. And it is also blatantly obvious. You suspect as well as I do, I bet, that at least several MAGAt leaders in the “emperor’s” regime made millions in this ongoing manipulated tariff crime. But that is just one piece of what is going on. Just … ⌘ Read more
SqliteCache
backend I'm working on here, what are your thoughts regarding mgirations from old MemoryCache
(which is now gone in the codebase in this branch). Do you care to migrate at all, or just let the pod re-fetch all feeds? 🤔
@abucci@anthony.buc.ci Apologies, the basic summary is as follows:
- Decided to rewrite the cache backend.
- It will now be a SQLite backend going forward.
- I’m planning on no data migration.
Go - MCP SDK 新玩法:實現海報生成 MCP Server 與 DeepChat 無縫集成
DeepChat 是國內主導的一個非常優秀的智能助手,開源 2 個月,已經收穫 1k+ 的粉絲關注,最近聽說新版本已經支持 MCP,迫不及待開始嚐鮮。但做個什麼插件好了,無意看到阿里雲的 “創意海報生成” 接口文檔,索性給 DeepChat 添加一個 “海報生成” 的功能。構建 MCP Server 看過我前面文章的小夥伴應該知道,我以前一般使用 mark3labs/mcp-go 這個庫,但發現國 ⌘ Read more
Go 語言新版的迭代器是怎麼個事
很多流行的編程語言中都以某種方式提供迭代器,其中包括 C++、Java、Javascript、Python 和 Rust。Go 語言現在也加入了迭代器。iter 包是 Go 1.23 新增的標準庫,提供了迭代器的基本定義和相關操作。爲什麼需要迭代器——–在 Go 1.18 引入泛型之後,便可以很方便的定義一些泛型容器類型來提升編碼效率。例如我們可以基於 map 類型定義了一個集合類型—— ⌘ Read more
I’m going to cry why is he so cute ⌘ Read more
I feel like they’re going to tell me a riddle. ⌘ Read more
Aside from fetching feeds every three minutes (which kind of adds mystery to this puzzle), I think there is something else going on with the client you are using, @andros@twtxt.andros.dev. Some of those twtxts are seconds apart, making me truly stumped. 😅
USDA to slash headquarters, other staff and relocate some to new ‘hubs’ around the country
Eric Katz, Senior Correspondent - Government Executive
_Stephan: The Department of Agriculture is being torn apart and moved out of Washington, D.C. entirely. The impact this is going to have on the wellbeing of farmers, whose average age is about 59, is going to be devastating. That guarantees that your grocery prices of anything those farmers … ⌘ Read more
利用 Katana 作爲 Go 庫實現高性能 Web 爬蟲
在信息收集、安全測試等領域,高性能、高併發的 Web 爬蟲工具是核心基礎設施之一。ProjectDiscovery 出品的 Katana 是一個基於 Golang 編寫的輕量級爬蟲,它默認以 CLI 工具形式提供。但實際上,它也可以作爲庫被直接集成進你的 Go 項目中,從而實現更靈活的定製。本文將介紹:Katana 的設計理念與功能,如何將 Katana 作爲庫引入到我們的項目當中,如何編寫自定義 ⌘ Read more
golang 每日一庫之高性能無鎖隊列 bruceshao-lockfree
bruceshao/lockfree 是一個基於 Go 語言實現的高性能無鎖隊列庫,旨在通過無鎖(Lock-Free)算法提升多線程環境下的併發性能。其設計靈感來源於 Java 的 Disruptor 框架,但針對 Go 語言的特性進行了優化,適用於高吞吐量、低延遲的場景,如實時數據處理、高頻交易系統等。以下是該庫的核心特性、實現原理、性能對比及使用場景的詳細分析:核心特性無鎖設計基於 CAS(C ⌘ Read more
@prologic@twtxt.net “Indiana, let it go” 😂
@lyse@lyse.isobeef.org I think we found a bug in the lextwt parser actually 😅
@kat@yarn.girlonthemoon.xyz It’s very well hidden, it took me a while to find that. Go to “Settings” in the menu bar up top → “Profile and Privacy” (already selected) → on the right at “User Info” → “1 Muted” → click the link with the minus in the circle at the message you want to unmute.
@prologic@twtxt.net @bender@twtxt.net @movq@www.uninformativ.de I’m going to join the party in Down Under. :-)
@thecanine@twtxt.net I’m so sorry I fucked things up 🥲 I hope you can trust I’ll try to do a better job of backups and data going forward 🤗
📣 I’m going to try and restore a few accounts tonight 🤞
@bender@twtxt.net i had to go to your instance to see the root post because I ACCIDENTALLY MUTED THE THREAD LMFAOOOOO but interesting re: unfollowing!
@@example.com
where the first
@kat@yarn.girlonthemoon.xyz I’M SO TIRED I FORGOT WHERE I WAS GOING WITH THIS
Adding to this, we already tried. It didn’t go too well. Slightly related—because it is a third party “integration”—I might be a “smaller group” member, but I don’t care much about one-way feeds (mostly RSS from blogs, news articles, etc.) either.
Fifty Years of Open Source Software Supply Chain Security (Queue)
ACM Queue looks at\
the security problem in the light of a report on Multics security that
was published in 1974.
We are all struggling with a massive shift that has happened in the
past 10 or 20 years in the software industry. For decades, software
reuse was only a lofty goal. Now it’s very real. Modern
programming environments such as Go, Node, and Rust have made it
trivial to reuse work by others, but our … ⌘ Read more
@prologic@twtxt.net let’s all go to Australia! We crash on prologic’s house; got enough inflatable mattresses, mate? 😅
‘Turbulence far away’: NYT exposes Trump ‘moneymaking weekend’ amid huge ‘market meltdown’
David McAfee, Senior Editor - Raw Story
_Stephan: As the days go on psychopath “emperor” Trump makes it ever more clear how little he is concerned with actual governing in a democracy sense. He shows Americans by his daily actions that he sees them as peasants and himself as above their petty wellbeing. And, because the corrupt U.S. Supreme Court p … ⌘ Read more
‘Oligarchy’: Trump exempts big oil donors from tariffs package
Dharna Noor, Fossil Fuels and Climate Reporter - The Guardian (U.K.)
_Stephan: I keep watching to see whether American voters are clear that as long as psychopath “emperor” Trump is President nothing is going to be done to prepare and obviate the impact of climate change on their lives. He is completely corrupt and in the service of the carbon oligarchs who bought him his office. Do you think MAGAt … ⌘ Read more
效率工具:使用 air 熱重載 Go 應用程序
在項目開發階段,熱重載技術非常有用,通過熱重載,可以實現在無需手動干預的情況下,修改代碼文件後,自動重啓 Go 應用。這極大地提升了開發體驗,同時也節約了我們的開發時間。本文我們一起來體驗一下使用 air 熱重載 Go 應用程序,提高開發效率。簡介air 是爲 Go 應用開發設計的一款支持熱重載的命令行工具。以下是 air 官方總結的特色:• 彩色的日誌輸出 • 自定義構建或必要的命令 ⌘ Read more
Go API 中的上下文取消機制
在分佈式系統和微服務架構中,高併發請求和資源管理是每個開發者必須面對的挑戰。尤其是在處理長時間運行的任務時,如何實現優雅的取消和超時控制,直接關係到系統的穩定性和用戶體驗。Go 語言通過context包提供了一套標準化的解決方案,本文將深入探討其核心用法與最佳實踐。 上下文(Context)的本質與作用——————context.Context是 Go 語言中用於傳遞請求範 ⌘ Read more
@prologic@twtxt.net In all my two Go projects I use modernc.org/sqlite
and can’t complain. Works great for me.
Grab the iPhone 16e Default Wallpaper
Perhaps you recently saw that Apple had released the iPhone 16e and drooled with envy at the iPhone 16e default wallpaper, which sort of looks like a drop of Liquid Metal (why did macOS Sequoia autocorrect capitalize “Liquid Metal”? Who knows, but it did it again, so let’s go with it) or maybe a water … Read More ⌘ Read more
@arne@uplegger.eu I’m very glad I only rarely have to deal with .docx & Co. And when I have to, 99% is in read mode only. Even though, I don’t think that Markdown is the best choice, I use it on a daily basis. Some things, like links, in reStructuredText are better in my opinion.
Jira just resists to switch to Markdown and forces us to use its silly markup language.
For real typesetting, LaTeX is the way to go. But I very, very rarely do that.
[$] Page allocation for address-space isolation
Address-space isolation may well be, as Brendan Jackman said at the
beginning of his memory-management-track session at the 2025 Linux Storage,
Filesystem, Memory-Management, and BPF Summit, “some security
bullshit”. But it also holds the potential to protect the kernel from
a wide range of vulnerabilities, both known and unknown, while reducing the
impact of existing mitigations. Implementing address-space isolation with
reasonable performance, though, is going to require some signific … ⌘ Read more
Markdown and the Slow Fade of the Formatting Fetish - a nice article about Markdown VS proprietary formatting. With quotes like “Microsoft Office works in an office where you pretend to work until you can finally go home.” 😄
使用 Go 構建併發的 KV 存儲系統
帶你使用 Go 編寫一個簡單的 KV 存儲系統,使用Fiber框架,支持併發操作並實現 TTL 功能。通過本教程,你可以:瞭解 KV 存儲的底層工作原理 瞭解 CRUD 如何實現 瞭解併發處理,比如鎖的使用 瞭解 TTL 功能如何實現 初始化項目——–首先,創建一個新的項目目錄並進行初始化:go mod init mszluKV安裝依賴——-//fiber ⌘ Read more
基於 Go 構建百萬級反向代理服務
在現今 Web 開發中,高效安全地管理海量流量是系統架構設計的核心命題。反向代理作爲客戶端與後端服務之間的智能調度器,已成爲應對高併發場景的利器。1. 反向代理反向代理是一種位於服務器端的代理服務器,它代表後端服務器接收客戶端的請求,並將請求轉發到內部網絡中的實際服務器,最終將服務器的響應返回給客戶端。負載均衡:通過輪詢 / 加權算法分發請求至多臺後端服務器 安全防護盾:隱藏真實服務器 IP ⌘ Read more
Widespread firings start at federal health agencies including many in leadership
Rob Stein, Sydney Lupkin, Selena Simmons-Duffin, Joseph Shapiro, Carmel Wroth, and Yuki Noguchi, Staff Writers - npr
_Stephan: Today psychopath “monarch” Trump gutted your healthcare. The result is going to be not just increased death, as Senator Bernie Sanders said, but a significant increase in avoidable injuries and illnesses. The lifespan of Americans is alr … ⌘ Read more
@movq@www.uninformativ.de @xuu@txt.sour.is That sounds like kat! :-)
Is there some Makefile shenanigans going on maybe? $V
and $C
being swallowed by the Makefile. I fell in that trap again the other day.
well, that leads to a long conversation.
Piracy is a difficult topic which is very personal, so I won’t say much about it.
On writing books, I’ve tried along with other digital products such as courses and videogames, and I got to confess that it has been hard for me.
If it helps, I think it all reaches our expectations on the activity and the result. If royalties is the expectation, it’s going to be slow. By 5% of royalties, for a rough example, a huge amount of sales will be required to get a decent “wage”, so I’ve understood of doing it by the side of a normal employment although it has been discouraging and a bit sad.
I have reflected about it in Spanish here: https://sembrandojuegos.substack.com/p/sobre-expectativas-al-crear-juegos
@prologic@twtxt.net Fully agreed. I’m far more likely to buy such mediums when DRM-free. I never go near Amazon eBooks etc because of their lock-in, and I have a Kobo eReader which needs to have the books side loaded unless directly from the Kobo store. I prefer DRM-free files every time.
使用 Go 實現服務端事件推送 SSE
背景–在對內部 CRM 項目進行優化時,我們發現項目中的站內信功能目前採用了 WebSocket 來實現消息推送。然而,對於站內信這種低頻的推送場景來說,維護一個長連接的成本相對較高。WebSocket 通常用於需要實時雙向通信的應用,而我們需要的只是簡單的單向推送。經過考慮,我們決定使用一種更輕量級的技術——Server-Sent Events(SSE)來實現站內信的推送。這種技術不僅可以減 ⌘ Read more
使用 Go 進行 SSH 隧道:輕鬆構建安全通道
使用 Go 進行 SSH 隧道:輕鬆構建安全通道 ————————-SSH 隧道常常被用來安全地穿越防火牆、保護數據傳輸以及遠程訪問受限服務。本文將帶你一步步瞭解如何用 Go 語言搭建一個 SSH 隧道,並結合實際案例分享一些個人經驗和最佳實踐,讓你輕鬆上手這一強大工具。 什麼是 SSH 隧道? —————SSH 隧道(SSH Tunnel)是 ⌘ Read more
Going back to old MemoryCache
for now and going to bed 🛌
搞懂常見 Go ORM 系列 - Ent 框架詳解
在 Go ORM 開篇中我們將 Go ORM 框架分成了三類🌲 反射型主要通過反射機制將結構體映射到數據庫表上,代表作爲 go-gorm/gorm🌲 代碼生成型通過代碼生成工具預先生成數據模型及查詢構建器,代表作有 ent/ent 和日益流行的 go-gorm/gen🌲 SQL 增強型基於原生 SQL 庫進行封裝和擴展,既保留 SQL 的靈活性,又提供了一系列便捷函數,代表作爲 jmoiron/s ⌘ Read more
Go 語言錯誤處理:Panic 與 Error 的抉擇
在 Go 語言的開發實踐中,錯誤處理機制是構建健壯應用程序的核心要素。與其他語言不同,Go 通過顯式的錯誤返回和獨特的 panic/recover 機制形成了獨特的錯誤處理哲學。本文將深入探討 panic 與 error 的本質區別,並通過實際場景分析幫助開發者做出正確的技術選擇。 錯誤處理機制的核心差異———–Error 的顯式傳遞特性Go 語言將 error 定義爲內置接口類型, ⌘ Read more
Go 1-25:工具鏈優化與運行時改進
Go 語言自誕生以來,始終保持着穩定的迭代節奏。2025 年 8 月即將發佈的 Go 1.25 版本在工具鏈、運行時、編譯器及標準庫等方面都帶來了值得關注的改進。本文將從實際開發角度出發,詳細解析這些變化的技術細節及其對開發者產生的實際影響。工具鏈增強—–構建系統優化go build命令的-asan選項在 1.25 版本中默認啓用了內存泄漏檢測機制。該功能會在程序退出時自動檢查未釋放的 C ⌘ Read more
** Late March Snow **
The forecast predicted snow, but even with that knowledge I held out hope that it wouldn’t. The shade over the window in the bedroom doesn’t close all the way. It always stops short of totally covering the window with about an inch further to go. It is too short. When I woke up this morning there was a flat grey line of light streaming into the room through the gap left by the too short shade. So, I spent some time shoveling this morning. Probably sooner than I ought to have since it’s still coming down. It’s 80ish de … ⌘ Read more
Canada Announces Bombshell Break With U.S. Over Trump
, -
_Stephan: MAGAt monarch Trump is singlehandedly destroying a 200-year-old friendship and working partnership between the United States and Canada. The effect this is going to have on U.S. communities is going to be devastating. Trump is a resentful psychopath and not smart enough to realize that Canada will very quickly find alternative buyers for their raw materials and products, while America will have to fin … ⌘ Read more
Ehhh yeah, what could go wrong 🤔 😵💫
Trump is a Threat to the Entire Human Species
John B. Alexander, Commentator - Daily Kos
_Stephan: As MAGAt dictator Trump’s regime continues its coup, although I am beginning to see ordinary Americans turning out in opposition, I still don’t see media or ordinary Americans acknowledging that this devastation of the country’s democracy is disordering the entire world and endangering the matrix of life on Earth, and that it is going to take years to repair this damage. John Al … ⌘ Read more
RFK Jr.’s Mass Layoffs: How Many Jobs Top Health Agencies Will Lose
Kristina Fiore, Director of Enterprise & Investigative Reporting - MedPage Today
Stephan: The United States already has the lowest-ranked and most expensive healthcare system in the developed world. Now, as the fascists continue their coup, it is going to get worse. The vast majority of Americans have no idea what good healthcare is actually like.
NIH Ends Future Funding to Study the Health Effects of Climate Change
Annie Waldman and Sharon Lerner, Health Car Reporter | Health and Environment Reporter - ProPublica
_Stephan: MAGAt Monarch Trump and his regime are very pointedly doing nothing to prepare for climate change. Indeed, they deny it exists as a real alteration in the ecosystems of Earth. So no funding for healthcare to prepare for what is demonstrably happening. It is going to create … ⌘ Read more
Go 語言中 Redis 管道的性能潛力
在現代分佈式系統架構中,Redis 憑藉其卓越的性能表現已成爲不可或缺的緩存和數據存儲組件。但在高併發場景下,如何突破網絡 I/O 瓶頸成爲開發者面臨的重要挑戰。本文將深入探討 Go 語言中 Redis 管道的實現原理,並通過詳實的代碼示例展示其性能優化之道。Redis 交互模式的演進之路—————傳統 Redis 客戶端的工作模式遵循 “請求 - 響應” 的同步範式。當執行S ⌘ Read more
golang 每日一庫之 base64Captcha
今天要介紹的庫 mojocn/base64Captcha 是一個用於 Go 語言的高效驗證碼生成庫,支持圖片、音頻等多種驗證碼格式,並且可以通過 base64 編碼輸出,方便前端直接使用。該庫廣泛用於 Web 應用、REST API 以及需要身份驗證的系統中,以增強安全性。主要功能——–支持多種驗證碼類型數字驗證碼 (DriverDigit):僅包含數字,適用於一般驗證碼場 ⌘ Read more
golang 每日一庫之 go-pinyin
go-pinyin 漢字轉拼音庫今天要介紹的庫是一個拼音庫,這個庫相對比較冷門,但是開發過母嬰類 app 的道友可能知道。go-pinyin 是一個用於將漢字轉換爲拼音的 Golang 庫,提供多種模式,支持帶音調、無音調、首字母提取等功能。該庫適用於拼音搜索、漢字排序、文本轉換等場景。安裝——使用 go get 下載安裝:go get -u github.com/mozillazg/go ⌘ Read more
使用 Go 構建 MCP Server
一、MCP 介紹 ———1. 基本介紹 MCP(Model Context Protocol,模型上下文協議)是由 Anthropic 公司(Claude 大模型的創造者)於 2024 年 11 月推出的一種開放標準協議,旨在統一大型語言模型(LLM)與外部數據源和工具之間的通信方式。MCP 的核心目標是解決當前 AI 應用開發中的數據孤島和碎片化集成問題。2. 協議特點 MCP 可以 ⌘ Read more
@prologic@twtxt.net In all seriousness: Don’t worry, I’m not going to host some Fediverse thingy at the moment, probably never will. 😅
But I do use it quite a lot. Although, I don’t really use it as a social network (as in: following people). I follow some tags like #retrocomputing, which fills my timeline with interesting content. If there was a traditional web forum or mailing list or even a usenet group that covered this topic, I’d use that instead. But that’s all (mostly) dead by now. ☹️
Wait! What’s going on?! 🧐
Apple’s Mac Site Features Fictional ‘Lumon Terminal Pro’
Apple is going all out with promotions for the popular Severance Apple TV + show today, and as of right now, you’ll find a new “Lumon Terminal Pro” listed on Apple’s Mac site.
The Lumon Terminal Pro is designed to look similar to the machines that Severance employees like Mark … ⌘ Read more
WebSockets 在 Go 中的應用:從基礎到實踐
WebSockets 提供了一種強大的雙向通信方式,使客戶端(如 Web 瀏覽器)與服務器能夠實時交換數據。與傳統的 HTTP 請求 - 響應模型不同,WebSockets 允許全雙工通信,即客戶端和服務器可以隨時獨立發送和接收消息。因此,WebSockets 非常適合用於聊天應用、實時數據推送和交互式遊戲等場景。在本篇文章中,我們將使用 Gin 框架和 gorilla/websocket 庫,搭 ⌘ Read more
構建可維護的 Go 項目:整潔架構實踐指南
在快速迭代的軟件開發過程中,如何構建長期可維護的代碼庫始終是開發者面臨的重大挑戰。本文將以 Go 語言爲例,深入探討整潔架構(Clean Architecture)的核心思想及其在工程實踐中的具體實現方式。通過系統性分層、接口隔離和依賴管理,我們將展示如何打造具備高可測試性、低耦合度的現代化 Go 項目。 整潔架構的核心設計原則———–整潔架構由 Robert C. Martin 提 ⌘ Read more
I now subscribed to most feeds in my Go tt
reimplementation that I already followed with the old Python tt
. Previously, I just had a few feeds for testing purposes in my new config. While transfering, I “dropped” heaps of feeds that appeared to be inactive.
This might motivate me to actually “finish” the new client, so that it could become my daily driver. No need to use the old software stack any longer. Let’s see how bad this goes.
[$] Development statistics for 6.14
By the time that Linus Torvalds released
the 6.14 kernel, 11,003 non-merge changesets had been pulled into the
mainline, making this one of the smallest releases we have seen in some
time. Indeed, one must go back to the 4.0\
release, which happened almost exactly ten years ago, to find a release
with fewer changesets than 6.14. Even so, “small” is relative, and 6.14
contains a lot of significant changes. ⌘ Read more
爲什麼 Go 語言的錯誤處理其實設計得很好
Go 的臭名昭著的錯誤處理 [1] 引起了編程語言圈外人士的廣泛關注,常常被認爲是該語言最具爭議的設計決策之一。如果你瀏覽 Github 上任何一個用 Go 編寫的項目,幾乎可以保證你會看到以下代碼行比代碼庫中的其他部分出現得更頻繁:if err != nil { return err}對於剛接觸這門語言的人來說,這可能顯得多餘且不必要,但 Go 將錯誤視爲一等公民(值)的原因,深深植根於編 ⌘ Read more
Go Http 框架性能測評: Fiber vs- Gin vs- Go 標準庫
本內容是對知名性能評測博主 Anton Putra Fiber vs. Gin vs. Go (stdlib): Performance (Latency - Throughput - Saturation - Availability)[1]: Performance (Latency - Throughput - Saturation - Availability) 內容的翻譯與整理, 有適 ⌘ Read more
@movq@www.uninformativ.de Yeah, most of the graphical applications are actually KDE programs:
- KMail – e-mail client
- Okular – PDF viewer
- Gwenview – image viewer
- Dolphin – file browser
- KWallet – password manager (I want to check out
pass
one day. The most annoying thing is that when I copy a password, it says that the password has been modified and asks me whether I want to save the changes. I never do, because the password is still the same. I don’t get it.)
- KPatience – card game
- Kdenlive – video editor
- Kleopatra – certificate manager
Qt:
- VLC – video player
- Psi – Jabber client (I happily used Kopete in the past, but that is not supported anymore or so. I don’t remember.)
- sqlitebrowser – SQLite browser
Gtk:
- Firefox – web browser
- Quod Libet – music player (I should look for a better alternative. Can’t remember why I had to move away from Amarok, was it dead? There was a fork Clementine or so, but I had to drop that for some unknown reason, too.)
- Audacity – audio editor
- GIMP – image editor
These are the things that are open right now or that I could think of. Most other stuff I actually do in the terminal.
In the past™, I used the Python KDE4 bindings. That was really nice. I could pass most stuff directly in the constructor and didn’t have to call gazillions of setters improving the experience significantly. If I ever wanted to do GUI programming again, I’d definitely go that route. There are also great Qt bindings for Python if one wanted to avoid the KDE stuff on top. The vast majority I do for myself, though, is either CLI or maybe TUI. A few web shit things, but no GUIs anymore. :-)
@movq@www.uninformativ.de Where can I join your club? Although, most software I use is decentish in that regard.
I just noted today that JetBrains improv^Wcompletely fucked up their new commit dialog. There’s no diff anymore where I would also be able to select which changes to stage. I guess from now on I’m going to exclusively commit from only the shell. No bloody git integration anymore. >:-( This is so useless now, unbelievable.
Security updates for Monday
Security updates have been issued by Debian (libxslt, mercurial, and webkit2gtk), Fedora (chromium, dotnet8.0, ffmpeg, jupyterlab, and kitty), Mageia (expat and libxslt), Red Hat (pcs), SUSE (apptainer, chromium, kernel, libarchive, mercurial, python311, radare2, xorg-x11-server, and zvbi), and Ubuntu (golang-github-cli-go-gh-v2 and nltk). ⌘ Read more
There Are Four Things You Must Do to Save America
Stephan A. Schwartz, Editor - Schwartzreport
_Stephan: As I was researching stories for today’s SR, I did a podcast with a host named Helen Cowan. She asked me what I thought was going on in the United States, and what I thought ordinary people could do to preserve the nation’s democracy and avoid the country being owned by oligarchs. As I answered her I thought that rather than do the usual four trend stories … ⌘ Read more
Trump’s funding ax throws colleges into an existential crisis
Erica Pandey, - Axios
_Stephan: The Trumpian authoritarian coup continues, and democracy dissipates; all of this following Hitler’s action list point by point. What stands out for me is how weak the institutional resistance is. Universities are docilely falling to their knees. Law firms are proving equally craven. There is only one way this is going to stop. You – and I mean you – must participate … ⌘ Read more
Ctrl+Left
to jump a word left, I get 1;5D
in my tt2 message text. My TERM
is set to rxvt-unicode-256color
. In tt
, it works just fine. When I change to TERM=xterm-256color
, it also works in tt2
. I have to read up on that. Maybe even try to capture these sequences and rewrite them.
Well, some time ago I put this in my ~/.Xdefaults:
URxvt.keysym.Control-Up: \033[1;5A
URxvt.keysym.Control-Down: \033[1;5B
URxvt.keysym.Control-Left: \033[1;5D
URxvt.keysym.Control-Right: \033[1;5C
Probably to behave more like XTerm and fix a few other issues I had with other programs. But, it turns out, tcell expects the original sequence: https://github.com/gdamore/tcell/blob/main/terminfo/r/rxvt/term.go#L487
Hmm.
@movq@www.uninformativ.de hahahah i for one hate sleeping and need to be busy 24/7 or else i go insane so server stuff is awesome for my ADHD ass!!!
IaaS does seem kinda interesting to me, i think i could vibe with that more than full on cloud stuff
i hope i can be one of those people who does the barebones stuff bc i am a rare sicko who finds it fun and cloud stuff scares me LMAOOOO
What to do in London near the KubeCon + CloudNativeCon Europe 2025 Venue, part one
London’s calling and our local CNCF Ambassadors have answered with some great ideas of things to do close to the KubeCon + CloudNativeCon Europe 2025 venue. Cross the river Since our event is going to be… ⌘ Read more
‘Absolute chaos’ at Dept of Agriculture could skyrocket rural grocery prices: report
Brad Reed, Staff Writer - Raw Story
_Stephan: The United States as I predicted is going into recession, and your groceries prices are going to go up. We are at a moment of truth we have not experienced since the Founders created the United States. We are no longer a functioning democracy, and the authoritarian government that now runs the country cares noth … ⌘ Read more
US measles outbreak tops 300 cases — what to know about the disease
Emily Cooke, Staff Writer - Live Science
_Stephan: Because of the destruction of the healthcare agencies in the United States by psychopath Trump, his Frankenstein oligarch Musk, and the flying monkeys of DOGE, I predict we are going to see more pandemics. Measles, now above 300 cases, has spread to a number of states beyond Texas – Alaska, California, Florida, Georgia, Kentucky, Maryland … ⌘ Read more
從 Shell 到 Go:腳本編寫的優雅進化
你有沒有想過,寫腳本這件事,可能不再需要依賴 Unix Shell 了?別誤會,Shell 確實是個 “魔法工具”,能用一行命令完成許多複雜任務。但如果你是 Go 語言的愛好者,或者正在尋找一種更現代化、更高效的腳本編寫方式,那麼今天這篇文章絕對會讓你眼前一亮!我們將深入探討如何用 Go 語言結合script包,輕鬆實現原本需要 Shell 才能完成的任務。不僅代碼更優雅,還能跨平臺運行,甚至 ⌘ Read more
golang 每日一庫之 gopsutil
shirou/gopsutil 是一個用 Go 語言實現的跨平臺系統信息採集庫,其設計靈感來源於 Python 的 psutil。它爲開發者提供了一套統一、簡潔的 API,用於獲取底層操作系統的各項指標數據,如 CPU、內存、磁盤、網絡、主機信息以及進程狀態等。下面我們將從多個方面詳細介紹這個庫的功能、設計特點、使用示例以及應用場景。庫簡介——跨平臺支持 gopsutil ⌘ Read more
使用 Golang-OpenCV 獲取攝像頭視頻流: 從原理到實踐
在現代計算機視覺應用中,實時視頻處理是一個重要的功能,例如監控系統、人臉識別、手勢檢測等。而 Go 語言結合 OpenCV 可以高效地實現攝像頭數據的採集和處理。在本篇文章將會簡單的講解,OpenCV 處理視頻流的基本步驟,原理和如何使用 gocv 這個庫來讀取攝像頭畫面。安裝 OpenCV因爲我用的是 mac 電腦所以,我使用 homebrew 進行 opencv 的安裝,其他平臺例如 arch ⌘ Read more
Golang 擴展 osquery,讓系統查詢更強大!
在深圳有很多老闆都很奇葩,比如我的前老闆,需求是半夜給的,效果是要早上看到的,我要感謝我的的前老闆,讓我接觸到了聞所未聞的新奇技術。今天要分享的內容是 osquery 這個東西,不知道各位萬能的網友們知不知道。osquery 是一個強大的開源工具,它能讓我們像查詢數據庫一樣獲取操作系統信息。而 osquery-go 則是官方提供的 Golang SDK,可以讓我們擴展 osquery,添加自定義查 ⌘ Read more
@movq@www.uninformativ.de I have no doubt that you’re not seeing the images correctly 😀. It’s just that it’s broken when viewing them, in my case, and analyzing the URLs, I’ve seen everything I mentioned.
Regarding the hash, you’re right. I’ll have to investigate what’s going on. I’m having a hard time getting the hash generation to work properly.
使用 Go 實現 License 認證
在軟件授權管理中,License 機制可以有效防止未授權使用,確保軟件的合法性。本篇文章將講解如何使用 Go 生成機器碼、創建 License、驗證 License 及防止時間篡改,並提供完整可運行代碼示例,以讓您理解其中的邏輯。License 機制概述在軟件授權體系中,License(許可證)是用於驗證軟件的合法使用權限的一種機制。常見 License 設計包含以下關鍵要素:機器碼:用於唯一標識 ⌘ Read more
chromem-go:Go 語言 RAG 應用的高效輕量級向量數據庫
前言在開發 RAG(Retrieval-Augmented Generation)應用時,起初你可能更傾向於選擇一款輕量級的向量數據庫,而非複雜的大型數據庫。例如,在關係型數據庫的選擇上,許多人會更願意使用 SQLite 而不是 PostgreSQL 或 MySQL,以減少額外的配置和維護成本。在 Go 語言中,chromem-go 提供了一種簡潔高效的解決方案——它是一款可嵌入到 Go 程序中的 ⌘ Read more
** A day off **
I didn’t go to work today. Six month ago I took the day off when I made my kids a dentist appointment. So, this morning I took them to the dentist where we played Mario Kart in the waiting room on the Nintendo the dentist keeps set up there.
After that, I dropped them each at school and picked up my dad and took him to Costco and to the Chinese takeaway place. While he gossiped with the folks at the takeaway I started Sally Rooney’s Normal People. I’m late to this book, but enjoying it right away.
After all th … ⌘ Read more
@lyse@lyse.isobeef.org interesting! yeah i figured it was some parsing stuff going on
Found this girl in the undercarriage of my car just over a year ago. How it started and how its going: ⌘ Read more
Trump asks Supreme Court to curb judges’ power to block policies nationwide
Josh Gerstein, Staff Writer - Politico
_Stephan: Trump has taken his authoritarianism to the Supreme Court and I predict we are coming to a moment of truth for the future of the United States. Trump is clearly banking on the corrupt fascists on the Court to rule in his favor, and I understand this thinking. But strangely, I’m not sure it is going to play out as he hopes. I … ⌘ Read more