Linuxworld, Boston, 2006, Here I Come!

Joy!

Oh man, this is going to rock.  I’ve wanted to go to LinuxWorld for a LOOOONG time.  Now, finally, thanks to my new employer, I’ll be there.  I am hoping to be able to come home with the nice and nifty leather jacket they’re giving away for early registrants.

Any KDE folk going to be there?  Anyone that I know going to be there?  =:)

whee

Delete the Internet

Delete the Internet

Darnit, I hate it when I accidentally delete the Intenet!! =;)

Treo 650, VMWare, HotSync Woes

So, after several weeks of beating my head against the wall, I’ve found this simple fix for syncing my WinXP guest VMWare virtual machine inside my SuSE Linux host.  Basically, it looks like because usbfs wasn’t being mounted at boot time, VMWare wasn’t getting notified of my Treo 650 as it was trying to HotSync.  Make this change in /etc/fstab:

#usbfs /proc/bus/usb usbfs noauto 0 0
usbfs /proc/bus/usb usbfs defaults 0 0

and/or run this manually if you have to:

sudo mount -t usbfs usbfs /proc/bus/usb

Thanks VERY much to andyb for this little tidbit!!!

Oh, and in case you’re asking, no, I can’t seem to sync evolution/gnome-pilot successfully/consistently with my Treo 650 (yes, I’ve added the correct lines to devices.xml) and Exchange (couldn’t sync the calendar?!?!?), and kpilot doesn’t sync with evolution (which is the only OSS thing that can sync with Exchange right now).  I blame myself partially, since I could very well spend the time to get kpilot syncing with evolution’s databases, and could also spend the time to help get kontact working with Exchange.  Blah.

Fantom o’the Opera

Tickets For The Phantom
Tickets to the Phantom of the Opera: $380

The Phantom, The T-shirt
Wearable memorabilia for the whole family: $130

The 5 Dapper Kaspers and a Cross-Eyed Dog
5 Smiling Kaspers and a cross-eyed dog: $Priceless

Log4j, Tomcat, and Family Campfires

First, the family campfires bit…

We have an AMAZING house that God has blessed us with, and with it a really nice back yard. And we have TONS of trees all throughout our property (note to self: take pictures of house and back yard for our little viewers). Well, as happens in a forest (that’d be where we live, complete with deer, bears, and coyotes), trees fall over (even when we’re not there to hear them fall), and quite a few of the little guys have fallen in our yard.

I’d like to burn them, for the following noble reasons:

  • To honor the fallen tree-warriors (okay, well, it sounds good)
  • To serve as a warning to other trees as what will happen if they let their guard down and fall over in my yard (humor, folks)
  • To clean up my yard (did I mention we have LOTS of fallen trees in our yard?)
  • To roast marshmallows, hot dogs, and whatever else we can fit on a stick (wait a second, kids, get the cat off that stick…)
  • To tell ghostly, ooky spooky stories!!!

In general, I think it will be a totally cool and neato thing to be able to have camp fires in our back yard. I am looking WAY forward to being able to do it!!! If I’m lucky, one of my clever little progeny will remember to take pictures too. =:)

Now, on to the log4j and tomcat thing…

I’ve spent the better part of yesterday beating my head against the wall, trying to get some servlets at work to log to their own logfiles using log4j and tomcat 5.5.x. It used to be a piece of cake to do this with tomcat 4, since tomcat 4 provided a nice Logger stanza for a given Servlet in its context.xml. But tomcat 5.5 changed all that.

I first tried to override log4j’s rootLogger in each of my servlets in the tomcat container, and change this at run-time by using ${LOGNAME} in my log4j.properties and call System.setProperty() for LOGNAME at initialization time. This did not work and I have several bumps on my forehead to prove it.

So, today, after a good night sleep, I approached it differently–namely, by doing all the magic in 2 places…

log4j.properties now has a definition for each context (entry point–be it Servlet’s init() or standalone class with a main()) that defines logfiles, formats, sizes, etc. It looks like this:

# Root Logger definition.
# this is where everything will go unless another logger is specified for itlog4j.rootLogger=INFO, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-5p %d : %C{1}.%M : %m%n

