• xorg 1.4.x on Fulong

    So once I got gentoo installed on the fulong, I decided to do an emerge world update on the system. Yes, there were some problems during this and the KDE update was a bit hairy, but it did eventually install everything in the list.

    One issue I found with it was that the emerge would go for a while, then die with a compile error. If I started the emerge again it would continue for a while, then die again in a new spot on a different package. I had to do this iteration more than once because of packages breaking during compile, even though when restarted they would compile fine. Is this a problem with the Fulong where it is getting overstressed or something? The system has a full gigabyte of RAM installed so that is probably not the problem, unless there is some spot in the memory stick that is bad that I do not know about.

    Another thing I found was that X broke. Everytime I fired it up, it would die with a segfault. Eventually I found a patch that was running around out there from Zhang Le that fit the bill, and once I patched it with his patch it started to work again. Apparently this is a problem with the 1.4.x series of X. In my case it is a pre-release version (

    The patch I installed is now on my local web site.

    There are also still some problems with KDE, so I am now in the process of unmerging KDE completely from my system so that I can put in something else that I more prefer. Still haven’t quite decided WHAT, of course… 🙂

  • Happy Birthday!

    To me!

    Yes, I am a leap-year baby, so I only get to do this once every four years. Yay!

    OK, so much for that. The thing is, birthdays for me are just not all that important. I guess not having one but every four years, at least in my case, makes it seem less important or something. I dunno.

    I’ll be writing another entry later today detailing what I did to get X working on my Fulong.

  • Tivo Recovery

    So, last night I thought I had lost my Tivo. It appeared to have died after a power outage caused by a big thunderstorm in the area (I heard the transformer blow up down the street after I lost power.) Once the power came back, it was just hanging at the “almost there. just a few minutes more…” screen, and not getting any further. I let it sit there all night and it didn’t get anywhere.

    This evening I pulled the system apart and yanked the drive, figuring that the drive was just old and dying, but maybe I had a shot at firing it up one last time and pulling a copy off of it. I followed the directions (well, sort of…) on the following website:

    A Step by Step Guide to Upgrading the Hard Drive Capacity of a Tivo Series 2

    I diverged a bit from their instructions when it came to how I hooked up the drives, as I have a couple of external USB->IDE drive cages that make it easier to do than pulling a machine apart to hook drives into. So using these I did the quick recovery version of the instructions to just pull over the system, then put the new 120gb drive (an extra 50% capacity… woot!) into the Tivo.

    On starting of the Tivo, I thought I was still doomed for a bit there as it was still displaying the “almost there. just a few minutes more…” screen, but that cleared up after… what do you know? A few minutes. 🙂

    So I am now the proud owner of a 120 hour Tivo Series II box. 🙂

  • Modulo Arithmetic Issues

    Interesting… I don’t know if I got the bonus question right or not, but now I am finding some interesting things about it. It turns out that I am both right and wrong about the properties of taking the modulo of a negative number.

    I did quite a bit of testing to make sure that when you take the modulo of a negative number, you receive either a negative number or zero. This was true whether I used php, emacs, bc, or an online calculator I found.

    However, apparently when programmers were first writing the modulo routines they decided on a slightly different approach as to what modulo actually meant and came up with the current solution, which generates a negative number. Hence:

    The mathematical definition:


    The Computer Science definition:


    So, looking at these there is a difference between the two, but I favor the computer science version in this case since we are dealing with indexes that are to be used on a computer system where this is defined in the CS method.

  • Testing offer

    Just made an offer to Stuart Longland to do some stage testing for the 2008.0 build of gentoo on various platforms. I have in my possession a Lemote Fulong, an SGI Origin 200, and an SGI Indy r5k machine (I also have an r4600, but we won’t go into that… I’m not even sure if it works.)

    Doing this sort of testing is just the sort of thing that I enjoy working with, and I have the equipment almost setup and ready to go now to actually do it. I have to pull out a big-ass Gateway server that is sitting in the rack improperly in order to put in some rack rails that will support it, but once that is done I can install the rest of the rails that I have for the rack and rack up the Origin 200 and possibly the Indy, assuming the rails will work for it. Otherwise I may just have to set it on top of the Origin 200 instead.

  • Hash tables and bit buckets

    So I was working on homework for my database II class this morning (very early this morning, I might add) when I came across the final problem asking what a hashing table with the following hashing formula with various values of B plugged into it would be useful for:

    H = n2 mod B

    Now, using the value of 10 for B doesn’t really help all that much, as you leave four of the buckets empty at all times and four of the other buckets will get double filled, assuming an equal distribution of values for n (0,1,2…) But there is a reason to use this! What happens if you set B=2, and start plugging in negative values in for n? Well….

    • 102 mod 2 = 0
    • 112 mod 2 = 1
    • 122 mod 2 = 0
    • etc.

    We get alternating values of 0 and 1. But we could do this without going the extra step of squaring the value and get the same result, right? Well, yes and no… what happens if we input a negative number for n?

    • (-10) mod 2 = 0
    • (-11) mod 2 = -1

    Uh-oh! Now we have a situation where we are getting a value that does not fall into a bit bucket that exists! What to do, what to do? Well, if we square the value of n in this case, all of the even values of n, whether they are positive or negative, will fall into the 0 bucket, and all of the odd values of n, positive or negative, will fall into the 1 bucket:

    • ( -10)2 mod 2 = 0
    • (-11)2 mod 2 = 1

    Thus, problem solved! Now I just hope that I got this right and I get the nice extra credit that I so richly deserve for being a fucking genius. 🙂

  • The Taming of the Shrew

    Last night I went to see a performance of Shakespeare’s The Taming of the Shrew. Now, this was not done by some world renowned acting troupe, nor even a college level group. No, it was done by one of the local high schools. Now, that being said, it was actually quite good. Of course, I also know a good portion of the cast, so I am supposed to say things like this, but if any of them ever read this, they know that I don’t pull punches when it comes to criticism. I just say it like it is, and if they can’t deal with it they are probably in the wrong business to begin with.

    Now, I have never seen this play before, nor do I believe have I ever read the play in school or anywhere else. It would probably have been a bit prudent of me to at least have read a one-page summary of what it was about prior to going, but oh well. The reason I bring this up is that for the first fifteen minutes or so of the play I was completely lost in what was going on. There is a certain amount of adjusting one has to do in order to get into the feel for Shakespearean prose, and when you couple that with a main character who is battling an oriental accent in order to get their diction right, well, it was difficult to say the least.

    The girl playing Kate (or Katherine, or whatever) did a fine job, though the first half of her work took hardly any actual acting. The final monologue from her took a lot, however. I guess you have to know the play in order to understand what I am talking about here. Needless to say, she is a person who has a will of her own normally.

    The guy who played Baptista is, quite frankly, an ass. Always has been. He can act, but he has a tendency to overact, mainly because he believes he is better than he truly is. Oh, he’s good, I’ll give him that, but he isn’t the best, and eventually someone is going to show that to him, and I have a feeling when that time comes, it is going to be painful.

    Now, the guy who played Biodello is an awkward youth. Hopefully he will grow out of this eventually, but for now he needs to learn how to stand straighter, perhaps go through a movement class or three, because on stage he simply looks very awkward.

    The rest of the cast did fine, and I really didn’t see anything that bad occurring, nor that stupendous that it requires pointing out here.

    One incident that did occur in the show was a dinner scene in which one of the serving wenches tripped and crashed into the table, sending everything on the table down onto the floor, and breaking the wine bottle that had been sitting on the table. Glass all over the floor, no easy way to play it down. It took them three or four attempts between scenes to clean it up properly, when what they should have done was get a dustmop on it in their first break to get the glass out of the way. Actors can deal with a wet deck, but glass is just bloody dangerous.

    The other momentous occasion occurred in a break-out scene with Bianca and her two suitors who were vying for her hand in marriage, one through intellect, the other through the arts. The one who was trying through the arts had a mandolin in hand, and as he sat there flirting with Bianca, mandolin sitting in his lap with the neck pointing out like a phallus, it rose as he felt that he was getting closer and closer to victory… right up to the point where she shoots him down, at which point the mandolin also came down to lay there…. limp. The person sitting with me had to restrain me from truly breaking up in laughter, as it was subtle the way he did this, and there were parents in the room whom I do not think realized just what was going on… not to mention their much younger children next to them who really did not know what was going on.

    So there we have it, another play done and over with, something that I hopefully will not ever have to go and see again.

  • Gentoo on Fulong

    So, a couple of days ago, I decided that it was high time to install a different version of linux on my Lemote Fulong.

    First of all, the Lemote Fulong is a Chinese desktop machine designed for low power with a decent amount of capability. It is a MIPS based machine, using pretty much all of the MIPS architecture that is not patented by various other corporations. As such, it works pretty well in this regard.

    It only runs linux based operating systems, as Microsoft certainly never wrote a version of Windows for the MIPS architecture. The closest they have ever come is by writing Windows NT for the Alpha architecture. So linux it is.

    By default, the Fulong comes with a modified Debian installation installed, and that is maintained by the Lemote corporation. Unfortunately they do not maintain everything as up-to-date as I would like it, so I went searching for other distributions. I found that Stuart Longland had been working on getting gentoo working on the Fulong, so I patiently waited for him to get something going. That day happened last week.

    He had released a kernel for the machine a while ago, but the rest of the distribution was still coming along. Last week he released a liveUSB image of his distribution for use, and I quickly grabbed that and started playing with it.

    His instructions included putting a netboot kernel and the liveUSB image onto a flash key and booting the entire system from the key, but I would rather use the keys as little as possible, so I put the kernel onto a tftp server I have available to boot from instead. From there I was able to bootstrap into the liveUSB image and play around.

    Of course, this wasn’t enough, and I wanted the entire thing installed onto the harddrive of the fulong instead. My first couple of attempts didn’t go so well, and ended up in a mess. Finally I was able to build a distribution on the harddrive that had a working kernel that would boot, and I am now good to go with a full gentoo distribution on the harddrive, and I can now remove the USB key for good from the system.

  • Disney and V&A’s

    This past weekend I went to Disney World with some friends of mine. Now, I hold an annual pass so I get in there for free, as do they. These friends of mine like to go there more to stay that the resorts and get away from things back home and at work, whereas I prefer to go to the parks in order to get away from everything.

    We drove down on Friday evening, and about half way there I realized that I had left my wallet in my car back at their house, so I was completely without any funds, ID, or anything else. This… sucked. I had my pass with me, so I would be able to get into the parks, but if I wanted to do anything else I was completely reliant upon them for funding, etc.

    I also kept feeling my ass because my wallet was missing, but that is a different matter.

    So, as we were approaching Disney we were debating where to eat. Now, I don’t have any real preference on where we eat, as I can eat just about anything anywhere, so I let the others in the truck argue over where to go. There was some debate on going to Jiko which is in Animal Kingdom Lodge, and we even managed to get reservations there. Then they decided that it might be more fun to go to Citrico’s in the Grand Floridian instead. We have a waiter there who is a good friend, so we managed to get reservations there instead without any issue.

    We got to Disney and checked into our hotel (Buena Vista Palace Hotel & Spa), then drove over to Citrico’s for dinner. Nice dinner, as always.

    On Saturday, my friends were a bit… slow… in getting going. We went to breakfast at the Concourse Steakhouse in the Contemporary Resort. Decent little place to get breakfast, though I am not a big breakfast person. From there we went to Hollywood Studios (formerly known as MGM Studios) and went to see exactly one thing… Walt Disney: One Man’s Dream. After that we left the park. Yeah… we went and saw one thing. As I said… they go to enjoy the resorts, I go to enjoy the parks. Ah well. We then went back to the hotel and rested until late afternoon, when we got all gussied up to go to Victoria & Albert’s in the Grand Floridian.

    Now, Victoria & Albert’s (aka V&A’s) is not some restaurant where you can just check in at anytime. This is a restaurant where you have to be in coat and tie (if you remove your coat at the table, they ask you to put it back on) or a dress… basically you have to be dressed to the nines just to get in. This is a full-service restaurant where you are escorted to the bloody bathroom if you have to go (no, they don’t follow you inside, but the do escort you to the door.) The prices are fixed (>$100 a seat, guaranteed) but you get a full seven course meal that is very very good.

    The maitre-de and waiters know their stuff as well, and if you want a specific wine they probably have it, or can recommend a number of substitutes for what you want.

    Anyway, a really good meal was had, and I even found a new wine that I enjoy, which is bloody impressive seeing as I only like sweet wines that don’t have that bitter dryness to them.

    Afterwards we got back to the hotel, and I was still feeling antsy because I just had not moved around enough that day, so I walked across the street and the whole way through Downtown Disney and back before going to bed.

    The next day we went and had breakfast at Rainforest Cafe just outside of Animal Kingdom, then went in to see the Finding Nemo show and then go on Expedition Everest. From there we went home.

    Again, I would have done a lot more in the parks during my stay, but my friends are just not ones to do so, which is unfortunate.

  • Infiniband Network Mapping

    So, recently I had to figure out a way to produce a map of the infiniband fabric. What this means, and how to display it, was a different matter. I had a number of tools available to do so, but the most important one I found was the ibnetdiscover tool that is packaged with the OFED (OpenFabrics Enterprise Distribution) software stack.

    This tool allowed me to find the infiniband connections between the different switches in our fabric and the connections to individual nodes. Of course, all it would tell me is the IB GUID associated with each switch and node, although the nodes would let me know that they were connected to via “HCA-1”.

    To fix the switches, I had to go to each switch and get their GUIDs manually and enter them into a file that ibnetdiscover supports as a lookup file. Not so bad for the 24-port edge switches that we have from Cisco, but the Silverstorm switches are unmanaged, and we cannot login to them. Fortunately I was smart when I installed the Silverstorm switches and grabbed the GUIDs off of them when I installed them.

    The larger Cisco 9600 series (also known as TopSpin 270) switch was a much larger problem, because none of the GUIDs detailed by the software matched anything that the 9600 series switch shows in queries sent to it. Mapping that out was a pain, and the way that things are apparently connected in a 9600 series switch is interesting. There are three different kinds of blades in the 9600 series:

    • Port blades where you physically plug infiniband cables into the card
    • Management blades which plug into the back of the switch and manage the port blades
    • Super management blades which manage the management blades.

    These are all interconnected: 2 port blades connect to a single management blade, which in turn are connected to each of the super management blades. So, when a message comes in across one of the cables, it enters through a port blade, goes to a management blade, which in turn decides whether it should go out another port on that same port blade, through a port on the other port blade that is attached to the management blade, or up to one of the super management blades. All of this is of course figured out via the subnet manager engine which runs on the 9600 series switch (in our case). That subnet manager can also be run in software on any host node, but because of the size of the infiniband network that we have, it was better to offload that to an actual hardware based subnet manager. I was able to figure out these interconnects on the 9600 switches by using the ibtracrt command against LIDs.

    So, I had the different GUIDs allocated to different switches, but what about the individual nodes connected? All I was getting was “HCA-1” out of them, and trying to override via the lookup file wasn’t working. The problem turned out to be that when infiniband is firing up on the nodes, it was firing up so early that getting the hostname was not occurring, so all it had to go on was that it was connecting via port 1 on the infiniband HCA. By setting up a command to cat the hostname into the sys value on each node, this was fixed and the proper names were being displayed.

    Now that I could get an output to come out that was right, it was a simple matter to write a perl script that would take this output and convert it to an output that would work well as an input for the program “dot”, which took that input and produced a very nice GIF of the infiniband network mappings.