Determining Your Current EC2 Region in Go

If you program in Go and use it to access AWS resources, you’ll notice that each of the services in the SDK require a region to be explicitly specified. This is because AWS constructs an API endpoint that is region-specific and some company resources may exist in a specific region (not necessarily where the code is being run). If the code is knowingly trying to access AWS resources in the same region, it can be annoying to hardcode a region into the code. It makes the code rigid and brittle (non-portable). There is a way to have your code automatically determine its region. ...

May 26, 2018 · 2 min · 246 words · Scott Brown

Simple Per-User Bash Profile Configuration

While creating Ansible scripts to automate the configuration of servers, I frequently stumble across an issue where I need to setup a user’s profile on the server that has a custom path. The issue that arises is that the .bash_profile file is a single file where any number of PATH exports can be provided. Any step in a provisioning tool like Ansible should be aware that this only adds state. I have seen other DevOps workers use modules like lineinfile, which I abhor because you can never be certain that the module will work. You will always ask yourself, “did the PATH on line 5 get set correctly, or did someone change one character (or perhaps add a comment) that now breaks the lineinfile module task?” ...

November 6, 2014 · 3 min · 483 words · Scott Brown

More Freedom with GNU Stow

In honour of our friends down South celebrating their independence, let’s look at installing a local version of ruby onto a POSIX machine without requiring wrappers like rvm or rbenv. We want to be free to install things where we want, when we want, and how we want. Now that’s true freedom. Install GNU Stow Okay, you are going to need to install stow system wide for this step. This requires administrative permissions. I promise it’s the only thing. ...

July 4, 2014 · 3 min · 525 words · Scott Brown

Setting up a VPS

For this website I decided to use a VPS instead of using a shared host or a PaaS like Heroku. I figured that I need to keep my system administrator skills up to date, and there is no better way to do this (as someone who works from home) than to run everything myself. Running a VPS is also much more affordable than using Heroku, so that’s another win. As for shunning shared hosts, the reason I didn’t go down that route is simply because I’m tired of using cPanel or any UI, because I am much more comfortable on a command-line interface. Oddly enough, I find that cPanel (and its ilk) make things more difficult for me to understand, possibly because I overthink how to perform a simple task. ...

June 30, 2013 · 4 min · 783 words · Scott Brown