Friday, August 31, 2007

Good habits: lengthen your history

It's important to know what you've done, as a sysadmin. If you're one of a group of admins, history becomes even more important.

The first thing I do on a legacy Linux system, is edit /etc/profile, and change HISTSIZE to 100000 or more. Note, this does not erase previous history (although etting it to zero will).

Of course, "history" records only one side of the conversation. The responses of the machine are just as important. Unfortunately, there's no straightforward mechanism like history, which would automatically log everything you see. Your terminal client can often do this for you, but it would be nice to do it on the machine itself.

To bug the bash people about this, for their next release, go here.

The "script" command is a temporary fix ... it records your session in a transcript file. You type "exit" or ^d to stop recording. It writes into a file called "typescript", unless you specify something different.

Trying to automate this:

... you cannot just put "script" in your .bashrc file ... it will go into an infinite loop, because "script" itself starts a new shell (when you stop this, amusingly, you'll find yourself at the bottom of a few hundred nested shells ...)

You can't put it in .login ... because script starts a shell. When .login exits, so will the "script" shell. But that's not what you need.

What you need to do, is set an environmental variable in .bash_login, unset it in .basrc, and then start "script" just once.

Monday, August 13, 2007

MSN Messenger very broken on Macs

Microsoft's closed-protocol Windows Live, Microsoft Messenger IM environment will work for a mac under some conditions. If you first authenticate on the machine you first sign in on, you're ok, and the client works passably well (although there are many irritations, like a nearly useless search feature) ... but if you need to take on previously authenticated identities, you're hosed. It simply doesn't work on a mac. The re-authentication e-mail never gets sent. Also, the web ui, "webmessenger.msn.com" is simply broken for any browser that runs on a Mac (Firefox, Safari, and the old IE) ... it loses connections and messages quite easily.

However, MSN Messenger even works well on 8-year-old machines running Windows 2000 Pro ... set one up so you don't need to buy a new machine and give money towards Microsoft's monopoly-driven attempts to create working software.