What is Expensive?

I was talking with one of my mentees last week and we happened upon the topic of money and wages. I mentioned to him that, in order to talk about money properly, you have to define the word “expensive.” Naturally, people think the word “expensive” means that the price of something is too high, but the problem with this definition is that it lacks context. I explained it to my mentee in this way. ...

February 20, 2015 · 4 min · 680 words · Scott Brown

Installing rbenv on Raspberry Pi

Note: This article assumes a working knowledge of rbenv. Installing rbenv (a Ruby version manager) on a Raspbian-based Raspberry Pi is a bit difficult because the base Debian ruby-build package does not provide you with an up-to-date list of Ruby versions. To workaround this issue, you can easily install ruby-build yourself, instead of relying on the official Debian packages. I’m not a fan of the official rbenv package in the Debian repositories because it tries to install too many things (namely Ruby 1.8 for some reason), and I also don’t like to install rbenv system-wide, so let’s start by installing rbenv to our local user. ...

January 7, 2015 · 2 min · 279 words · Scott Brown

Installing the Postgres gem on OSX using Postgres.app

Here is a quick tip on how to install the pg ruby gem on OSX if you only have Postgres.app installed. First, if you attempt to install the pg gem it will fail with: $ gem install pg Fetching: pg-0.17.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /Users/me/.rbenv/versions/2.1.5/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** If you search for solutions to this issue you will undoubtedly be told to install the postgresql package from Homebrew. That’s nice, but you already have the Postgres.app and you don’t want to maintain 2 versions of the same application on your machine (it is also not isolated, and can cause port conflicts). ...

December 18, 2014 · 1 min · 204 words · Scott Brown

Respect

R-E-S-P-E-C-T, find out what it means to me. - Aretha Franklin I’m feeling a bit crabby this morning, perhaps because I had to deal with a take-home exercise that passed for an interview. But that’s another story. Today I want to focus on respect and how the software industry is mishandling it. To service the above quote, I also want to provide some insight into how I, just your average humble software developer, choose to define the term. ...

November 20, 2014 · 10 min · 1972 words · Scott Brown

Be Kind to Keyboard Users, Use a Tab Index

There are many ways to navigate a website these days, especially on mobile where you can swipe, pinch, and touch. But what about the people on Desktops that use keyboards? Let’s be nice to them. One trait of seasoned computer users that I’ve seen is that they start to use their mouse less often and rely more heavily on keyboard shortcuts. When it comes to reading websites, you can scroll with your arrow keys, but what about jumping to relevant sections on a web page? You could use the PgUp and PgDown keys on your keyboard, however many people now use laptops, and those keys are buried in a Control/Function-key combination, so I doubt they get much use (I don’t have data on this, it’s merely from my own experience). ...

November 11, 2014 · 3 min · 527 words · Scott Brown

Be Nice to Sysadmins, Add a version.txt to Your App

One best practice that I rarely see used by companies is a version file that denotes what is currently in Production. Let’s step back a bit and use a real-life situation. A company released a new version of their Web application to Production from master (using the git-flow model). Some hours go by and its now late into the night when the application fails. Unfortunately, all of the developers are now at home and only the poor operator (who is on-call support) is left wondering what happened. The software didn’t fail in the test environment, what could possibly have gone wrong. ...

November 10, 2014 · 2 min · 411 words · Scott Brown

Be Careful with the Order of Ansible Handlers

I recently stumbed across an gotcha with Ansible that I wasn’t aware of. It happened when I was writing notification handlers that should run after a new version of code is downloaded to a server. In my task file I was downloading (via Git) the latest code from the repository: --- # roles/app-code/tasks/install_code.yml - name: ensure code repository is downloaded git: > accept_hostkey=yes key_file={{ app_code_bitbucket_private_key_file }} repo={{ app_code_git_repository }} dest={{ app_code_home_dir }} version={{ app_code_git_version }} sudo: yes sudo_user: '{{ app_user_name }}' notify: - update gems - precompile assets - add hash marker file - restart app server Whenever new code is downloaded to the system, the task will show CHANGED and each notification handler will be called. In this case, we want each notification to happen in a specific order because you don’t want to restart the application server before the assets and third-party libraries are configured. In this case, using an array may not execute the handlers in this order even though you’d expect it to. ...

November 9, 2014 · 2 min · 385 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

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