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

Gathering Requirements Properly

Today I want to highlight a bit issue with the tech industry, and that is the gathering of requirements from customers. I’ve seen far too many product and project managers gather requirements from the client, then pass them to developers to implement without batting an eye as to their feasibility. Let’s use a specific example pulled from my work today: users can post images but post needs to go through approval before going live ...

October 3, 2014 · 2 min · 375 words · Scott Brown

Most of Your Time At Work Will Not Be Coding

…at least, not in the traditional, hands-on-keyboard sense. This is one of the things that a lot of CompSci graduates don’t realize when they head out into the workforce. When I look back at all my jobs and put on my PHB’s hat, I would say that I spend less than 25% of time coding. Another 25% of the time is reading code, yak-shaving or searching for solutions. The rest of the time is spent talking with people; this is a skill that neither CompSci, nor most university courses teach. These numbers always fluctuate (some days, I put my head down and code almost 100%), but it says a lot about how much “coding” I do. Also note that I wrote “talking with people”, not “talking to people” because there is a big difference. ...

September 26, 2014 · 3 min · 636 words · Scott Brown

Harvesting Usernames from Websites

I am working with a client right now on their Web application. While creating an account to do testing, I noticed a glaring security issue that allows people to harvest usernames. This topic has been covered before, I am still surprised that it keeps popping up around the Web, but this time is a bit different. I should note that the client knows about the issue, but what I want to point out in this article is how insidious the issue becomes. ...

September 10, 2014 · 6 min · 1182 words · Scott Brown

Boolean Columns Answer Too Few Questions

One of the things that I dislike seeing in an application’s database architecture is the use of booleans. They do not convey enough information to any party to be meaningful, other than to ask a question that expects a yes/no answer. Often, questions such as those as a follow-up question that the field cannot answer. For example, in many databases I see the following fields on a User model: User ==== id primary key username the user's username credential password_encrypted authenticates the username ... other fields ... enabled true if the user is active, false otherwise When a user has been banned for doing something inappropriate, an application simply sends this query: ...

September 8, 2014 · 3 min · 563 words · Scott Brown

My Personal Tech Radar Chart

I finished speaking on the phone with a recruiter and, yet again, I had to spell out exactly what I look for in a job. It’s difficult to explain the same thing and have people understand what I mean, so I decided to be even more opaque and put it in a radar chart. That, and I love radar charts. To read the chart, higher numbers mean things I like doing more. And things I like to do more of, mean jobs that make me happy. And a happy Scott is a very productive Scott. ...

August 22, 2014 · 1 min · 130 words · Scott Brown

Adding Test Data Through Metaprogramming

Note: Contrary to what you are about to read, I am still against metaprogramming on the whole, as it adds an unnecessary amount of magic that may confuse other developers. That being said, I would hate working in a language without it. Use sparingly, like junk food. “With great power…” Yadda yadda. Enjoy the article. I am currently writing a gem to wrap the Cleanspeak API and I was using the JSON examples in my test cases that they supply in their API docs. I wrote the test cases like so: ...

August 22, 2014 · 4 min · 642 words · Scott Brown

Learning to Fib Correctly

I have been looking into Elixir and I am enjoying the language (mainly from both a readability standpoint, I haven’t done enough to form an opinion about its performance benefits). I read the chapter on recursion and then applied it to a quick and dirty Fibonacci implementation (my favourite way to learn recursion in a new language). It is as easy ascreating a new file called fib.ex and adding the following: ...

August 21, 2014 · 5 min · 1005 words · Scott Brown

Using SSH Keys with Multiple BitBucket Accounts

I was using BitBucket the other day for a new client, but I wasn’t able to use my standard BitBucket account (business reasons). I attempted to add my standard SSH key (id_rsa) to the new BitBucket account but SSH keys must be unique to the entire BitBucket system. I don’t understand the reason for this uniqueness but there is a way around it using a rarely used SSH technique. First you need to generate a new SSH key. You will name it something different than the default (id_rsa) because it will be used exclusively for the new BitBucket account. ...

July 18, 2014 · 2 min · 306 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