Discover the benefits of a lightweight reverse proxy tool called rathole, designed for seamless access to local web applications. Learn how to optimize server resources and enhance tool installations with pre-commit and UV integration. Dive into the exciting features of Python 3.14, especially functools placeholders, and hear about the challenges of migrating old blog content using AI. Plus, explore innovative podcasting techniques and the fun of dynamic QR codes while reminiscing about movie nights and coding mishaps.
35:46
forum Ask episode
web_stories AI Snips
view_agenda Chapters
auto_awesome Transcript
info_circle Episode notes
question_answer ANECDOTE
Self-Hosted Rathole For Webhooks
Michael Kennedy described self-hosting Rathole as a tiny Rust binary running in Docker that maps public URLs to local ports for webhooks and debugging.
He left it running on his server using only about 11 MB memory and uses a Docker compose setup to auto-start it.
volunteer_activism ADVICE
Install Pre-commit With uv
Use pre-commit with uv by installing pre-commit via uv-tools and the pre-commit-uv helper to speed up Python tool installation.
This ensures Python-based hooks and linters get installed with the fast uv installer instead of pip alone.
insights INSIGHT
functools.Placeholder Solves Positional Binding
functools.placeholder in Python 3.14 complements functools.partial by marking positional slots to fill later, solving positional-argument binding limitations.
Rodrigo's example showed using placeholder with str.translate to build reusable punctuation-removal partials.
Get the Snipd Podcast app to discover more snips from this episode
Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too.
Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.
A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Features
High Performance Much higher throughput can be achieved than frp, and more stable when handling a large volume of connections.
Low Resource Consumption Consumes much fewer memory than similar tools. See Benchmark. The binary can be as small as ~500KiB to fit the constraints of devices, like embedded devices as routers.
On my server, it’s currently using about 2.7MB in Docker (wow!)
Security Tokens of services are mandatory and service-wise. The server and clients are responsible for their own configs. With the optional Noise Protocol, encryption can be configured at ease. No need to create a self-signed certificate! TLS is also supported.
Hot Reload Services can be added or removed dynamically by hot-reloading the configuration file. HTTP API is WIP.
functools.partial is cool way to create a new function that partially binds some parameters to another function.
It doesn’t always work for functions that take positional arguments.
functools.Placeholder fixes that with the ability to put in placeholders for spots where you want to be able to pass that in from the outer partial binding.
And all of this sounds totally obscure without a good example, so thank you to Rodgrigo for coming up with the punctuation removal example (and writeup)
Had to juggle this a bit because the RSS feed only held the last 50. So we had to go back in and web scrape. That resulted in oddies like comments on wordpress that had to be cleaned etc.
Whole process took 3-4 hours from idea to “production”duction”.
The chat transcript is just the first round getting the RSS → Hugo done. The fixes occurred in other chats.
Carefully mapping old posts to a new archived area using NGINX config. This is just the HTTP portion, but note the /sitemap.xml and location ~ "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.+?)/?$" { portions. The latter maps posts such as https://blog.michaelckennedy.net/2018/01/08/a-bunch-of-online-python-courses/ to https://mkennedy.codes/posts/r/a-bunch-of-online-python-courses/
server{listen80;server_nameblog.michaelckennedy.net;# Redirect sitemap.xml to new domainlocation=/sitemap.xml{return301<https://mkennedy.codes/sitemap.xml>;}# Handle blog post redirects for HTTP -> HTTPS with URL transformation# Pattern: /YYYY/MM/DD/post-slug/ -> <https://mkennedy.codes/posts/r/post-slug/>location~"^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.+?)/?$"{return301<https://mkennedy.codes/posts/r/$4/>;}# Redirect all other HTTP URLs to mkennedy.codes homepagelocation/{return301<https://mkennedy.codes/>;}}