chrishowie.com

Linux

Comcast modem fun

by Chris on May.15, 2009, under Computer, Linux

Well, the Comcast guy showed up today and dropped off the modem self-installation kit. About two or three hours later and it still wasn’t working quite right.

Here is my setup. The modem is plugged into eth0 on a Linux box, and eth1 runs to a switch. Traffic routed out eth0 is masqueraded (also known as NATed). If the modem and Linux box are turned on then everything works fine. But if I bring eth0 down and back up, then some odd behavior begins. All traffic that originates on the Linux box behaves normally — I can use elinks to browse the web and irssi to chat on IRC without any problems. But any traffic that is masqueraded, meaning that it comes from another computer on my network, does not behave normally. The connection establishes and works for a split second and then is silent.

I’d suspect a routing problem on the Linux box, but tcpdump there confirms everything is working as it should. However, ifconfig reports RX errors on eth0. This makes no sense — traffic originating from the LAN side of the router box triggers receive errors on eth0. Unless I reboot the router and the modem. I have not observed this behavior with any other ISP or uplink switch.

Anyone have any theories?

6 Comments more...

The new Gazebo: a Gtk# interface to FICS

by Chris on Apr.17, 2009, under C#, Chess, Linux

I’ve abandoned my idea of creating an AJAX interface for the time being. It is a cool idea but I think I can do much better by writing a proper application.

The Linux FICS interface scene is rather weak. eboard is about the best there is in terms of usability, and it has its share of problems. xboard is there for the minimalists who want their interface to provide a chess board only. When compared with the powerful and extensible interfaces available for Windows it’s rather a shame there’s nothing similar for Linux.

So I’ve decided to take the name I was going to use for my web interface and apply it to a new Linux interface. Building on Mono.Addins, I’ve already got an interface that can be extended in several key ways. Addins can, for example, provide new text highlighting classes or classes that can manipulate the console text buffer in interesting ways.

Using a tip from jonp in #mono, I have now come up with an extensible preferences system that does not suck, based on XLinq. Addins can simply subclass PreferenceContainer, slap on a few attributes, and they have an easy-to-use set of strongly typed preferences that get automatically serialized to XML. Right now only the basic primitive types and strings are supported, but this will be extended later to include things like arrays, lists, and XLinq objects. Thanks to Mono.Addins and some more support classes I wrote, addins can also provide Gtk# widgets that get embedded into the application preferences window. By writing very little code, addin authors can persist their settings and provide the user with a convenient way to change them.

I’m still lacking a chess board though. If anyone likes writing custom widgets and feels comfortable working on this project let me know. The sources will be made public in the coming weeks after I’ve had a chance to polish them and set consistent style guidelines.

3 Comments more...

Host configuration

by Chris on Dec.31, 2008, under Computer, Linux

Switching to a new web host is always fun. I spent most of Monday and Tuesday trying to get the Subversion client and Apache module installed and working. Today I tinkered with Sendmail enough to get it doing what I want.

Installing Subversion was much more tricky than it seemed at first. My host has libapr 0.9.4 installed, but Subversion requires at least 0.9.7 since earlier versions can corrupt fsfs repositories (which is the type I prefer). I tried 1.3.3 and ran into some interesting problems.

The core issue was that 0.9.4 was in /usr/lib, and the dynamic linker was grabbing that one for Apache before 1.3.3 was loaded for the Subversion module. Since 0.9.4 was loaded first, and 0.9.4 and 1.3.3 share symbols, some of the functions the Subversion module calls were being incorrectly linked to the 0.9.4 version, which presumably is not ABI-compatible since the major version number differs. This resulted in segmentation faults on every request to the server, effectively taking down my website. In order for this to work I would have to get the dynamic linker to take 1.3.3 first, but then Apache would have the same issue — using an ABI-incompatible version of a library it was linked against.

So I got 0.9.17 and installed that, then ran into another dilemma. 0.9.4 is in /usr/lib, so it gets priority. The dynamic linker was still loading 0.9.4 first and loading 0.9.17 when Apache loaded the Subversion module. This means that the module, while linked against 0.9.17, would effectively use 0.9.4. So corruption of fsfs repositories would still be a possibility.

