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

Posted in Algorithms, Code Poetry | Tagged , | 2 Comments

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

Posted in Ruby on Rails | 1 Comment

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

Posted in Uncategorized | 5 Comments

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

Posted in Usability | Leave a comment

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

Posted in Code Poetry, How To | Tagged , , | Leave a comment

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

Posted in Code Poetry, Gmailcc, Linux | Leave a comment

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

Posted in Linux, Sysadmin | 1 Comment

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

Posted in Usability | Leave a comment

Hide Data in Bad Blocks

This is part 3 in a series on how to hide your data. First of all, the methods explained in this series are not secure. Anyone with some low-level knowledge of filesystems can tell there’s hidden data when looking at … Continue reading

Posted in How To, Linux, Sysadmin | Tagged | 2 Comments

Hide Data in Invisible Partitions

This is part 2 in a series on how to hide your data. First of all, the methods explained in this series are not secure. Anyone with some low-level knowledge of filesystems can tell there’s hidden data when looking at … Continue reading

Posted in How To, Linux, Sysadmin | Tagged | Leave a comment