Friday, December 21, 2007

"I keep just enough vi knowledge in my head so that I can edit a Makefile and build Emacs." -- Tony Foiani, 1999

Wednesday, November 28, 2007

How to enable the root user in Mac OS X using NetInfo, or change root's password:

  1. Open the NetInfo Manager utility (located under /Applications/Utilites/).
  2. Click the lock (padlock icon) in the NetInfo Manager window.
  3. Enter an administrator account name and password, then click OK (this isn't Administrator as in root, it's Administrator as in a user account with administrative privileges, typically the first account created during the initial install or setup).
  4. For Mac OS X 10.2 and later, choose Enable Root User from the Security menu.
  5. If you have not previously set a root password, an alert box may appear that says "NetInfo Error," indicating that the password is blank. Click OK.
  6. Enter the root password you wish to use and click Set.
  7. Enter the password again for verification and click Verify.
  8. The root user is now enabled.
  9. Click the lock again to prevent changes.

Monday, November 5, 2007

Social networking

Today I'm trying out a Technorati Profile to see if any of these things actually help. Still got lots to learn! :-)

Wednesday, October 31, 2007

Walking Sticks

If anyone wants to get me something for Christmas, I think these Gold-knobbed "Hame Top Canes" from Brazos Walking Sticks are just gorgeous.

Monday, October 1, 2007

Linux on a Dell Vostro 1700 laptop

At my company, Cedar Creek Software, we recently purchased a new laptop:

Dell Vostro 1700 laptop
Model # PP22X
17" wide aspect-ratio screen

We use SuSE Linux on our workstations, because it "just works" to a greater degree than any other distro I've tried in the last 9 years - at least of all the distros that are still ticking (and I've tried quite a few).

lspci -nn gives the following specs for the monitor:

01:00.0 VGA compatible controller [Class 0300]: nVidia Corporation GeForce 8600M GT [10de:0407] (rev a1)

And the following for the 4965AGN wireless network adapter:

0c:00.0 Network controller [Class 0280]: Intel Corporation PRO/Wireless 4965 AG or AGN Network Connection [8086:4229] (rev 61)

At first I tried SuSE 10.2 and was able to get the monitor working with the usual pre-built nVidia kernel modules from nVidia's repository, but I could not get the wireless adapter to work. Everything else worked fine.

For the wireless, I tried installing the official Intel drivers but I couldn't make it happy with the SUSE-supplied kernel and kernel sources. It kept complaining about the mac80211 subsystem, and many other things. I tried a lot of stuff, including a vanilla kernel, which the Intel drives were unable to patch and use properly (I have not idea what I did wrong). I tried NDISWrapper. Contrary to what it says on the en.opensuse.org wiki, I did get NDISwrapper to work with the Windows XP driver, but it made the laptop unstable - it would just freeze up randomly and I'd have to cycle the power.

Finally I upgraded to a kernel & sources from the SuSE kernel-of-the-day repository (which now seem to have a good set of mac80211 modules sources and all the other things that are needed to support the drive from the Intel wireless project), but then when I'd try to run iwlist and iwconfig it would complain that the module (or something) was complied with support for a higher version of something (I forget exactly what) than the wireless tools.

One of the things I love about SuSE is their hardware support. New hardware is often supported by the very next release of SuSE, however the next version of SuSE - 10.3 - isn't out yet. But it's getting to the final stages of beta testing (thank you, Novell / openSuSE, for the new open development model that gives us access to betas!), so I downloaded the latest LiveCD made from the 10.3 beta tree and discovered that the 4965AGN wireless card worked in the LiveCD environment just fine.

So I've downloaded and installed the RC1 release of SuSE 10.3 on the Vostro 1700. They've made some small improvements to the installer and and distro and I really like it. SuSE is such a fine distro, I strongly recommend it for workstations, laptops, and personal computers.

The troublesome 4965AGN was immediately detected by the installer - Yay! - and works great with no trouble.

The nVidia GeForce 8600M GT graphics card was correctly detected and configured at the optimum size by the 10.3 installer/config tools, unlike 10.2 which left the config set to a low resolution by default. That's with the xorg open source drivers that came with SuSE, of course.

However I did have some trouble configuring the dualhead setup. I needed to be able to use a secondary monitor on the laptop's VGA out as a second screen. I usually use Xinerama, configured with SaX2, for this kind of setup.

I downloaded the latest source driver from nVidia (it's not really all source, but it's the package nVidia provides that allows you to build your own kernel module) and it compiled quickly with no trouble. The documentation on the opensuse.org wiki then says to then use "sax2 -r -m -0=nvidia" to configure the monitor. That works fine for the laptop's own monitor, at 1440x900, but when I tried to use SaX2 to configure Xinerama for the second monitor, it wouldn't work at all. The resulting X config left the laptop's screen turned off and put the laptop screen's setting on the external monitor - which of course were the wrong size, shape and resolution. I spent a good amount of time trying to make this work, then read about using "TwinView" without Xinerma in the nVidia documentation. I tried it out and it works. I tried using the nVidia-supplied config tool, nvidia-xconfig for both the laptop-only config and the dual monitor config and it produced perfect, working configs for both. I highly recommend it.


For the dual-head config just plug in the external monitor and run (as root):

    nvidia-xconfig --twinview

Thursday, August 2, 2007

Emacs Example Tutorial: kill a block of text

When trying to learn to use Emacs, I had a very hard time finding out how to kill a multi-line block of text in Emacs. When I say "block" I mean a square or rectangle that does not include anything outside the marked area, in other words, not including the rest of the lines - whatever portion I didn't mark. For example, the equivalent of "Block Mode Editing" like in Kate, or UltraEdit.

If you go search on google for this kind of block "cut", you'll normally find documentation telling you to use C-w (note to newbies: in emacs documentation when you see "C-", that means the Control key, and when you see "M-", that means the Meta key, which is the "Alt" key for most PC users. So C-w is Control-w). This kills all text on every line, including the end of the line, within the whole region, from the Mark to the Point. When I am trying to trim out a block of text from multiple lines (such as an unusually large comment block, or a portion of a column from a tabulated text file), I don't want the whole line killed, just the letters and other characters inside the square block.

I finally found that this is called killing the "region-rectangle", and the command is:

    C-x r k

For those that don't know: you "mark" a region in Emacs by positioning your cursor in one corner of the area you want to mark and hitting Control-Spacebar. You will see Emacs respond with the message "Mark set". Then navigate the cursor (I always use the arrow keys, but I guess there's other ways to do it) to the opposite corner of the region you want to mark. The "region" is now marked as a rectangle between wherever you started (when you hit Ctrl-Space) and wherever your cursor is now sitting.

Wednesday, July 25, 2007

Deleting files based on content: using find, grep, xargs and rm

Today a user asked me to help remove a deluge of spam from their inbox, since they had been flooded by a particular spammer. Well, everyone makes mistakes sometimes and today was my day: I made a mistake with -print in the find command and accidentally deleted all of the users's email. Whoops.

All the spam contained the the word "Desv" as part of the from. I could have used grep, but there were so many files in the directory that grep -i Desv * complained that the argument list was too long - this is a nice "safety" feature of bash that wasn't always there. Someone figured they should limit the shell globbing of * so it couldn't generate a gigantic list that could cause buffer overruns. So I had to use find to get around the file glob size restriction. The right syntax for find turned out to be:

    find . -exec grep -l Desv {} \; | xargs rm