In the past few weeks, I’ve had a few conversations with web developers and back-end engineers who are unfamiliar with Ruby, in which I’ve tried to explain how Ruby can be nearly as expressive as Perl (tiny amounts of code can accomplish a lot) while being as readable as Python or Java. In fact, I think that Ruby’s expressiveness can remove distracting boilerplate code, allowing compact expressions to be far more readable than a more verbosely written version of the same algorithm.
Continue reading “On Ruby’s Expressiveness- The Littlest Microframework Explained”
MacRuby tweaks to your customized .irbrc
I started playing with MacRuby this evening. macirb wouldn’t run with my customized .irbrc and gave the following error:
1 2 3 |
/usr/local/bin/macirb:60:in `block': No such file or directory - open() failed (Errno::ENOENT) from /usr/local/bin/macirb:9:in `block' from /usr/local/bin/macirb:7:in `<main>' |
Managing autossh via monit
SSH port forwarding is so useful that sometimes you want to daemonize it, to create encrypted tunnels that never go away. But it’s not trivial to do this. Fortunately it is possible with a little fiddling, and I did it using monit.
Continue reading “Managing autossh via monit”
Making Bundler 1.0.0.beta.10 install Nokogiri on Leopard with a newish libxml
Okay, now that Bundler 1.0.0.beta.10 is out, you can once again pass build-time options to gems with native extensions, such as Nokogiri. So this supercedes my older instructions for making Bundler 0.8.5 install Nokogiri on Leopard.
So now instead of making a YAML file and referring to it, pass the options like this:
1 2 3 |
bundle config build.nokogiri \ --with-xml2-include=/usr/local/include/libxml2 \ --with-xml2-lib=/usr/local/lib |
Fix for MacBook Pro sudden USB and Ethernet port failures
I own a 2.16GHz MacBook Pro, which is a little over 3 years old. Over the last year I’ve had an odd problem with it, which has gotten severe in the last few weeks. The problem was that it would suddenly disable the Ethernet port and the USB ports, disconnecting mounted disks and freezing networked services. The only workaround was to reboot or sleep/wake. I finally found the cause and fixed it last week. My guess is that pretty much all MacBook Pros of similar age and design will develop this problem, so read on if you have a similar issue.
Continue reading “Fix for MacBook Pro sudden USB and Ethernet port failures”