惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
罗磊的独立博客
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
J
Java Code Geeks
V2EX - 技术
V2EX - 技术
Vercel News
Vercel News
N
News and Events Feed by Topic
腾讯CDC
P
Proofpoint News Feed
N
News | PayPal Newsroom
www.infosecurity-magazine.com
www.infosecurity-magazine.com
爱范儿
爱范儿
O
OpenAI News
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
D
Docker
Y
Y Combinator Blog
博客园 - 聂微东
G
Google Developers Blog
S
Security @ Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
S
Schneier on Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
C
CXSECURITY Database RSS Feed - CXSecurity.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
CERT Recently Published Vulnerability Notes
I
Intezer
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
博客园 - Franky
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
Scott Helme
Scott Helme
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 最新话题
C
Cybersecurity and Infrastructure Security Agency CISA

kmcd.dev

gRPC-Web Should Have Fixed gRPC Making Dynamic Protobuf Fast in Go Proxy, Record, and Mock gRPC APIs with FauxRPC Exploring Protocol Buffers Interactively Introducing ProtoDocs Ghost in the Shell: The Manga Behind the Anime The Hidden Cost of google.protobuf.Value Why Networking Built Its Own Data Modeling Language Zero-Friction Demos with WASM Let's Learn About BGP ConnectRPC: Where is it now? Building APIs with Contracts The Case for Greppable Code Unknown Fields in Protobuf IRC Log: Reactionary Faking protobuf data in Go Y'all are Sleeping on Mise-en-Place IRC Log: Standup 2 HTTP/2 From Scratch: Part 4 IRC Log: rm -rf /var/opt/gitlab/postgresql/data HTTP/2 From Scratch: Part 3 Building a Live BGP Map HTTP/2 From Scratch: Part 2 IRC Log: The Cloud Scale Incident Visualizing the Internet (2026) Shell Log: Namaste HTTP/2 From Scratch: Part 1 IRC Log: Standup HTTP/1.1 From Scratch WHOIS is dead, long live RDAP Months Considered Harmful Encryption vs. Compression On Creating My Own Cover Art Traceroute Tool from Scratch in Go My Favorite Interview Question From JSON to Protobuf Breaking gRPC Morse Code Can You Hack a Phone with Your Voice? Visualizing the Internet (2025) HTTP QUERY and Go I made a daily word game Protovalidate: Can Input Validation Be This Easy? Behold! The Barcode Scanner Mixing CEL and Protobuf for Fun FauxRPC and Protovalidate The Call of the Monolithic Codebase FauxRPC + Test Containers Self-Documenting Connect Services gRPC Over HTTP/3: Followup JSON to Protobuf Conversion gRPC: The Ugly Parts Working with Protobuf in 2024 Introducing FauxRPC HTTP/1.0 From Scratch Y'all are sleeping on HTTP/3 HTTP/0.9 From Scratch What version of HTTP are you using? Texans in Denmark gRPC Over HTTP/3 gRPC: The Good Parts Leaving Texas for Greener Pastures gRPC: The Bad Parts Unit Testing ConnectRPC Servers Adding chart.js to Hugo Why I'm Rebranding Benchmarking gRPC (golang) Blog Update gRPC From Scratch: Part 3 - Protobuf Encoding Tracking the Wins Visualizing the Internet (2024) Dropping Unknown Fields in ConnectRPC RESTless: Web APIs After REST Introducing unknownconnect-go Making gRPC more approachable with ConnectRPC Inspecting Protobuf Messages Introducing protoc-gen-connect-openapi gRPC From Scratch: Part 2 - Server gRPC From Scratch: Part 1 - Client Why you should use gNMI over SNMP in 2026 The Rollercoaster of Productivity in Side Projects Lessons from a Decades-Long Project How I learned to code Economists with (virtual) Guns Visualizing the Internet (2023) softlayer-python: language bindings/CLI for a cloud company SwFTP: SFTP/FTP Server For Openstack Swift Video: Morning Copenhagen Commute Goodbye Evepraisal Visualizing the spectrum of the sun (Part 2) Visualizing the Internet (2022) Evepraisal: A price estimation tool for Eve Online Visualizing the spectrum of the sun
Daily Prompts
2024-06-04 · via kmcd.dev

