Office Tips

Related Pages

Helping Students

Students should not be in the DC tutor offices. These offices contain sensitive materials such as exams. These students should be helped in the CS Tutorial Center MC4065. It is also a good idea to help students in a Mac Lab, because in that case, you can teach several students at one time which might saves some time.

Tips on Helping Students

When helping students, make sure you are clear and concise. Do not give them answers; instead guide them on the right direction by giving subtle hints and re-teaching certain concepts that may be confusing.

Accessing the Course Account

See MountingCourseAccountOnCampus to learn how to connect from your office computers.

Forcing Drive Unmount

Occasionally drives will get a bit glitchy and fail to unmount. In Mac OS X, all mounted drives appear in the directory /Volumes/. The directory name of the mounted drive is what you will need to know to force an unmount.

pbeshai: /Volumes $ ls
ls: cs135: Permission denied
COURSE_SHARE/ HOMES_MATH/   Macintosh HD  cs135-1/      cs135-2/      cs246/        cs246-1/      cs246-2/

For full details on the drives that are mounted, you can simply run the mount command in the terminal without passing any arguments.

pbeshai: /Volumes $ mount
/dev/disk0s2 on / (local, journaled)
devfs on /dev (local)
fdesc on /dev (union)
<volfs> on /.vol
//CS-TEACHING;MJGRAING@SMB-SHARES.STUDENT.CS.UWATERLOO.CA/CS135 on /Volumes/cs135 (nodev, nosuid, mounted by mjgraing)
//CS-TEACHING;PBESHAI@SMB-FILES.STUDENT.CS/PBESHAI on /Network/Servers/smb-files.student.cs/pbeshai (nodev, nosuid, automounted, mounted by pbeshai)
//CS-TEACHING;PBESHAI@SMB-SHARES.STUDENT.CS.UWATERLOO.CA/CS246 on /Volumes/cs246-2 (nodev, nosuid, mounted by pbeshai)

Once you have determined the name of the mounted drive you want to remove, simply type: umount -f [drive name]. In the example above, you would type umount -f cs246-2.

Finally, if Finder doesn't realize that you have unmounted the drive, you can restart finder and it will fix itself by typing killall Finder.

Locking Your Screen

The easiest way to lock your screen on a Mac when you're out of the office, is to simply click the padlock in the upper right corner of the screen and select "Lock Screen". This, however, stops anybody else from using the computer while you're away. The desired behaviour is to simply stop anybody from using your account while you're away, without having to log out completely.

