[go: up one dir, main page]

Simon Willison’s Weblog

Subscribe

October 2021

25 posts: 3 entries, 11 links, 1 quote, 10 beats

Oct. 6, 2021

TIL Using Fabric with an SSH public key — Inspired by [this tweet](https://twitter.com/driscollis/status/1445772718507376646) by Mike Driscoll I decided to try using Fabric to run commands over SSH from a Python script, using a public key for authentication.

Writing for distributed teams (via) Vicki Boykis describes how she only sent 11 emails during her first 12 months working at Automattic, because the company culture there revolves around asynchronous communication through durable writing using the P2 custom WordPress theme. “This is a completely different paradigm than I’ve ever worked in, which has been a world usually riddled with information lost to Slack, Confluence, and dozens of email re:re:res.”

# 6:29 pm / communication, wordpress, vicki-boykis

Abusing Terraform to Upload Static Websites to S3 (via) I found this really interesting. Terraform is infrastructure as code software which mostly handles creating and updating infrastructure resources, so it’s a poor fit for uploading files to S3 and setting the correct Content-Type headers for them. But... in figuring out how to do that, this article taught me a ton about how Terraform works. I wonder if that’s a useful general pattern? Get a tool to do something that it’s poorly designed to handle and see how much you learn about that tool along the way.

# 6:51 pm / s3

Oct. 9, 2021

Finding and reporting an asyncio bug in Python 3.10

I found a bug in Python 3.10 today! Some notes on how I found it and my process for handling it once I figured out what was going on.

[... 1,789 words]

Oct. 12, 2021

How to win at CORS (via) Jake Archibald’s definitive guide to CORS, including a handy CORS playground interactive tool. Also includes a useful history explaining why we need CORS in the first place.

# 2:07 pm / javascript, security, jake-archibald, cors

Oct. 14, 2021

Release datasette 0.59 — An open source multi-tool for exploring and publishing data

Oct. 15, 2021

Release datasette-auth-tokens 0.3 — Datasette plugin for authenticating access using API tokens
Release datasette-statistics 0.2 — SQL statistics functions for Datasette

Oct. 17, 2021

Web Browser Engineering (via) In progress free online book by Pavel Panchekha and Chris Harrelson that demonstrates how a web browser works by writing one from scratch using Python, tkinter and the DukPy wrapper around the Duktape JavaScript interpreter.

# 3:53 pm / browsers, python

Oct. 18, 2021

TIL Using the sqlite3 Python module in Pyodide - Python WebAssembly — [Pyodide](https://github.com/pyodide/pyodide) provides "Python with the scientific stack, compiled to WebAssembly" - it's an incredible project which lets you run a full working Jupyter notebook, complete with complex packages such as numpy and pandas, entirely in your browser without any server-side Python component running at all.
Release datasette-publish-vercel 0.11 — Datasette plugin for publishing data using Vercel

Tests aren’t enough: Case study after adding type hints to urllib3. Very thorough write-up by Seth Michael Larson describing what it took for the urllib3 Python library to fully embrace mypy and optional typing and what they learned along the way.

# 7:03 pm / python, static-typing, mypy, seth-michael-larson

Where does all the effort go? Looking at Python core developer activity (via) Łukasz Langa used Datasette to explore 28,780 pull requests made to the CPython GitHub repository, using some custom Python scripts (and sqlite-utils) to load in the data.

# 8:21 pm / python, datasette, sqlite-utils, lukasz-langa

Oct. 19, 2021

Datasette 0.59: The annotated release notes

Visit Datasette 0.59: The annotated release notes

Datasette 0.59 is out, with a miscellaneous grab-bag of improvements. Here are the annotated release notes.

[... 2,103 words]

Why you shouldn’t invoke setup.py directly (via) Paul Ganssle explains why you shouldn’t use “python setup.py command” any more. I’ve mostly switched to pip and pytest and twine but I was still using “python setup.py sdist”—apparently the new replacement recipe for that is “python -m build”.

# 5:22 pm / python

Oct. 21, 2021

Release datasette-hello-world 0.1 — The hello world of Datasette plugins

New HTTP standards for caching on the modern web (via) Cache-Status is a new HTTP header (RFC from August 2021) designed to provide better debugging information about which caches were involved in serving a request—“Cache-Status: Nginx; hit, Cloudflare; fwd=stale; fwd-status=304; collapsed; ttl=300” for example indicates that Nginx served a cache hit, then Cloudflare had a stale cached version so it revalidated from Nginx, got a 304 not modified, collapsed multiple requests (dogpile prevention) and plans to serve the new cached value for the next five minutes. Also described is $Target-Cache-Control: which allows different CDNs to respond to different headers and is already supported by Cloudflare and Akamai (Cloudflare-CDN-Cache-Control: and Akamai-Cache-Control:).

# 10:40 pm / caching, dogpile, http, cloudflare

Oct. 22, 2021

TIL Removing a git commit and force pushing to remove it from history — I accidentally triggered a commit which added a big chunk of unwanted data to my repository. I didn't want this to stick around in the history forever, and no-one else was pulling from the repo, so I decided to use force push to remove the rogue commit entirely.

Oct. 23, 2021

Tonic (via) Really interesting library for building Web Components: it’s tiny (just 350 lines of code), works directly in browsers without any compile or build step and makes very creative use of modern JavaScript features such as async generators.

# 5:21 am / javascript, web-components

Oct. 24, 2021

Release datasette 0.59.1 — An open source multi-tool for exploring and publishing data

Oct. 25, 2021

But this much is clear: Facebook knew all along. Their own employees were desperately trying to get anyone inside the company to listen as their products radicalized their own friends and family members. And as they were breaking the world, they had an army of spokespeople publicly and privately gaslighting and intimidating reporters and researchers who were trying to ring the alarm bell. They knew all along and they simply did not give a shit.

Ryan Broderick

# 8:22 pm / facebook

Oct. 28, 2021

TIL Understanding Kristofer Joseph's Single File Web Component — [Via Brian LeRoux](https://twitter.com/brianleroux/status/1453472609518034944) I found [single-file-web-component.html](https://gist.github.com/kristoferjoseph/c4e47389ae0f0447db175b914e471628) by Kristofer Joseph. It's really clever! It demonstrates how to build a `<hello-world></hello-world>` custom Web Component in a single HTML file, using some neat tricks.

Weeknotes: Learning Kubernetes, learning Web Components

I’ve been mainly climbing the learning curve for Kubernetes and Web Components this week. I also released Datasette 0.59.1 with Python 3.10 compatibility and an updated Docker image.

[... 1,101 words]

aws-lambda-adapter. AWS Lambda added support for Docker containers last year, but with a very weird shape: you can run anything on Lambda that fits in a Docker container, but unlike Google Cloud Run your application doesn’t get to speak HTTP: it needs to run code that listens for proprietary AWS lambda events instead. The obvious way to fix this is to run some kind of custom proxy inside the container which turns AWS runtime events into HTTP calls to a regular web application. Serverlessish and re:Web are two open source projects that implemented this, and now AWS have their own implementation of that pattern, written in Rust.

# 5:04 am / aws, lambda, rust, docker

Oct. 29, 2021

DuckDB-Wasm: Efficient Analytical SQL in the Browser (via) First SQLite, now DuckDB: options for running database engines in the browser using WebAssembly keep on growing. DuckDB means browsers now have a fast, intuitive mechanism for querying Parquet files too. This also supports the same HTTP Range header trick as the SQLite demo from a while back, meaning it can query large databases loaded over HTTP without downloading the whole file.

# 3:25 pm / sqlite, parquet, webassembly, duckdb

2021 » October

MTWTFSS
    123
45678910
11121314151617
18192021222324
25262728293031