Monday, February 22, 2010
Sunday, July 12, 2009
ri documentation for MacPorts Ruby 1.9.1
My giving-back to the Internets for the day:
I installed Ruby 1.9.1 onto my Mac using MacPorts, and found that 'ri' didn't work to start off with—the system classes weren't on the documentation path (as noted in this issue). I tracked down the problem to this file:
/opt/local/lib/ruby1.9/1.9.1/rdoc/ri/paths.rbTo get it to work, change this line (line 31 in my install):
if m = /ruby/.match(RbConfig::CONFIG['RUBY_INSTALL_NAME'])to look like this:
if m = /ruby1.9/.match(RbConfig::CONFIG['RUBY_INSTALL_NAME'])Once this is done, ri1.9 should find the standard documentation.
The problem is caused by the non-standard install path used by MacPorts for this not-yet-mainstream version.
Labels: ruby
Friday, February 08, 2008
Yay Google!
Labels: google, tech, waste of time
Saturday, January 12, 2008
D-Link: Building Networks for Masochists
In our move to New Zealand, we're trying to cut costs by buying used items where we can. We lucked into finding some graduating college guys who were clearing house and selling everything, so we bought a bunch of stuff for a good deal.
Amongst this stuff was a DSL modem/wireless router. We definitely needed such a beast, and new ones here are ungodly expensive, so that was cool. However, it was made by D-Link. I'd had limited experience with D-Link products, but I wasn't particularly impressed b them. It was only a vague ambivalence, and it still seemed a good deal, so we went with it.
We get it home, and first thing I find is it has a British-style power plug on it, which is not at all the same as a New Zealand plug. The guys who sold it to us were, I believe, Malaysian, and it turns out they must have brought it from Singapore (which apparently uses British-style outlets). Not really the router's fault, but not a good omen.
So I set it up and it seems to mostly work. The administration website is horrifically designed, but how often do you have to deal with it? All the time, as it turns out, as it doesn't seem to hold persistent settings very, well, persistently. But it still mostly works, so OK.
But Sheila starts having problems going to certain web pages. Can't check her e-mail. Can't log into her bank account. Most any secure page just doesn't work. Just sits for a few seconds...then nothing. My Mac, however, had no issues (which of course led to more gloating on my part).
Thought at first it could be some malware, but she's pretty careful about that, and it didn't feel like it. Seemed like timeouts, like the bloody router was dropping packets. (Unfortunately as a combo modem/router, we couldn't take it out of the picture to verify.)
Futzed around a bit, did some Googling...saw others with similar problems but no solid solution. So finally I sit down to have a better look at it. Install Wireshark (what they're calling Ethereal these days, if you were unaware or forgot like I do every time I learn the new name). Capture packets during a failure...and it's immediately apparent: nice, black-highlighted lines, ICMP messages from the router, saying 'packet dropped; too large for next hop, fragmentation required'. Yeah, MTU stuff, which I kinda guessed.
So I learn a bit about PMTUD, or 'Path MTU Discovery' protocol. It's a way of dynamically optimising MTU to a particular destination by first sending larger packets, looking for responses saying, "nope, too big', and sending again, making them smaller till they fit down the Intertubes.
In my case, MTU from the router out to the Internets was set to the provider-specified 1492, which sounds appropriate for a PPPoE DSL connection. The 'too-large' packets were 1500 bytes, which, checking my calculator, is larger than 1492. So, yeah, problem.
But the router told the compter that it's all whack. Why don't it listen?
Looking at the response ICMP packet a bit further, the info about the failed packet ain't right! TCP sequence numbers don't match and are huge. Checksum failed. On all of them. So it's like going to the drive-thru and all you hear through the loudspeaker is garbled static. You try a few more times, "I WANT A CHEESE BURGER PLEASE", but eventually you give up and drive off.
Okay, terrible analogy. But I'm guessing that the computer's IP stack couldn't correlate the response with the original packet, so it thinks it was just lost, and tries again a few times then gives up. (Why no problem on my Mac? Dunno...maybe it has a smaller max MTU. Maybe it doesn't set 'do not fragment'. Maybe it makes a guess at correlating, or decreases the packet size on retries if it sees no response. I'll have to check it out.)
So, first thought: firmware upgrade on the router. I look and see it's running what appears to be version 1.00 beta, which sounds old to me. So I go to dlink.com and find the download page and see a pretty-recent 2.00 version and think, 'cool!'. Then I see the big warning saying how 'this firmware is engineered for North American products only and using it on another product may render it inoperable', and think 'crap!'. So I check out the Singapore support page, and find a couple of inconsistent links to various downloads, with specific versions for Thailand and some for Singapore...is that really necessary?! Most of them are pretty old, and most seem to say 'only for ADSL2 connections, breaks ADSL1'. Some appear to be for very-particular bug fixes, but they're just in a plain directory listing, no info to go on. There's a reference to the firmware shipping with it, which is still the same bloody beta version that I already have!
Eventually I get scared and give up on that path. Figure out a way to adjust global MTU on the machine to 1492, and all is golden. Not a great solution, but a workable one.
So what's my point here? Well, if somebody else has this problem and Google points them here, maybe they'll find a solution hidden amongst my ramblings. And also to note that you can just see the chaos and ad-hoc nature of sofware development at D-Link, from the outside. From the terrible design of the software, from seeing the (presumed) bugs in the software, from seeing that they have different software for every bloody country they sell to! I've been in enough bad-enough development environments to know the signs, but for me they've had the good grace to collapse before going to market.
Or, in short: I think I'll avoid buying another D-Link product in the future.
Labels: disappointments, tech, whining
Monday, December 24, 2007
Arbitrary Quote
Truth is, I've been spring-loaded my entire life. Life gets shot at me from point-blank range and I just shoot straight back. Which is okay if you're John Wayne or De Niro saving the world, but when your chief nemesis is bubble-overrun it's slightly less convincing. When you're younger, you think you're the only one. Special. Then you start seeing spring-loaded people everywhere. Sitting on buses. Kicking their dogs. Beating their children unconscious. Road rage. Trolley rage. Pew rage. Soul rage.
— Overdue new Releases, Matt Johnson
This from the book I'm currently reading, and rather enjoying, by a local Wellington author.
Labels: literature, rage, wellington
Tuesday, October 30, 2007
Geeking out, Mac style
I. Love. My. Mac.
Apple has truly seduced me. I bought a low-end iBook back in 2004 to check out OS X, which sounded great on paper. It was running 10.3 Panther at the time, which was pretty cool. Then 10.4 Tiger came out, and I loved Spotlight and Exposé, enough so that when time came to move to New Zealand and I was shedding computers, I decided to make a Mac my only machine.
And so I bought a spanking new 15" MacBook Pro. And while my MasterCard smoked for a few days afterward, I never once had the slightest twinge of regret over my purpose. It is simply fantastic. The quality you get for the money is astounding.
And now I've just upgraded to 10.5 Leopard, and I just sit here and drool. It looks stunning, which is great, but then you get to using the new features, and it just works. The new Finder Cover Flow and Quick Look are so amazingly slick and fast I'm still amazed; give me a week and I won't be able to imagine living without them. Time Machine is trivial to set up and just works (though on this one the delivered reality is rather less impressive than the vaporware I remember from a year ago...even Apple isn't perfect). Spaces is the most elegant implementation of multi-desktop that I've seen. Mail's parsing of contact info and appointment information is a really cool concept and works pretty well. So far, absolutely no regrets over shelling out NZ$199 for the upgrade.
Yes, there are still some things that you can't do on a Mac. Last night I had to borrow the wife's PC laptop to load some New Zealand maps onto my Garmin GPS. Connecting to my company's VPN uses a PC-only solution. But it's getting to the point where I view these exceptions as a weakness in those products rather than seeing the Mac as an 'also-ran' platform. (Garmin, to their credit, is finally getting around to supporting Mac, but they're not quite there yet.) Of course, I could always shell out for a copy of Windows and dual-boot or run something like Parallels, but at this point I don't see the value for the money.
And since I mentioned it, I will put in a plug here for the New Zealand Open GPS Maps Project, which provides free auto-routing street maps for Garmin GPS. The price is much better than the near-$300 that Garmin wants for their equivalent, and after limited experience, I can't see anything that's missing.
Monday, April 30, 2007
Medieval Architecture Comes to the North Bay
A few weeks ago my wife says, "Some guy built a castle in Calistoga and they're giving tours...wanna go?"
(Context: Calistoga is a town at the north end of the Napa Valley, about half an hour from us.)
I just stammered: "Castle? Calistoga? Huh?"
"Yeah—they brought in artisans from Italy and everything. It's a winery."
I remained dubious. It sounded like a gimmick and completely arbitrary. I feared kitsch.
But Sheila was quite excited by the prospect, and there are certainly worse ways to spend a weekend than a visit to Calistoga. So we managed to book space on a tour this afternoon, and drove out there.
It took me about 3 minutes to completely change my mind. It was, in every way my feeble mind could perceive, a 12th-13th century Italian castello. Except in the Napa Valley. And brand spanking new. It has to be among the most remarkable buildings in all of the Bay Area. The stonework is amazing, the vaulted ceilings, the frescoes, the towers. And the part above ground is dwarfed by the labyrinth of caves and tunnels beneath (used to store the wine, of course), all with cross-vaulted brick ceilings.
All of this managed to get built in the regulatory environment of modern-day America. Northern California, no less. The cost was, of course, enormous, and building it was a 14-year ordeal that pays tribute to the sheer tenacity of the owner with this vision.
In the end, I guess it's still rather arbitrary to have a Tuscan castle in California wine country, but I'm fully behind it now. Where, after all, would not be improved by being a little more Italian?
Information: Castello di Amorosa.
Labels: architecture, california, italy, wine