The solution is to run a simple command in the terminal (or if you're really savvy, bind running this command to a shortcut key with the help of Quicksilver):

/System/Library/CoreServices/"Menu Extras"/ -suspend

If you're not up for binding a key, or memorizing a gigantic path like the one above, you can create an alias to the above command and just run that from the terminal.

OR you can use the FriendlyScreenLocker, an application that you can run from Finder just by double clicking.

Creating a runnable Application in Apple Script

To create the Friendly Screen Locker application, we created an Apple Script document (in Script Editor) with the following source:

do shell script "/System/Library/CoreServices/'Menu Extras'/
     Contents/Resources/CGSession -suspend"

Then we selected File -> Save As, enabled the option "Run Only" and set the file format to "application".

Oracle Calendar

It is possible to install a Mac client on your local machine (note: only install it on the local machine if you will always be using the same computer). This provides a front-end to Bookit that is far more user-friendly than the web version.

IST provides a download page which links to the Mac client. Download it and open the installer. You can then copy the Oracle Calendar application to the folder /Users/Shared/ and then drag the App from that location to your dock. It will then be accessible from the machine you installed it on.

Note that this program is fairly buggy. It is prone to crash, and when it does, it will crash every time you try to launch it before you have a chance to do any interaction. Currently, the only known "fix" for this is to log out of your account and log back in.


Firefox 3.0 on the Mac computer are quite buggy, and will often disable back button (and other functions in Firefox).

If that happens, you can use the following shell Script to clear the bug:

rm -f $HOME/Library/Application\ Support/Firefox/Profiles/*.default/places.sqlite-journal

You can simply download, which includes the shell script 'fixfirefox' and a runnable application called Firefox Fixer. Make sure that fixfirefox is in your $HOME/bin directory in order for Firefox Fixer to work.

Another available solution is done through the following applescript:

do shell script "$HOME/bin/fixfirefox"
tell application "Firefox" to activate

Place the application that runs this on your dock instead of Firefox (unfortunately, Firefox will still appear in the dock once loaded). An already bundled application is available for download:

An ideal solution would make use of Login Hooks. It should be possible to do by running /Developer/Applications/Utilities/Property List Editor and then editing ~/Library/Preferences/, but this has not yet been tested. No warranty is attached to this, so only edit this file extremely carefully.

Can't find rst, announce....?

When you somehow cannot start rst the course account, this may be a signal that the login script (LoginMan) is not being used. Check with other course staff to see if using this is desired.

If the login script is being used, the cause might be an issue with the PATH in your account setup. One quick non-ideal way to try to prevent overwriting the PATH is to write this on the command line when in your personal subdirectory of the course account:

rm .cshrc

Alternatively, you can edit the .cshrc file to maintain the already existing portion of the path. This may be of the form setenv PATH `/bin/showpath {... some additional director(y|ies)...} current`.

Note that if your SHELL is not derived from csh, the name of the configuration file and the syntax of the commands will vary.

Is the Mac mysteriously hiding your Word files?

If you are clicking on your .doc files and they are disappearing, try this:

  • In a terminal window, cd to the appropriate directory (likely under /Volumes/) and copy the offending file ( cp oldfilename.doc newfilename.doc); you should then be able to delete the old file.
  • Now you should be able to open up the new file, until this happens again.
  • NOTE: If anyone finds a better way of doing this, or avoiding this problem, please post it on the Wiki.

I have created something in Unix, but it is not showing up in the Mac Finder windows

Right-click (or control-click) in the Finder window, and select "New Folder". This will reset the Finder, and whatever you created should now be visible. You can now just delete the new folder.

Alternatively, if you have set up Finder so it shows all hidden files, you can delete the automatically-generated .DS_Store file from within Finder to force a refresh of that folder.

Pine Improvements

For those of us that have to check our mail in the terminal, and choose to use pine, you may find it much more enjoyable to use the attached .pinerc file. Just place the .pinerc file in your home directory under the course account (e.g. ~cs246/u/pbeshai/.pinerc) and you will benefit from a colourful interface and the ability to use aggregate commands.

  • pinerc: Put this .pinerc in your ~csNNN/u/username/

Pine colours

This is enabled by the following line in the .pinerc:

The following lines containing the text 'color' define what colours you would like to see in pine; see the pinerc file attached to this page for details and a colour scheme much more pleasant than the default.

Note that while this is quite nice on lab Macs or Linux front ends, the default xterm on the Solaris front ends does not display colour, so the usability of pine will be compromised.

Aggregate Commands

To use aggregate commands in pine, go to a folder, and press the ; key. This will give you the following prompt: SELECT criteria :. Read the options listed at the bottom to choose what you would like to select. Items that are selected have an X beside them in the message list.

Once you have items selected, you can apply a command to all of the selected objects by pressing the A key. This will give you the APPLY command : prompt. Now enter the command you would like to use (e.g. D for delete, S for save).

This is enabled by adding enable-aggregate-command-set to the feature-list option.

Moving Messages to Folders

To move messages to folders, select the messages you want using the : character (colon), press a to apply all, press s to save all, ctrl-t to select a folder, and navigate to your folder and press enter to select it, and press enter again to complete the operation

Using vim as an editor

This is not done in the pinerc attached here; it is recommended only for users comfortable with vim.

In your .pinerc file, add the following two features to the feature-list option: enable-alternate-editor-cmd,
. Then, find the editor option, and change it to:

The reason to use this alternative version of vim is that it also provides a colour environment. Also, if run from a course account, it will attempt to use the .vimrc in /u/csXXX/u/yourUserID instead of /u/csXXX, allowing for personal customization of the editor.

Using ls in colour

Settings for Unix/Linux (GNU =ls)

LS can output in colour, and these colours can be configured. To do this, you'll need to set the LS_COLORS environment variable; this is most easily set indirectly. Add the following line to your .profile / .bashrc file:

eval $(dircolors -b $HOME/.dircolorsrc)

or the following line to your .cshrc:

eval `dircolors -c $HOME/.dircolorsrc`

Then, create the .dircolorsrc in your home directory with the following command:

dircolors -p > $HOME/.dircolorsrc

You can then edit this file to create the colour settings you want, or to make other customizations like adding an entry for TERM xterm-color. A sample .dircolorsrc is attached, with a few adjustments from the default to make things more readable in Mac OS Leopard's homebrew-style terminal window (notably, the default bold blue for directories is barely readable in this terminal style).

Then, you'll need to make sure that --color=auto is always passed to the ls command. This can be done with an alias; in .cshrc with something like:

alias ls 'ls -F --color=auto'

or in .bashrc / .profile:

alias ls='ls -F --color=auto'

Note that in the above aliases extra parameters are passed; you can configure this any way you like, and possibly create multiple aliases to perform various common directory listing tasks.

Settings for Mac (BSD ls)

The colours for this command are stored in the slightly-differently-named LSCOLORS environment variable. At the time of writing, there is no known command-line generator available, but there is an online tool. The end result for your .bashrc / .profile should be:

   export CLICOLOR=1
   export LSCOLORS=GxFxDxDxhxDgDxabagacad

or, for .cshrc:

   setenv CLICOLOR 1
   setenv LSCOLORS !GxFxDxDxhxDgDxabagacad

Then, the alias for viewing colours in .cshrc should be

alias ls 'ls -F -G'

or in .bashrc / .profile:

alias ls='ls -F -G'

Combining the systems

The following is an excerpt of .bashrc / .profile so the colour directory listing will work on both Mac and Linux/Solaris systems, and will fall back to default colours without an error if there is no .dircolorsrc file present on any course account that is connected to:

if [[ "$(uname -s)" = 'Darwin' ]]; then
   export CLICOLOR=1
   export LSCOLORS=GxFxDxDxhxDgDxabagacad
   alias ls='ls -F -G'
   if [[ -r "$HOME/.dircolorsrc" ]]; then 
      eval $(dircolors -b "$HOME/.dircolorsrc")
   elif [[ -r "$HOME/u/$REMOTEUSER/.dircolorsrc" ]]; then
      eval $(dircolors -b "$HOME/u/$REMOTEUSER/.dircolorsrc")
   alias ls='ls -F --color'

Multiple desktops in Mac

In System Preference, turn on the Spaces feature. When press F8, you can see multiple desktops.

Use a Better Terminal

xterm in Mac looks bad. Login into ubuntu.student.cs or fe-linux.student.cs with ssh -Y:

ssh -Y ubuntu.student.cs

and launch gnome-terminal to enjoy a much nicer terminal.

Alternatively, just use the Terminal application instead of X11. Find this in /Applications/Utilities/ Starting with the Leopard machines in particular, this aapplication becomes much more usable and is a reasonable alternative to X11.

Diskquota Preservation for Greedy Programs

Some programs eat up a lot of diskquota by dumping a lot of data into Library/ on your personal account. Frequently, you don't care about any configuration past the default (note that if you do, the following information does not apply).

For example, if you do a local install of Google Chrome, it has the potential to store a lot of information. By jumping down to the Unix layer, you can trick Google into using /tmp as a store, where information will not count to your quota and will be cleared out regularly. It just requires the following steps:

cd Library/Application\ Support/
ln -s /tmp Google

Note that creating a Google folder with no read/write/execute permissions simply crashes Chrome; a destination it can see is required for it to operate.

Similar steps can be taken for other applications if you find they're using an unacceptable amount of disk space. Just deleting the folder is insufficient, as the application will keep regenerating it, and you will need to sweep+delete regularly.

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatdircolorsrc .dircolorsrc r1 manage 1.9 K 2010-01-18 - 11:32 TerryVaskor Sample file to set ls colours
Compressed Zip archivezip r1 manage 2.9 K 2009-05-04 - 10:49 PeterBeshai  
Compressed Zip archivezip r1 manage 55.6 K 2009-05-04 - 11:37 PeterBeshai  
Compressed Zip archivezip r3 r2 r1 manage 47.0 K 2009-04-07 - 14:56 PeterBeshai Application that can be run from Finder to lock the screen (+ source, icon)
Unknown file formatext pinerc r1 manage 17.0 K 2009-08-20 - 11:05 PeterBeshai Put this .pinerc in your ~csNNN/u/username/
Edit | Attach | Watch | Print version | History: r31 < r30 < r29 < r28 < r27 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r31 - 2018-09-05 - YiLee
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback