Gehen Sie mit der App Player FM offline!
#447 Going down a rat hole
Manage episode 504132450 series 1305988
- * rathole*
- * pre-commit: install with uv*
- A good example of what functools.Placeholder from Python 3.14 allows
- Converted 160 old blog posts with AI
- Extras
- Joke
About the show
Sponsored by DigitalOcean: pythonbytes.fm/digitalocean-gen-ai Use code DO4BYTES and get $200 in free credit
Connect with the hosts
- Michael: @[email protected] / @mkennedy.codes (bsky)
- Brian: @[email protected] / @brianokken.bsky.social
- Show: @[email protected] / @pythonbytes.fm (bsky)
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.
Michael #1: rathole
- 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.
Brian #2: pre-commit: install with uv
- Adam Johnson
- pre-commit doesn’t natively support uv, but you can get around that with
pre-commit-uv
$ uv tool install pre-commit --with pre-commit-uv
- Installing pre-commit like this
- Installs it globally
- Installs with uv
- adds an extra plugin “pre-commit-uv” to pre-commit, so that any Python based tool installed via pre-commit also uses uv
- Very cool. Nice speedup
Brian #3: A good example of what functools.Placeholder from Python 3.14 allows
- Rodrigo Girão Serrão
- Remove punctuation functionally
- Also How to use functools.Placeholder, a blog post about it.
- 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)
Michael #4: Converted 160 old blog posts with AI
They were held-hostage at wordpress.com to markdown and integrated them into my Hugo site at mkennedy.codes
Here is the chat conversation with Claude Opus/Sonnet.
- 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.
This article is timely and noteworthy: Blogging service TypePad is shutting down and taking all blog content with it
This highlights why your domain name needs to be legit, not just tied to the host. I’m looking at you pyfound.blogspot.com. I just redirected blog.michaelckennedy.net to mkennedy.codes
Carefully mapping old posts to a new archived area using NGINX config. This is just the HTTP portion, but note the
/sitemap.xml
andlocation ~ "^/([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 { listen 80; server_name blog.michaelckennedy.net; # Redirect sitemap.xml to new domain location = /sitemap.xml { return 301 ; } # Handle blog post redirects for HTTP -> HTTPS with URL transformation # Pattern: /YYYY/MM/DD/post-slug/ -> location ~ "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.+?)/?$" { return 301 $4/>; } # Redirect all other HTTP URLs to mkennedy.codes homepage location / { return 301 ; } }
Extras
Brian:
- SMS URLs and Draft SMS and iMessage from any computer keyboard from Seth Larson
- Test and Code Archive is now up, see announcement
Michael:
451 Episoden
Manage episode 504132450 series 1305988
- * rathole*
- * pre-commit: install with uv*
- A good example of what functools.Placeholder from Python 3.14 allows
- Converted 160 old blog posts with AI
- Extras
- Joke
About the show
Sponsored by DigitalOcean: pythonbytes.fm/digitalocean-gen-ai Use code DO4BYTES and get $200 in free credit
Connect with the hosts
- Michael: @[email protected] / @mkennedy.codes (bsky)
- Brian: @[email protected] / @brianokken.bsky.social
- Show: @[email protected] / @pythonbytes.fm (bsky)
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.
Michael #1: rathole
- 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.
Brian #2: pre-commit: install with uv
- Adam Johnson
- pre-commit doesn’t natively support uv, but you can get around that with
pre-commit-uv
$ uv tool install pre-commit --with pre-commit-uv
- Installing pre-commit like this
- Installs it globally
- Installs with uv
- adds an extra plugin “pre-commit-uv” to pre-commit, so that any Python based tool installed via pre-commit also uses uv
- Very cool. Nice speedup
Brian #3: A good example of what functools.Placeholder from Python 3.14 allows
- Rodrigo Girão Serrão
- Remove punctuation functionally
- Also How to use functools.Placeholder, a blog post about it.
- 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)
Michael #4: Converted 160 old blog posts with AI
They were held-hostage at wordpress.com to markdown and integrated them into my Hugo site at mkennedy.codes
Here is the chat conversation with Claude Opus/Sonnet.
- 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.
This article is timely and noteworthy: Blogging service TypePad is shutting down and taking all blog content with it
This highlights why your domain name needs to be legit, not just tied to the host. I’m looking at you pyfound.blogspot.com. I just redirected blog.michaelckennedy.net to mkennedy.codes
Carefully mapping old posts to a new archived area using NGINX config. This is just the HTTP portion, but note the
/sitemap.xml
andlocation ~ "^/([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 { listen 80; server_name blog.michaelckennedy.net; # Redirect sitemap.xml to new domain location = /sitemap.xml { return 301 ; } # Handle blog post redirects for HTTP -> HTTPS with URL transformation # Pattern: /YYYY/MM/DD/post-slug/ -> location ~ "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.+?)/?$" { return 301 $4/>; } # Redirect all other HTTP URLs to mkennedy.codes homepage location / { return 301 ; } }
Extras
Brian:
- SMS URLs and Draft SMS and iMessage from any computer keyboard from Seth Larson
- Test and Code Archive is now up, see announcement
Michael:
451 Episoden
सभी एपिसोड
×Willkommen auf Player FM!
Player FM scannt gerade das Web nach Podcasts mit hoher Qualität, die du genießen kannst. Es ist die beste Podcast-App und funktioniert auf Android, iPhone und im Web. Melde dich an, um Abos geräteübergreifend zu synchronisieren.