You may have noticed from my mastodon feed or from a link on the website’s navigation that I have added daily prompts. Each day is a new question to answer. You can respond to the post on Mastodon and it will appear (after some minutes) on this website. I’ve been doing it for the entire month of May and I intend to keep doing it to spur my thoughts and maybe others. I feel like having a question to answer each day helps give others context on who I am, what I’m doing and how I see the world. I have also found that it acts as a good way to reflect on things. I’ve wanted some answers to be different… so I now have some motivation to make them different.

So go and check out the prompts page.

The rest of this article talks about all of the pieces that went into making this happen behind the scenes, besides actually writing the prompts.

I wanted to show a banner image for the prompts… but using the same one every day seemed boring… So now I have a set of 6 banner images that I rotate through. Here’s how I did that with Hugo:

layouts/partials/prompts/load-cover.html

{{- $images := (resources.Match "images/prompt_covers/*") -}}
{{- return (index $images (mod .Date.Day (len $images))) -}}

This piece of code picks a new cover based on the day of the month, so the first of every month will have the same cover, for example. As I add more covers, the covers might shift over some number of days but I hope to eventually make 31 covers so each day of the month is unique. Notice that I used the return statement. This is a special Hugo-specific statement that allows you to return values from partials.

Here’s an example how how I use this partial in another template:

layouts/prompts/single.html

{{- $cover := (partial "prompts/load-cover.html" .).Fill "1520x400 Center webp q100" -}}
<figure>
    <img src="{{ $cover.RelPermalink }}" alt="{{ $cover.Title }}" />
</figure>

Mastodon “Comments”

I’ve changed a lot about how this website is deployed lately and hopefully, no one noticed… The biggest change was switching from GitHub Pages to Cloudflare Pages. At first, this was just a temporary change, because Cloudflare was going to make me wait an entire week before allowing me to use kmcd.dev with the pages website, so I adjusted the Github Action to publish to Cloudflare Pages instead and everything went pretty great with that. That got me thinking… I was scheduling GitHub Actions to post daily updates and I also had a separate posting schedule for Tuesday to publish a new post. That seemed both wasteful and limiting at the same time. So I came up with a plan.

Instead of using Github Actions or Cloudflare Workers to deploy my static website, I’m just going to do it myself, from my Synology NAS. This allowed me to have a much more frequent update schedule for my website if there were changes. You may ask: what does it mean to “have changes” for a static website? Changes can be one of the following:

  • I committed some changes that affected the website output
  • A scheduled post becomes live
  • A new mastodon post happened on my feed or there are other changes with the post (likes, favorites, boosts, edits etc.)
graph TD
    deployment[Deployment Script]
    cloudflarepages[fa:fa-cloud Cloudflare Pages]
    hugo[Hugo]
    deployment -- Git --> commits[Git Commits]
    deployment -- Git --> schedule[Scheduled Content]
    deployment -- Mastodon API --> mastodon[Mastodon Updates]
    commits --> hugo
    schedule --> hugo
    mastodon --> hugo
    hugo -- Wrangler --> cloudflarepages
  

I have a simple script that checks for new changes in my Github repo periodically and does a rebuild to see if there are any scheduled changes. However, you may be wondering how I add mastodon posts to my “static” website. If you experiment enough, you may see that replies get added to my website within 10 minutes (if posted during the day in the European CEST timezone, otherwise it waits until the morning). I made this happen by writing some code with Go and a library called go-mastodon that scans through my previous mastodon posts and puts the updated statuses into a Github repo which is updated for each build of my website. If I want to block content from appearing on my website, I can block the user or mute the reply.

The system works out pretty well. I can improve this, however. I could use a webhook to trigger builds more quickly when there are changes to my Github repo or if there are new posts on mastodon. As it stands, I have to wait up to 10 minutes to see the changes reflected… which isn’t bad, it could just be better. This doesn’t help with scheduled posts, but it would reduce the frequency that I have to check for updates on a timer.

I intend to polish the script that I use to pull down Mastodon updates and publish it as a tool that others can use. I may try to also add support for Blue Sky as well but I make no promises!

Enjoy

I do hope that others find the prompts useful. If you have a suggestion for a prompt or any questions about my setup, please let me know in the comments for this post!