Mac (Pete's notes)

Also, see Jeff Custard's Mac tips

Cool productivitiy enhancements for Mac

Address Book

Don't try to export meetings from Meeting Maker into Address Book. It will seem to work, but any event in Meeting maker that has invitees will make an Address Book event with invitees. Later, if you change such an event in Address Book, every invitee will be sent an email. There seems to be no way to prevent this. It's embarrassing. to fix it, I found "iCal Cleaner", an app that does various things to clean up iCal, including "delete all attendees". It worked, but it sent one last dying gasp of embarassing emails.

My Address Book contains all my personal address data. Most of the entries aren't in any group, but some are in the "DeLynn's" group. I also have the OOB modems in the "modems" group. These entries are maintained by hand.

I also have all the NETS contacts data, in three groups: "NETS", "FGRP" and "Other". The "Other" group is the catch-all for NETS Contacts entries that don't fit in "NETS" or "FRGP".

To load the NETS contacts pages into my Address Book, I run the convert-contacts.pl program on netserver. The program creates 3 .vcf files, containing the "NETS", "FRGP" and "Other" entries. These sets are disjoint - entries appear in only one of the groups even though Address Book supports having an entry in multiple groups.

To copy the 3 files from netserver to cisl-lorient, do this on cisl-lorient:

cd
scp netserver:/usr/web/nets/internal/*.vcf .

To import the files into Address Book, make sure you have the proper group highlighted for each file, and then File->Import the file. It'll warn about "n cards are duplicates and will be updated". Click "OK", and fields that exist in the imported cards will overwrite fields in the existing Address Book cards. Existing fields in the Address Book card that don't appear in the imported cards won't be disturbed. This is just what I want - some of my Address Book entries have information that isn't in the NETS Contacts page, like Marla's home address. When I import the NETS contacts data, Marla's phone number fields are updated but the home address isn't deleted. Cool.

If you click "Review duplicate...", it will show you the new card and highlight the changed text, and let you select "Keep Old", "Keep New", "Keep Both", or "Update". How these options work is a bit non-intuitive.

After you've imported the three sets of cards, you'll have lots of duplicates, so do "Card->Look for Duplicate Entries..."

For Marla to update the contacts list in her iPhone, she does

  1. In Thunderbird, export address book to an ldif file
  2. In Windows Address Book
  3. Import the ldif file
  4. Import \\Netserver:\web\nets\internal\contacts-all.vcf
  5. In iTunes, sync to the iPhone

xxx

Adium

I use Adium for instant messaging instead of iChat. IChat is good because it comes with Mac OS X, but it opens separate windows for every chat, causing more window clutter. Adium keeps all chats in one window, and seems to have a lot more bells and whistles.

I do IM through the NETS jabber server. Blake Caldwell set it up, and created a Wiki page describing it.

AppleScript

Store new AppleScripts in ~/Library/Scripts. I use AppleScript to wrap my "PetesHelp" thing.

If you use an "in" clause in an AppleScript "do script" command, it sends the command to the window specified in the "in" clause. If you don't use an "in" clause, it creates a new Terminal window and runs the command in the window.

BlueTooth

I bought a wireless mouse and a wireless keyboard with okapi. Both use BlueTooth. The Mac OS allows you to "name" your BlueTooth devices, but naming only works with Apple keyboards and mice. My Apple keyboard has a name, and the Mac OS can tell me when the keyboard's batteries are low. No such luck with the Kensington mouse. Sigh.

Also, if you reboot the Mac, you lose connectivity to the keyboard and mouse, so you have to "discover" them again. So don't reboot :-)

The keyboard comes with a CD-ROM. After some confusion, I discovered that what's on the CD-ROM doesn't need to be installed.

burning a CD

To burn a CD containing music, see iTunes,

To burn an ISO image

Calculator

I use the Mac calculator in RPN mode, almost always to compute finnaces, which means I want 2 decimal places of precision. By default, it displays scientific notation. To get it to display 2 digits, do View->Basic.

Changing a Mac's "machine name"

It's under System Preferences->Sharing. Just type the new name into the "Computer Name" field.

DefaultApps - to match file types to applications

I downloaded this to solve a specific problem - how to get Safari to stop using Preview to view PDFs and start using Adobe Reader. DefaultApps seems to work, but I couldn't figure out how to use it to change Safari's handling of PDFs. Then I figured out that Safari *was* using Adobe, it just was doing it "inside" the Safari window. This is supposed to be helpful, but I liked the intuitive knowledge that two applications were running separately. Maybe I'll get used to it.

DNS and /etc/resolv.conf

I discovered that "host" and "dig" commands didn't work. Dig worked if I specified the DNS server on the command line, but it wouldn't use the contents of /etc/resolv.conf. I eventually found that /etc/resolv.conf was a simple file, which it shouldn't be. Under Mac OS X it's supposed to be a link to /var/run/resolv.conf. I deleted the actual file named /etc/resolv.conf and created a link, and dig started working.

The contents of /var/run/resolv.conf are updated by the MAC OSX DHCP daemon. If you use System Preferences to see what your default router and DNS search domains are, you'll see the ones initialized by DHCP in grey-ed out text. If you override them by setting them explictly, you'll see them in regular (not grey-ed out) text, and you'll change the contents of /var/run/resolve.conf.

When I'm connected to NCAR, either by VPN (home) or directly (at work) I want my search domains to be "scd.ucar.edu" and "ucar.edu". The DHCP server sets them to just "scd.ucar.edu". To fix it, you can use System Preferences->Network and under "Advanced, DNS" you can explicitly set the list to "scd.ucar.edu" and "ucar.edu". Trouble is, Mac OS X will then use those domains and ignore what DHCP tells it, so it will fail when you move to a foreign network. The handle this, I use Locations. I created a "location" named "UCAR (ML or home with VPN" and set it's search domains explicitly to "scd.ucar.edu., ucar.edu.". Note the syntax, the comma is needed. Then I set the Automator workflow that I use when I got home (it's named "Arrive at home.app") to make it set the "location" to "UCAR (ML or home with VPN". Of course, I also set the "Leave Home.app" so that it resets the "location" to "Automatic". Now the only issue is that I have to remember to set the "location" to "Automatic" whenever I connect someplace that isn't home or work.

Dreamweaver

On 2006-10-16, I got the Dreamweaver Studio 8 media from WSST and installed it on my Mac. I asked Dorothy Bustamante to buy a license and charge NETS. I told Susan, Jennifer and Marla.

The README suggested reading http://www.macromedia.com/go/st_documentation for an overview of Studio 8 products. Studio 8 is

  1. Dreamweaver 8
  2. Flash Professional 8
  3. Contribute 3
  4. Fireworks 8
  5. Flash 8 Video Encoder
  6. Flashpaper 2

Finder

By default, the Finder won't display some folders, like /usr/web. To get to them, do

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

fink

Fink is one MAC open-source software project, the other is MacPorts. WSST (Jose) says fink is no more, and WSTT instals only MacPorts on WSST-supported machines. Thus, I want to stop using fink. At one time, I needed fink to get, like, unison and antlr. For example, on 2005-11-08, when I wanted to install unison, MacPorts had only version 2.9.1, and fink had 2.13.16, which has an Aqua interface.

Before you can use fink, you need Perl (comes with Mac OS X) and Xcode, the Apple development environment. So go get Xcode.

On 2007-08-28, on my new Intel Mac (okapi), I did "rm -rf /sw" to delete the old binaries that I had migrated from my old PPC Mac (okapi) and then I downloaded Fink-0.8.1-Intel-Installer.dmg from the SourceForge "fink" site. I clicked on the .pkg file. Then, as root, I did a "fink selfupdate" and got a horrible error about "use of AUTOLOAD" in /Library/Perl/5.8.6/darwin-thread-multi-2level/Term/ReadKey.pm. Googling suggested that I do:

mv /Library/Perl/5.8.1 /tmp
mv /Library/Perl/5.8.6/darwin-thread-multi-2level/Term/ReadKey.pm /tmp
...which helped. Apparently the 5.8.1 is ancient and came when I migrated off the PPC system. Just wait a *long* time for that initial rsync to complete. Fink chugged a long time and installed lots of stuff.

When you go to http://fink.sourceforge.net and follow directions to install fink, it runs pathsetup.sh, which tried to modify my .profile file and fails, dunno why. I added the following to my .bashrc instead:

# If we're on a MAC, and fink is installed, set it up.
if [[ -e /sw/bin/init.sh ]]; then
    . /sw/bin/init.sh
fi

fink seems to be the Debian apt-get system - the commands are similar. You use "install xxx" to install a package. Like apt-get, you can fetch the current stable stuff or let fink get unstable stuff. Some stuff I want (like unison) is unstable, so I looked the at the fink FAQ and found instructions for how to make fink scan "unstable" as well as "stable" stuff. I edited /sw/etc/fink.conf, to add unstable/main and unstable/crypto to the Trees: line, and then did

fink selfupdate; fink index; fink scanpackages
fink update-all

This chugged for, like, 30 minutes building stuff. I was then able to install unison-aqua, which also took a long time installing TCL and TK.

To get something with fink, use "apt-get"-like commands:

fink update
fink install dosunix
fink install rkhunter

You can install wireshark via fink, but I chose to install it by downloading the Mac version of the program. That version automatically starts X11, and may have other advantages.

WSST installed fink and several packages on galway. At least one (gtk) wouldn't update, so I can't do "fink update-all". To get around this, I went through and deleted several packages that I don't need on galway:

fink remove abook
fink remove aspell aspell-en aspell-shlibs
fink remove avahi avahi-dev libavahi-client3-shlibs
fink remove clamav clamav2-shlibs clamav4-shlibs clamav5-shlibs
fink remove libavahi-common3-shlibs libavahi-glib1-shlibs libavahi-glib1-dev
fink remove dbus dbus-shlibs
fink remove fltk-x11 fltk-x11-shlibs openexr openexr-dev
fink remove gnome-base gnome-common gnome-icon-theme gnome-mime-data
fink remove gtk-doc
fink remove icon-naming-utils imagemagick imagemagick10-shlibs
fink remove libart2 libart2-shlibs

Firewire - Crossfire external drive

I bought a SmartDisk Crossfire XF160, a 160GB 7200-RPM USB-2.0/Firewire-400 external disk drive. Model number XF160, serial number JH5928. They recommend turning the drive on before plugging it into the Mac. I plugged it the Firewire port and it seemed to work. I registered it at SmartDisk.com.

The drive came with a CD-ROM that contains SmartDisk Tools, a disk formatting utility that isn't necessary for Mac OS X - the Mac Disk Utility can do the job.

It came with BounceBack Express backup software on the drive. I installed BounceBack on my Mac and registered it with CMS Products.

The manual is in Applications/BounceBack. It's an "application" and when you run it, it runs Preview. I used Preview's Print command and did PDF->Save to make a true PDF file, which is here.

When I first tried BounceBack Express, it didn't "see" the Crossfire, though the Crossfire was connected and available on the Desktop. Tech support explained that for BBBackupExpress to see a drive, it drive must be formatted as a Mac drive. I used the Mac's Disk Utility to Erase it and set the Volume Format to MAC OS Extended (Journaled) and named it Pete-backup.

BBExpress has an irritating feature that when you start it, it immediately starts doing a backup. A call to CMS Support at 714-424-5520 supplied the answer: Use change any settings, such as the destination drive, you run the BBSettingsExpress application. Then you run the BBBackupExpress application to actually do the backup. Running BBExpress will start backup every time.

BBBackupExpress makes a complete copy of the source to the destination, but to make it fast, it only copies files that differ. The destination is just a drive like any other - you can go get an individual file.

To keep DeLynn's backup separate, I write my files to Pete-backup:okapi and hers to Pete-backup:ladyjane.

You can't make a bootable external drive without purchasing BounceBack Express Professional for an extra $49.

The BounceBack software is available online at http://www.cmsproductseng.com/files/Mac/Mac BB NetCell 514r2.dmg

Consider SuperDuper, a free program (more features if you buy) for making copies of my Mac hard disk onto an external drive.

Goodies

Goodies I've installed and may have paid for

A Apple Store dude recommended AppleJack (free) for system diagnostics.

GPG

See my GPG page.

IP Calculator

http://www.bitcricket.com/ip-subnet-calculator.html

iPhoto

Turn the camera on. It doesn't matter where the dial-wheel is set. Connect its USB cable to the Mac. The camera will make a "ding-dong" sound and the LCD will go to "USB" mode. Select "Mass-Storage" and then push the Select button. The Mac should detect the camera as a "NO-NAME" disk. Start iPhoto and it should say "Loading Camera" and then "Ready to Import photos".

iStat Menus

iStat Menus is an application that puts little graphs or other performance indicators into the menu bar. I use it to watch network and CPU use. I also use it to display the Date & Time in the menubar in a better format than the default Mac 

IRRToolSet

On 2010-01-04, I tried to build the IRRToolSet on netserver and failed. Googling, I found http://irrtoolset.isc.org/wiki/CruftCleanout, which contained this...

The subversion cruft-cleanout branch is an attempt to clean up the IRRToolSet sources and to make the distribution more manageable by removing as much unreferenced code as possible. As of June 2009, the branch contains ~42.5kLoC, down from 112.4kLoC in the trunk. This reduction was achieved by removing aoe, roe, CIDRAdvisor, prtraceroute and prpath, all machine generated code, and all consequently unreferenced code.

The future supported targets of this branch are librpsl, peval, rpslcheck and RtConfig.

In order to build IRRToolSet from the code repository, you will need GNU autoconf, automake, libtool, bison, flex and a C++ compiler. The code is well tested with GNU C++, and should work with any version between 3.4 and 4.2.

The branch can be checked out and compiled using the following commands:

% svn co svn://irrtoolset.isc.org/branches/cruft-cleanout
...
% cd cruft-cleanout
% glibtoolize
% autoreconf -i
% automake
% ./configure
% make

The primary development platform for this branch is MacOS X 10.5.6 (Leopard). The target platforms are Ubuntu Linux, FreeBSD 7.x and Solaris 10.

Parallel builds are now supported. I.e. you can issue "make -j X" on a multicore machine and the compilation process will proceed much faster.

Mac XCode users can download and install an XCode 3.1.1 project file in the root directory of the IRRToolSet distribution, allowing development using an IDE.

I first had to install libtool using MacPorts, and I had to make MacPorts' /opt/local appear in my PATH before /usr/local, but I got it to work. I ran "make install" as root (livin' large) and I got these into /usr/local/bin:

There's a peval peval man page on the ISC Wiki. I care about the following basic commands:

iTunes

Some albums (like the Beatles Abbey Road) have songs that run smoothly into one another. With the default iTunes setting, they'll play back with annoying dropouts between songs. One fix is to do iTunes->Preferences->Playback and change the Crossfade playback to zero. That reduces the size of the dropouts but doesn't eliminate them entirely. Sigh.

To share music with other iTunes users on the local LAN, open iTunes Preferences->Sharing and enable "Share my library on the local network". Then open System Preferences, Sharing, then the Firewall tab. In the Allow window, check iTunes Music Sharing. A less secure way is to do System Preferences, Sharing, then the Services tab, then check Personal File Sharing.

Copying songs from one Mac to another

Apple marks songs that were purchased from the iTunes music store, so they are harder to copy around. Songs that you have ripped off CDs are not marked, so they can be copied.

To copy songs over the net, copy them to my Public folder, then go to the other machine and open Finder->Go->Connect to server. For this to work, on the source machine you have to have turned on Personal File Sharing in System Preferences->Sharing.

To copy ripped songs from one Mac to another, write the songs in MP3 format on a CD-RW. If you write them in the default AAC format, the song won't have any title information when you import them on the target system. Create a playlist. Select iTunes->Preferences->Advanced, then the Burning tab, then MP3. When selecting songs to burn onto the CD, hold down the 'option' key while you select the itunes -> advanced menu, and the 'convert to mp3' entry will be highlighted.

When you want to play an Internet radio station like radioio Ambient, and you access it with a radioio SoundPass so that you don't get commercials, it plays through iTunes. That's fine, but you may find that iTunes periodically stops playing radioio and "goes to the next song". The solution is to go to iTunes Preferences->Advanced and set the "Streaming Buffer Size" to "Large".

To copy an entire iTunes music collection from one Mac to another, boot the source Mac in "firewire" mode by holding down the "T" key while the Mac boots. Then on the target Mac, copy in the iTunes directory.

iCal

From: Pete Siemsen <siemsen@ucar.edu>
Date: March 28, 2011 10:00:59 PM MDT
To: Jeff Custard <jcustard@ucar.edu>
Subject: Re: "NETS Engineering Meeting" has been canceled.

Dude,

Ok, so I'm plenty embarrassed about mailing stupid unintentional messages to all of NETS.  You know how it happened: I exported meetings from MM to a .ics file, then imported the file into iCal.  Trouble is, MM events that have a guest list get created in iCal with a list of "invitees".  If you modify the iCal event in any way (like try to delete it or reschedule it) iCal helpfully sends an email to all the invitees.  If you modify it by deleting all the invitees, when you "save" it, iCal emails a cancellation message to all the invitees.  The worst part is, if you've imported a recurring event, like the "NETS Meeting" events, it gets stored as a recurring event in iCal, and deleting each event causes the emails.

This has been complained about in mailing lists, and a guy wrote a shareware program called "iCal Reply Checker" that is designed just to stop this behavior.  People say the program works.  I downloaded the 10-day free trial, it costs 3 pounds to buy it.

So I want to test it.  I plan to create an event with you as a guest, then follow the sequence to see if I've found a solution to the problem.  Hope you don't mind :-)

I don't have a great alternative - I have several recurring events in my iCal now.  I'd have to wipe my iCal database and start over.

-- Pete


On Mar 28, 2011, at 12:08 PM, Jeff Custard wrote:
Pete,

Please remove me from your calendar notices.
 --Jeff


Begin forwarded message:
From: Pete Siemsen <petesiemsen@me.com>
Date: March 28, 2011 12:02:34 PM MDT
To: jcustard@ucar.edu
Subject: "NETS Engineering Meeting" has been canceled.

“NETS Engineering Meeting” has been canceled.
when
Wednesday, March 30 2011
1:30 – 3:00 PM MDT
Repeating event.
from
Pete Siemsen
invitees
You.

MobileMe is a service provided by Apple • Terms of Service • Privacy Policy
Copyright © 2011 Apple Inc. • 1 Infinite Loop, Cupertino, CA 95014 • All Rights Reserved
<iCal-20110328-110234.ics>

See my Personal Planning page.

TimeZones

When I travel to a different time zone, I should change the timezone in the laptop, to make it show the right time-of-day in the upper right-hand corner. This isn't enough: to make iCal behave correctly, I also have to change the timezone in iCal. Use the pull-down in the upper right-hand corner of the iCal window. Similarly, I should set the global timezone in the iPod Touch, to make it display the correct time, but that's not enough. I also have to set the timezone in the iTouch calendar. Go to Settings, Mail, Contacts, Calendars, Time Zone Support.

iChat

I use Adium for instant messaging instead of iChat. IChat is good because it comes with Mac OS X, but it opens separate windows for every chat, causing more window clutter. Adium keeps all chats in one window, and seems to have a lot more bells and whistles.

i-Installer (for installing TeX)

I installed i-Installer in order to use it to install TeX. I followed the directions for installing TeX at http://www.rna.nl/tex.html, which had this link to i-Installer: ftp://ftp.nluug.nl/pub/comp/macosx/volumes/ii2/II2.dmg. After following the directions, I had I-Installer.app in /Applications/Utilities. To learn how I used i-Installer to install TeX, see my directions for installing TeX on Mac OS X to see how I used i-Installer.

Internet Connect

Here are some notes about using Internet Connect to dial-in to somewhere from the Mac. Other notes can be found in my nextel page.

To connect to the Level3 RAS using PAP and PPP:

  1. Open System Preferences
  2. Change Show: to Internal Modem
  3. Click Dial Now.... This starts the Internet Connect application
  4. The "Internal Modem" tab should be highlighted. Choose from the Configuration: pull-down.
  5. Select Window->Connection log.
  6. Click "Connect"

To create new configurations, select Configuration->Edit Configurations.

I was able to connect to Level3's RAS on 2006-01-22 with few problems, using the above and PAP authentication. What follows is old information.

  1. Set the "Description" to NCAR RAS
  2. Set the "Telephone Number" to 303-872-8000
  3. Set the "Account Name to siemsen
  4. Set the "Password" to blank
  5. Click the "Prompt for password after dialing" box
  6. Set the "Modem" to "Apple Internal 56K Modem (v.92)"

Apple's implementation uses CHAP for authentication, which is compatible with the NCAR RAS, but incompatible with the Level 3 RAS service. To connect to Level 3, you need to use PAP for authentication. There does not seem to be a way to configure Internet Connect to make it use PAP, but since Internet Connect uses the pppd program to make PPP connections, and you can configure pppd, you can use PAP. To do so, as root, create a file named /etc/ppp/options. Put these lines in the file:

-chap
+pap

The next time you use Internet Connect, it'll use PAP authentication instead of CHAP authentication, and you should be able to connect to the Level 3 RAS. Of course, you'll no longer be able to connect to the NCAR RAS - you can only use one of CHAP or PAP at one time.

Kerberos

To set up Kerberos on a Mac, for access to the UCAR CIT domain, create a file named /etc/krb5.conf file containing this:

[libdefaults]
default_realm = CIT.UCAR.EDU

That will avoid later errors that say
Kerberos Error
Configuration file does not specify default realm

To get a Kerberos ticket, which I need to access the SAMBA shares on netserver, do this:

To change my CIT password,
  • Get a ticket as above, then click the "Change Password" tab
  • It should prompt you for with a "Change Password" window.
  • Click OK. Now you have a Kerberos ticket, valid for 10 hours.
  • Highlight "siemsen"
  • Click on the Password icon to change the Password
  • If you can't change your password with Ticket Viewer, go bother the people in WSST to help you use their Windows box to change the password. If you're nice to them, they can let you do it in such a way that you can bypass the Windows "don't reuse existing password" check, so you can re-use the existing password.

    Keyboards

    Dvorak and keyboard viewer

    To set up a Mac for Dvorak, go to System Preferences->Language & Text->Input Sources. In the big scrolling list of languages:

    This'll make a new icon in the top menu bar. Use the icon to turn Dvorak layout on or off, and to display the Keyboard Viewer.

    The Keyboard Viewer seems cool, but when it's displayed the control keys don't work.

    Remapping keys

    First, read http://developer.apple.com/darwin/runningX11.html

    Apple's X11 has a Preferences option to "Enable keyboard shortcuts under X11". I haven't tested it yet to find out exactly what it does.

    MacBook's enter key should be ctrl

    The Mac laptop keyboard has an "enter" key where the right-hand "Control" should be. I do Control-P in bash a lot, and I can't do it "properly" with two hands on the laptop's keyboard. More important, it makes hitting lots of control keys difficult in XEmacs. To fix it, I got DoubleCommand, a free application which remaps keys via a kernel hack. Once installed, you configure DoubleCommand via System Preferences. I checked "Enter key acts as ctrl key" and got what I want. Be sure "Enter key acts as cmd key" is unchecked. When configuring DoubleCommand, remember to "Activate" and "Save->System", or you'll lose your settings across a reboot.

    Function keys

    Apple uses the top-row keys to mute sound, control volume, do Exposé, etc. I want to use function keys in ...

    key my use Comment
    F1    
    F2    
    F3    
    F4    
    F5    
    F6 Aquamacs undo  
    F7 Aquamacs goto-line  
    F8 Show all Spaces  
    F9    
    F10  
    F11 (in Mail) send message to OmniFocus Inbox
    (Clip-o-tron 3000 feature)
    configured in OmniFocus preferences
    F12 Dashboard
    F13    
    F14    
    F15    
    F16    
    F17    
    F18    
    F19    
    control-space LaunchBar  
    option-command-escape open Force Quit window  
    option-command-escape open Force Quit window  
    shift-command-7 PetesLookup  
    shift-command-[ move to previous tab in Terminal, Aquamacs, Safari  
    shift-command-] move to next tab in Terminal, Aquamacs, Safari  

    Notes:

    Keychain Access

    Mac OS X stores passwords used by the system in the user's "Keychain Access" utility, which is like Quicken's "vault". I store passwords in it, but it's user interface is a little bit less than obvious. To look up a password, start the app and double-click on the password entry that you need. Then click the little "Show password" button. You should be prompted for the password to keychain access itself, and then it'll show you the password.

    ls

    I like the "ls" command to display its output with colors. Trouble is, there are two flavors of "ls" command, and they set up colors differently. The GNU version has more powerful support for colors. The BSD version is not as good with colors, but it's what comes with Mac OS X, and Apple has added some Mac-specific extensions to it. I thought that the color was more important than the extensions, so I tried setting aliases and whatnot to use the GNU version. After some time, I discovered that the GNU version would sometimes make real ugly output from my "lt" alias (all the colorizing escape codes were visible) so I gove up on the GNU version.

    Both flavors of "ls" use an environment variable to control color. The GNU version uses the "LS_COLORS" environment valiable, and the BSD version uses the "LSCOLORS" environment variable. I set up both environment variables in my .bashrc file just in case :-).

    To make the GNU verson available on MAC OS X, I used MacPorts to install coreutils, which installs the GNU version of "ls" as "gls". I then set up an alias in my .bashrc to establish "gls" as "ls" to give me colors. As described above, I later changed my mind and went back to the less cool /bin/ls.

    MacPorts (formerly DarwinPorts)

    MacPorts is one MAC open-source software system, the other is fink. As of 2010, I'm trying to stop using fink and use only MacPorts.

    On 2009-11-06, I needed the Gimp. I tried to install it with fink, and it failed to install. Due to that and rumors that MacPorts is better than fink, I installed MacPorts. I installed the .dmg file for Leopard and ran the installer. Fink installs into /sw, MacPorts installs into /opt.

    Then I set up my .bashrc so that I can use the MacPorts software:

    # If MacPorts is installed, set it up.
    if [[ -d /opt/local ]]; then
        PATH=/opt/local/bin:${PATH}
        PATH=/opt/local/sbin:${PATH}
        MANPATH=/opt/local/share/man:${MANPATH}
    fi

    Then I did

    (as root or siemsenadmin)
    sudo port install ant
    sudo port install coreutils
    sudo port install dos2unix
    sudo port install fping
    sudo port install git-core +svn+bash_completion+doc+gitweb
    sudo port install groovy
    sudo port install ispell
    sudo port install lft
    sudo port install libtar
    sudo port install libtool
    sudo port install lynx
    sudo port install maven2
    sudo port select --set maven maven2
    sudo port install mtr
    sudo port install net-snmp
    sudo port install subversion
    sudo port install tcptraceroute
    sudo port install tftp-hpa
    sudo port install w3m
    sudo port install wget

    To upgrade the stuff that's installed with MacPorts, do this:

    sudo port selfupdate
    sudo port upgrade outdated

    MacPorts might install it's own copy of Python 2.4 to satisfy the dependencies of other things that you install with MacPorts. MacPorts stuff (/opt) comes before other things in my PATH, so you'll start using Python 2.4 by default. That will breaks things like Sqlite3 (Django). You'll probably want to do the following to install symlinks in /opt to restore the standard Apple Python 2.6 as the default.

    sudo python_select python26-apple

    Mail.app

    When Mail.app crashes

    Customizing Mail

    Mail mailboxes and folders

    The "mailboxes" shown by Mail.app are not all the same.

    SMART MAILBOXES are virtual links to messages that are in the Inbox. When you delete one of these, the corresponding message is deleted from the Inbox. Smart mailboxes are a convenient way to group messages into groups. Smart mailboxes are known only to Mail.app - they are not stored on the IMAP server. If you run Mail.app on two different Macs, you have to set up smart mailboxes individually on both Macs.

    You can group smart mailboxes into folders. The trick is to pull-down Mailbox->New Smart Mailbox Folder to create the folder, then drag smart mailboxes into it. I set up a NOC folder containing "I2 NOC", "UCAR NOC" and "NLR NOC."

    ON MY MAC mailboxes are real places - when you move a message to one of these, it's deleted from the Inbox.

    Move the "REMINDERS" folder to the bottom.

    PGP and Mail.app

    To let Mac Mail handle PGP encrypted messages, install GPGMail as described on my GPG page.

    Mail From and To headers

    In an attempt to make Mail.app send emails with a "From:" line of "siemsen@ucar.edu" instead of "siemsen@okapi.ucar.edu", I found this webpage http://email.about.com/od/macosxmailtips/qt/etalwaysreplyto.htm which got me to try this:

    okapi$ defaults write com.apple.mail UserHeaders '{"Reply-To" = "siemsen@ucar.edu"; "From" = "siemsen@ucar.edu";}'

    This worked (it didn't give an error) but subsequent test emails sent to the Level 3 routing registry showed that my emails were still from "siemsen@okapi.scd.edu". Sigh. Then later, I discovered that the Mac's Mail.app will do the right thing, perhaps because I did the command above. Regardless, I can now send emails to the Level 3 routing registry.

    Mail rules (assigning colors)

    Use Preferences->Rules to filter inbound mail. I use it to assign color messages from Marla red and from the rest of NE yellow.

    Mail Act-On

    1. Download the .dmg
    2. Run the "Install" program. It'll install ~/Library/Mail/Bundles/MailActOn.mailbundle.
    3. Restart Mail
    4. Go to Mail->Preferences->Mail Act-On->Register
    5. Set the User/Email to "Pete Siemsen"
    6. Set the regstration code (from 1Password)
    7. Click Ok

    See the Mail Act-On Quick-Start Guide

    Filtering spam

    Greg does a great job filtering spam on my siemsen@car.edu account. If I ever choose to use, say, mobileMe to handle personal email, I might want to consider using SpamSieve to filter the spam locally. it's supposed to be a good filter.

    Meeting Maker

    Don't try to export meetings from Meeting Maker into Address Book. It will seem to work, but any event in Meeting maker that has invitees will make an Address Book event with invitees. Later, if you change such an event in Address Book, every invitee will be sent an email. THere seems to be no way to prevent this. It's embarrassing. See the Address Book section of this page for a possible fix.

    As on Windows, if you use Palm DeskTop, you should install it before you install Meeting Maker to so Meeting Maker can find and install the conduit. See my Palm on Mac page.

    1. http://www.fin.ucar.edu/it/services/calendar/download.html
    2. click on the Macintosh link
    3. a new window should open that has in icon labeled "Installer" if using safari.
    4. double-click "Installer"
    5. click on "click on lock to make changes" lock icon.
    6. when prompted give an account with administrative privileges
    7. click on "next" button on the choose install folder screen
    8. click "ok" on the warning message that comes up
    9. select "delete meeting maker data" on the backup data screen and click "next" button.
    10. select where you want to put an alias (if you want one)
    11. click the "install" button
    12. on the last screen, leave the "launch meeting maker" check box selected.
    13. click on "done" button to finish install
    14. meeting maker should start up and show the login screen
    15. click "select" button next to the server information
    16. select "UCAR-MM8" that shows up on the right side of the window
    17. click "select" button to close window and return to login window
    18. login with your login and password

    If Meeting Maker starts behaving funny, you may want to erase the local copy of the MM database, like so:

    cd ~/Library/Preferences/Meeting\ Maker
    rm -rf siemsen:*
    rm -rf \$siemsen:*

    Mice

    Dynex mouse

    On 2010-07-06, I bought 2 Dynex DX-WMSE mice at Best Buy, for DeLynn and me. These are good, cheap, optical wired mice. They have the basic 3 buttons with a middle scroll wheel, and extra buttons 4 and 5. To use the extra buttons, I downloaded SteerMouse, a shareware application. See my SteerMouse notes

    Kensington Bluetooth mouse

    Great, but has the annoying sleep feature to save the battery, so I have to hold down the left mouse button to wake it up. At least with this mouse, I can cut/paste using the left and middle buttons in X11, as long as I have unchecked the X11 "Emulate three button mouse" preference.

    Logitech M310 USB mouse

    The nicest feel. I can't get cut/paste to work with this mouse. The Logitech Control Center software works, but doesn't solve the problem. The mouse has a little "Quick Switch"button on top, which is Button 6. SteerMouse maps it to "Switch Application", which is as good as anything else, I suppose.

    Setting the cursor size

    It's easy to lose the cursor, especially when using two displays. To make the cursor bigger, do System Preferences->Universal Access->Mouse & Trackpad and set the Cursor Size.

    Focus follows mouse

    Aqua doesn't directly support true focus-follows-mouse, probably because unenhanced focus-follows-mouse doesn't work well with the menu bar that Mac OS maintains at the top of the Mac OS screen. Suppose you have the cursor in a small application A window that is surrounded by a bigger, application B window. If you want to go use something on the (application A) menu bar, you have to move the mouse up to the menu bar, over the application B window. As you do, the focus and the menu bar change to the application B. You're screwed!

    CodeTek Virtual Desktop Pro supports focus-follows-mouse in an enhanced way that solves the problem. It allows you to cause the focus to follow the mouse, but not if the mouse is moving, and the focus will change only after a configurable pause. This is very cool! To customize CVDP to turn focus-follows-mouse on: with CVDP running, click on the little blue button on bottom of the CVDP control pane to bring up the CVDP preferences window. Under the Switching tab, under Focus Follows Mouse, turn on Enable focus follows mouse and Do not focus if window is in motion and Do not raise window when focused, and leave the other buttons turned off. Then set the Focus follows mouse after... (seconds) to about 1/5 seconds.

    Multicast

    See VLC

    Blackberry Desktop Manager

    Plug the phone in before starting the application, or the app may not see the phone.

    When I ran it, it replaced the OS on my phone (took over an hour), and I was then able to sync my Contacts (Address Book) with the phone. The BlackBerry Desktop Manager syncs both ways, so if I ever want to record a phone number in my phonea I can. I never will, because I'll use the iPod Touch instead.

    Network

    If a Mac says it's using a "self-assigned IP address" (one which starts with 169) it can be one of these things:

    1. The Mac isn't getting a DHCP address from the router. When this happened at home on 2011-01-17, the LinkSys wasn't providing a DHCP address because I'd just installed a wireless printer, so we'd hit the maximum number of addresses that the LinkSys was configured to provide. I fixed it by raising the maximum number of addresses from 10 to 12.
    2. You're reconnecting to a wireless network and the Mac has somehow remembered the wireless network incorrectly. This happened 2011-01-27 when I was in a hotel. The wireless network's password hadn't changed, so I don't know what was wrong. You have to "forget" the wireless network and try again. Go to System Preferences -> Network -> Airport -> Advanced -> Airport. Delete the network from the list of "Preferred Networks".

    Printers

    To print duplex from a Mac, do File->Print, then set the third pull-down to Layout, then select Two-sided:->Long-edged binding.

    As of 2006-04-13, SCD uses CUPS, the Common Unix Printing System. It's used by default by Mac OS X and Red Hat Fedora Core 4. The print queues are on cups-server.scd.ucar.edu. A cupsd daemon runs on each host to manage jobs emanating from the host. The local cups daemon listens on port 631, so you can web to http://localhost:631 to interact with the daemon to show a list of printers, see if jobs have printed, etc.

    To print from the command line under Mac OS X (and perhaps Linux?), use a command like

    lpr -P ML-26D_B-W@cups-server.scd.ucar.edu

    To tell the printers known to the Mac, use System Preferences -> Print & Fax or from the command line, do

    lpstat -a

    If Safari prints in black-and-white (no colors), you need to check the "Print backgrounds" box in Safari's "Print..." window.

    rkhunter

    Rkhunter looks for security problems. I downloaded it with fink. I ran it with "rkhunter --check". The resulting /var/log/rkhunter.log file had several warnings. The first one said I needed to run "rkhunter --propupd", so I did and then re-ran "rkhunter --check". That warning went away.

    Quicksilver

    In December 2009, I switched from QuickSilver to LaunchBar.

    Reverse video

    Tired of reading a long webpage as black-on-white? Mac OS X has a special command designed for handicapped people. Use ctrl-option-command-8 to toggle reverse video for the whole screen.

    Security

    To quickly lock your system when you step away, use Shift-Control-Eject.

    On 2006-02-23, Rich Johnson posted an email to nsag describing Mac OS X hacks that exploit the standard user practice of having the main account have admin privileges. The fix is to disable admin privileges on the main user account and create a separate account that has privileges. I thought I could make the privileged account be "root", but that doesn't seem to work. So I opened System Preferences->Accounts, unlocked it (lower left), authenticated, clicked "+", added an account named "admin", set it to have administrator privileges, then removed administrator privileges from the "siemsen" account.

    When you start a new MAC for the first time, it prompts you to create your account. I created "siemsen". That account is a standard Unix account with privileges so that it can run sudo. Sudo is fine for most things.

    For some things, you'll access to the true root account. For instance, minicom requires that it be run by root when it's being configured, and doesn't like being run under sudo. Apple delivers the root account disabled. To enable it, run Utilities -> NetInfo Manager, then pull-down Security -> Enable Root User. It'll prompt you to give the root account a password.

    To make the Mac ask for a password at startup,

    To make the Mac ask for a password after going to sleep,

    To make the Mac encrypt my home directory,

    SAMBA

    To use the Mac's SAMBA client to connect to a server, do Finder->Go->Connect To Server.... To connect to netserver, set the Server Address to smb://128.117.2.200/web. To connect to my home directory, set the Server Address to smb://128.117.2.200/siemsen.

    When I create files, they get set with a protection of -rwxrw-r--, I don't know why. I'd prefer it if they didn't have the group "x" bit set.

    Once in a while, you won't be able to connect. Look in netserver:/var/log/samba/log.cisl-lorient or netserver:/var/log/samba/log.galway to see why. You'll probably find messages like this:

    Authentication for user [siemsen] -> [siemsen] FAILED with error NT_STATUS_PASSWORD_EXPIRED
    You need to change your CIT password. The following procedure only works if you are physically inside the UCAR security perimeter - it won't work if you are VPN'd in from home. If you are at home, the only way to change your CIT password is to call CPG and ask for the WSST on-call person. Call them and ask them to change it to something you both agree on. I had to do this with Jose Castilla on Saturday, 2011-02-26.
    1. won't work if VPN'd - must be physically inside UCAR perimeter!
    2. open Keychain Access
    3. pull-down Keychain Access -> Ticket Viewer
    4. select the identity named siemsen@CIT.UCAR.EDU
    5. Click Remove Identity
    6. Click Add Identity
    7. Set the Identity to siemsen@CIT.UCAR.EDU identity (CIT.UCAR.EDU must be in caps!)
    8. Set the password to some new password
    9. update 1Password

    If you get

    KDC reply does not match expectations
    it could be because you didn't use caps for CIT.UCAR.EDU

    Safari

    "client denied by server configuration"

    If Safari displays "Forbidden" errors on files in your Sites directory, try running "Disk Utility" to repair permissions. Worked for me. The odd thing was that Firefox and Chrome were able to browse my home directory without errors. Weird.

    BetterSource

    BetterSource is a better HTML source viewer than "View Source". To install it, do Safari->Safari Extensions, find it under "Developers" and click on "Install Now". It'll put a new button in your toolbar. When you use it, it opens a new tab, which is different than "View Source", which opens a new window.

    Click-to-flash

    ClickToFlash used to be a Safari plug-in, and now is a Safari extension that blocks Flash animations, giving me to see Flash when I want, not when the advertisers want.

    With Safari 5, ClickToFlash is a Safari "extension", so to enable it, you do Safari->Safari Extensions and click on "Install Now".

    ClickToFlash can sometimes block sites that I want to see. One example is Amazon.com, where ClickToFlash will block the the "Listen" Flash app that lets me listen to song fragments before buying. To fix this, ClickToFlash has a "whitelist" where you can list sites for which ClickToFlash is to always allow Flash. To fix Amazon, I went to Safari and pulled-down Safari->ClickToFlash->Preferences, and added "www.amazon.com" to the "Automatic loading" list.

    Fonts in Safari

    To set the fonts used by Safari, do Safari->Preferences->Appearance. For the Standard font, I like Times New Roman 18. For the Fixed-width font, I like Courier 14, even though I like Menlo in Terminal windows.

    Adobe Flash in Safari

    On 2008-12-22, I dawnloaded Flash version 10,0,12,36 for Safari and tested it by visiting http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507 It's features are demo'd here.

    PDFs in Safari

    Safari came up with a new irritation - PDFs are automatically opened "within" the browser window. This means you lose the controls that Adobe Acrobat reader gives you - you can't resize the PDF text, you can't resize the PDF window without resizing the Sfari window, you're SCREWED. It seems that it was working a bit for a while - there was another toolbar inside the browser that provides these capabilities. Then I must've upgraded Acrobot or Safari or something, and the toolbar went away. I Google'd and learned how to turn off the "PDF inside browser window" feature and view PDFs in a separate Acrobat window as God intended.

    defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES

    Java console in Safari

    To enable the Java console with Safari, you do it outside of Safari with Utilities->Java->Java 1.4.2 Plugin Settings, then under the General tab, set Use Java console.

    Nagios sounds in Safari

    Nagios makes noises by imbedding an HTML tag that contains a sound file (/usr/share/nagios2/htdocs/media/hostdown.wav) encoded as a "audio/x-wav" MIME type. Safari needs to play the file with an application that plays sound. If Safari doesn't know how to play the sound, it'll display a pop-up that says

    Safari can't display content on this page.

    The application "Windows Media Player.app" may be able to play this content. Would you like to try?

    If you click OK, Windows Media Player will start and immediately pop up a window that says "One or more arguments are not valid".

    I tried to fix this using Default Apps, the 3rd-party application that sets default applications for file extensions and MIME types. Under "MIME", I changed the application to Quicktime. It didn't work, despite the fact that I can browse with Safari to the hostdown.wav file and hear the sound. I suspect that Default Apps isn't doing what I think it's doing. I don't know how to get Safari to use Quicktime to play the sound.

    Debug menu in Safari

    In a Terminal window, type this:

    defaults write com.apple.Safari IncludeInternalDebugMenu 1

    Restart Safari and find a new "Debug" menu at the top right. It didn't provide a way to make Safari prefer IPv6 over IPv4 addresses, which is what I was looking for, but it's kinda neat.

    RSS

    From: John Hernandez
    Date: June 7, 2010 11:51:55 AM MDT
    To: Pete Siemsen
    Subject: Nagios notifications feed

    Hey Pete,

    I've been experimenting with having access to Nagios notifications on my mobile device.

    My goal was just to have access to a "Nagios history log" of sorts, protected by some basic password auth (no VPN required), in case I get called by the NOC or I get a call from a member while I'm away from a PC with VPN.

    What I've settled on is an RSS feed, delivered by a simple Perl CGI on the nagios server. Here are the features:

    Click on "Reporting - Notifications" in the webUI to get an idea of how it works. If you're interested, and I can help you get it set up.

    John Hernandez

    Pete's notes:

    I tried the above, with limited results. When I tried to access from Safari using the URL John supplied, I got an error page. John created an account for me, and then it worked. But I couldn't get it to work from Mail.app's RSS interface, and I couldn't get it to work with mi iPod touch. Sigh.

    ScriptingBridge

    ScriptingBridge is a way to control a scriptable Mac OS X application from another Mac OS X application. It's an alternative to writing an AppleScript and then invoking it from an application. I use it to control Safari from PetesLookup. This section documents what I did.

    Following the Scripting Bridge Programming Guide, I did this to generate the header files that are needed to send Apple Events from PetesLookup to various browsers:

    cd ~/play/objective-C/PetesLookup
    sdef /Applications/Google\ Chrome.app | sdp -fh --basename GoogleChrome
    sdef /Applications/Firefox.app | sdp -fh --basename Firefox
    sdef /Applications/Safari.app | sdp -fh --basename Safari

    This generated a file named Safari.h. I added it to the PetesLookup project. Then I added an #import "Safari.h" to the PetesLookupForMac.m file. Then I added the Scripting Bridge Framework to the project by going to the Frameworks->Other Frameworks"/nobr> and doing an "Add...". Then I plowed through learning to use it. It works.

    To generate a header file named SystemEvents.h, so I can access the "System Events" to find out what application currently has focus, I did

    sdef "/System/Library/CoreServices/System Events.app" | sdp -fh --basename SystemEvents

    Services (application linkage)

    Mac OS X lets you select text with the mouse in one application and feed it to another application. For example, you can select an email address in Safari and then use "Safari->Services->Mail->Send To" to cause Mail to open a compose window, with the addressee filled in. You can write your own services, so I created a general-purpose "PetesLookup" service that looks up IP addresses, AS numbers, VLANS, abbreviations, etc.

    For Mac OS X to "see" your service, you first have to put the .app file in an Applications directory. You can put it in the system-wide Applications directory, but it's probably better to but it your home directory:

    $ mkdir ~/Applications
    $ cp -R ~/play/objective-c/PetesLookup/build/Debug/PetesLookup.app ~/Applications/
    Then you have to log out and log back in to make Mac OS X scan all Application directories for services.

    To verify that Mac OS X sees the service,

    $ /System/Library/CoreServices/pbs -dump_pboard | grep PetesLookup
        NSBundleIdentifier = "edu.ucar.PetesLookup";
        NSBundlePath = "/Users/siemsen/Applications/PetesLookup.app";
        NSPortName = PetesLookup;

    To see why an application doesn't show the new service in it's Services menu,

    $ /Applications/TextEdit.app/Contents/MacOS/TextEdit -NSDebugServices edu.ucar.PetesLookup
    2010-02-03 20:34:46.808 TextEdit[6380:903] NSDebugServices=edu.ucar.PetesLookup
    Pete's lookup (edu.ucar.PetesLookup) is disabled in the services menu and disabled in the context menu, by the standard Services policy.

    To fix that problem, go into System Preferences, Keyboard, Keyboard Shortcuts, Services and find your service (at the bottom) and check it.

    Hopefully, that problem will be fixed:

    $ /Applications/TextEdit.app/Contents/MacOS/TextEdit -NSDebugServices edu.ucar.PetesLookup
    2010-02-03 23:41:05.108 TextEdit[6480:903] NSDebugServices=edu.ucar.PetesLookup Pete's lookup (edu.ucar.PetesLookup) is explicitly enabled in the services menu and enabled in the context menu, in preferences.

    When debugging a Service, it helps to run the Console application, which will show you any NSLog calls that you make in the service.

    The Apple docs about how to program services says that in Snow Leopard, "NSSendTypes and NSReturnTypes no longer need to be specified". That's true, sorta, but if you don't specify an NSSendTypes, the new service will show up in the "General" category instead of the "Text" category.

    Services (network) - FTP, SSH, TFTP, etc.

    ftpd

    To start the ftpd daemon so other machines can FTP to this Mac, go to System Preferences->Sharing and FTP Access.

    sshd

    To start the sshd daemon so that users can SSH to this Mac, go to System Preferences->Sharing and turn on "Remote Login". Then, with "Remote Login" highlighted, set "Allow access for" to "Only these users" and add "Pete Siemsen" to the list. Note that "ladmin" is Jon Frudeger in WSST.

    tftpd

    I Google'd and found TftpServer, a front-end that makes it easy to start/stop the "tftp server", but I'm not sure I have a tftpd.

    sleepwatcher

    Mostly to try to make my Mac more secure (see mp ssh-agent notes below), I installed sleepwatcher. Later, I learned how to use it to play a sound whenever my Mac goes to sleep, which is useful to keep from unintentionally putting the Mac in my backpack "awake" and cooking the Mac.

    Sleepwatcher is a program that watches a Mac for "go-to-sleep" and "wake-up" events, and executes a user-defined script when either of these events happens. I downloaded both pieces of it - sleepwatcher and the "startup item". It installs into /usr/local/sbin/sleepwatcher. Then I created ~/.sleep and ~/.wakeup scripts in my home directory. Sleepwatcher runs them when the Mac goes to sleep or wakes up. I made the scripts log messages and timestamps to ~/sleeplog.

    Note that the Mac "pmset" command does several interesting things around power, sleeping, etc.

    Spaces

    In Spaces, a cool way to move a window directly to different virtual desktop is to select the window with the mouse, as if yu're going to drag it, and while holding the mouse down, do CTRL-number, where nmber is the desktop you want to switch to. Very cool.

    By default, Spaces will switch virtual desktops when you drag a window to the edge of the screen and hold the mouse down there for 0.75 seconds. This irritates me, because I never want to use the mouse to switch desktops. To fix it, do this in a Terminal window:

    defaults write com.apple.dock workspaces-edge-delay -float 10.0
    killall Dock

    ssh-agent

    If you can't ssh to cisl-lorient or cisl-valencia, see my notes for sshd.

    In order to log in to remote hosts without having to type passwords, I run ssh-agent. It stores my ssh keys and feeds them to applications like "ssh" and "scp" as needed. For ssh-agent to work, you have to load it with your keys, one time. From then on, you can ssh to other hosts without having to specify a password every time.

    Mac OS X automatically starts ssh-agent via launchd whenever an ssh application runs. The ssh-add command automatically saves passphrases in the keychain. The advantage here is that the new -k option to ssh-add can be used to autamatically add all identities that have passphrases stored in the keychain. This would be convenient if I stored my identity in a place that was always mounted. Since I don't, I still use my "ssho" bash function to load keys into ssh-agent from my USB drive.

    ssh-add has a -c option that will confirm every use of a key. David Mitchell wants me to use it, but it seems to have no effect in Mac OS X. I tried setting SSH_ASKPASS, but no window pops up. So I just don't confirm. Sorry, David.

    I'm vulnerable to someone stealing my laptop and having access to my ssh keys. To prevent this, I should follow Dave Dribin's suggestions for how to make the Mac stop the ssh-agent whenever it goes to sleep. To do this, I installed sleepwatcher, which runs a script in my home directory whenever my Mac goes to sleep or wakes up.

    SteerMouse

    SteerMouse is a shareware application that lets you program the buttons on your mouse. It also has another nice feature: it "warps" the mouse cursor to the top of "OK" buttons. I use SteerMouse to program the buttons on my mice.

    I used SteerMouse to program the buttons as follows:

    Button emitted characters effect
    4 (left side) Shift Command [ Previous Tab (in Terminal, Safari and Aquamacs)
    5 (right side) Shift Command ] Next Tab (in Terminal, Safari and Aquamacs)

    sysctl

    Download the "Broadband Tuner" from http://www.apple.com/support/downloads/broadbandtuner10.html Run it to raise the default TCP buffer sizes and set the /etc/sysctl.conf file so the values are preserved across reboots.

    System details

    ladyjane - DeLynn's Mac

    Purchased 2005-07-30 at the Cherry Creek Apple Store.

    Purchased AppleCare Protection Plan along with the Mac. I registered it using the code that came in the APP box. To get technical support, call 800-275-2273 and give the serial number of the Mac. I'm covered until 2008-07-25.

    Part No. M9691LL/A
    Serial No. 4H5221UWRJ7
    Airport ID: 00-11-24-9c-74-d5
    Ethernet ID: 00-14-51-01-e4-98
    BlueTooth ID: 00-14-51-4c-ae-c5

    okapi - Pete's Mac

    Purchased 2005-08-07 by UCAR.

    Purchased AppleCare Protection Plan along with the Mac. It's "auto-enrolled", which means an APP box didn't arrive with the Mac. To use it, call 800-275-2273 and give the serial number of the Mac. I'm covered until 2008-08-07. I can call 800-275-2273 for technical support.

    Part No. Z0B610009
    Serial No. W8532219SQ7
    Airport ID: 00-11-24-a1-05-5f
    Ethernet ID: 00-11-24dd-08-cc
    BlueTooth ID: 00-14-51-4f-62-7d

    What I ordered

    		DATE SAVED: 07/25/05 - 09:48 AM Pacific Standard Time
    
    		SAVED ITEMS:
    
    		Part Number:   TC706LL/A
    		Product Name:  Kensington PilotMouse Bluetooth Mini
    		Unit Price:    $69.99
    		Quantity:      1
    		Net Price:     $69.99
    		Estimated time to ship:    2-3 weeks
    
    		Part Number:   M8853LL/A
    		Product Name:  AppleCare Protection Plan for PowerBook (w/ or w/o Display)
    		Unit Price:    $349.00
    		Quantity:      1
    		Net Price:     $349.00
    		Estimated time to ship:    1-3 business days
    
    		Part Number:   Z0B6
    		Product Name:  PowerBook 15" 1.67GHz SuperDrive
    		Options:
    		065-5288   1.67GHz PowerPC G4 w/64MB VRAM
    		065-5377   1GB DDR333 SDRAM - 2x512 SO-DIMMs
    		065-5283   80GB Ultra ATA drive @ 5400 rpm
    		065-5286   8x SuperDrive (DVD±RW/CD-RW)
    		065-5376   AirPort Extreme Card
    		065-5290   Backlit Keyboard/Mac OS - U.S. English
    		Unit Price:    $2,449.00
    		Quantity:      1
    		Net Price:     $2,449.00
    		Estimated time to ship:    1-3 business days
    
    		Part Number:   M9270LL/A
    		Product Name:  Apple Wireless Keyboard
    		Unit Price:    $59.00
    		Quantity:      1
    		Net Price:     $59.00
    		Estimated time to ship:    Within 24 hours
    
    		Part Number:   T9187LL/A
    		Product Name:  Office 2004 for Mac - Professional Edition
    		Unit Price:    $499.95
    		Quantity:      1
    		Net Price:     $499.95
    		Estimated time to ship:    Within 24 hours
    
    		SUBTOTAL: $3,426.94
    	

    Tabs

    I try to use tabs in Terminal, Safari and Aquamacs to help group related pages and buffers. To cycle through tabs, all three apps use Shift-Command-[ and Shift-Command-]. I used the SteerMouse app to program the left and right mouse buttons on my Dynex mice to produce these sequences. See the section about the Dynex mouse.

    Terminal

    Terminal preferences (my defaults for all Terminal windows)

    To set my personal defaults for all Terminal windows, open a fresh Terminal window and do Terminal->Preferences. Click the Settings tab. Click the Shell subtab.

    ...then click the Use setting as default button to save them.

    Set Terminal window colors

    I use Terminal windows to remote hosts. I like to use different colors for different hosts. To make it easy to open new Terminal windows, I use LaunchBar. The following describes the process:

    1. Open Terminal
    2. Pull-down Shell->New Remote Connection
    3. Select Secure Shell (ssh)
    4. Click the plus sign under Server
    5. Type the name of the machine and click OK
    6. Click Connect. That creates the new Terminal window and connection. Now we want to create a Terminal menu item, so that we can open a session/window by right-clicking on the Terminal icon in the Dock and selecting "New Window".
    7. Pull-down Terminal->Preferences
    8. In the list on the left, select okapi and pull-down Duplicate Settings
    9. Change the name of the new item from "okapi 1" to the name of the new machine
    10. On the Window tab, set the Background Color
    11. On the Shell tab, set the Run Command to "ssh xxx" and clear the "Run inside shell" button
    12. Close the Settings window. We've saved a named set of settings, with a unique background color for the remote machine. This is cool, but in order to open a window to the remote machine, I have to use the mouse to right-click on the Terminal icon in the Dock, then scroll down to the menu item. To make this faster, I use LaunchBar. See my notes about LaunchBar.
    13. Back in Terminal, Pull-down Shell->Export Settings...
    14. Save the file
    15. Move the .terminal file to ~/Library/Application Support/Terminal

    Selecting Terminal window colors

    I use different dark background colors to identify various Emacs and Terminal windows. For this to work, I need unique dark colors. Here's the set of colors I found. Colors have many naming systems. If you open Terminal->Preferences, select a settings name from the ones on the right, and click Window and then Color, you get a standanrd Mac "Colors" chooser window. In that window, use the second option (Sliders) and set the slider type to RGB Sliders, so you can set colors by numbers. Then you can set the following:

    my name RedGreenBlueColor What
    black 0 0 0 localhost
    dark grey 25 25 25  
    dark red 40 0 0 Ciscos
    dark green 0 45 0 nagman
    dark blue 0 0 45 Aquamacs
    dark purple 30 0 30 netserver
    dark cyan 0 30 30 other remote Unixes
    dark yellow 30 30 0  
    dark brown 50 32 0  

    If Terminal starts slow

    http://www.proposedsolution.com/solutions/osx-terminal-slow-launch/

    TeX and LaTeX

    I installed TeX so I could work on the Aquamacs manual. Following the recommendation in the README file for the Aquamacs manual, I installed TeX and LaTeX by following the directions at http://www.rna.nl/tex.html. I installed i-Installer as describe here, and then ran it.

    TextExpander

    TextExpander does these great things for me:
    1. expands abbreviations into long strings. Like "ssiem" into "siemsen@ucar.edu"
    2. fixes common typos, like "FGRP" into "FRGP".
    3. expands HTML abbreviations, like ",li" into "<li></li>"

    I bought it on 2008-02 for $24.95, and then upgraded to version 3.0 in 2010-05 for $34.95.

    To synchronize snippets between machines, I use DropBox. The Trick is to stop TextExpander, then do this:

    ln -s /Users/Siemsen/Dropbox/Library/TextExpander TextExpander

    ThisService

    The ThisService program is a way to inform Mac OS X that a new service is available in ~/Library/Services. See the section about Services for a description of services and how I use them.

    Trackpad

    The laptop trackpad and one button are a serious pain in 2 ways:

    So I'll try to have a real three-button mouse available even when I'm using the laptop port-ably. That means I can check the "Ignore trackpad when mouse is present" box under System Preferences->KeyBoard & Mouse, under the Trackpad tab.

    Virtual PC

    I typically use Virtual PC to run Visio or to access websites that require Internet Explorer. For notes about Visio, see my Visio on Windows notes.

    To access Mac files from Virtual PC, you don't have to run a SAMBA server on the Mac. Instead, tell Virtual PC to share a MAC OS X directory. In Virtual PC, pull-down Drives->Share Folder.... Then click on the Share Folder... button. Select siemsen folder and set the Share every time checkbox. Then restart Virtual PC. When you start Windows Explorer, you should find a folder named Disconnectd Network Drive: Z under My Computer.

    To access netserver files from Virtual PC, click on the "netserver" shortcut to SAMBA-mount the /usr/web directory. Then navigate to the .vsd file that you want to edit and double-click to launch Visio.

    Visio

    See the previous section for notes about how to use Virtual PC to edit Visio files. For notes about Visio itself, see my Visio on Windows notes.

    WebDAV - for syncing OmniFocus

    I use WebDAV to sync OmniFocus databases between my Mac laptop and my Mac desktop. Instructions can be found at HOWTO Setup WebDAV on Mac OS X Leopard for syncing OmniFocus to iPhone - Manas Tungare I run a WebDAV server on galway and sync to it from galway and okapi.

    wireless and certs

    To load a certificate on my laptop, follow the directions in the NETS Open Wiki at https://wiki.ucar.edu/display/netsopen/802.11i+User+Docs

    1. On the laptop, connected via a wire to the network...
    2. web to https://netserver.ucar.edu
    3. log in (upper right corner, requires YubiKey)
    4. Click on "Create a new nonce (login required)
    5. Click "Submit"
    6. Copy the nonce string over a Terminal window so you have it for later
    7. disconnect the laptop from the wired network
    8. turn the Airport on
    9. connect to the "UCAR" network
    10. In a separate Safari window, web to https://netserver.ucar.edu
    11. Click on "Redeem a nonce"
    12. Cut/paste the nonce that you copied into the Terminal window
    13. Fill in the username with "siemsen"
    14. Click "Submit"
    15. Click "Download certificate"
    16. open the certificate file (the name ends with .p12)
    17. KeyChain Access will open and ask for the password for the certificate. The password is the nonce (you have to type it, you can't cut-and-paste).
    18. A new entry will appear in Keychain Access. To see it, click on My Certificates over on the left. It'll have a name like "siemsen@6033.4b25.eac9" and an expiration date that is 1 year in the future.
    19. Quit Keychain Access
    20. Unlike the rest of the UCAR Wireless Certificate Installation Instructions for "Apple OSX", do this...
    21. Connect to "UCAR Internal".
    22. In the dialog box that pops up, set the "Mode" to "EAP-TLS".
    23. Use the pull-down to set the "Identity" to the cert that you installed above
    24. Set the "Username" to "siemsen"
    25. click "Join"
    26. It'll pop up another dialog that says "eapolclient wants to sign using key "privateKey" in your keychain". Click "Always Allow".
    27. You should be good to go.
    If you get into the mode where it can't connect to UCAR Internal, and it cycles, giving "Self assigned IP address", a possible fix is the following:
    1. open System Preferences, Network, Wi-fi, Advanced, Wi-Fi
    2. under Preferred networks, highlight "UCAR Internal"
    3. click on the little pencil icon
    4. set the "Security" to "WPA2 Enterprise"
    5. set the username to "siemsen"
    6. leave the password blank
    7. set 802.1X to "Automatic"
    8. choose your TLS certificate from the list
    9. click "OK"
    10. click "Apply"

    X11

    As of 2009-05-29, X11 is called "XQuartz". You have to download and install it separately from Software Update. Log in to Apple Developer Connection to get it.

    When X11 starts, it creates an xterm by default. This is annoying. To stop it, edit /etc/X11/xinit/xinitrc and comment out the line that starts an xterm.

    With some mice, I can't do the standard cut/paste. Specifically, while I can select text with the left mouse button, I can't paste it with the middle mouse button. When I hit the middle mouse button, nothing happens. It works when I use Kensington Bluetooth mouse and I have X11->Preferences->Input Emulate three button mouse unchecked.

    I tried installing autocutsel, which really seemed like it might help, but it didn't.

    apt-get install autocutsel
    more /sw/share/doc/autocutsel/README
    autocutsel &

    I tried learning the difference between the middle mouse button on the Kensington mouse and on the Logitech mouse. They seem to generate the same X events. Perhaps the Bluetooth driver is doing the right thing and the USB driver isn't? The solution seems to be to buy another Kensington mouse. As long as you're considering expensive mice, try Apple's Mighty Mouse.

    When I start XEmacs on netserver displaying back to okapi, I get BadWindow events when I use the scroll wheel. I don't when I run the XEmacs that's local to okapi.

    Xcode

    Xcode is the MAC development environment. You need it to do things other than development. For example, if you use something that needs cpp (needed by xrdb), or if you're going to build things that you download from the web.

    I downloaded Xcode 3.2.1 from http://developer.apple.com. It installs stuff in /Developer. I had to join the ADC (Apple Development Consortium) before I could download it.

    Xcode is not in Applications, it's in /Developer, dunno why.

    XCode and Interfoce Builder are huge topics, but here are the important things that took me a long time to get.


    Pete Siemsen
    Last modified: Wed Nov 22 11:50:46 MST 2006