Author Archives: David
A Distributed Mutex and Semaphore using Redis
Redis has some really neat atomic multi-operation commands that can be used to create a distributed mutex. Check out the documentation for the SETNX command for an example. This example is based on polling and unfair: waiting processes are not … Continue reading
5 Ways to set Attributes in ActiveRecord
Rails 3 allows the developer to change ActiveRecord attributes in various ways. I describe five methods, each with its own unique side-effects. Includes handy cheat sheet. Continue reading
Git How-To: Remove Your Password from a Repository
When you’re making an app that uses credentials to access some service, in the early stages of development before any code to access a config-file is written, a username and password are occasionally hard-coded in the source. Since you use version … Continue reading
On the Redundancy of the Password Inputbox: eToro
As a case study relating to my previous post on password input-boxes, I present eToro, a social foreign exchange trading service. Here’s what you see if you want to sign up: As you can see, a standard sign-up screen. All … Continue reading
Expanding a leading tilde in C/C++
If you’re writing an app that accepts a path to a filename as user-input or in config-files, you’ll have to be able to parse the famous leading tilde and expand it to the correct home directory of the correct user. … Continue reading
Gmail Carbon Copy
Today I’d like to introduce Gmail Carbon Copy, an application I’ve coded during the last couple of months. The latest version is stable and works, so I’m deeming it fit for public consumption. Gmail Carbon Copy, or Gmailcc simply creates … Continue reading
Munin and Apache: Can’t locate object method
If you’re using Munin to track statistics on your server and you’re trying to use any of the Apache plugins, you might have some trouble getting it working. If Munin won’t display any statistics on Apache, and the munin-node.log logfile … Continue reading
On the Redundancy of the Password Inputbox
We all know and love the password inputbox. It hides all the characters you type with stars, and encrypts the contents stored in memory. It’s about the only constant in the potpourri of user registration pages. It’s the part no … Continue reading