Good morning! Recent security incidents reminded me of an important rule that often doesn't make it on to security checklists: Separate work and personal email. In these incidents, workers used forwarding rules to send work email to personal accounts. Attackers used those rules to collect sensitive information. This is an example of exfiltration. Company security … Continue reading Separate Work and Personal Email
Articles
Passing Parameters to Docker Builds
Hello! When I'm building Docker images, sometimes I need to pass data from the build agent (e.g. my CI pipeline) into the build process. Often, I also want to echo that data into the logs so I can use it for troubleshooting or validation later. Docker supports this! These examples were all tested in Docker … Continue reading Passing Parameters to Docker Builds
PowerShell Scripts with Arguments
Hello! I write a lot of utility scripts. Little helpers to automate repetetive work. Like going through all those YAML files and updating that one config item, or reading through all those database entries and finding the two that are messed up because of that weird bug I just found. These scripts are usually small. … Continue reading PowerShell Scripts with Arguments
PowerShell on OS X: Git Hooks
Hello! PowerShell works great on Mac OS X. It's my default shell. I usually only do things the Posh way, but sometimes the underlying system bubbles back up. Like when I'm writing git hooks. In Posh, git hooks live in the same place and still have to be executable on your platform. That doesn't change. … Continue reading PowerShell on OS X: Git Hooks
A Checklist for Submitting Pull Requests
Hello! Reviewing code is hard, especially because reviewers tend to inherit some responsibility for problems the code causes later. That can lead to churn while they try to develop confidence that new submissions are ready to merge. I submit a lot of code for review, so I've been through a lot of that churn. Over … Continue reading A Checklist for Submitting Pull Requests
How to Grep in PowerShell
Hello! In oldschool Linux shells, you search files for a string with grep. You're probably used to commands like this (example results from an OSS repo): It outputs strings that concatenate the filename and the matching line. You can pipe those into awk or whatever other command to process them. Standard stuff. You can achieve … Continue reading How to Grep in PowerShell
Tox: Testing Multiple Python Versions with Pyenv
Hello! I use Python's tox to orchestrate a lot of my tests. It lets you set a list of versions in a tox.ini file (in the same directory as your setup.py), like this: Then you can run the tox command, it'll create a venv for each version, and run your tests in each of those … Continue reading Tox: Testing Multiple Python Versions with Pyenv
PowerShell on OS X: Setting Your Path Variable
Hello! There are two tricky little problems when setting your path variable in PowerShell. Here's how to get past them. First, lots of guides show things like this: Which works on Windows but won't work on OS X. The variable name has to be all-caps: Next, the separator between path elements on Windows is ;, … Continue reading PowerShell on OS X: Setting Your Path Variable
PowerShell: Python venv Missing Activate.ps1
Hello! Ran in to a weird problem this week: I created a Python 3.7.9 venv, but I couldn't activate it in PoweShell (my shell of choice). The Activate.ps1 script was missing. The core docs for 3.7 list VENV/Scripts/Activate.ps1 as the command to activate venvs in PowerShell (which seemed odd because I'm used to VENV/bin/activate from … Continue reading PowerShell: Python venv Missing Activate.ps1
Terratest Good Practices: Table-Driven Tests
Hello! Terratest is a common way to run integration tests against terraform modules. I use it on many of the modules I develop. If you haven't used it before, check out its quickstart for an example of how it works. For simple cases, the pattern in that quickstart is all you need. But, bigger modules … Continue reading Terratest Good Practices: Table-Driven Tests