Posts

Bloody OpenBSD syslogd

I spent quite some time today trying to figure out why, oh why, syslogd doesn't want to log to a remote log host. The config file on the machine was identical to that on other machines that worked just fine. Long story made short, that particular version on that particular system didn't like having an IP address after that @ sign. A hostname worked fine. The syslog on our other redhat machines didn't care. I don't know what the reason is yet. Could it be that syslog works the same way on both machines and just does a gethostbyname on whatever is after the @ sign, and glibc gives an answer for the IP address while libc on BSD does not? Whatever the reason, bloody syslogd should at least log an error somewhere. Or a warning. Or whatever.

Switching to Gnome

Me, a long-term Windowmaker user, recently switched to Gnome. There main reason is that I had wanted to drop Windowmaker for a while now. There has been no development for a while now and I don't really like the fonts or the lack of themability of window borders and such. I decided to give Gnome a try because I've always liked the appearance of Gtk applications and a full Gnome desktop can run without having to run a zillion processes in the background. I have looked at KDE but it just doesn't feel right. One feature I really liked in Gnome was the automounting of removable media. It didn't work smoothly because there are a few prerequisites: Your user must be in the plugdev group You must not have an entry for the device in /etc/fstab The last one is mostly speculation, but when I removed the lines in /etc/fstab (leftovers from the windowmaker era) it all started working. I still prefer the Windowmaker style Alt+<Right Click and Drag> to resize a window. With...

Setting the onSubmit handler with JavaScript

A common issue -- setting the onSubmit event handler of a form with JavaScript. I mean, it's easy enough to set it with <form id='theForm' onsubmit="return confirm('Really submit?');"> but here is how to do it with JavaScript <script type='text/javascript'> document.getElementyById('theForm').onSubmit = function() { return confirm('Really submit?'); }; </script>

Parsing HTML with Perl and XPath

I have had to write an HTML parser a few times already and I've always used HTML::Parser . Because it's simple and because I never bothered to do it anohter way. I always wanted to ideally do some parsing with XPath because that way I can easily find what I need with one or two queries. Unfortunately, XPath only works on properly formatted XML documents, so unless the page I am parsing is XHTML, I couldn't do much. I also wanted to somehow convert the HTML to properly formatted XHTML and use XPath with that. Unfortunately, I didn't know an easy way to do that either. Well, now I do. I can use the HTML::TreeBuilder module from HTML-Tree CPAN distribution. It is easy enough to use the module itself for parsing: my $tree = HTML::TreeBuilder->new_from_file("test.html"); my @img = $tree->look_down('tag', 'img', sub { $_[0]->attribute("src") =~ m!thumbnail!; } However, as I would rather use XPath, here is how to easily convert t...

VS 2005 does not want to profile my ASP.NET project

Image
Visual Studio 2005 does not want to profile my ASP.NET project! What's up with that? This is with the Team Edition that has the quite useful "Performance Tools" included. However, when I start a new Performance Wizard I don't see my ASP.NET web site project in the list of profileable projects. To make a long story short, the solution is to not select the "No Start Page" option in the debug dialog as shown in the following figure. Checking "Current Page" does not work either. Just to be safe, go with "Specific Page" and pick something from the list.

KVM: virtualize a single partition

A nice feature in XEN that I miss in KVM is the ability to use a single partition as a disk image. In XEN you can do disk = [ 'file:/dev/vg0/img_root,sda1,r' ] and you can also safely mount /dev/vg0/img_root when the virtual machine is not powered on. With KVM you're out of luck, or at least my googling returned lots of questions and no solutions. Well, there is a not so hard way of working around the issue.

External repositories in subversion

Edit the svn:externals property for the directory where the external stuff will go into svn propedit svn:externals . Add a line for each external entry you want to have: local/path http://external/repo local/path2 -r### http://external/repo Example for me adding jokey's virtualbox ebuilds: svn pe svn:externals /var/repos/chutz/app-emulation virtualbox http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox virtualbox-additions http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-additions virtualbox-bin http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-bin virtualbox-guest-additions http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-guest-additions virtualbox-modules http://overlays.gentoo.org/svn/dev/jokey/trunk/app-emulation/virtualbox-modules The original tip was here .