Archive for October, 2007

How to scroll compiler output in Emacs

I’ve used M-x compile in emacs for years. Like for 17 years. My fingers automatically do ^x^m that I have had as the key binding for that command, as soon as I save a source file.

However, at some point in Emacs 21 (and now on 22) the *compilation* buffer stopped scrolling; it would show the top of the output, but then scroll out of sight. Then I would have to move the point to the end of that buffer to see the compilation activity. It was very annoying, but not annoying enough that I spent any time trying to find the settings.

But I did finally stumble across it, and here it is:


(setq compilation-scroll-output t)

One more line in my 5000 lines of emacs personalization lisp.

How to install tomcat mod_jk on Mac OS X Leopard

You’d think this would be easy, but you’d be wrong. I was.

First, the config files have moved. They are not in /etc/httpd anymore. They are in /etc/apache2. Great. But that was the easy part.

I followed similar instructions to my previous method for Tiger, but if you do that, you get this in your system.log when you restart Apache:


/private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/mod_jk.so into server: dlopen(/usr/libexec/apache2/mod_jk.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/mod_jk.so: mach-o, but wrong architecture

I checked the architecture of the mod_jk.so. It said i386. Whaa??? An Intel Mac won’t load an i386 file in Leopard? (Sad face here). OK, fine, all I have to do is is compile with gcc with the right flags. What are those?

-arch x86_64

But that’s not the whole deal, because I use apxs to do the compiling, so you actually have to hack up the Makefile.apxs magic line. In particular, after you generate Makefile.apxs, edit it like this:


mod_jk.la:
$(APXS) -c -o $@ -Wc,"${APXSCFLAGS} -arch x86_64 ${JK_INCL}" "${JAVA_INCL}" "${APXSLDFLAGS} -arch x86_64 " mod_jk.c ${APACHE_OBJECTS}

Then your apache should at least load, and you can configure the rest.

Notes on Upgrading to Leopard

Turn off the stupid, unnecessary dock eye candy (thanks to ars technica):


% defaults write com.apple.dock no-glass -boolean YES
% killall Dock

After I booted (MacBook() after first install, the lights on the CAPS LOCK and NUM LOCK keys were inverted. That is, they were on when caps or num lock was off, and off when on. A reboot fixed it. Weird.

Apparently if you have APE installed, you should do a clean install or an archive-and-install. I’ll make sure I do this when I upgrade my desktop machines (home and work) (DF)

Cool feature: ssh client can use the Apple keychain to store and retrieve your ssh private key pass phrase. Furthermore, it seems to initiate an ssh-agent! So standard, and hence, awesome.

Another note: I have a Sonos music system, and when I did an “archive and install” on my iMac, the SMB share that had my music on it was lost. Solution: make sure Windows sharing was enabled; then in the Sonos Desktop Controller, I had to delete my old music library and re-add it, which recreated the share.

JWZ is the king

If you needed yet more evidence, here it is:

How to backup your computer.

Money quote: “If you have Windows…”

NTS - TEA - Tiny Encryption Algorithm

This could come in handy some day, a very small, simple, free encryption algorithm.

Wikipedia link: http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm

(Thanks to pme for the pointer.)

RRDtool installation on CentOS 5.

I love RRDtool. It’s fantabulous. But it is a pain to build and install. Here are notes for CentOS 5 (or red hat 5, probably)

Packages you probably need (in addition to “normal” packages needed for development):

yum install libpng-devel freetype freetype-devel libart_lgpl-devel

Once you have these, it should be a pretty smooth configure/make/install.

A Good Explanation of fields in mod_status apache output

http://www.onlamp.com/pub/a/apache/2000/04/21/wrangler.html

Of particular interest to me:

Acc
The first number in this trio is the number of accesses or requests using this connection. For non-KeepAlive connections, this will be 0 since each request makes its own connection and so is always the first (and last). The second is the number of requests handled thus far by this child. The third is the number of requests handled by this slot; the child may have come and gone, its slot taken by another.

CPU SS Req Conn Child Slot

CPU: The child's CPU usage in number of seconds.
SS: Seconds elapsed since the beginning of the request.
Req: Milliseconds taken to process the request.
Conn: Kilobytes transferred across this connection.
Child: Megabytes transferred by this child process.
Slot: Megabytes transferred by this slot, across children.