This is where a bit of the weirdness begins. My host gives me write permissions on just about every directory, including /usr/bin and /usr/sbin. But for some reason, not /usr/lib. So I couldn’t just divert the libapr-0.so symlink over to 0.9.17. I was stuck here for a while, mulling the issue over.

A few hours later I returned to the problem with an idea: /etc/ld.so.config. This is where the list of library directories are stored, and the first ones listed get searched first. /usr/local/lib was at the top, followed by /usr/lib. Since I installed libapr in an alternate prefix (/usr/local/apr), I had two options: symlink to 0.9.17 from /usr/local/lib, or add /usr/local/apr/lib to /etc/ld.so.config. Yes — /etc/ld.so.config was writable, and /usr/lib was not. Go figure.

I decided to add my libapr path instead of symlinking. And now all is well in the Apache world.

That describes the last two days. Today I had the unpleasant task of trying to convince sendmail that mail for chrishowie.com should not be delivered to local mailboxes on the web server, since I don’t use my host’s mail service. After poking around with sendmail.cf for an hour or two and not making any headway I joined #sendmail on Freenode and requested help. Between all the comments about how my server’s hostname should be www.chrishowie.com and not chrishowie.com (something that’s out of my power to change) I got some pointers that lead to a new, minimal, and working sendmail configuration:

