Using the Machines in the Sun Lab


or any other computer running Unix, for that matter. Turning these computers off without executing the proper shutdown procedure can cause damage to everyone's files, including your own. Additionally, other people may be using the computer remotely at the same time you are using it, and turning the machine off is sure to anger those people. If you are ever tempted to turn one of these computers off, read the section titled When You Encounter Problems below. If that doesn't help, contact John R. Baskwill at ITS. If no help is available, simply leave the computer alone and use a different one if necessary. Report the problem to one of the people listed above as soon as possible.

IMPORTANT: When you finish using one of the Suns, be sure to log out (see the section titled Logging Out below). Otherwise, anyone can sit down at the computer you just left and access and modify your files, send harrassing email as you, and so on.

Availability of Sun Lab Machines

Unless reserved for a class or seminar, the Sun Lab is available as long as the Olmsted Building is open to individuals having a valid access to Sun Labs (available via your PSU Id card which must be activated by the staff assistant) and an account on Sub Lab machines.

The machines are on 24 hours a day and available for console and remote access, with the exception of the duration for the maintenance of the machines. The maintenance of the machines is normally performed late Sunday morning to early Sunday afternoon. You should plan your work accordingly. The machines may not be available for other reasons, such as power outages, hardware or software failures, etc. If the reason the machine(s) will be unavailable is known ahead of time (with the exception of the regular maintenance), an email will be sent to the mailing list.

Policy on Acceptable Uses

Before you start using Sun Lab machines, make sure you read and understand the policy on acceptable uses of these machines.

Table of Contents

Logging In/Out
Getting Started
Learning the shell
Text Editors
Access via SSH and SFTP
Locking a Computer
Getting Help
When You Encounter Problems

Logging In/Out

To log in to Sun Lab machines, you will need a valid Sun Lab account. This account is different from your PSU Access account. You may request a Sun Lab account by filling out a form from Computer Science program at W255 Olmsted. Once you have a valid account, you can log in to any of the machines in Sun Labs with your account credentials. Note that the password will be the same password that you use to access other PSU systems.

To log out, you can click the button on the far-right of the top menu bar and select "Log Out...". Make sure that you save your work and close all open windows before you log out.

If you are logged in remotely via ssh, simpy type

or hit ^D (otherwise known as control-D).

Return to Table of Contents

Getting Started

When you log in, you will be greeted by the desktop environment called Unity. At startup, Unity will present you with a Top Menubar (the horizontal bar on top of your screen) and a Launcher (the vertical bar on the left of your screen). Since Unity is your interface to the machine, how comfortable you are with Unity determines how effective you are in using the machines.

If you are new to Unity, you are strongly recommended to watch Ubuntu Unity Overview by Alan Pope at Canonical. If you prefer to read, read this introduction. More in-depth introduction to Unity include:

Return to Table of Contents

Learning the Shell

To open a shell from the desktop environment:

  1. Click on Ubuntu Button on Launcher to open a search bar called Dash
  2. Type "terminal" on Dash and press enter key.
The shell is a program that reads your commands from the keyborad and passes them to operating system to execute. The more you use unix system (i.e., Sun Lab machines), the more you will find yourself using the shell. To learn to use the shell and unix commands, read Learning the Shell. You might also find the following helpful:

Return to Table of Contents

Text Editors

Five text editors are available to you:

  1. vim
  2. emacs
  3. nano
  4. pico
  5. gedit
The editors vim, emacs, nano, and pico can be used whether you are sitting at a Sun Lab machine or are using ssh. The gedit editor can only be used if you are sitting at a Sun Lab machine. If you have never used any of these editors before, nano and pico are the easiest to learn (but also the least powerful). For more information on any of these editors, check the appropriate man page or info documentation as described in section Getting Help. The info documentation contains much more information than the man page for emacs.

emacs and vim have the built-in tutorials you can follow. To access emacs tutorial, open an emacs window by executing the command:

and type Ctrl-h t (that is control key and h at the same time, followed by t) inside the emacs window. For vim tutorial, execute the following command:

Return to Table of Contents


All of the following discussion applies whether you are accessing these computers via ssh or are actually sitting at one of the Sun Lab machines.

Most importantly, NEVER print an executable file -- that is, an a.out file or any other file produced by compiling a program. This files are extremely large and contain no intelligible information when printed.

To print a postscript file or text to one of the B/W laser printers in the lab, enter the command:

lp filename

where filename is the name of the file you want to print. A postscript file will usually have a .ps extension. Many applications (notably web browsers and Adobe Acrobat) produce/print postscript files. You should not have to change anything in the default configuration of these applications to print correctly.

You can also convert a text file to a postscript file and then print it using the enscript command. This allows you to format a text file nicely. For example, the following:

enscript -fCourier8 -2rG filename

