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:
- Get some decent fonts (I borrowed some from my Ubuntu distribution -- I'm sure there are lots of other places to get fonts from).
- 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)
- Start NetInfo Manager.
- Create new folder in /root (name: exports).
- Click on new_directory in menu, changes will be saved.
- Click on exports, add a subdirectory name (physical name of mount point).
- Add a property clients (set to blank for all clients).
- 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:
- Open a terminal window and enter "sudo -i" (enter your password).
- Start "Netinfo Manager".
- Go to users, unlock and change the user id.
- Go back to the terminal window and enter:
find / -user 501 -exec chown {} 500 \;
(substitute appropriate values) - Back in Netinfo manager, to groups, unlock and change the group id
- 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
- Insert the Install Disk 1 and click on the "Xcode Tools" Folder.
- 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
There are a huge number of very useful keyboard shortcuts for the Mac. But finding out what they are can be tedious. However several applications will give you hints. One way is to observe the shortcuts given in the menus. Safari has a number of useful shorcuts. For example, if you hold down the Ctrl key while you click a link ... A menu pops up ... One of the options on the menu is Copy Link. If you install Firefox, you will find that many of the shortcuts that work in Safari, also work in Firefox. However Firefox does not show the hints in the bottom bar, as Safari does. It's just another reason to keep using Safari on the Mac for a while before switching to Firefox (see below).
Note: Mac refers to the "Apple" or Command Key. Whether it is "Apple" or "Command" is not always clear. The Option key is also marked Alt in small writing.
-
Also there are some Some useful keyboard shortcuts, which are sort of documented (if you can decode what the symbols mean in the menus):
Ctrl-Mac-Eject Close all applications and reboot Ctrl-Option-Mac-Eject Shutdown Immediate (Turn Power Off) Shift-Mac-Q Close all applications and logout (brings up logout dialogue, with 120 second countdown) Shift-Mac-Option-Q Close all applications and logout immediately Mac-Delete Delete Item (Move to trash) Mac-N Open a new Finder window (click on the Desktop first) -
You can check which system calls were being accessed by running fs_usage (as root) while running an application
-
Getting Quicktime to work with various codecs was difficult. I found a codec which played .AVI files, only to discover that it would not play anything larger than 2GB. VLC is an excellent video GNU video player for the Mac (see below). It will play just about anything. It's open source. And it's free (as in beer and as in speech). Files larger than 2GB don't faze it at all. Also, I was not able to get iTunes to read .ogg files. Which was rather annoying, considering the sizeable number of OGG files I already have. There is a package called XiphQT , which educates iTunes to grok OGG. However, I found the system slow to recognise the new codec (I had to restart the computer after I installed it). Also, it doesn't seem to read all the OGG tags the first time it encounters a new file. OGG works much better in Amorok (which IMHO is the best music management software in the world). But while in the Mac world it is easier to play your music with iTunes.
Setting up mail for the network was difficult. The other workstations on this network are Linux. After the great TPG fiasco, I changed to all Linux servers. I found that the Mac Mail system was not very co-operative. It seemed to want to do things "The Mac Way". I would have liked to have persisted and found out how the Mac MUA works, but I decided to take a short cut and install "Evolution". This worked very well on the Mac.
I also installed Firefox, Open Office and the Gimp. For some applications Safari seems to work better than Firefox. Or at least this is the case if the applications has been written properly. With Apple supporting Safari, it is closely integrated with the Operating System, and there are some features about Safari, that you may become quite fond of, once you have learned to do things "The Mac Way". There are many reasons why developers should write applications that do not depend on browser-specific code. Nevertheless, some sites persist in making their applications browser-specific. I won't go off on a tangent to discuss why this is a bad idea. But many such browser-specific sites forget about Safari. Fortunately most of these sites will support Firefox. So it may be necessary to keep a version of Firefox on your Mac. For some reason there appears to be some fonts missing from Firefox. There is a lot of confusing chatter on the Internet about this. But generally Firefox will work even if the screens don't look so pretty.
Gimp seemed to work ok. One of the things I use Gimp for is removing red-eye from photos. This is quite tedious however. It usually means zooming in to each eye, select just the (red) pupil and adjusting the colours. I always thought that I might look at the possibility of automating this in Gimp, but I haven't got around to it.
I was pleasantly surprised to discover that iPhoto does this for you. All you have to do is click on each eye that you want fix ... then click on the red-eye adjustment ... and it is done! iPhoto seems like a good application, well integrated with the desktop and easy to use. Sometimes the Mac automatic red-eye adjustment goes completely off the rails. This seems to be the case when the subjects are not filling a large portion of the photo, or are partially in shadow. But for your standard poses, this feature is very handy. Especially for those group shots, where there might be a dozen or so red-eyes.
I wanted to install Active State perl, because I was interested in trialing the Active State compiler. This was pretty easy. All that was required was to download the package and install it.
There are a few additional cleanup steps that need to be run if you already had a perl install (you almost certainly would have). These were the cleanup steps that I used:
# Install Active Perl for Mac OS X
# Read the release notes:
# run these commands
sudo -i
# get rid of old perl commands
cd /usr/bin
mv perl perl-5.8.6
mv perlbug perlbug-5.8.6
mv perlcc perlcc-5.8.6
mv perldoc perldoc-5.8.6
mv perlivp perlivp-5.8.6
mv cpan cpan-5.8.6
mv a2p a2p-5.8.6
mv c2ph c2ph-5.8.6
mv crc32 crc32-5.8.6
mv dprofpp dprofpp-5.8.6
mv enc2xs enc2xs-5.8.6
mv find2perl find2perl-5.8.6
mv h2ph h2ph-5.8.6
mv h2xs h2xs-5.8.6
mv instmodsh instmodsh-5.8.6
mv libnetcfg libnetcfg-5.8.6
mv piconv piconv-5.8.6
mv pl2pm pl2pm-5.8.6
mv pod2html pod2html-5.8.6
mv pod2latex pod2latex-5.8.6
mv pod2man pod2man-5.8.6
mv pod2text pod2text-5.8.6
mv pod2usage pod2usage-5.8.6
mv podchecker podchecker-5.8.6
mv podselect podselect-5.8.6
mv prove prove-5.8.6
mv psed psed-5.8.6
mv pstruct pstruct-5.8.6
mv ptar ptar-5.8.6
mv s2p s2p-5.8.6
mv splain splain-5.8.6
mv xsubpp xsubpp-5.8.6
# create links to the new perl binaries
ln -s /usr/local/ActivePerl-5.10/bin/perlbug
ln -s /usr/local/ActivePerl-5.10/bin/perlcc
ln -s /usr/local/ActivePerl-5.10/bin/perldoc
ln -s /usr/local/ActivePerl-5.10/bin/perlivp
ln -s /usr/local/ActivePerl-5.10/bin/cpan
ln -s /usr/local/ActivePerl-5.10/bin/a2p
ln -s /usr/local/ActivePerl-5.10/bin/c2ph
ln -s /usr/local/ActivePerl-5.10/bin/crc32
ln -s /usr/local/ActivePerl-5.10/bin/dprofpp
ln -s /usr/local/ActivePerl-5.10/bin/enc2xs
ln -s /usr/local/ActivePerl-5.10/bin/find2perl
ln -s /usr/local/ActivePerl-5.10/bin/h2ph
ln -s /usr/local/ActivePerl-5.10/bin/h2xs
ln -s /usr/local/ActivePerl-5.10/bin/instmodsh
ln -s /usr/local/ActivePerl-5.10/bin/libnetcfg
ln -s /usr/local/ActivePerl-5.10/bin/piconv
ln -s /usr/local/ActivePerl-5.10/bin/pl2pm
ln -s /usr/local/ActivePerl-5.10/bin/pod2html
ln -s /usr/local/ActivePerl-5.10/bin/pod2latex
ln -s /usr/local/ActivePerl-5.10/bin/pod2man
ln -s /usr/local/ActivePerl-5.10/bin/pod2text
ln -s /usr/local/ActivePerl-5.10/bin/pod2usage
ln -s /usr/local/ActivePerl-5.10/bin/podchecker
ln -s /usr/local/ActivePerl-5.10/bin/podselect
ln -s /usr/local/ActivePerl-5.10/bin/prove
ln -s /usr/local/ActivePerl-5.10/bin/psed
ln -s /usr/local/ActivePerl-5.10/bin/pstruct
ln -s /usr/local/ActivePerl-5.10/bin/ptar
ln -s /usr/local/ActivePerl-5.10/bin/s2p
ln -s /usr/local/ActivePerl-5.10/bin/splain
ln -s /usr/local/ActivePerl-5.10/bin/xsubpp
exit
# NB: The above shell commands were generated with ls, awk and vi
# Check your installation
perl -v
perl -e 'foreach (@INC) { print "$_\n"}'
sudo ln -s /usr/local/ActivePerl-5.10/bin/ppm /usr/bin/ppm
# create a ~/.MacOSX/environment.plist as in the release notes:
# <key>PERL5LIB</key>
# <string>/path/to/perl/lib</string>
# NB: I created this file in root's home folder as well (not sure if I needed to do that)
# after this I could start ppm with this the command:
sudo ppm
BIBLIOGRAPHY:
The following are some of the links I discovered while installing OS X.
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 - VLC media player. If you are tired of various codecs not working with Quicktime, try this. VLC seems to play most common formats. |
|
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. |