time-machine is my library for mocking the current date and time in Python tests. I’ve just released version 3.3.0 with a decent number of changes, so here’s a lovely summary for you. Despite doing one simple-to-describe task, time-machine has ended up being quite a big library, thanks to the...
Take this code, parsing the date of an annually recurring event that only has a month and day, such as a work anniversary: from datetime import datetime def parse_anniversary(date_str: str) -> datetime: parsed = datetime.strptime(date_str, "%d/%m") return parsed.day, parsed.month...
Take this class, which implements __eq__() and derives __ne__() from it: class Lemming: def __init__(self, name): self.name = name def __eq__(self, other): if not isinstance(other, Lemming): return NotImplemented return self.name == other.name def...
When you use a unittest.mock mock, you often make assertions on the calls it received, such as through the mock_calls list. But sometimes you want to assert on the order of calls across multiple mocked functions, for example to check that steps in a process happen in the right sequence. To do...
Testing terminology distinguishes between different kinds of test doubles, including: mocks, which replace the real behaviour of a function. spies, which wrap a function, recording calls for later assertions. Despite its name, unittest.mock is not just for mocks: it can also create spies,...
Did you know that each Django release has a “code word” associated with it? It’s hidden in plain sight, in the announcement blog post describing the list of features coming in the next version. I think this is a lovely little tradition. I last covered the list back in 2021, for Django 3.2 (post)....
I recently migrated one of my client projects from the legacy django-csp package to Django 6.0’s built-in Content Security Policy (CSP) support (release note). This security header is a powerful tool for preventing unwanted content from being loaded on your site, so configuration correctness is...
Just as cars painted red are known to be faster, libraries implemented in Rust are also known to be faster. Today’s example is orjson, a Rusty replacement for Python’s built-in json module, boasting 10x faster serialization and 2x faster deserialization. Such a library is great, but adopting it...
Here’s a lovely hack that I’ve used when machete-mode debugging. Say you have a class, and you want to find its live instances, perhaps to check how many there are or what value a certain attribute has across them. Normally you'd have to alter the class initialization to store its instances in a...
Introducing Overlap Atlas! Very similar to another little web app that I made a few weeks ago, making use of Android timeline data and Spotify data, I now have another little web app for visualizing overlaps of 2 peoples timeline data (or lack of overlaps). You can load one or more Google...
I bought a set of 3 eero Pro 6 mesh (Wi-Fi 6) routers back at the end of 2023, and the first one of them died in the last few weeks. Trying to power the device via USBC no longer does anything, and eero support didn’t have much to try other than the reset button and a new power adapter. So I...
In several programs, I’ve wanted to solve the problem of associating extra data with an object. For example, in django-upgrade, the individual “fixer” functions often want to store extra data per visited ast.Module object. A common pattern in Python is to store the data in an extra attribute...
I’m about to head camping on Dartmoor, and wanted to go prepped with some of the various map related data that I will need. Basically, where to camp, and where not to camp… Searching around I managed to find this basic set of infomation Camping Map Dartmoor firing times The Military...
Wikidata is a free and open knowledge base that anyone can edit. It is a sister project of Wikipedia and serves as a central repository for structured data, so rather than paving pages with text, it stores data in a structured format that can be queried and reused across different platforms....
The capabilities in a large language model emerge, mysteriously, from the training data. Everyone agrees that you start with a big pile of data, add some compute, and at the end you can vibe code. Opinions differ on what that pile of data should look like. Microsoft AI recently released an...
With local AI agents increasingly writing and executing code autonomously, giving them unrestricted access to your machine is becoming a massive security risk. This is one of the primary reasons that agentic flows have so many flavors of approval that may need to happen throughout an agents course...
I recently decided to run an experiment on wikibase.world: what happens when you give an AI agent the keys to a live MediaWiki instance and ask it to do some targetting gardening, including edits to Wikibase? Meet the Jules free tier, though i’m sure you could use any agent. Over the course of...
Earlier this week, someone asked me if they were perhaps late to making use of AI-assisted development, as they dove into it in the past 2 months (using GitHub Copilot) and are already seeing large gains in a small team in terms of leverage of time. I thought for a second and responded that they...
Car buying in 2026 still sucks Buying a car from a dealership is an objectively awful experience. There’s a long history behind why manufacturers can’t sell directly to customers (without certain workarounds like Tesla/Rivian), so unless you’re going that route you’ll inevitably need to talk with...
A blog post went very viral in the AWS space recently which asserts that there’s a silent crash in AWS Lambda’s NodeJS runtime when HTTP calls are made from a Lambda function. The post is nearly 23 pages long and mostly pertains to the handling of the issue by AWS (which seems like it could have...
Intro The Windows Filtering Platform (WFP) is a framework designated for host-based network traffic filtering, replacing the older NDIS and TDI filtering capabilities. WFP exposes both UM and KM apis, offering the ability to block, permit or aduit network traffic based on conditions or deep packet...
TL;DR We've entered a new age of learning where AI, particularly large language models, enables us to absorb knowledge more efficiently than ever before. AI tools can save valuable time through content summarization, serve as personal researchers that work in the background, and create customized...
Intro Long-term surveillance hinges (among other things) on microphone capture and recording capabilities, serving as a cornerstone of persistent monitoring operations. Threat actors can silently harvest sensitive intelligence from team meetings, voice chats, and internal discussions - providing...
There have been a number of recent changes in the Lambda sandbox environment, mostly transparent ones like changing the Runtime API IP address and port to a link-local IP. But recently I noticed a change in how Lambda handles function crashes and re-initialization, and after confirming this...
Intro Ransomware is one of the simplest, yet significant threats facing organizations today. Unsuprisingly, the rise and continuing development of ransomware led to a plentitude of research aimed at detecting and preventing it. AV vendors, independent security reseachers and academies all...
If you mostly know me because of this blog or my cloud talks, it may surprise you to learn that I’m also an avid parachutist. I’ve been skydiving since 2010 and BASE jumping since 2012, and have more than 1200 combined jumps all over the world. It’s a neat hobby! Contrary to popular belief, it’s...
We all have secrets. Some are small secrets which we barely hide (sometimes I roll through stop signs on my bike). Others are so sensitive that we don’t even want to think about them (serverless actually has servers). Managing and securing secrets in your applications have similar dimensions! As...
In the first post of this series, we demonstrated that container-based Lambda functions can initialize as fast or faster than zip-based functions. This is counterintuitive as zip-based functions are usually much smaller (up to 250mb), while container images typically contain far more data and are...
Note: the second part of this post is available here. When AWS Lambda first introduced support for container-based functions, the initial reactions from the community were mostly negative. Lambda isn’t meant to run large applications, it is meant to run small bits of code, scaled widely by...
Why you shouldn’t use Lambda layers Lambda layers are a special packaging mechanism provided by AWS Lambda to manage dependencies for zip-based Lambda functions. Layers themselves are nothing more than a sparkling zip file, but they have a few interesting properties which prove useful in some...
This post is both longer and more popular than I anticipated, so I’ve decided to add a quick summary: TL;DR Lambda occasionally pre-initializes execution environments to reduce the number of cold start invocations. This does NOT mean you’ll never have a cold start The percentage of true...
While PHP isn't my favorite language by any means, it's one that I've used throughout my career at various points. This fact was recently brought to my attention during a conversation with a colleague about my past experiences. I wouldn't label myself a dedicated PHP developer, but my history with...
If you’ve heard anything about Serverless Applications or AWS Lambda Functions, you’ve certainly heard of the dreaded Cold Start. I’ve written a lot about Cold Starts, and I spend a great deal of time measuring and comparing various Cold Start Benchmarks. In this post we’ll recap what a Cold...
I've never been great at keeping up with blogging, but I believe it's important, especially as a software engineer as it exercises our ability to document and write things down. I typically blog when I have free time and my mind isn't focusing on other things. As I've taken a vacation day today, I...
As I sit next to a gas store in Vermont, I once again have a hard copy book with me to read on vacation. This time it's "Learning ClojureScript" by Andrew Meredith, and just like Clojure For the Brave and True it's another free book that can easily be downloaded and read from any fancy gizmos....
As I continue my journey with learning functional programming, I have started to explore deeper into the languages that I enjoy and do some experimenting with interesting parts of those languages. This has led me to defmulti and defmethod, enabling you to create methods that deal with different...
I'm still on my journey with exploring F# but I want to look at something with the .Net Core platform itself, so this will apply to both C# and F#. Ahead-Of-Time (AOT) compilation isn't a new concept. Languages like C and C++ need to be compiled before (or ahead of) execution time. The JVM and CLR...
For this first topic of showing off parts of F# I want to use a code challenge I have used for interviewing candidates at a couple different companies. This challenge is simple to solve but is left open ended to allow the candidate to discuss and debate the decisions they have made. The main point...
As I'm sure, so many other people have also found their lives disrupted due to the pandemic and other world events; I'm just getting to the point where I can think about blogging again due to getting a sense of normality back. One of the things I have been doing is continuing my journey with...
Clojure seems to be coming up a lot in postings, books, and social media. Some most notable mentions are by Gene Kim in a couple of different instances, Love Letter To Clojure being the biggest but also in his book The Unicorn Project where Clojure is a beloved language by Maxine the main...
This time of year, I always find it interesting the number of articles telling you the top languages you should learn. Yes, there’s a steady stream of these types of articles throughout the year but right at the end when a new year is about to start is when I’ve seen them the most. Titles...
In my last posting, I talked about bringing a book on my trip to Italy and nothing about the technology that I brought. This was a clever (not really) way to be able to talk about Clojure and "Clojure for the Brave and True" but being who I am, I did bring some technology with me on my trip. I...
In my last post, I said I was in Italy on vacation and you may be thinking to yourself (most likely not, but just go with it) "what high tech gizmos did he bring with him on his travels?" and I would happily reply "A book!", yes a paper book. Being a software developer, I have access to tons of...
As I sit here in Venice on my vacation, I figure this would be a great time to dust off my blog. I haven't put much time into it lately, I find myself wanting to write when I have a good balance with work and life with some learning on the side. Sadly, this balance has been missing for a bit,...
I have lived through a lot of the major WiFi technology updates, I have also replaced a lot of WiFi routers in my lifetime. With wanting to spend less time dealing with WiFi issues I decided to buy something that was a better quality. Around 2013 the Apple Airport Extreme 6th generation just came...
GPG stands for GNU Privacy Guard, it’s a public-key cryptography that can be used to digitally sign items like commits in Git. GPG provides a lot more functionality, but let's go into why you would want to digitally sign your Git commits. Git does not have any way to validate the author of a...
Obviously, Fitbit is an activity tracker, there isn’t any doubt about that but there are some nice features with Fitbit’s line (along with others) of activity trackers that have been extremely useful in the DevOps and Infrastructure area of my current job. I have the Fitbit Charge 2 and for an...
Over the past couple months, I've been working on fine tuning my Python skills, part of this has been taking tutorials online along with building some applications. One of the things I’ve been wanting to document, mostly for myself, is setting up a new environment for developing with Python. I’m...
So, it was time for a bit of change for the blog. I have been using an older version of Jekyll for some time and upgrading for me has always been a pain. I picked to move away from Jekyll to something new, this is where Hugo comes into play. Hugo Hugo is another static site generator like Jekyll...
I've had the opportunity to use the Elastic Stack (formally known as ELK) for some time now, there's a great number of use cases that the Elastic Stack can fit, but one of the primary uses is to help aggregate logs files into one centralized location. This gives you the ability to analyze and...