Showing posts with label Leopard. Show all posts
Showing posts with label Leopard. Show all posts

Leopard - a spotty start

Added later: See the following post (above) for solution!

First, the good news. I have Leopard up-and-running, and it is great. It feels faster (maybe it is faster, who knows) it looks great.

Installation is supposed to be straigtforward. Put the CD in the drive and follow the instructions. We got to the place where you are supposed to select a disk on which to install Leopard - no disk appears. Wait,... Wait some more,... Make a cup of tea, ... Still a blank.

Go back, and look for an exit button - there is none. Try Disk Utility as suggested to select startup drive - no drive appears. Despair begins. I did back up my important files before starting this process, but restoring them will be a hassle - and what about the unimportant ones (I have a long tail, lots and lots of not very important files, but if they all go, that will feel quite important).

I try various incantations of keys (escape, eject, command-Q, even ctrl-alt-del) nothing works.

In desperation, I plug in an external drive to see if I can perhaps escape this nightmare by installing Leopard on that. The drive appears, but I'm not allowed to install on that drive. I'm about to do a hard reset (well forced power-down by pressing the button until it gives up). Then, my hard drive appears as a possible selection.

I select the drive, hit continue, and leopard installs without further hitch (it takes almost two hours).

It looks just the same - it just feels better, and faster. Of course, if you look closely, it isn't the same, but the changes are subtle, it feels entirely familiar, but better.

Now to install XCode Tools... This time, everything starts fine, but then fails at the end telling me that CHUD installation has failed, and I should contact the software manufacturer (that would be Apple).

Starting over: MacPorts

As a long-term Fink user, I've found it hard to summon up the energy to move to Macports (previously known as Darwin Ports), until now. A dead disk provided the necessary impetus to overcome this energy barrier.

MacPorts—so I am told by friends I trust—is closer to the Mac zeitgeist, and has more packages available in fresher versions.

My first experience was not good. I tried the standard install from .dmg with two fresh, fully updated installs of Leopard + x11 + XCode Tools—one on my ageing MBP; one on a sparking new MacBook Air. Neither succeeded in creating the code>.profile that is supposed to adjust the PATH environment variable.

You should start with a standard install as it does almost everything—and may even do it all, for some it succeeds.

In the environment of a shell accessing packages installed by MacPorts, PATH should include /opt/local/bin:/opt/local/sbin and MANPATH should include /opt/local/share/man. The standard install is meant to create a .profile to achieve this. It didn't.

Googling macports leopard profile led to various suggestions (as usual, others have encountered this problem before me). One of these works—others don't.

Do not add the new paths to /etc/paths and /etc/manpaths.

Do not add new files named macports or MacPorts, containing the new paths, to /etc/paths.d/ and /etc/manpaths.d/.

Do create a file ~/.profile containing the following code:

 export PATH=/opt/local/bin:/opt/local/sbin:$PATH export MANPATH=/opt/local/share/man:$MANPATH 

Then you can type sudo port -d update in a fresh terminal window, to update your MacPorts installation, and sudo port install emacs-app, for example, to install a Cocoa version of emacs.

You'll find the Emacs installed as a regular application in /Applications/MacPorts/.

Note: If you already have a .bash_profile or .bash_login, you can and should append the commands above to that file, and optionally rename rename that file as .profile, instead of creating a new .profile.

Explanation: (for the full story try man bash)

When bash is invoked as an interactive login shell, or as a non-inter-active shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

Opaque Leopard Menu Bar

Many find the translucent menu bar in Leopard disconcerting. There are several tips posted elsewhere suggesting various hacks involving obscure environment variables to turn off this feature.

Apple did it for you! (since 10.5.2)

Go to System Preferences > Desktop and Screen Saver. Uncheck the Translucent Menu Bar checkbox. You're done!

OSX Alarm Clock

Stuck away from home with a dead mobile phone battery, I needed an alarm clock—no sign of it in Date and Time.

The solution: use iCal on the MacBook. Set an event at the time you want the alarm. Set up an alarm action to open a suitably noisy audio file (which will open with iTunes if you have the default setup).

