Django data migration using a PostgreSQL CTE
I figured out how to use a PostgreSQL CTE as part of an update statement in a Django data migration. The trick here is mainly understanding how to ...
203 words
|
1 minute
Exporting Amplitude events to SQLite
[Amplitude](https://amplitude.com/) offers an "Export Data" button in the project settings page. This can export up to 365 days of events (up to 4G...
166 words
|
1 minute
Querying the GitHub archive with the ClickHouse playground
Via [this comment](https://news.ycombinator.com/item?id=34197637) on Hacker News I started exploring the [ClickHouse Playground](https://clickhouse...
654 words
|
3 minutes
Scroll page to form if there are errors
For a Django application I'm working on ([this issue](https://github.com/simonw/django-sql-dashboard/issues/44)) I have a form that can be quite a ...
88 words
|
1 minute
DevOps Metrics and KPIs
Day 85 of 90 Days of DevOps - DevOps Metrics and KPIs. Part of the Best Practices & Culture series covering essential DevOps concepts and hands-on practices.
433 words
|
2 minutes
Recovering data from AWS Lightsail using EC2
I ran into problems with my AWS Lightsail instance: it exceeded the CPU burst quota for too long and was suspended, and I couldn't figure out how t...
359 words
|
2 minutes
Continuous Learning Culture
Day 84 of 90 Days of DevOps - Continuous Learning Culture. Part of the Best Practices & Culture series covering essential DevOps concepts and hands-on practices.
458 words
|
2 minutes
Bundling Python inside an Electron app
For [Datasette Desktop](https://datasette.io/desktop) I chose to bundle a full version of Python 3.9 inside my `Datasette.app` application. I did t...
381 words
|
2 minutes
Documentation and Knowledge Sharing
Day 83 of 90 Days of DevOps - Documentation and Knowledge Sharing. Part of the Best Practices & Culture series covering essential DevOps concepts and hands-on practices.
594 words
|
3 minutes
Piping echo to a file owned by root using sudo and tee
I wanted to create a file with a shell one-liner where the file lived somewhere owned by root.
155 words
|
1 minute
Team Collaboration and Communication
Day 82 of 90 Days of DevOps - Team Collaboration and Communication. Part of the Best Practices & Culture series covering essential DevOps concepts and hands-on practices.
493 words
|
2 minutes
DevOps Best Practices Compilation
Day 81 of 90 Days of DevOps - DevOps Best Practices Compilation. Part of the Best Practices & Culture series covering essential DevOps concepts and hands-on practices.
446 words
|
2 minutes
Using the undocumented Fly GraphQL API
[Fly](https://fly.io/) has a GraphQL API which is used by some of their own tools - I found it while [browsing around their code](https://github.co...
456 words
|
2 minutes
Copy rich text to the clipboard
I've been experimenting with a tool for generating the content for a weekly Substack newsletter by querying the Datasette API for my blog and assem...
433 words
|
2 minutes
WebAssembly and Future Tech
Day 80 of 90 Days of DevOps - WebAssembly and Future Tech. Part of the Serverless & Advanced Topics series covering essential DevOps concepts and hands-on practices.
509 words
|
3 minutes
Useful Markdown extensions in Python
I wanted to render some markdown in Python but with the following extra features:
201 words
|
1 minute
Commit a file if it changed
This recipe runs a Python script to update a README, then commits it back to the parent repo but only if it has changed:
302 words
|
2 minutes
Edge Computing and CDN
Day 79 of 90 Days of DevOps - Edge Computing and CDN. Part of the Serverless & Advanced Topics series covering essential DevOps concepts and hands-on practices.
382 words
|
2 minutes
Running a Django and PostgreSQL development environment in GitHub Codespaces
Helping people setup development environments (and fix them when they break) can be incredibly frustrating. I'm really excited about cloud-based de...
862 words
|
4 minutes
GraphQL and Modern APIs
Day 78 of 90 Days of DevOps - GraphQL and Modern APIs. Part of the Serverless & Advanced Topics series covering essential DevOps concepts and hands-on practices.
629 words
|
3 minutes
Running tests against PostgreSQL in a service container
I wanted to run some Django tests - using `pytest-django` and with Django configured to pick up the `DATABASE_URL` environment variable via [dj-dat...
233 words
|
1 minute
Rate limiting by IP using Cloudflare's rate limiting rules
My [blog](https://simonwillison.net/) was showing poor performance, with some pages taking several seconds to load or even failing entirely.
498 words
|
2 minutes
Querying newline-delimited JSON logs using AWS Athena
I've been writing my Fly logs to S3 in newline-delimited JSON format using the recipe described in [Writing Fly logs to S3](https://til.simonwillis...
675 words
|
3 minutes
A script to capture frames from a QuickTime video
I was putting together some notes for a talk I gave, and I wanted an efficient way to create screenshots of specific moments in a video of that talk.
964 words
|
5 minutes