I booted into OS X today and tried running the unit tests for my PHP driver. It chugged away for a while, then gave me “bus error”. Great. Gotta love C error messages. I narrowed it down to when I insert 253 or more elements into MongoDB. Now, that number was suspiciously close to 256, but I couldn’t think why that would be. I tracked it to the encoding code, then to the _id class code, then to the _id generation code. Surprisingly, it was doing its “bus error” thing before any memory access, it was just reading a file. I suddenly realized that I wasn’t closing the file after reading it, fixed it, and it ran perfectly.
This was written in April of 2009. It is very out of date. See http://rcrisman.net/article/11/installing-mongodb-on-hostmonster-bluehost-accounts for more up-to-date information (as of August 2010). Keep in mind that shared hosting with Hostmonster is very lame. They only lets you run a program for 5 minutes before killing it, so it’s fairly useless to install MongoDB unless you have a dedicated IP.
I finally got MongoDB working on this site, so I’m going to start switching stuff over from MySQL. I’m biased, but I think it’s just an easier database to use.
And, because I like writing tutorials… How I did it:
- Downloaded the binary I created of MongoDB for “legacy” Linux. I originally compiled this for a user on Mandriva 2006 (see previous post about VMWare), but it works fine for other old Linux distros, too.
$ tar zxvf mongodb-linux-i686-old-linux-1.tgz
- Make a directory for the database to put files in:
$ mkdir /home/user/data
- Upload libjava.so, libjvm.so, and libverify.so. Make sure they have execute permissions and put them somewhere like /home/user/lib.
$ export LD_LIBRARY_PATH=/home/user/lib
replacing the path wherever you put the .so’s above.
- Start the database:
$ cd mongodb-linux-i686-old-linux-1 $ bin/mongod --dbpath /home/user/data --nojni run
I cheated a bit and didn’t install Java, so I had to use the –nojni option. If you install Java, you won’t need that (and you won’t need to upload the individual .so files).
Now, what good is a database if you can’t use it, right? So, I downloaded my PHP driver (go to its Github repository and click “Download” for the latest version). I then followed the install instructions and put the .so generated by
make in /home/user/extensions.
I changed the options under “PHP Config” in Hostmonster’s CPanel to use php.ini in /home/user/public_html/php.ini, and then edited that file to use my extension.
I made a simple test page with:
Which connected me to MongoDB, showing:
when I loaded the page!
On Friday at work, I wrote a short post extolling the virtues of VMWare. It was freakin awesome. I had to debug a problem a user was having on a 3-year-old version of an obscure Linux distro, so Eliot (my boss) suggested using VMWare. It was so cool. I found a site that actually still had the distro available, downloaded it, installed it on a virtual machine, and got the exact same error the user was getting! Awesome.
Then I went home, figuring I’d work on it more when I got there.
When I got home… my wireless internet didn’t work. The kernel module for it wouldn’t even load, and when I ran ifconfig, it printed two new interfaces: vmnet1 and vmnet2. It turns out VMWare does something to some types of kernel modules. Damn you, VMWare!
For some reason, I’ve always had computers with Atheros wireless cards, which are very touchy about things like working. So, I started trying to get it going again. This pretty much describes how it went: http://imgs.xkcd.com/comics/success.png. Around 11pm, I gave up, and decided to leave it until Sunday, when I could look at it with fresh eyes.
Today, I booted into Linux to give it another shot. Or, rather, I attempted to boot into Linux. But, I had somehow messed up the modules in a way that made my system unbootable.
So, now I’m reinstalling Ubuntu.
Here’s hoping I make it to shore before the sharks get me. I’m going to be running VMWare from the OS X side of things from now on.
I finally put up another comic. I’ve been delayed for two reasons: first, I’ve been really busy with work. I’ve done some major work on the PHP driver, so it should now be easily installable on Linux and Mac (it’s also faster).
Second, I’ve been wanted to add a “one shot gag” section, which requires some fairly major rewriting of my site code, so I tried to get Git set up on Hostmonster (my hosting provider). I got it set up fine, but the money-grubbing jerks at Hostmonster block outgoing ssh unless you pay for a dedicated IP. So, I can’t put the source of my site on Github, which is sad. However, at least I have Git set up locally, so I don’t have to worry about breaking stuff.
Anyway, hope people enjoy the one-shots. More coming.
(Which is a terrible book, by the way.)
I read Schneier on Security, which is an interesting blog about security and squids. (Wait, is the plural of “squid” just “squid”?) See, every Friday he post something squid-related, and last week it was an 8-foot squid pillow. Well, obviously I had to make one for myself.
I went to one of the fabric stores on Orchard Street to get fabric. “How much per yard?” I asked the salesman as he pulled down a bolt.
It had a stupid flowed pattern on it, and I wouldn’t want my 8′ stuffed squid to look ridiculous. “How about that one?” I asked.
“And that one?”
“Okay, I’ll take two yards. How much is a package of stuffing?”
In retrospect, I should have asked for ermine.
I got home, cut the pattern out of newspaper, pinned it to the fabric, and cut out all the pieces. I pinned everything together and I pulled out my sewing machine. I put the first piece in and started up the machine. It went fwipafwipafwipafwipa. All was right with the world. As I started down the second seam, it went fwipafwipafwipaSCREEfwipaSCREEfwipaSCREECH-SCREECH-SCREECH.
I unscrewed the case and looked for parts that could be oiled. There were, as far as I could tell, two moving parts. I oiled them, put everything back together, and tried again. Now, not only did it screech, but the needle didn’t move up and down. I had apparently oiled something that once moved the needle through friction.
So now I have a paperweight. I’m going to have one more look at it and then find a sewing machine repair shop.
It annoys me that I can easily partition my hard disk or install more RAM on my computer, yet a machine built in 1918 has gotten the best of me.
Keeping with this website’s themes of mollusks and dating…
Live, nude mollusks!
An entertaining, educational, very strange video about how slugs have sex. Not for the faint of heart. There’s more mucus involved than you can even imagine:
I am the first result for “snail in a turtleneck”! (Okay, not terribly surprising.) What was really entertaining was the ads it generated, though:
Target: for the finest in snail turtlenecks.
I was eating lunch today and reading my RSS feeds. Every half-dozen spoonfuls or so, I’d look at my bowl to plan my next phase of attack, but mostly I was just reading the blogs. Near the end of my soup, I looked down and saw a big clear chunk on my spoon. Now, I’ve been trying to get better about eating onions that haven’t made a trip through a Cuisenart, but this was rediculous. I picked it out. And realized that it was a chunk of glass.
A lot of the glasses have cracks in them, so one must have broken in the dishwasher and a piece fallen into the bowl. I’m going to be very careful about rinsing bowls out before using them, from now on.
I keep imagining it slicing open my gums, tongue, throat, or stomach, if I hadn’t happened to look down. Ugh.
I was looking at real estate listings today and there was one place that had “1.1” baths. I’ve heard of 1.5 baths, but what’s .1 of a bath? A bidet?
I saw a video today about how Microsoft imagines 2019 to be. It gave me the idea of how to do a better RSS reader, which is something I’ve been thinking about for a while. It’ll have a main page with snippets of stuff in sections like a newspaper, and you can click on a section to expand it, then close it when you’ve read it and if it’s marked as read, it’ll be deleted from the main page.
Hopefully I’ll be able to program it up soon, maybe this weekend.