Make sure you set the alarm to go off on date (not 15 minutes beforehand as I first did). Make sure the volume is set high, headphones removed. Leave the lid open and, preferably, power connected. The alarm will wake the laptop from sleep, and play your song.

Update 2011-04-15 In Leopard 10.5.6 the alarm does not wake your computer from sleep :-( In System Preferences >> Energy Saver >> Schedule, set your computer to wake a couple of minutes before the alarm goes off.

If you subscribe to any external calendars, set iCal offline — otherwise any alerts complaining that some calendar is unreachable will prevent the alarm from sounding.

Printing in the Forum

Updated for Snow Leopard 2011-04-21.

The print-server address is printif.inf.ed.ac.uk

You can look up the available printers with the DICE command printers
[tammy]mfourman: printers
if213m0 HP 4100DTN - IF213
if237c0 Canon iRC3080i multi-function device in IF237
if313m0 HP8150DN - IF313
if336c0 Canon iRC3080i multi-function device in IF336
if413m0 HP8150DN - IF413
if435c0 Canon iRC3080i multi-function device in IF435
if536c0 Canon iRC3580i multi-function device in IF536

You should install and select the Canon iR C3080/3480/3580 PPD Canon UFR_II_V200_MacOSX_us_EN.dmg File for Mac OS X for the multi-function (scan-print-copy) Canon devices.

You probably already have the HP drivers. If the configuration is not attached to the printer, you can print it using the printer's menu buttons.

polyml

Dave Matthews's polyml is my implementation of choice for Standard ML (my language of choice).

The latest release (version 5.1) compiles on Leopard. The download should be unpacked automatically by Stuffit Expander—otherwise use gtar xvzf polyml.5.1.tar.gz.

 cd polyml.5.1 ./configure make sudo make install 

You should get the message:

 Libraries have been installed in:    /usr/local/lib  If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:    - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable      during execution  See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. 

You can also download later development versions of the source from the cvs repository on sourceforge:

 cvs -d:pserver:anonymous@polyml.cvs.sourceforge.net:/cvsroot/polyml co polyml cd polyml cvs update -Pd chmod +x install-sh ./configure make sudo make install 

Mac OS X 10.5: Web Sharing - "Forbidden 403"

In what follows, substitute your short username for myshortname

Create the file
/etc/apache2/users/myshortname.conf
containing the following text:

 <Directory "/Users/myshortname/Sites/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> 
Set the group and owner as follows:
sudo chown root:wheel /etc/apache2/users/myshortname.conf

Restart apache by switching Web Sharing off then on in System Preferences.

Wireless Keyboard lost?

How to make a bluetooth device a favorite






My MacBook Air has problems finding my wireless keyboard. It is paired, but not seen. I have to go through the whole rigmarole of adding a new device to make it visible. Why?

Sometimes Bluetooth preferences lets me connect; sometimes not.

My Keyboard isn't a favourite! Solving this should be easy—just use Bluetooth panel in System Preferences.

There's an obvious button to press in Tiger; but on Leopard it's hidden.

Solution

Open Bluetooth Preferences ...

Select your device (Keyboard or whatever).

For an immediate fix select Connect from the settings menu.

For something longer-lasting, select Show More Info

The trick: From the settings menu (which has now changed) select Add to Favorites. You're done.

Sometimes it shows connected but still no keystrokes appear: Disconnect and then Connect using the settings menu.

Adjust brightness for 24 inch LED Cinema Display?

I think that the F1/F2 keys on my MacBook Air used to adjust brightness of the primary display. In any event, they certainly don't now (10.5.6) allow me to adjust the brightness of my 24" LED display—they adjust the brightness of the MacBook Air screen, whichever display is selected as Primary.

However, the Display tabs of the Display panels of System Preferences allow you to adjust the brightness of each display independently.

Zip it up

To zip a directory:
Select the folder in the Finder.
From the File menu, select Create Archive of "<foldername>"
that's all!
Leopard update:
In Leopard the menu entry reads Compress "<foldername>"

You have created a zip archive <foldername>.zip

To unzip, double-click the file <foldername>.zip

X11 on Leopard

X11.app won't launch for me - a quick google tells me that others have the same problem.

The idea under Leopard is that X11 will launch automatically as required, so just typing xterm in a Terminal window will launch a xterm window.

But for me this didn't work, since I had set DISPLAY = 0:0

To check, type echo $DISPLAY if the response is 0:0 (as you might expect) you need to remove the entry for DISPLAY from environment.plist (double-click on the file and the property list editor should open). On the other hand something bizarre:

 mfourman$ echo $DISPLAY /tmp/launch-SKAysC/:0 
seems to be fine!

Note that some applications may set the DISPLAY variable on startup. I had to retire sshLogin (a Mac port of sshAskPass) because it insists on doing this. So I'm back to using ssh-add from the terminal to set up my ssh identity before launching xterm.

Connecting via ssh from the xterm then sets up an X11 connection so that remote X applications can use your Mac screen. Use ssh -X to forward X11 connections, or set this up, for hosts you trust, in your ssh configuration.

Your ssh configuration depends on various files in ˜/.ssh:

authorized_keys config identity  identity.pub  known_hosts

You can set your ˜/.ssh/config on a per-host basis: for example

 # Any configuration value is only changed the first time it is set. # Thus, host-specific definitions should be at the beginning of the # configuration file, and defaults at the end. Host trusted.local      ForwardX11 yes       ForwardX11Trusted yes Host ssh.foo.uni.ac.uk      Compression yes      Cipher blowfish      ForwardX11 yes  Host ssh.foreign.com      User alias  Host *      ForwardX11 no      ForwardX11Trusted no 
Note X11 forwarding should be enabled with caution.

User Specifies the user to log in as, useful when you have a different user name on different machines.

The default configuration file (see /private/etc/ssh_config) includes a list of common settings. The configuration files contain sections separated by ``Host'' specifications, and that section is only applied for hosts that match one of the patterns given in the specification. (Lines starting with `#' are comments. Copy this template, remove `#' and edit values as desired. For details see man ssh_config)

 # Host * #   ForwardAgent no #   ForwardX11 no #   RhostsRSAAuthentication no #   RSAAuthentication yes #   PasswordAuthentication yes #   HostbasedAuthentication no #   GSSAPIAuthentication no #   GSSAPIDelegateCredentials no #   GSSAPIKeyExchange no #   GSSAPITrustDNS no #   BatchMode no #   CheckHostIP yes #   AddressFamily any #   ConnectTimeout 0 #   StrictHostKeyChecking ask #   IdentityFile ~/.ssh/identity #   IdentityFile ~/.ssh/id_rsa #   IdentityFile ~/.ssh/id_dsa #   Port 22 #   Protocol 2,1 #   Cipher 3des #   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc #   EscapeChar ~ #   Tunnel no #   TunnelDevice any:any #   PermitLocalCommand no 

Setting environment variables

There is a special environment file which loginwindow reads each time a user logs in. The environment file is: ~/.MacOSX/environment.plist

Dot files aren't, by default, visible in the finder, so type cd; open .MacOSX in a terminal. If the environment.plist file is there you can open it in the Property List editor with a doubleClick. Otherwise, you will have to create the .MacOSX directory yourself.

To create the directory and file
$ cd
$ mkdir .MacOSX
$ echo "" > .MacOSX/environment.plist
$ open .MacOSX/environment.plist

This should open your new, empty environment.plist file in the Property List Editor. Select Root and Add a Child: the Key should be the name of the variable you want to set; Type should be String; Value should be the value you want to set for this variable. Next time you log in the variables should be set.

Environment variables set in environment.plist also appear in the standard bash environment. You can see all your environment variables using the shell command env from a Terminal window.

REFERENCE: http://developer.apple.com/qa/qa2001/qa1067.html

WARNING: do not set the DISPLAY variable—see my post re. X11 on Leopard.