Category: how-to

  • Using 1Password and direnv to store developer secrets

    This is more notes to myself so i don’t forget. Goals: Benefits of 1Password: Initial set up 1. Install 1Password, 1password-cli, direnv. 1Password must be the direct download or Homebrew cask version, not the Mac App Store version as App Store enforces sandboxing. 2. Configure 1Password desktop app 3. Configure shell Add to ~/.zshrc. This…

  • Using Web Search with Claude Code API Billing

    If you’re running Claude Code against your own API key or through a proxy instead of Anthropic’s native backend, you’ve probably noticed that the built-in WebSearch tool just doesn’t return results because it relies on a server-side API that only exists at Anthropic. Without web search, the agent cant research, so we built a self-hosted…

  • Auto-switching SSH keys for work repos

    I have a personal GitHub account and a corporate one, and I found it annoying to have to select the correct SSH key for work repos, so I configured git and SSH to pick the correct key for me. After initial setup, there are three config files to modify: After the initial setup, there are…

  • How to: use custom / self-signed certificates with Requests in Python

    In a previous post, I explained how to configure Azurite to use a self-signed certificate to enable OAuth authentication. One challenge with this method is that the Azure Python SDK will refuse to connect to azurite, reporting errors such as: This is because the the Azure SDK uses the Requests library, which in turn uses…

  • How to: use Azurite with self-generated certificates for HTTPS in a Codespace or Devcontainer

    I’ve been using Azurite to simulate Azure storage for my development. If you’re not familiar with it, Azurite is a local storage emulator for Azure Storage, and you can read my other post about how i’ve set up my devcontainer configuration to run Azurite as a service container. As my deployed code is using an…

  • How to: Use Azurite as a service container in Codespaces or Devcontainers

    When developing with Azure Storage, it can significantly speed up your development process if you can use a local development environment, rather than constantly connecting directly to storage in Azure itself. This is where Azurite comes in – Azurite is a local storage emulator for Azure Storage, mimicing blob/container, queue and table storage. While there…

  • How to: Create SAS with multiple permissions in Pulumi

    In Pulumi, when calling pulumi_azure_native.storage.list_storage_account_service_sas_output() to generate a SAS, you pass the required permissions to the permissions: Input[str | Permissions | None] parameter. pulumi_azure_native.storage.Permissions is an enum, offering simple selections (R, L etc.): But you can also pass a string of permissions, any of R, L, D, W, C, A, or P, depending on the…

  • How to: retrieve storage account primary key using Pulumi

    Another note for myself. I wanted to use this to give my app access to the entire account. I thought they would be a property of pulumi_azure_native.storage.StorageAccount but they’re not. Instead you need to call pulumi_azure_native.storage.list_storage_account_keys().

  • How to: check if a container exists without account level List permission

    In a storage account, you can create a SAS scoped to a specific container, however, that SAS does not have permission to execute BlobClient.exists() as this requires at least list privileges on the parent object (e.g. the account), and when you try to perform the check, you’ll get this error: Note that this is an…

  • How to automate backups of a PostgreSQL server using Barman/barman-cloud-backup to S3

    I was surprised not to find many up to date instructions on this. I have a few basic requirements: After a bit of playing around, I decided to use Barman for the backups – it’s significantly easier to configure and use than pgBackRest and has native support for backing up to S3, point-in-time restore, and…