Mon, 15 Dec 2008

Emacs and Cygwin python

If you happen to be using Windows Emacs and Cygwin Python there's an annoying interaction where “M-x run-python” hangs. The easiest way to fix it is to mount the directory where you have your emacs installation into the Cygwin file name structure. For instance, I have my emacs installation in C:\emacs\emacs-22.2, and in a cygwin shell I did mount -b ‘C:\emacs' /emacs, and now running the Cygwin python works.

The emacs function run-python adds the emacs data-directory to the PYTHONPATH in the emacs process-environment before running python; unfortunately, since this is the MS Windows emacs, its data-directory starts with a drive letter and a colon. When the Cygwin python initializes sys.path it splits PYTHONPATH at the colons, which means sys.path ends up with the drive letter as one component (usually interpreted as a relative path) and everything after the colon as another component. It that's a valid Cygwin pathname for the Emacs data directory (which is what the above mount command did), things work (accidentally).


Thu, 11 Dec 2008

Mousing in Emacs under Screen

It turns out that if you execute the command xterm-mouse-mode (or evaluate (xterm-mouse-mode 1) in your initialization file) when running Emacs under Screen it allows “non-modified single clicks” to work. Normal mouse functionality is still available by holding the Shift key while clicking. I use the PuTTY ssh client for remote access to various servers, and this works well Emacs in Screen under PuTTY, too.


Sat, 06 Dec 2008

µstr - Micro String API - for C

I was very pleased to discover large parts of µstr compile and seem to work under VMS v5.5-2 with GCC 2.7.1, which is almost the only compiler available to me on that machine. The other is VAX BASIC, which has adequate simple string handling, but lacks advanced string handling and has only very painful facilities for dynamically allocating complex data structures and working with them.


Wed, 03 Dec 2008

2GB Windows XP Hibernation Problem

Coding Horror points out the hotfix for the:

⚠ Windows - System Error
Insufficient system resources exist to complete the API.

error when trying to suspend a Windows XP machine with 2 gibibytes. The hotfix is hosted by Owen Cutajar and is from Microsoft KB909095.

Update: 2008-12-11: Unfortunately, it doesn't always work. Even after applying the hotfix, one of my laptops still won't hibernate.


Wed, 26 Nov 2008

Cygwin setup crashes updating bash

Thanks to the wonders of Google and Ruben I finally found the answer: remove (you'll want to make a backup copy before you remove it, though) /etc/setup/bash.lst.gz which apparently had become corrupted.

According to a comment on that post, running gunzip -t on all files in /etc/setup will tell you which setup files have been corrupted.


Sun, 14 Sep 2008

Ancient History and Ancient Hardware repurposed with NetBSD 4.0, almost

For some odd reason I decided to power on my old Gateway 2000 486DX/33 and do something with it. It hadn't been on since Wednesday, May 25th, 2005, if I can believe the BIOS date. (I was pleasantly surprised the settings gotten corrupted.) Up to the point I turned it off it was acting as a mail server backup for my personal system, and was running Sendmail, Dovecot, a greylisting milter, and Emacs. A little before that it had actually been one of the MPL DNS servers.

Anyway, it had Windows 95 on the original 200MB IDE hard drive and FreeBSD 4.10 on the 2GB Quantum XP32275S Atlas II. It came with Windows 95 of course when I bought it, but I ran SLS Linux on it originally, if I remember correctly, because 386BSD wouldn't install, and later MCC Interim Linux, and eventually FreeBSD. When my wife got me the SCSI controler and CD-ROM I was so thrilled because now I wouldn't get dragging home OS distributions on floppy any more! Once I got the 2GB hard drive I put Windows 95 back on the 200MB drive for my wife and for the occastional work-related Windows 95 excursion. It had 16MB originally, but I scrounged 4MB more of RAM for it very late on, when it was a DNS server.

I wanted to get a more recent OS on it, but remembering how FreeBSD 4.10 was a pretty tight fight there at the end, I decided I'd put NetBSD on it. (NetBSD documentation says it still should be possible to run in 4MB.) I used NetBSD for a while for my main box at home, but I was never satisfied that I'd mastered it as well as FreeBSD, and I thought this would be good way to put the old 486 to work. Luckily I was albe to find an 3c509B card to get it on the network, because it turned out the 3.5” floppy and the CD-ROM drive were both non-functional. (As I worked with the machine I remembered the floppy had been bad when I'd turned it off, but the CD-ROM had been working.) I gathered some confirmation information and then started trying to figure out how I was going to get NetBSD on it. Luckily the FreeBSD 4.10 install was still working and I was able to extract the NetBSD dosboot.com bootloader from base.tgz, copy it and the netbsd-install kernel over the network with FreeBSD, mount the old 200MB Windows 95/MS-DOS disk under FreeBSD, and copy the files over there, then boot into MS-DOS with F8 when Windows 95 started to boot, run through the prompting for each line in the config files and answering “NO”, and then run dosboot netbsd-install.

The installation was successful, but unfortunately the boot process failed.

As I recall, I've had problems in the past getting boot loaders to boot off this drive. I'll have to revisit it when I have some more time.


Sat, 13 Sep 2008

htop is much clearer than top

I ran across htop as I was installing software on my new Ubuntu install, and am finding it invaluable: much clearer than the standard Linux top.


bash startup on Ubuntu 8.04.1 ridiculously slow!

I installed Ubuntu 8.04.1 on a Pentium II machine with 256MiB and was disturbed by how slowly it seemed. It turns out that it was just that bash was starting incredibly slowly. Removing the default Ubuntu ~/.bashrc fixed it. It turns out to be something in /etc/bash_completion which causes the slowdown, but I haven't figured out what yet.


Fri, 12 Sep 2008

Chrome

On the advice of a coworker I tried out Chrome; after a day I think it has almost become my favorite browser. If only it built on the BSDs and Linux, and a noscript equivalent. I wonder what RSS/Atom reader will integrate with it well?


Wed, 10 Sep 2008

E-mail Crisis, Part 4

Well, it looks like a leader is slowly emerging in my quest for an Emacs based mail reader: Wanderlust

It handles MH- and Maildir-format mailboxes, UTF-8 in headers, has good facilities for reading and composing MIME messages, and I finally got it to work with Lotus Domino/Notes IMAP/SSL, amazingly.

Moreover, it looks like I'm probably going to switch to using a Maildir-format mailbox, which will work well with my use of Unison: MH-format mailboxes' use of plain numbers for message IDs/filenames (which can change a lot) makes things a little more confusing when syncing mailboxes with Unison.

Moving away from MH-format mailboxes is a bit of a shame, since it means that I'll be losing the ability to use the MH command line programs for accessing my e-mail. I've used MH in the past, and have always liked the command line access it gives you. Ah well. I wish mdmh had advanced further.