# Suppress the tomcat logging whilst DEBUG is switched on
log4j.logger.org.apache.catalina.core=ERROR
log4j.logger.org.apache.catalina.session=ERROR
log4j.logger.org.apache.jasper.compiler=ERROR

# our servlets…
# we want these to go to different files, underneath tomcat’s logs directory

# Test Servlet
log4j.logger.TestServlet=DEBUG, TS
log4j.additivity.TestServlet=false
log4j.appender.TS=org.apache.log4j.RollingFileAppender
log4j.appender.TS.File=${catalina.home}/logs/TestServlet.log
log4j.appender.TS.MaxFileSize=10MB
log4j.appender.TS.MaxBackupIndex=10
log4j.appender.TS.layout=org.apache.log4j.PatternLayout
log4j.appender.TS.layout.ConversionPattern=%-5p %d : %C{1}.%M : %m%n

# PosInSpeedControlServlet
log4j.logger.PosInSpeedControlServlet=DEBUG, PISCS
log4j.additivity.PosInSpeedControlServlet=false
log4j.appender.PISCS=org.apache.log4j.RollingFileAppender
log4j.appender.PISCS.File=${catalina.home}/logs/PosInSpeedControlServlet.log
log4j.appender.PISCS.MaxFileSize=10MB
log4j.appender.PISCS.MaxBackupIndex=10
log4j.appender.PISCS.layout=org.apache.log4j.PatternLayout
log4j.appender.PISCS.layout.ConversionPattern=%-5p %d : %C{1}.%M : %m%n

# PosOutSimulatorServlet
log4j.logger.PosOutSimulatorServlet=DEBUG, POSS
log4j.additivity.PosOutSimulatorServlet=false
log4j.appender.POSS=org.apache.log4j.RollingFileAppender
log4j.appender.POSS.File=${catalina.home}/logs/PosOutSimulatorServlet.log
log4j.appender.POSS.MaxFileSize=10MB
log4j.appender.POSS.MaxBackupIndex=10
log4j.appender.POSS.layout=org.apache.log4j.PatternLayout
log4j.appender.POSS.layout.ConversionPattern=%-5p %d : %C{1}.%M : %m%n

This seems to be doing the trick nicely, and it sure feels a whole lot cleaner. In addition, inside each entry point (Servlet.init() or Class.main()), I have the following code:

DaLog.getInstance().initialize(”TestServlet”);

This allows DaLog (my little logger helper Singleton class) to send all logging information to the desired context in log4j. “TestServlet” above matches up nicely with the definition in my log4j.properties file ” log4j.logger.TestServlet=DEBUG, TS”. This ties the two pieces together a little more tightly than I’d like, but it sure feels a whole lot better than trying to kludge it another way. Here’s my little DaLog class…

package nft.util;

import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintStream;

import org.apache.log4j.*;

public class DaLog {

private static String DEFAULTCONTEXT = “DEFAULT”;

private String _context = DEFAULTCONTEXT;

private static DaLog _me;

private PrintStream _realErr;
private PrintStream _realOut;

public static DaLog getInstance() {
if (null == _me)
_me = new DaLog();

return _me;
}

private DaLog() {
// save off references to “real” stderr and stdout…
_realErr =
new PrintStream(new FileOutputStream(FileDescriptor.err));
_realOut =
new PrintStream(new FileOutputStream(FileDescriptor.out));
}

/**
* Initialize must be called once per instantiation of this class. The context
* that is passed will be used as the context in the log4j.properties
* file. This context is used to determine debug level, logfile location,
* and other useful things.
* @param context
*/
public void initialize(String context) {

_context = context;

restoreDefaultOutput();

// make sure everything sent to System.err is logged
System.setErr(new PrintStream(new LoggingOutputStream(Logger
.getLogger(_context), Level.WARN), true));

// make sure everything sent to System.out is also logged
System.setOut(new PrintStream(new LoggingOutputStream(Logger
.getLogger(_context), Level.INFO), true));

}

public Logger getLog() {
return Logger.getLogger(_context);
}

public void shutdown() {
restoreDefaultOutput();
}

private void restoreDefaultOutput() {
// restore stdout and stderr…
System.setErr(_realErr);
System.setOut(_realOut);
}

}

