Hi there 👋

Welcome to my blog

解决 "undeclared name: any (requires version go1.18 or later)" 编译错误

$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest $ $ protoc-gen-go --version protoc-gen-go v1.34.2 $ $ sh make.sh user.pb.go:123:45: undeclared name: any (requires version go1.18 or later) $ 流水线编译报错,其中make.sh文件代码: ... protoc -I=./ --proto_path=./ --go_out=./ --go_opt=paths=source_relative user.proto ... go build 同样的代码在本机编译就没问题...

2024-06-14 · 1 min · 473 words · Liudon

搭建自托管IPFS Gateway服务,替代Cloudflare的IPFS Gateway

背景 4月底的时候,Livid大佬提醒,Cloudflare应该是调整了IPFS Gateway网关策略,我的IPFS镜像博客无法访问了。 没查到...

2024-05-22 · 3 min · 1262 words · Liudon

302跳转的跨域问题(CORS)

302跳转的跨域问题 场景一:302不返回跨域头 请求 GET /302 HTTP/1.1 Host: liudon.xyz Origin: https://www.baidu.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 返回 HTTP/1.1 200 OK Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Cf-Ray: 88535773eaf5107e-HKG Content-Length: 143 Content-Type: text/html Date: Fri, 17 May 2024...

2024-05-17 · 2 min · 721 words · Liudon

GORM增加sqlcommenter特性

什么是sqlcommenter? sqlcommenter is a suite of middlewares/plugins that enable your ORMs to augment SQL statements before execution, with comments containing information about the code that caused its execution. This helps in easily correlating slow performance with source code and giving insights into backend database performance. In short it provides some observability into the state of...

2024-04-18 · 2 min · 742 words · Liudon

源码分析:GORM是如何生成sql的

在gorm下实现sqlcommenter过程中,遇到一些问题,顺便把gorm整个流程梳理了一遍,整理记录一下。 gorm使用示例 package main import ( "gorm.io/driver/mysql" "gorm.io/gorm" )...

2024-04-18 · 6 min · 2737 words · Liudon

工银亚洲网银密码重置

18年的时候办了张工银亚洲的银行卡,好几年没有用过了。 今年想起来了,发现网银登不上了,密码忘了。 最悲剧的是,试了超过10次,账户冻结了。 打9...

2024-03-16 · 1 min · 481 words · Liudon

加速Cloudflare访问

背景 这是当前的博客架构,文件保存在Github仓库,通过Cloudflare Page提供访问。 众所周知,在国内,Cloudflare的CDN...

2024-02-21 · 3 min · 1128 words · Liudon

2023年终总结

2023年过完了,是时候来个总结了。 博客 2023年一共更新了15篇内容,共计12000字。 访问Top3的文章: 将博客部署到星际文件系统(IP...

2024-01-04 · 2 min · 748 words · Liudon

2023年12月北京暴雪记录

记录暴雪下普通打工人的生活。 12月14日 周四 北京的雪已经连着下了两天了。 12月11日,也是因为下雪,晚上打车打到10点半才叫到车。 所以这次下...

2023-12-16 · 2 min · 599 words · Liudon

使用Hugo实现响应式和优化的图片

继续我们的博客优化之旅,本篇内容我们将介绍如何使用Hugo实现响应式和优化的图片。 问题 在之前文章里,通过腾讯云数据万象实现了图片优化能力,具...

2023-12-10 · 5 min · 2021 words · Liudon

加速Google Analytics

起因 Google Analytics是一款优秀的流量分析服务,集成方便,使用简单。 最近在优化页面访问速度,发现Google Analytics是一个优化点...

2023-12-02 · 2 min · 870 words · Liudon

使用Google Indexing API加速博客收录

对于一个新站点来说,总是想着能让搜索引擎快点收录网站内容。 今天,我们就来介绍一种利用Google Indexing API接口,通过Github Actions...

2023-10-27 · 2 min · 635 words · Liudon

在Netlify上部署Twikoo评论系统

在本篇文章里,我会介绍如何在Netlify上部署Twikoo评论系统,如何接入到静态博客Hugo,以及如何实现Twikoo系统版本自动更新。...

2023-10-19 · 5 min · 2117 words · Liudon

利用Github Actions定时抓取微博

背景 在微博上关注了一些用户,比如tk教主,月风。 但是有些内容过段时间不可见了,所以希望可以定时抓取微博归档备份下来。 实现方案 整体思路:利用G...

2023-10-07 · 2 min · 823 words · Liudon

北大口腔牙周刮治记录

病情 上次洗完牙后,还是不时有出血的情况。 前段时间更是出现牙龈劈开一块肉,特别容易塞东西的情况。 于是,又跑到医院来看牙了。 医生检查后,说是牙周...

2023-09-17 · 2 min · 716 words · Liudon

故乡回忆之旅

赶在8月底,趁着娃暑假的尾声,回了趟老家。 老家有条俗语,“永福庄的街,三里长”。 这天吃完午饭,临时起意,带媳妇溜溜大街,见识下我们的大街。 小...

2023-09-09 · 1 min · 292 words · Liudon

解决Golang使用go get安装包后找不到可执行文件的问题

背景 编译流水线代码 go get google.golang.org/protobuf/cmd/protoc-gen-go@latest protoc -I=./zzz --proto_path=./xx --go_out=./abc --go_opt=paths=xx.proto ... go build -o xxx 在go升级到1.20.1版本后,执行报错。 protoc-gen-go: program not found or is not executable 解决 Starting in Go 1.17, installing executables with go get is deprecated. go install may be used instead....

2023-08-17 · 1 min · 195 words · Liudon

修正Hugo的JSON Feed格式

问题背景 前几天在Planet里follow自己的web3博客,遇到下面的错误。 经过Livid大佬提醒,说是网站的JSON Feed不是标准格式...

2023-03-25 · 3 min · 1451 words · Liudon

我的学车之路

之前在2022年终总结提到过,我在练车考驾照。 就在昨天,终于拿证了。👏👏👏 咱也是可以上路开车的人了,虽然比别人晚了快10年才拿证。🐶 2022...

2023-03-24 · 1 min · 375 words · Liudon
将博客部署到星际文件系统(IPFS)

将博客部署到星际文件系统(IPFS)

将博客部署到星际文件系统(IPFS)

在这篇文章,我将会介绍如何利用Github Actions将hugo博客自动部署到IPFS上,并通过自定义域名访问IPFS上的文件。 IPFS(...

2023-02-21 · 3 min · 1326 words · Liudon