PGTS PGTS Pty. Ltd.   ACN: 007 008 568               Mobile Version Coming Soon

point Site Navigation







Valid HTML 4.01!






   Download Kubuntu Today

   Ubuntu

   The Power Of KDE + Ubuntu





Mac Os 10.2.11 (Tiger)

By Gerry Patterson

Customising Mac OS X.

Apple's decision to use BSD as the basis for their operating system is a major reason for resurgence of their fortunes. It frees the company from the tedium of creating and maintaining an operating system and allows them to concentrate on applications.

Even though the operating system is BSD, there are a lot of things that have been changed. BSD users need to learn to do things the "Mac" way.

This is a small list of some of the things I did to customise a Mac Pro running OS X Tiger.


Customising Terminal

I tried the terminal application. This can be found in the terminal applications folder. You can add it to your menu by dragging it to the menu from the applications folder. There was no .profile, so I created one, The PATH was very basic, so I added $HOME/bin and created /usr/local/bin (and added it to the PATH). Administrator functions can be performed with the "sudo" command.

At First, I found terminal windows rather ordinary. I found cut and paste difficult to use and the fonts were ugly. A couple of things that make the Mac Terminal much easier on the eyes are:

  1. Get some decent fonts (I borrowed some from my Ubuntu distribution -- I'm sure there are lots of other places to get fonts from).
  2. Use anti-aliasing.

After I became accustomed to the Mac way of doing things (new keyboard and strange Mac mouse), I began to appreciate that the Mac Terminal had some great features. There are several keyboard shortcuts that can be accessed with the "Mac" key. Some of the ones that I learned quickly were Mac-C to copy, Mac-V to paste, Mac-A to select all. Mac-N opens a new terminal window, and Mac-1 - Mac-9 allows quick switching between up to 9 sessions. (Note: The Mac key is sometimes referred to as the Command key. Generally speaking the Mac key is used where the Ctrl key is used in keyboard shortcuts in Windows. Ubuntu has also adopted many of the Windows shortcuts, so these translate easily to OS X using the Mac key.

However there is a word of warning for Windows (and these days, Ubuntu) users. When you unpack your brand new Mac Pro and start using it, the Mouse has both sides mapped to the Primary Button. This means (in Windows speak) that there is no right-click button. If you want your mouse to behave like a Windows mouse you must map the right hand side of your Mac mouse to the Secondary Button (Hint click on "Mouse and Keyboard" in the System Preferences menu. It looks as though Windows is the defacto standard for mouse behaviour, these days. Even Ubuntu has run up the white flag on mouse mappings, although for old X diehards Ubuntu does give you the option of preserving the classic X mouse behaviour.

In order to get some of the keys mapped in Linux, when I used the terminal app, I needed to add custom mapping for some of the keys (PgUp, PgDn, End etc). To do this, I used a perl script on the Linux console to discover the mappings and the keys. The perl script is as follows:
#!/usr/bin/perl
$curr_stty = `stty -g`;
while (1){
        undef $b2;
        system "stty raw -echo";
        # sysread STDIN,$x,1;
        $x = getc(STDIN);
        system "stty $curr_stty";
        $h = unpack "C",$x;
        print "ESC " if ($x =~ /\e/);
        printf "%c",$h;
        printf " Hex: %x",$h;
        print "\n";
        exit if ($x =~ /^q$/i);
}

The above script will display the codes for each key as it is pressed. Press the letter 'q' to stop it.

After creating terminal profiles they are saved in this location:

    ~/Library/Application Support/Terminal/

Each terminal config file ends in the extension ".term". These appear to be XML files.


Macs and NFS with Linux

Getting the Mac to work with NFS was tricky. It seems that more effort has been put into making it easy for Samba shares. I suppose Apple considers that people who want to get NFS working probably know enough how to it anyway (and this assumption is probably correct).

The following examples are copied from the exports man pages (Darwin Kernel Version 8.9.2)


EXAMPLES
           /usr /usr/local -maproot=0:10 friends
           /usr -maproot=daemon grumpy.cis.uoguelph.ca 131.104.48.16
           /usr -ro -mapall=nobody
           /u -maproot=bin: -network 131.104.48 -mask 255.255.255.0
           /u2 -maproot=root friends
           /u2 -alldirs -network cis-net -mask cis-mask
           /Users -alldirs -network 2.29.96.0 -mask 255.255.255.0
           /Applications -ro -network 2.29.96.0 -mask 255.255.255.0

In order to start NFS on the Mac, I tried editing editing the file /etc/exports. I added some lines and started mountd. When it did not work I started NFS with the verbose output to STDERR. HINT: use this command:

    mountd -d /etc/exports

On the Linux server make sure that nfslock has been started (look for /etc/init.d/nfslock).

In order to get NFS working I had to add this line to the Linux NFS server configuration:

    share 192.0.2.0/255.255.255.0(rw,root_squash,insecure)

The instructions for creating an NFS share on the Mac is downright weird. Here are the instructions which I got from the Internet (see: bibliography). In the NetInfo Manager go to: Applications->Utilities->NetInfo Manager

Instructions for starting NFS server on MAC, the MAC way. NB: must have NetInfo Manager. (You can get this from the Mac site)

  1. Start NetInfo Manager.
  2. Create new folder in /root (name: exports).
  3. Click on new_directory in menu, changes will be saved.
  4. Click on exports, add a subdirectory name (physical name of mount point).
  5. Add a property clients (set to blank for all clients).
  6. Add a property opts rw (for read-write).

When I tried to this it worked. However when it came time to add a second, I had great difficulty getting the second share to work.

I found it easier to edit /etc/rc.local script to mount NFS volumes. While I was at it I added a line to force the clock to synchronise. For some reason this is very slow on the Mac, so I only do it every 5 days.
# mount any servers, that I know will be working
mount -t nfs myserver:/nfs /nfs

# mount the nfs drives on other workstations if they are present
ping -qc1 ws01 > /dev/null 2>&1
if [ $? -eq 0 ] ; then
        mount -t nfs ws01:/shared /ws01_shared
fi

ping -qc1 ws02 > /dev/null 2>&1
if [ $? -eq 0 ] ; then
        mount -t nfs ws02:/shared /ws02_shared
fi

# synchronise the clock -- Do this every fifth day
/bin/date +%d | /usr/bin/perl -ane 'exit 1 if ($F[0]%5==0)'
if [ $? -eq 0 ] ; then
        # ping your ISP's DNS -- quick test of the internet connection
        ping -qc1 1.2.3.4 > /dev/null 2>&1
        if [ $? -eq 0 ] ; then
                # use your preferred NTP server here ...
                ntpdate ntp.foo.bar.com pool.ntp.org
        fi
fi

Changing uid and gid:

  1. Open a terminal window and enter "sudo -i" (enter your password).
  2. Start "Netinfo Manager".
  3. Go to users, unlock and change the user id.
  4. Go back to the terminal window and enter:
    
           find / -user 501 -exec chown {} 500 \;
        
    (substitute appropriate values)
  5. Back in Netinfo manager, to groups, unlock and change the group id
  6. Go back to the terminal window and enter:
           find / -group 501 -exec chgrp {} 500 \;
        
    (substitute appropriate values)

Installing the C compiler for Mac OS X

  1. Insert the Install Disk 1 and click on the "Xcode Tools" Folder.
  2. Select XcodeTools.mpkg.

Changing access to computer:

System-Preferences->(Internet & Network)->Sharing

I Tried to install The Incredibles - Rise of the Underminer for the kids, however the disk would not install under kids account. It would only install on an admin account.

One way to have achieved this would have been to grant admin rights to each child, install the software and then revoke admin rights. However even if this approach did work it would have been rather tedious and there other games which appeared to have the same problem

I decided to create a pseudo user for games. Whenever they wanted to use a game they could login as the games pseudo-user. As I would grant admin rights before installing a game and revoke the rights after the install.


Tips, applications, configuration




BIBLIOGRAPHY:

The following are some of the links I discovered while installing OS X.

sial.org

Using Automount on Mac OS X. If you are not familiar with The Mac Way, this is a good reference to get you used to the strange way of mounting NFS volumes.

VideoLAN

VideoLAN - VLC media player. If you are tired of various codecs not working with Quicktime, try this. VLC seems to play most common formats.

Xiph.org

XiphQT Download Site. Download the Mac package and follow the instructions in the ReadMe. I had to restart the computer to make it kick in. However I had several windows open when I installed it.