Weird Ruby behavior somewhat explained

Tags: devops

The djsd binary wasn’t installed with the executable bit set when I installed it from the dotjs-ubuntu repository. I’m running Ubuntu 12.04 on my desktop. Before submitting a drive by pull request I tested 13.04, and it worked fine. At this point I assumed it was either a version difference or something wonky in my environment.

Testing on a clean 12.04 virtual machine pointed directly at my environment. What was the difference? The machines that worked were using the system provided ruby interpreter. The machine that didn’t was using an RVM supplied ruby interpreter. I’m sure there’s more to it than that, but as an infrequent ruby coder that’s all I needed to know before deleting my dotjs-ubuntu fork and calling off the hounds.

And if you aren’t using dotjs, well, you should. It’s awesome. You can inject javascript on a site by site basis. For instance, here’s what keeps me from spending stupid amounts of time browsing imgur:

$('.post a').css('visibility', 'hidden');
$('div.jcarousel ul li a').css('visibility', 'hidden');

JavaScript

That file lives at ~/.js/imgur.com.js, and it removes links to other images on any page served by the site.

It’s a compromise: In the past I’d block the site in my hosts file, but friends would send me links to images. I’d oblige by removing the host entry to view the link then regret that decision later. Will power is a finite resource, and I can’t click on links that aren’t visible.