will print the text file filename in an 8 point Courier font (-fCourier8), two columns (-2), landscape (-r), gaudy mode (filename, date, etc... at top of page) (-G) to the printer as a Postscript file.

If you change your mind about printing a particular file, use the command:

lpstat -a

to get a listing of all pending print jobs, and then the command:

cancel pid

where pid is your print job id number.

If the job has already started to print, you need to cancel your job at the printer by pressing the orange cancel button.

You can also use sftp from a PC to download your file to that PC for printing.

Return to Table of Contents

Access via SSH and SFTP

All of the Sun Lab machines can be accessed via ssh and sftp. To access the machines from outside of the Penn State campus, you will need to install and run the Virtual Private Network (VPN), which is availabe for download at the PSU ITS webpage.

In addition, you will need a secure shell (shh) client. Macs and Linux systems come with ssh installed. Examples of ssh clients for Windows include PuTTY and MobaXterm. These clients are useful for working from a remote location, or for those times when all seats at the Sun Lab are in use. The PCs in the campus labs have ssh installed. Select the Start menu, then Programs, and then (probably) security (ITS changes the folders periodically). Any of the following Sun Lab machine names can be used.

alpha lab:

beta lab:
As some of these computers will be out of service at times, try several before concluding that none are accessible.

Return to Table of Contents

Locking a Computer

If you are sitting at a computer and need to leave for less than five minutes, it is acceptable to secure your account by locking the computer. This is done in one of the following ways:

  1. CTRL + ALT + L
  2. Click on the far-right button on Top Menubar and Select Lock
After you execute one of the above commands, a screen saver will appear on the monitor. When you return, remove the lock by pressing Return and then entering your password.

If locking a computer becomes problematic (i.e. if computers are consistently locked for long periods of time), the locking feature will be removed. System administrators reserve the right to remove a lock and log the user out whenever necessary.

Return to Table of Contents

Getting Help

Using man and info

The following discussion of man and info applies whether you are accessing these computers via ssh or are actually sitting at one of the Sun Lab machines.

If you know the name of the command you need more information on, enter:

man command-name

Some commands will also have additional information available in the form of info documentation. This can be accessed by entering:

info command-name

If no info documentation is available, then info will display the relevant man pages, so always using info is a good strategy. To see the tutorial on using info, enter:

and then hit h to bring up help on info.

If you want to see a list of commands relating to a particular topic, enter:

man -k topic

When all other sources of help fail, ask John R. Baskwill at ITS.
NOTE: Do not bother him with questions related to your classes and/or assignment. He would not answer such questions.

Return to Table of Contents

When You Encounter Problems

Remember that turning the power off and on never helps when a program locks your screen or some other mishap occurs. All that turning the computer off will accomplish is annoying anyone else who was using it and (likely) damaging the file system. Please read the following before asking for help.

If a power surge occurs while you are sitting at one of the machines and it loses power, it will often be able to restart itself when power returns. This process can take as long as five minutes or more, so be patient. Eventually, the login window should reappear so that you can log back in and continue working. If the computer can not restart itself, contact John R. Baskwill at ITS for assistance. You will be logged out when a power surge occurs, and so your account is secure even if help is not available.

If you are logged in via ssh and a power surge occurs, your connection will be broken. You won't be able to ssh back in until the computer has restarted, which can take five minutes or more as noted above.

The following discussion applies whether you are accessing these computers via ssh or are actually sitting at one of the Sun Lab machines, except that you may not have to use a separate ssh session if you are sitting at one of the Sun Lab machines.

If a program you are using crashes, you may get an error message like:

segmentation fault, core dumped
In that case, just remove the core file from the directory you ran the program in (unless you need it for debugging):
rm core
and then continue with whatever you are doing.

If a program you are using locks up a window or your entire screen, do the following:

  1. If you have a usable window on your screen, simply use that window. Otherwise, log into another Sun Lab machine or go to a PC with Internet access. Then ssh to the machine whose screen is locked. For example, if you are using a web browser on the computer grace and the web browser causes the entire screen to lock up, go to another computer and use ssh to log back into grace.
  2. Execute the command:

    ps -ef | grep your-user-name

    This will display a list of all of the programs (processes) you have running. The rightmost column displays the names of the programs. Pick the row containing the name of the offending program in the rightmost column, and note the number in the second column (from the left) of that row. This number is referred to as the process id (or simply pid).
  3. Execute the command:

    kill pid

    wre pid is the numeric process id from the previous step. This should stop the execution of the offending program.
  4. Check if the program was indeed stopped. If not, return to your second window or log in point and execute the command:

    kill -9 pid

    If this doesn't work, ask John R. Baskwill at ITS for help.
  5. If you logged in from another machine or PC, don't forget to log out from that machine before returning to work.
The combination of ps and kill is useful whenever you can't find another way to stop a program's execution.

Return to Table of Contents

Math/Computer Sciences Home Page