OSTYPE(`linux')dnl
DOMAIN(`generic')dnl
FEATURE(`stickyhost')dnl
FEATURE(`nullclient',`chrishowie.com')dnl
undefine(`ALIAS_FILE')dnl

Ta-da. Now all email sent from the server goes through my domain’s real mail servers.

That’s the last thing I had to do to get my hosting where it should be. At this point I consider migration to the new host complete. Now I can return to coding that C# networking stack…

Leave a Comment more...

Linux Virtualization

by Chris on Jun.26, 2008, under Computer, Linux

I’ve been using VirtualBox for some months now. It’s pretty slick and doesn’t get in my way too much. Just for the heck of it I’ve been experimenting with a few other similar systems: OpenVZ, vserver, KVM, and Xen. OpenVZ and KVM are the only two I’ve tinkered with long enough to at least have a clue what’s going on.

I was trying KVM at the suggestion of someone in #debian who seemed to like it a lot better than VirtualBox. After playing with KVM I’m not sure where this opinion came from. Just getting KVM and libvirtd to the point where I could actually run a VM took over a half hour. The virt-manager GUI looked nice but was buggy in some spots, and the lack of guest OS drivers meant that many things were a bit sluggish. On the plus side, networking was much easier to setup — but only sometimes. (If you add a network card *after* creating a VM you cannot choose which mode to run it in and are forced to use usermode NAT.) Another cool feature was emulation of a tablet pointing device in addition to a regular mouse device. This means that KVM doesn’t need any guest drivers for mouse integration, because it set the pointer position using the tablet.

At the end of the day, VirtualBox still wins for desktop virtualization. I’m still keeping KVM on the radar though.

1 Comment more...

Bluetooth presence detection

by Chris on Apr.14, 2008, under Computer, Linux

I recently found my USB Bluetooth adapter and have been tinkering with using it to talk to my Palm. I’ve successfully configured Linux to allow PPP connections over Bluetooth, so I can sync my Palm if I don’t have the cradle hooked up.

But a more interesting use for Bluetooth is presence detection. BlueProximity is a project that will establish a connection to a device and use it to trigger Gnome’s screensaver. When you leave the room the screensaver locks, and when you come back it unlocks. Nifty idea in theory, but it renders my Palm useless while I’m in the room — it displays a “Connecting” dialog that blocks use of anything else. While BlueProximity can be disabled with a few mouse clicks, why would I want to go through the hassle of disabling and enabling something that’s supposed to make my life easier? It’s far fewer steps to, say, hit a key combination to lock and enter my password to unlock.

But it’s not always necessary to make a connection. hcitool allows you to, for example, query device names by Bluetooth address. If it can get a response we assume that the device is in range. I’ve employed this technique in a script I’ve been maintaining over some years for myself. I trigger it from cron at certain times and it raises my volume to 90% and loops over a Spin Doctors song — a pretty effective alarm clock. What if I get up early and leave though? My neighbors probably wouldn’t appreciate hearing music that loud that early until I get back (however good the music may be). So last night I added a conditional that checks if my Palm is in range of my computer. It will only continue if it sees my Palm. And since I take my Palm everywhere, leaving my dorm room effectively disables my alarm clock. Neat.

I wonder if BlueProximity could be patched to allow picking between connection-based and name-discovery-based detection. This kind of tool has a lot of cool applications, such as setting Pidgin away when I leave and setting it available when I get back.

Better would be a “presence” D-Bus service that could be configured using a variety of presence-detection systems (such as checking for a Bluetooth device) and would fire an event when the user leaves or returns. Any interested application could be notified of user presence changes.

2 Comments more...

gnome-terminal cursor

by Chris on Mar.28, 2008, under Computer, Linux

The latest release of gnome-terminal has removed the ability to disable the blinking cursor, which I had previously turned off. The only way to disable it is to disable blinking cursors in all text entry widgets. For some reason I prefer the cursor in text boxes to blink, but cannot stand a blinking terminal cursor. Every blink jars my mind and I lose focus, like someone’s looking at me waving his hands and yelling “hey!” every second.

Blink. Blink. Blink. Arrrgh.

Anyway, since the developers saw fit to remove this feature presumably under the GNOMEism of “keep things simple, users be damned,” I have coded a quick patch to permanently disable cursor blinking in gnome-terminal.

As frustrated as I am at what I think is a stupid decision, at least this is free software.

22 Comments more...

Tursiops 0.1 released

by Chris on Dec.03, 2007, under C#, Linux

As expected, the hacking on Tursiops continued most of last week. I’m a little late getting a release out there, but here it is. The archive contains two folders, one for i386 machines and one for amd64. The copy of Tursiops in each is identical, but the glue library is platform-specific.

If you want the corresponding source code, svn co https://layla.chrishowie.com/svn/Tursiops. This release corresponds to revision 126 if you want the exact code of this release at a later date.

The only known issue at this point is that the “refine search” function does not update the progress meter, and a refine operation cannot be canceled. This should be fixed in the next release.

Feedback is welcome — just comment here. Enjoy!

11 Comments more...

Tursiops beta around the corner

by Chris on Nov.24, 2007, under C#, Linux

I wrote a while ago about a project I had started to develop a universal trainer for Linux. I’ve been intentionally delaying the public release because I wrote it as one of my first C# projects and the codebase was less than maintainable, and probably had a lot of memory leaks. Additionally, the UI was created using Glade and instantiated using Glade#.

I’ve been working over Thanksgiving break to bring it up to par with my other projects. Basically this means a complete rewrite, except for the C glue library. Surprisingly, much of the codebase is identical, but the pieces that have changed have changed dramatically. The UI has been rewritten with MonoDevelop’s Stetic designer, and there should be no major memory leaks. The UI is more streamlined and search speed has been improved. In fact, where it used to use several MB of memory at a time during searching, it should now use next to none.

This is why I haven’t released for over a year. I knew this had to be done first, but I hadn’t got around to it. I expect a beta release by the end of next week. Two more things remain to be implemented: search result narrowing (important) and freezing (less important but still cool).

If I haven’t already said so, the project will be released under the GPLv2.

2 Comments more...

Debian Etch released, layla upgraded

by Chris on Apr.09, 2007, under Computer, Linux, Meta

Etch has finally been released. I have upgraded layla (the server running this blog) from Sarge to Etch, and the upgrade process was pretty smooth. Only a few things needed manual attention.

Quite surprisingly, there weren’t any problems upgrading the kernel to 2.6.18, even though this required replacing hotplug with udev, something I’ve experienced pain with before. One reboot is all it needed.

Leave a Comment more...

pcap-sharp RC1

by Chris on Mar.23, 2007, under C#, Linux

I have released pcap-sharp RC1. If you’re interested, give it a shot and let me know how it works for you.

10 Comments more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact me so I can take care of it!

Links

Links to friends' blogs, and a few other sites of mine.