Bookmark this site!


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.


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


No xauth data

The common
Warning: No xauth data; using fake authentication data for X11 forwarding.
appears to be harmless. However, it is annoying. It arises when you have no xauth data!

The command
xauth list
displays all your xauth data. If there is no entry for your local display — which looks something like
localhost/unix:0 MIT-MAGIC-COOKIE-1 026666083d4e480d3e77544949281b49
you can generate one using the command
xauth generate :0 .

This creates an authorization using the MIT-MAGIC-COOKIE-1 protocol. Clients that connect with this authorization will be untrusted.
The period "." is part of the command; "untrusted" is probably what you want.
However, for some operations you need to connect as a trusted client. In case of problems, try using the command
xauth generate :0 . trusted
see man xauth or the X11 Security Extension Specification.


Printing to DICE printers

You have to be connected inside the DICE firewall (eg. by physical connection, informatics wireless, or ssh) to use the printers ...

On a DICE machine, use the Unix command printers -s to list the available printers, + information on models, printservers, and location. (See man printers for other options.)

Use the Printer Setup Utility (in /Applications/Utilities/ on the Mac) to add a new printer:

IP Printing
Printer type: LPD/LPR
Printer Address:
Queue Name: lwa
Printer Model HP LaserJet 4050 Series

Printer Type
Printer Address
is the address of the server
Queue Name
is the name of the printer
Printer Model
can be left as Generic. However, if you get it right you can access printer-specific options from the OSX print dialogs.