Now, if you, dear reader, have either been helped by this or know of a better way, PLEASE, PLEASE, PLEASE add a comment to this post and let me know!! =:) I was absolutely flabbergasted to find (or actually, to not find) yesterday that there were no complete examples of how to have more than one servlet using log4j in a container like Tomcat and going to different log files. Gah!!

Now I Remember Why I Don’t Run Sid

It used to be that I used Debian’s unstable tree (Sid–named after the “unstable” child from Toy Story) for my work machine and home machines. The only problem was that occasionally, when I would update to the latest and greatest packages, things would break and then it would take a bit of time and effort to get things back to working order. To some extent, this was actually fun and a good way to learn how things work. In general, I don’t learn how things work until I get over the fear of breaking something–play with it, break it, learn how to fix it, etc.

At some point in the last few years, it became less than fun to constantly have to learn how to fix things that were broken before I could get some work done, so I started using some of the more stable Linux distributions, like Mandrake, Fedora Core, and most recently (and still) OpenSuSE. This kept me still fairly up to date with the latest and greatest packages, but as long as you stick to the official release packages and cycle, you’re pretty safe from anomalies and having to fix random things when they break.

I forgot all that, apparently. I’ve been tracking the apt repositories for SuSE 10, and yesterday for some reason I cannot recall, I decided to “apt-get upgrade” (pull down all the latest packages). What fun! Actually, to be fair, only one thing really went wrong. When I rebooted this morning, X (the Graphical User Interface) was unable to start. So I ran “startx” manually. Back came the error something alone the lines of “unable to load ‘radeon’: module does not exist (0)”. Not very nice. Apparently what happened was that the driver (/usr/X11/lib/modules/drivers/radeon_drv.so in this case) was moved into a new package (xorg-x11-driver-video-6.9.0-3) and there was no dependency in apt for it to get installed.

Bummer. =:) So, a simple “sudo apt-get install xorg-x11-driver-video” later and I’m back up and running. Here’s hoping that this helps someone else who gets stuck with this. =:)

But it’s a good reminder, all the same, as to why it’s best to stick to the stable release packages and cycles of your favorite Linux distribution, boys and girls.

Okay, bye.

A New Family Car



2000, Family Pictures, originally uploaded by vanRijn.

No, it’s not the trike I’m sporting in the picture, but I thought it was blog-worthy all the same.

Oh.

We broke down and bought a 2005 Chrysler Town & Country.

It’s a truck, dangit.

I Win!!



My New Toy, originally uploadd by vanRijn.

The funniest thing happened to me on the way to the Store Support Center the other day….

I’d been getting e-mail notifications from someone I didn’t recognize like this:

This message was sent to you at the request of SERENA SOFTWARE, INC. to notify you that the package information below has been transmitted to UPS. The package(s) may not have actually been placed with UPS for shipment. To verify when and if the shipment is tendered to UPS and its actual transit status, click on the tracking link below or contact SERENA SOFTWARE, INC. directly.

So I figured I’d better check my work mailbox, did, and opened the envelope I found. I read this letter:
Lucky Letter!

Surprise!!

Apparently, I won last month’s iPod 2-gig nano contest I entered with Serena (the vendor who now sells PVCS) on a whim.

Yay me!! =;)

The Night of the Terrible 406s

I have not been able to do the “blog this” thing from Flickr for a while now. Irritating. I finally had enough of it tonight, so after a few minutes Googling, I found that some hosts are blacklisting xmlrpc.php and sending back 406 errors intentionally because of security problems with old versions of xmlrpc.php/WP that people haven’t bothered upgrading/fixing/patching. To get around it, all you have to do is copy your xmlrpc.php script to some other name and tell Flickr to use that endpoint instead.

Which reminds me, I need to upgrade to the new 2.x WP release, when I get a spare couple of hours (yeah, right)….

[update]: Yikes. Just as I was trying to post this entry, I got bit by the 406 error on the wp-admin/post.php page too. Sheesh. So then I tried to submit a help desk ticket and guess what I got…. Yep, another 406 error.

Powered by Bleezer