$Id: FAQ.txt,v 1.23 2007/06/06 16:51:01 jhabel Exp $

0. Table Of Contents
====================

0. Table Of Contents

1. Introduction

2. General
2.1 Opening Hours

3. Getting an account
3.1 Choosing a password
3.2 "Can I get an account without having to be there in person?"
3.2.1 How do I generate an ssh-key?
3.2.2 How do I use the that ssh-key?

4. Using your account
4.1 Terms Of Service
4.2 "I forgot my password / how can I change my password?"
4.3 "How can I change my shell?"

5. WWW
5.1 "Netscape sucks!"
5.2 "How do I maintain my website?"
5.3 "How do I include cgi's in my website?"
5.4 "Can I have a Wiki?"
5.4.1 "What Kwiki Plugins are available?"
5.4.2 "How can I use these plugins?"
5.4.3 "How can I allow only specific users to edit pages in my Wiki?"
5.5 How do I use PHP?"
5.6 "How can I access the fabulous pipeline?"
5.6.1 "How can I access the fabulous pipeline via pine?"
5.7 "How can I protect portions of my website?"
5.8 "Where are the logs?"
5.9 "How can I make plugins work with Mozilla Firefox?"
5.10 "I found an error on the website.  Who should I contact?"
5.11 Existing firefox processes?

6. Mail
6.1 "How do I read my email?"
6.2 "How do I forward my email?"
6.3 "How do I set up an auto-response during the vacations?"
6.4 "How can I filter email?"
6.5 "Are there any mailing-lists?"
6.6 "I sent you an email - why didn't I get an answer?"
6.7 "How can I check my mail with my mail client on my PC?"
6.8 "Are there any default mime.types and mailcap files?"
6.9 "Thunderbird can't copy mail between folders in imap"

7 Printing / Scanning
7.1 "How do I print?"
7.2 Pretty Printing
7.3 "How do I print man pages?"
7.4 Printing Problems
7.5 "How can I print simplex?"
7.6 "My printouts don't show up!" aka "I can't print!"
7.7 "Why won't my PDF print from a browser?"
7.8 Printing from OpenOffice

8. Database Usage
8.1 General
8.2 How do I access my database?
8.2.1 ...over the web using Perl?
8.2.2 ...over the web using PHP?
8.2.3 ...using the jdbc driver in Java?
8.2.4 ...using the jdbc driver in Java over the web?

9. Java
9.1 What does ``Could not reserve enough space for object heap'' mean?

10. Window Managers
10.1 "I want to have a fancier desktop!"
10.2 "What window managers are there?"
10.3 "When I try to log in, the login screen comes right back!"

11. SSH
11.1 "How can I connect to my account from home?"
11.2 "I frequently get a warning from ssh.  What's going on?"

12. Miscellaneous Questions
12.1 "How can I read MS [Word|Excel|Powerpoint]?"
12.2 "How can I read files from a floppy/cd/usb-stick?"
12.3 "How can I write files to a floppy or a CD?"
12.4 "I found a bug in some software / how can I request software to be installed?"
12.5 "Where can I learn about these wizardly UNIX commands?"
12.6 "My machine's locked up.  I'm just gonna reboot it..."
12.7 "Where's my TA?"
12.8 "Out of quota?"
12.9 "How can I compile my OpenGL homework?"
12.10 "Stuff in my ~/.bashrc is not executed!"
12.11 "What software is installed on the workstations?"
12.12 "How do I know when software has been updated?"
12.13 "Why does my program suddenly no longer compile?  I swear, it worked last semester!"
12.14 "How can I get access to a CVS repository?"
12.15 "How can I access my storage01 share?"
12.16 "I deleted / lost a very important file!  Are there backups?"
12.16.1 Requesting a Restore
12.16.1.1 A BAD Example
12.16.1.2 A Good Example
12.17 "How can I copy files from my personal machine to my home directory?"
12.18 "How can I set some default options for my X programs?"
12.19 "The machine is stuck displaying 'starting ypbind' - now what?"
12.20 "How can I grab a screen shot?"

==================

1. Introduction
===============

This document answers the most frequent questions and gives solutions
to the most frequent problems encountered in the CS-Lab (Burchard
127).  This document should be the first thing you look up if you
encounter any problems whatsoever.  This document is located at
http://www.cs.stevens.edu/support/FAQ.txt

If you find any information provided in this document to be wrong or
misleading, or if you have any suggestions and comments, please email
Oliver Gould at ogould@cs.stevens.edu with "[faq]" in the Subject line.

==================

2. General
==========

The Computer Science Laboratory (aka UNIX-Lab) is located in Room 127
of the Burchard Building and offers students access to a large number
of NetBSD workstations.  These workstations all have identical
configurations and allow the students to do their homework, read their
mail, browse the web etc.

NetBSD is a free, secure, and highly portable UNIX-like operating
system.  To learn more about NetBSD, see http://www.netbsd.org.  For
extensive documentation on NetBSD, see http://www.netbsd.org/guide/en/.

As a UNIX lab, we do not support Microsoft Windows in any way -- if
you want to use MS Windows, go to the Computer Center in the basement
of the Library.

More information on the CS Lab is available at
http://www.cs.stevens.edu/Lab/ComputerScience_Lab/index.html

Please note that Professors and Instructors often refer to the CS-Lab
as the 'guinness'-lab, after our main server.  While it's true that
you have an account on 'guinness', the machines you usually access are
different machines, commonly known under the joint hostname
'lab.cs.stevens.edu'.

2.1 Opening Hours
=================

During the Summer of 2007, the CS Lab is open

Monday through Friday:		10 am - 9 pm

You can call the lab at (201) 216-5048.

If the lab has to close unexpectedly, a message is sent to the cs-lab
mailinglist.  You can join that mailing list at by sending a message to
cs-lab-join@cs.stevens-tech.edu.

==================

3. Getting an account
=====================

In order to use the machines in the CS-Lab, you will need a CS account
on the CS Dept. main server.  This is a different account than your
attila-account or pipeline account.

In order to get an account, you need to come to the CS-Lab in person,
bringing a picture-ID.  Make an appointment by emailing
admins@cs.stevens.edu.

3.1 Choosing a password
=======================

When you get an account, you will be asked to enter a password.
Please choose a password prior to walking into the CS-Lab, as there
are several rules that you need to observe:

a) The password you choose must be different from the one you use for
   your pipeline-account.

b) The password you choose must be from 6 to 8 characters long

c) The password you choose must NOT be based on a dictionary word:
   not even a reversed word.  Not a word in English, German, French,
   Kisuaheli or whatnot.  Our program is very picky about this.

d) The password you choose should contain upper- and lowercase
   characters, as well as numbers and special characters

Choosing such a password takes a few moments, so please consider these
rules prior to coming to get your account.  A good way to choose a
password might be to choose a word or a sentence you can remember
easily, replacing some of the characters with numbers of special
characters, spelling it backwards and shifting the characters.

For example:

Choose 'mypasswd'.
Use special characters: 'm!?A22wD'
Spell it backwards: 'Dw22A?!m'
Shift each character to the left on the keyboard: 'Sq11">~n'

Now, DO NOT use 'mypasswd', 'm!?A22wD', 'Dw22A?!m' or 'Sq11">~n' as
your password!

Alternatively, you can use the command

hexdump -e \"%08x\\n\" -n 4 /dev/urandom

to generate a password, though that will of course only generate hexadecimal
characters.

Another alternative is to use the pwgen(1) command:

pwgen 8

or

pwgen -s 8


3.2 "Can I get an account without having to be there in person?"
=================================================================

If you are taking a class that is only offered online and you are
located too far away from Hoboken to be able to come in to Stevens in
person, you are still able to get an account.  In order for us to be
able to set up your account, you will need to send the following
information in an email to admins@cs.stevens.edu:

a) Your full name under which you registered as a student
b) The name and course number of the class you are taking
c) The name of your instructor
d) A telephone number where you can be reached
e) A *public* ssh-key (SSH2 RSA, at least 1024 bits)

Once all this information has been received, we will verify the
necessary information and inform you when you can access your account.

NOTE: This procedure is *only* for people who are taking an online
class _and_ who can not come to Stevens in person!


3.2.1 How do I generate an ssh-key?
===================================

Take a look at the man-page for ssh-keygen.

If you use Windows as your operating system, wipe the disk and install
a unix-like operating system - it'll make you much happier.  If that
is not an option, download and install (or have your local system
administrator install) a ssh-client/key generator for Windows such as
PuTTYgen and use that program to generate the key.

You can find instructions on how to generate a ssh-key using PuTTYgen
at http://the.earth.li/~sgtatham/putty/0.52/htmldoc/Chapter8.html#8.2,
for example.  If you use a different program, ask google.com and/or
your administrator.

Once the key has been generated, send the _public_ key to
admins@cs.stevens.edu.  Please remember to save the private key -- you will
need it to authenticate and log in lateron!

==================

3.2.2 How do I use the that ssh-key?
====================================

If you used PuTTYgen to generate the ssh-key, there's a strong
possibility you have PuTTY too. To use the key, open PuTTY. On the left
of the window there is a section labeled "Category." Under "Connection"
choose "SSH" then choose "Auth." On the right side of the window there
should be a section called "Authentication parameters" under which there
is a field labeled "Private key file for authentication." Either type in
the path and file name of the private key file previously generated or
click "Browse" and find the file that way.

If you are using the Windows SSH client from SSH.com, open it, click on
"Edit" and then "Settings." On the left, choose Under "Global Settings"
choose "User Authentication" and then choose "Keys" under that. On the
right, click on "Import." Find the file with the ssh-key and click "OK." 

If you are experiencing problems with either application, please refer
to their respective help files. If you are using another ssh client,
please refer to the manual for that application for details on using
ssh-keys.  

==================

4. Using your account
=====================

You now have an account on the CS Dept. machines.  You can now log into these
machines with your username and password.  This is not a UNIX-tutorial, so we
will not explain how to use your account.  Use your favorite search-engine
and/or ask you teacher/TA to figure out what exactly you need to do.  Use your
account responsibly.

Never ever let anybody else use your account; do not give anybody else
access to your password.  Any violation of this rule will immediately and
without any discussion result in your account being terminated.

One of the many things to keep in mind is that this is UNIX, and you
are a mere mortal, a normal user.  You do NOT reboot the machines.
No, you don't.  This is not Windows.  If the machine seems to be hung,
ask the lab-assistant for help.

There is absolutely no eating or drinking in the CS-Lab.  No
exceptions.

Always remember to log out of your account when you leave the lab.
Otherwise other people could use your account for all kinds of nasty
things and you'd be responsible.  If you just want to go to the
bathroom, you can lock your station with the "xlock" command.
However, never lock your station for longer than 5 Minutes.

If all workstations are occupied, people who have to do homework have
precedence over people who are just reading their email or browsing
the web and may ask you to give up your station.  This is school,
you're not _supposed_ to have fun or free time.

No shouting and running with scissors in the lab, either.

It is the CS Department's policy that all homework given for any
CS-Class must be able to be done on the machines in the CS-Lab.  If
your professor asks you to submit homework in a format that is not
available on these machines, please have that Professor contact either
Oliver Gould <ogould@cs.stevens.edu> or Brian Moriarty
<moriarty@cs.stevens.edu>.  We currently have all the software
installed that is required to do any homework for any of the CS
classes; however, do not bother to ask the lab-assistants or the
System Administrators to explain to you how to use the various tools
(such as "make", "gcc", "gdb" etc).  This is the job of your professor
or TA.

In addition, all information necessary to run any of the commands can
be retrieved by reading the >>manual page<<.  On the command-prompt,
type "man man" to learn more about the man command (and subsequently
"man yourcommand" to learn about "yourcommand").

If you do not know the name of the command, type "apropos keyword",
where "keyword" is a - d'uh - keyword relevant to the task you want to
perform.  If you ask any of the lab-assistants or System
Administrators about information that is available through "man" or
"apropos", you are likely to get yelled at.

Always remember:

man man
man apropos

4.1 Terms Of Service
====================

The Terms of Service are displayed to every new user upon logging in
for the first time.  If you wish to use the computing facilities
provided by the Department of Computer Science, you must agree to
these terms.  If you do not agree, we have to terminate your account.

To view the Terms of Service at any time, issue the following command:

$> more /etc/TOS

Once you agreed to the Terms of Service, you can prevent them from
being displayed each time you log in by editing the file ~/.profile
and removing the line

. /etc/tos.sh

4.2 "I forgot my password / how can I change my password?"
==========================================================

If you forgot your password, then you need to contact the lab assistant on
duty and ask him/her to change it.  You need to bring a picture ID and should
think of a good password beforehand.

No, we can NOT give you a password and tell it to you over the phone, nor can
we email it to you.  You MUST come in in person.  Bring a picture ID.

For the time being, users are unable to change their own password.  To
do so, please make an appointment with a System Administrator by
emailing admins@cs.stevens.edu.

4.3 "How can I change my shell?"
================================

For the time being, users are unable to change their own shell.  Please
file a problem report at to have your shell changed:
	http://www.cs.stevens.edu/support/gnats/submit.html

==================

5. WWW
======

5.1 "Netscape sucks!"
=====================

Yes, it does.  Netscape will crash on you and dump core, causing you
to run out of quota.  We usually recommend the firefox browser, but we
also have the following installed:

* links (or 'links -g' with a GUI)
* lynx
* firefox
* opera
* konqueror
* mozilla

We generally recommend 'links' as a text browser and 'firefox' as a graphical
browser.

5.2 "How do I maintain my website?"
===================================

First you must create a directory in your home directory to store the files 
for your website. The directory should be named according to your department 
and be in the format <xx>_html, where <xx> is your department. For example, 
math_html, hum_html, phy_html, chem_html, cs_html will work for math,
humanities, physics, chemistry and computer science respecively. The
directory needs to be readable and executable by everybody (755).  All files
you place into this directory will show up at
http://www.<xx>.stevens.edu/~yourusername/ 
where <xx> is the department from the name of the directory.

Please note that the legacy public_html can be used but will only appear
at http://www.cs.stevens.edu/~yourusername.  Note also, that this is the only
directory where you can run CGI's from.

For obvious reasons, your $HOME also needs to be executable by others.
When changing permissions on your $HOME directory, please note that
/home/<yourusername> is a symbolic link to the real location of your
home directory.

If you provide a file called "index.html", the directory will not be
listed, but this file will be displayed.  When writing HTML, please
make frequent use of the "tidy" command.

5.3 "How do I include cgi's in my website?"
===========================================

If you wish to offer dynamic content on your website, you may wish to
include cgi's.  You can do so without any problems, but there are a
number of things to remember:

First, the script/program MUST end in ".cgi", or otherwise it will not
be executed by the server.

Naturally, the program (and the directory it resides in, which must be
a subdirectory of ~/public_html (or that directory itself)) needs to
be read- and executable by everybody.  That of course also means, that
~, ~/public_html and the subsequent directories must be
world-executable as well (which is sufficient - world-readable, though
useful, is not required (if you don't understand why this is the case,
please review the file-permission concept in UNIX with respect to
directories)).

5.4 "Can I have a Wiki?"
========================

Yes, you can have a Wiki.  We have the Kwiki Wiki installed, together with a
number of plugins.  To start your own Wiki, create a directory under
~/public_html (note: public_html, not cs_html or any of the other directories;
at the moment, wikis can only be run under the CS website, and only if
initialized in the public_html directory) and initialize it:

$ cd ~/public_html
$ mkdir wiki
$ cd wiki
$ kwiki -new
$ kwiki -update
$ cat >.htaccess <<EOF
Options ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex index.cgi
EOF
$ chmod a+r .htaccess

Now point your browser at http://www.cs.stevens.edu/~<username>/wiki/.

5.4.1 "What Kwiki Plugins are available?"
=========================================

pkg_info -e '*Kwiki*'

5.4.2 "How can I use these plugins?"
====================================

Edit the file 'plugins' in your wiki directory and uncomment the plugins that
you wish to use.  (Note, these plugins need to be installed.  If you would
like to request a new plugin to be installed, please file a software request.)
After that, run 'kwiki -update' in your wiki directory and reload your wiki
website.

5.4.3 "How can I allow only specific users to edit pages in my Wiki?"
=====================================================================

If you do not wish to allow anybody to edit pages in your Wiki, then you can
require that every person editing a page has a username by adding the
Edit-RequireUserName plugin.  However, this does not prevent anybody from
simply creating a username and editing the page.  If you wish to only allow
specific users to edit pages, password protect your wiki.  See section 5.7.

5.5 How do I use PHP?"
======================

Very easy - just write your php file and save it in your ~/public_html
directory.  The PHP files need to end in ".php".  The files will then be
available, just like your ordinary html files, under
http://www.cs.stevens.edu/~yourusername/

If you wish to use PHP to interface with your database, please see
section 8.2.2.

Please make use of the extensive documentation available at
http://www.php.net/.

5.6 "How can I access the fabulous pipeline?"
=============================================

http://cpipe.stevens.edu/ has a number of browser capability checks that
routinely fail to actually detect that all that's necessary to access this URL
is indeed installed and functioning.  If your browser displays an error when
going to said URL, try to access the full URL of the login screen:
http://cpipe.stevens.edu/cp/home/loginf

Whatever it may be that you can do using this website, if there are
any problems with it, there is unfortunately next to *nothing* we can
do about it.  You are welcome to direct any questions and concerns to
the friendly people of the Computer Center, available at
helpdesk@stevens.edu or x5500, x5108 or x5491.

5.6.1 "How can I access the fabulous pipeline via pine?"
========================================================

To access Pipeline via pine(1), follow these steps: 
   
1. In your ~/.pinerc, find the line starting with "incoming-folders=" and
change it to 
incoming-folders={nexus.stevens.edu/novalidate-cert/user=<user name>}inbox
  
where <user name> is your Pipeline username.
  
2. To view your Pipeline folders, start Pine and type S, L, and A.  Give a
nickname, and for the ``Server'' field put 
nexus.stevens.edu/novalidate-cert/user=<user name>
  
Press Ctrl-X, type your Pipeline password, and save.
  
3.  To view your Pipeline inbox, type L in the Pine main menu, select
``Incoming-Folders'' and select 
{nexus.stevens.edu/novalidate-cert/user=<user name>}inbox
  
Do the same to view your Pipeline folders.  You can add and delete
Pipeline folders. Pressing tab while viewing your CS inbox also takes you
to your Pipeline inbox.


5.7 "How can I protect portions of my website?"
===============================================

In order to restrict access to portions of your personal webpage, you can use
a .htaccess file. Create a password file by issuing the command

 $ htpasswd -c /home/yourusername/passwords httpusername

where 'yourusername' is your username, 'passwords' is the name of the password
file being created and 'httpusername' is the username to which you wish to
allow access. htpasswd will ask you for a password and then ask for
confirmation.  Once this is completed, you may add more users with the
command

  $ htpasswd ~/passwords newuser

Note that 'httpusername' and 'newuser' need not be actual usernames currently
in use on our systems -- you are free to generate new usernames, as this only
effects the directory you intend to protect.  The usernames need to consist of
alphanumeric characters only, however.

Please remember to set the permissions on the 'passwords' file such that no
other users can access it.

Now in the directory to which you wish to limit access, create a file named
.htaccess. Within this file type the following:

  AuthType Basic
  AuthName "Password Required"
  AuthUserFile /home/yourusername/passwords
  Require valid-user

This will cause all who attempt to view this directory to enter in one of the
user name/password combinations created using htpasswd.

For more information, please see
http://httpd.apache.org/docs-2.0/howto/htaccess.html
http://httpd.apache.org/docs-2.0/howto/auth.html
http://apache-server.com/tutorials/ATusing-htaccess.html
      

5.8 "Where are the logs?"
=========================

As you work on your website, you will likely encounter various error messages.
In order to properly debug these problems, please remember to look at the
webservers log files.  The log files (both the access and error logs) 
are located in

/usr/people/guest/weblogs/

on all workstations.


5.9 "How can I make plugins work with Mozilla Firefox?"
=======================================================

Plugins that for one reason or another can not be installed system wide, can
be installed into a user's local directory. Under the .mozilla directory in
your home directory, create a new directory called 'plugins'. You can do this
by using the command

mkdir ~/.mozilla/plugins

If you wish to use the java plugin for Mozilla Firefox, you must make 
Firefox aware that the plugin exists. Then you can create a symlink 
in this directory pointing to the java plugin. You can do this with 
the following command

cd ~/.mozilla/plugins
ln -s /usr/local/java/jre/plugin/i386/ns610/libjavaplugin_oji.so ~/.mozilla/plugins/libjavaplugin_oji.so

Other plugins may be installed into your local plugins directory as well.
For example, to use the RealPlayer plugin, you would run the following
commands:

cd ~/.mozilla/plugins
ln -s /usr/pkg/lib/RealPlayer/mozilla/nphelix.so


5.10 "I found an error on the website.  Whom should I contact?"
===============================================================

If you have found an error on one of the departments' websites, please contact
the responsible webmaster.  We have email-aliases for the following:

http://www.acc.stevens.edu/     ->      acc-webmaster@
http://www.chem.stevens.edu/    ->      chem-webmaster@
http://www.cs.stevens.edu/      ->      cs-webmaster@
http://www.fe.stevens.edu/      ->      fe-webmaster@
http://www.hum.stevens.edu/     ->      hum-webmaster@                                                         
http://www.math.stevens.edu/    ->      math-webmaster@                                                        
http://www.phy.stevens.edu/     ->      phy-webmaster@                                                         
http://ssgps.phy.stevens.edu/   ->      ssgps-webmaster@                                                       
http://www.stoch.stevens.edu/   ->      stoch-webmaster@                                                       


5.11 Existing firefox processes?
================================

If you attempt to start the firefox browser, you may get the following
message:

    Firefox is already running, but is not responding.
    To open a new window, you must first close the 
    existing firefox process, or restart your system.

You can run the 'ps' command to see if there is another firefox process
running.  Open a terminal and type
  
  ps waux | grep firefox
   
If there is a line indicating that another firefox process is in fact running,
you can kill it using the kill command.  For example, if the above produced a
line like the following

username 23534  6.7 14104 34560 ?  Sa  9:09AM 0:05.19  /usr/pkg/lib/firefox/firefox-bin

then you would select the process ID, which is the first number after your
username and pass it to the kill command, adding

kill -KILL 23534

If there is no other firefox process running, then you have a lockfile left
from a previous instance of firefox.  You can remove that lockfile by running
this command:

rm ~/.mozilla/firefox/*/lock ~/.mozilla/firefox/*/.parentlock


==================

6. Mail
=======

6.1 "How do I read my email?"
=============================

With the account you also get an email-address
yourusername@cs.stevens.edu -- note that this is a different
email-address than yourusername@stevens.edu

man mutt

(Yes, you can use "pine" as well.  Or "mail".  Or "exmh".  Or
"balsa".  Or...)

All mail is stored in $HOME/.mail, to which the MAIL environment variable
is set in /etc/profile.  Check the value of $MAIL, and source /etc/profile
from any non-login shell if appropriate.

6.2 "How do I forward my email?"
================================

echo some@email.address > ~/.forward

6.3 "How do I set up an auto-response during the vacations?"
============================================================

Add the following to your ~/.procmailrc file (as taken from procmailex(5)):

----8<-----8<----8<----

:0 Whc: vacation.lock
* $^To:.*\<$LOGNAME@cs.stevens.edu\>
* !^FROM_DAEMON
* !^X-Loop: $LOGNAME@cs.stevens.edu
| formail -rD 8192 vacation.cache

:0 ehc
| (formail -rA"Precedence: junk" \
-A"X-Loop: $LOGNAME@cs.stevens.edu" ; \
cat $HOME/.vacation.msg \
) | $SENDMAIL -oi -t

----8<-----8<----8<----

6.4 "How can I filter email?"
=============================

man procmail
man 5 procmailex

Note that you do not need to edit your ~/.forward for procmail to work
- we automatically invoke procmail on all incoming mail, so that all
you need to do is create a file called ~/.procmailrc which contains
the rules.

6.5 "Are there any mailing-lists?"
==================================

See https://guinness.cs.stevens.edu/mailman/listinfo/ for a list
of available mailing lists and decide if any of them interest you.

6.6 "I sent you an email - why didn't I get an answer?"
=======================================================

Most likely, because not enough time has elapsed for us to answer it.
Another frequent reason is that you didn't provide a valid
return-address when you emailed us.  If you send us an email, make
sure that the address in the 'From:' field is valid!

Also, if you send us HTML mails, it is quite likely that we didn't
even see it.  HTML does not belong in email, and is likely to have
been filtered to /dev/null right away.

Your best bet is to NOT use Hotmail, Yahoo or any of these
web-interfaces and simply use your CS account -- that is
yourusername@cs.stevens.edu -- and if you ask a question that is NOT
answered in this document, you most likely will get a response within
a day at most.


6.7 "How can I check my mail with my mail client on my PC?"
===========================================================

A user can check their mail using their favorite mail client as long
as it supports either the POP or IMAP protocols.  In both cases your
email adress should be set you 'username@cs.stevens.edu' where
'username' is your username. 

For IMAP, set the incoming server to guinness.cs.stevens.edu. The
account name is your username.  Enable SSL for the connection and use
port 993.  For your outgoing server, you can use either your ISP's mail
server or guinness.cs.stevens.edu.  If you use guinness.cs.stevens.edu
as the outgoing mail server, make sure you enable authentication via SSL
for sending mail.

For POP, set the incoming server to guinness.cs.stevens.edu.  The
account name is your username.  Enable SSL for the connection and use
port 995.  For your outgoing server, you can use either your ISP's mail
server or guinness.cs.stevens.edu.  If you use guinness.cs.stevens.edu
as the outgoing mail server, make sure you enable authentication via SSL
for sending mail.

6.8 "Are there any default mime.types and mailcap files?"
=========================================================

We have the following two files available:

- http://www.cs.stevens.edu/support/docs/mime.types

  This file is the list of known mime.types as distributed with the apache
  webserver.  You can download this and save it as ~/.mime.types.

- http://www.cs.stevens.edu/support/docs/mailcap

  This is a file that contains a few default applications for certain mime
  types as appropriate for our systems.  Download this and save it as
  ~/.mailcap.

6.9 "Thunderbird can't copy mail between folders in imap"
==========================================================

See http://www.cs.stevens.edu/cgi-bin/query-pr-full?pr=1918

The problem seems to occur of the folder in question (the one you are trying
to move mail to) is in fact a symbolic link to another folder.  Use a full
absolute path instead of a symbolic link.

==================

7 Printing / Scanning
=====================

7.1 "How do I print?"
=====================

man lpr

If you are experiencing trouble when printing a postscript-file (for
example, the fonts look a bit shady), try using ps2ps(1) to clean up
the postscript.

If you printed a job and it disappears or is not printed for any other
reason (toner low, out of paper etc.), contact the lab-assistant.
Then use "lprm" to remove your print-job from the queue and print to
the other printer.

Do NOT print large files, websites or anything else that is not
absolutely necessary.  Save a Tree.  Never ever print binary files
(yes, people *have* done that).

Repeat: DO NOT PRINT LARGE FILES.  Any file larger than 20 pages must
not be printed.  And no, splitting it into multiple files doesn't make
this any better.  If we find out that you are printing excessively, we
will disable your account.

With lecture notes, if it is neccessary to print them, consider printing
multiple pages per side.

OpenOffice does this for .ppt slides. Simply print the notes from the
"handout" tab and it will print 4 pages per side.

For pdfs use the program kpdf. Select "Print" from the File menu and make
sure that "lp" is the printer chosen.  Select the "Properties" button and
in the "Print Format" tab select "4" under "Pages per Sheet" and click OK
to close the dialog box and select "Print" in the remaining dialog box.
This will give you 4 slides per side  and will help you keep under the
print quota.

You can pick up your print-outs at the front desk by asking the lab
assistant nicely.

7.2 Pretty Printing
===================

Many people would like to print their code two pages on one, with a
header, a footer, line-numbers and the like.  To do so, take a look at
the manual page for "a2ps".

Please note that a2ps(1) automatically sends its output to the
printer, so if you want to first try out a few command-line options to
see what the output would look like, please pass the "-o filename.ps"
option and preview the result using gv(1).

Also note that you really want to pass the "--medium=letter" option to
a2ps(1), as otherwise some of the content will be cut off when
printing, even though it will look just fine in gv(1).

If you wish to print a plain text file to the printer hptext, it will
automatically do pretty-printing.  If you do not want this, you can
use the following command:

a2ps --borders=no --columns=1 -R --medium=letter -B --printer=hptext filename

7.3 "How do I print man pages?"
===============================

http://www.google.com/search?q=how+do+I+print+man+pages

There are several ways to print the online manual pages.  But before
you do so, please think about whether you *really* need a printout:
the information is usually only helpful if you're near a computer
anyway, in which case you could of course just read it online.
Anyway, here's how you can do this:

$ man <topic> | col -b | ul | a2ps

or

$ groff -man /path/to/man/page.1 | lpr

Of course, it is always a good idea to first direct the output into a
temporary file, so you can inspect it and then print it:

$ man <topic> | col -b | ul | a2ps -o /tmp/foo.ps

or

$ groff -man /path/to/man/page.1 > /tmp/foo.ps

and then

$ gv foo.ps

and if you're happy with the result:

$ lpr foo.ps


7.4 Printing Problems
=====================

If you experience problems with the printer, make sure that you
printed to the right printer.  Also make sure that what you want to
print is actually printable -- usually it is a good idea to first
print to a file (say, /tmp/foo.ps) and then preview the result with
gv(1) before sending the file to the printer (lpr -P<printername>
/tmp/foo.ps).

If you experience problems, please ask the lab-assistant on duty to
help you.

7.5 "How can I print simplex?"
==============================

The printer in the CS lab as well as two of our other printers print duplex
per default.  That is, it will print page one on the first page, page two on
the flip-side, page three on the second page etc.  Occasionally, it may be
desirable to print one page per sheet;  this is called ``simplex''.

Unfortunately the printer in the CS lab no longer lets users change the
duplex settings reliably, so that manual intervention is necessary.  If
you need to print simplex in the CS lab, please ask the lab assistant to
temporarily disable duplex, then submit your print job.

The printers colt45 and baileys (for faculty usage only) can be made to
print in simplex mode via the 'printsimplex' command.  This command will
wait for the printer to become idle, set it to simplex, print the job and
then set the printer back to duplex, as it should be.  The command takes
as the first argument the name of the printer; all following arguments are
passed on to 'lpr'.


7.6 "My printouts don't show up!" aka "I can't print!"
======================================================


Sometimes printing doesn't work out, or the print job seemingly doesn't get
printed.  Here are a few things you can do to try to troubleshoot the problem
and get your printouts:

(a) make sure that you're printing to the correct printer

    The machines throughout the different departments all have different
    default printers, so if you just used 'lpr <filename>' without specifying
    a printer name, it may be that the printout comes out of a printer in
    another location.
    While this obviously *shouldn't* be the case, it may still happen
    sometimes.  Take a look at /etc/printcap:  the line starting with 'lp|'
    specifies the default printer.  If that is not the correct printer, then
    specify which printer you want to print to by using

    'lpr -P<printer> <filename>'

    The default printer for all machines in the CS Lab is 'hptext'.
    The default printer for all machines in Lieb 1st floor is 'baileys'.
    The default printer for all machines in Lieb 2nd floor is 'baileys'.
    The default printer for all machines in Lieb 3rd floor is 'colt45'.

    If you encounter a machine that does not have the correct default printer,
    let us know.

(b) make sure that the printout contains the output you expect

    Sometimes a PDF may look fine in the PDF viewer, but may not print.  You
    can check that the file prints ok by first printing it to a file, say
    <filename>.ps.  Then use gv(1) to preview the file.  If gv(1) can display
    the file correctly, then odds are you can print it.  If gv(1) does *not*
    display the file correctly, then you can try the following:

    (i) If you used acroread5 first to view the PDF, try to use xpdf instead.
        Then repeat the previous step.

    (ii) You can try to ``clean up'' the postscript file using ps2ps(1) or
         pstops(1).  Try both, then preview again using gv(1).

    (iii) You can try to use pdf2ps(1) to create a postscript file from the
          PDF source instead of acroread.


7.7 "Why won't my PDF print from a browser?"
============================================

As described above, some PDFs are not handled well by Adobe Acrobat, and
therefore the Acrobat plugin used by some popular browsers.  Please see above
[Section 7.7(b)] for suggetions on how to work around broken PDFs.


7.8 Printing from OpenOffice
===========================================

OpenOffice has no default printers. In order to print, you must edit the file
~/.openoffice.org2/user/psprint/psprint.conf. You can find a sample file with
entries for every file we support at http://www.issa.stevens.edu/support/docs/OOPrinters.txt
Simply copy/paste in the entry for your printer, or
copy the whole thing into that file. Any added printers will show up under
the printer drop down dialog.

==================

8. Database Usage
=================

8.1 General
===========

We have implemented a dedicated database server - if you require
access to it, contact either Oliver Gould or Brian Moriarty and
provide detailed information of why you need access to it.  If you
have a valid reason (for example, you are taking a Database class), we
will create a user-account for you in the Database system and also
create an empty database for each of you, which you can then populate
and perform your queries on.  The database used is PostgreSQL - see
http://www.postgresql.org for more information - and is running off
the host "heineken.cs.stevens.edu".

You can access the database by using the psql(1) program.  Please _do_
consult the manual page.  The following is an example of how to
connect to your database:

(jschauma@becasse) [jschauma]$ psql -h heineken jschaumaDB
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

jschaumaDB=# \q
(jschauma@becasse) [jschauma]$

As you can see, the name of your database is going to be
yourusernameDB.

Note that you will only be able to connect to the database server from
the machines in the CS-lab.  If you have any problems *connecting* to
the server, make sure that

(a) you have an account
(b) you are trying to connect from any of the machines in the CS-Lab
(c) you spelled the hostname correctly (heineken)
(d) you read the man page

If after all this you are still having problems, _email_ me or Brian
and include the complete error-message and provide as much detail as
possible.

If you can connect to the server and you have problems with the
interface or the SQL, please make sure that

(a) you read the man page
(b) you read the help entry ("\h some sql keyword")
(c) you read the general help ("\?")
(d) you ended your query with a semicolon or used "\g" to send the
    query to the server

If, after all this you are still having problems, contact *your TA* or
your professor, as it's quite likely that your SQL is incorrect.  If
they confirm that your SQL is correct and for unknown reasons things
are not working as expected, then (and only then) email Brian or me
about this.


8.2 How do I access my database?
================================

8.2.1 ...over the web using Perl?
=================================

If you wish to interface your website with your database, you can use
Perl.  The name of the file needs to end in ".cgi", it needs to be
world readable and world executable.

A simple example of how to access a database using a perl CGI is
below, to get you started:

#!/usr/pkg/bin/perl -w

use strict;
use DBI;

my $dbh = DBI->connect("DBI:Pg:dbname=<yourDB>;host=heineken", "<yourusername>") or die $DBI::errstr;

if (!defined($dbh)) {
	die "Could not open database.\n";
}
else {
	my $sth = $dbh->prepare("select * from <Tablename>");
	$sth->execute();
	print "Content-type: text/html\n\n";
	print "<html><head><title>Test";
	print "</title></head><body><h1>";
	print "Test</h1><p>";
	while ( my @contents = $sth->fetchrow_array() ) {
		print "First item is \"$contents[0]\"\n";
	}
	$sth->finish();
	print "</body></html>";

	$dbh->disconnect();
}

Obviously, you need to replace "<yourusername>" with your actual username.
For example, if I were using this example, I would use "jschauma" in place of
"<yourusername>".  Similarly you need to replace "<yourDBname>".


8.2.2 ...over the web using PHP?
================================

If you wish to interface your website with your database using PHP,
there are a couple of things that you need to pay attention to, which
are not immediately obvious.

First of all, even though it's a PHP page, the file needs to be treated as a
CGI for security reasons.  That is, the file name needs to end in ".cgi", it
needs to be world readable and world executable.  Furthermore, the first line
needs to be "#!/usr/pkg/bin/php" (similar to perl-cgi's).

A simple example of how to access a database using PHP is below, to
get you started:

#!/usr/pkg/bin/php

<html>
<title>Title</title>
<body>
<?php

$conn = pg_connect ("host=heineken dbname=<yourDBname> user=<yourusername>");

if(!$conn){
	die("Error connecting to database\n");
} else {
	$result = pg_query($conn, "select * from <TableName>");
	while ($row = pg_fetch_row($result)) {
		for ($j=0; $j < count($row); $j++) {
			echo "$row[$j]&nbsp;";
		}
		echo "<BR>";
	}
}
	

$close = pg_close($conn);

if( $close ) {
	echo "Alrighty, then.  We're done here.\n";
}
?>

</body>
</html>

Obviously, you need to replace "<yourusername>" with your actual username.
For example, if I were using this example, I would use "jschauma" in place of
"<yourusername>".  Similarly you need to replace "<yourDBname>".

8.2.3 ...using the jdbc driver in Java?
=======================================

Example code:

/*
 * Example Java stand-alone application that connects to your database using
 * the jdbc-postgresql driver.  Note that in order for this to work, you need
 * to have /usr/pkg/lib/java/postgresql.jar in your CLASSPATH.  Don't forget
 * to include "." in your CLASSPATH as well!
 *
 * Read http://java.sun.com/j2se/1.3/docs/api/java/sql/package-summary.html
 * and http://jdbc.postgresql.org/.
 *
*/

import java.sql.*;

public class JDBC_PostgreSQL_Example
{

	public static void main (String[] args)
	{

		String dbname = "<yourDBname>";
		String username = "<yourusername>";
		String query = "Select * from person";

		String protocol = "jdbc:postgresql://";
		String host = "www.cs.stevens.edu";
		String port = "5432";

		String url = protocol + host + ":" + port + "/" + dbname;
		Connection conn;


		try {
			Class.forName("org.postgresql.Driver");
			
			/* You do not need a password! Do NOT change this! */
			conn = DriverManager.getConnection(url, username, "");

		} catch (java.lang.ClassNotFoundException e) {
			System.err.print("Driver not found:\n\n");
			System.err.print(e.getMessage());
			e.printStackTrace();
			System.out.println();
			return ;

		} catch (Exception e) {
			System.err.print("Unable to establish connection:\n\n");
			e.printStackTrace();
			System.out.println();
			return ;
		}

		Statement stmt;
		ResultSet rs;

		System.out.println("Here it comes:\n");

		try {
			stmt = conn.createStatement();
			rs = stmt.executeQuery(query);

		} catch (Exception e) {
			System.err.print("Error executing query:\n\n");
			e.printStackTrace();
			System.out.println();
			return ;
		}

		try {

			ResultSetMetaData rsmd = rs.getMetaData();
			int colnum = rsmd.getColumnCount();

			while (rs.next()) {

				for (int i=1; i<=colnum; i++)
					System.out.print(rs.getString(i) + "\t");
				System.out.println();
			}

		} catch (Exception e) {
			System.err.print("Error reading data:\n\n");
			e.printStackTrace();
			System.out.println();
			return ;
		}
	}
} 

Obviously, you need to replace "<yourusername>" with your actual username.
For example, if I were using this example, I would use "jschauma" in place of
"<yourusername>".  Similarly you need to replace "<yourDBname>".

8.2.4 ...using the jdbc driver in Java over the web?
====================================================

In order to use the jdbc driver to interface with the database over the web,
you will need to write an applet.  The security restrictions on an applet
require that the webserver from which the applet is downloaded is the same as
the database server.  Since the database is hosted on heineken, you will need
to put the applet into your ~/linux_html directory, so that it, too is
accessed on http://heineken.cs.stevens.edu/~yourusername.

In addition, you will need to extract the jar with the driver in that
directory as well, so the applet can find the driver (obviously you have no
influence on the users CLASSPATH).

Finally, since the Computer Center's firewall blocks all but a few ports, you
can only access the database using an applet from within Stevens.  That is, if
you open the page containing the applet in a browser from outside the Stevens
network, the applet will error due to the connection to the database server
timing out.

Below find the example code for a very simple applet.


/*
 * Example Java applet that connects to our database using the jdbc-postgresql
 * driver.  Note that in order for this to work, you need to have extracted
 * the driver (/usr/pkg/lib/java/postgresql.jar) in your ~/linux_html
 * directory.
 *
 * Read http://java.sun.com/j2se/1.3/docs/api/java/sql/package-summary.html
 * and http://jdbc.postgresql.org/.
 *
*/

import java.applet.*;
import java.awt.*;
import java.sql.*;

public class dbapplet extends Applet
{
	TextArea text = new TextArea(10, 40);

	public void init()
	{

		String dbname = "<yourDBname>";
		String username = "<yourusername>";
		String query = "<your SQL query>";

		String protocol = "jdbc:postgresql:";
		String host = "heineken.cs.stevens.edu";
		String port = "5432";

		String url = protocol + "//" + host + ":" + port + "/" + dbname;
		Connection conn;

		add("Center", text);
		
		try {
			Class.forName("org.postgresql.Driver");
			
			/* You do not need a password! Do NOT change this! */
			conn = DriverManager.getConnection(url, username, "");

		} catch (java.lang.ClassNotFoundException e) {
			text.append("Driver not found:\n\n");
			text.append(e.getMessage());
			return ;

		} catch (Exception e) {
			text.append("Unable to establish connection to " + url + "\n\n");
			text.append(e.getMessage());
			return ;
		}

		Statement stmt;
		ResultSet rs;

		text.append("We seem to have a connection\n\n");

		try {
			stmt = conn.createStatement();
			rs = stmt.executeQuery(query);

		} catch (Exception e) {
			text.append("Error executing query");
			return ;
		}

		try {

			ResultSetMetaData rsmd = rs.getMetaData();
			int colnum = rsmd.getColumnCount();

			while (rs.next()) {

				for (int i=1; i<=colnum; i++)
					text.append(rs.getString(i) + "\t");
				text.append("\n");
			}

		} catch (Exception e) {
			text.append("Error reading data\n");
			return ;
		}
	}
}

Obviously, you need to replace "<yourusername>" with your actual username.
For example, if I were using this example, I would use "jschauma" in place of
"<yourusername>".  Similarly you need to replace "<yourDBname>".

==================

9. Java
=======

In order to allow for the various requirements in several classes as
well as for your leisure time Java programming, we have installed
several different JVMs on the lab.cs.stevens.edu machines.  These
include:

blackdown - an Open Source implementation of Sun's
            JVM version 1.3, running under Linux emulation
            Homepage: http://www.blackdown.org

kaffe     - an Open Source implementation of Sun's JVM
            free of any code from Sun
            Homepage: http://www.kaffe.org

native    - a native JDK, version 1.1.8
native14  - a native version of Sun's JVM 1.4.2

sun-jdk13 - Sun's JVM 1.3.1 running under Linux emulation

sun-jdk14 - Sun's JVM 1.4.2 running under Linux emulation

sun-jdk15 - Sun's JVM 1.5 running under Linux emulation

The default JDK is Sun's JDK Version 1.4.2.  Therefore, you will find
/usr/pkg/java/sun-4/bin in your PATH.  If you would like to make a
different JVM the default for your environment, you can do so by
executing the following command:

export PATH=`switchvm <jvm>`

where "<jvm>" is one of the JDKs mentioned above.  Please note that this
"`" is a 'backtick', the character you get by pressing the key that
contains the tilde ("~") character.

If, for example, you want to use the 'kaffe' implementation per
default, you could enter the following into your ~/.bashrc (or
~/.bash_profile):

export PATH=`switchvm kaffe`

If, at a later point in time, you want to change to, say, Sun's JDK
Version 1.4, you'd then execute

export PATH=`switchvm sun-jdk14`

"switchvm" is a small shell script that adjusts your path to include
the appropriate directory -- of course you can do so manually, or even
simply type in the full PATH every time you execute a java program.


9.1 What does ``Could not reserve enough space for object heap'' mean?
======================================================================

If you try to run the java compiler or the java virtual machine and you
encounter an error such as

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

then you have tried to run the command from a non-login shell.  The error is
due to the proper ulimit resources not being set for your current shell.  If
the shell you run the command in was a login shell, then it would have sourced
/etc/profile and set the ulimits correctly.

To fix the problem, make sure you are in a login shell (for example, a
terminal started with the '-ls' option).  Also, see 12.11 for similar
side-effects.

==================

10. Window Managers
===================

10.1 "I want to have a fancier desktop!"
========================================

Per default, every user has "twm" as their default window manager.
However, we do have several other window managers installed.  To make
any of the installed window managers your default one, simply edit
~/.xsession.  To make KDE your default desktop, for example, enter
"exec startkde" into your ~/.xsession.

To make WindowMaker your default window manager, first run
"wmaker.inst", and then enter "exec wmaker" into your ~/.xsession.

Note that ~/.xsession must be made executable (man chmod).

10.2 "What window managers are there?"
======================================

We currently have the following windowmanagers installed:

* 9wm
* amiwm
* afterstep
* blackbox
* ctwm
* enlightenment
* flwm
* fvwm1
* icewm
* ion
* lwm
* olvwm
* pwm
* ratpoison
* sawfish
* uwm
* windowmaker
* wm2

Though technically not a window manager, but a desktop environment, we
also have KDE and GNOME installed.

We highly recommend the use of the default window manager twm or
blackbox -- both are very fast and light.  With KDE and GNOME, things
will slow down significantly.

10.3 "When I try to log in, the login screen comes right back!"
===============================================================

Most likely, your ~/.xsession is not executable, or you want to run
windowmaker without having run "wmaker.inst" first.  Of course other errors
are possible as well.  You can always log in via the console by hitting
Ctrl+Alt+F1 (or F2, F3, F4) and make the necessary changes.  Ctrl+Alt+F5 will
bring you back into the X-Display.  The file ~/.xsession-errors usually
indicates what exactly the problem is.

==================

11. SSH
=======

11.1 "How can I connect to my account from home?"
=================================================

Using SSH you can log into your account from home or from other remote
locations.  Use the search-engine of your choice to find a proper SSH-client
for your Operating System.  Please make sure to use protocol version 2.

For Windows, many people seem to find Tectia (available at
http://www.ssh.com/support/downloads/secureshellwks/non-commercial.html) to
be satisfactory; for the Mac OS 9, Nifty Telnet seems to work fine.  Mac OS
X's comes with ssh builtin.

When connecting to your account, please always connect to
"lab.cs.stevens.edu", which will drop you into any one of the machines here
in the lab.  If, for whatever reason, you can not connect to
lab.cs.stevens.edu, try connecting to shell.cs.stevens.edu.

For security reasons, we do not allow telnet connections.

11.2 "I frequently get a warning from ssh.  What's going on?"
=============================================================

lab.cs.stevens.edu and all other NetBSD workstations received a common
ssh-key on 2003-10-01 in order to avoid confusion resulting from multi-homed
hosts with several different keys.

The fingerprints for the new keys are:

   ssh version 1:          73:e1:da:82:e4:fd:25:24:ad:51:1a:a5:25:8a:d5:84
   ssh version 2 (dsa):    2c:72:e5:ca:fc:7b:3c:ae:9e:e9:d6:0c:c0:d8:90:73
   ssh version 2 (rsa):    95:6f:61:1d:51:09:0a:1f:19:88:48:74:a2:99:8c:44

If you know what the warning means, compare the fingerprint and remove the old
host entry from your ~/.ssh/known_hosts file.

If you don't understand any of this, the best solution (right after trying to
understand what all this means by reading the relevant manual pages and google
around) may be to remove your ~/.ssh/known_hosts file.

The ssh keys fingerprints are also available from
http://www.cs.stevens.edu/support/docs/ssh-fingerprints.txt.asc

That file is signed with Jan Schaumann's public PGP key, which in turn is
available from http://www.cs.stevens.edu/~jschauma/public_key.gpg.asc.

==================

12. Miscellaneous Questions
===========================

12.1 "How can I read MS [Word|Excel|Powerpoint]?"
=================================================

Excel Spreadsheets can also be read by "gnumeric" and "kspread", Word
documents by "abiword", "antiword", "kword" and others.  Powerpoint
slides can be read with "kpresenter".

Also, you can read all of these in OpenOffice, which can be started by issuing
the command "soffice".  However, OpenOffice is a huge resource-hog and it is
not unusual for it to take up to several *minutes* to start up, which is why
we recommend using the other applications mentioned above.

The first time 'soffice' is run it needs to create a whole lot of files in
your $HOME; just follow the instructions on screen.


12.2 "How can I read files from a floppy/cd/usb-stick?"
=======================================================

cd /auto/{floppy,cd,stick}

Note that the "floppy" part will not be tab-completed, as the medium
is mounted automatically.  Also note that not all USB sticks are currently
supported.  If your USB medium is not supported at the moment, you have the
option of leaving it with the system administrators and they can see if they
can add support to the kernel.  This may, however, take a few days.

Now if you want to change the medium, you can use the following
sequence of commands:

[put floppy in drive]

~ $> cd /auto/floppy/
/auto/floppy $> ls
[some stuff]
/auto/floppy $> cd
~ $>
~ $> amq -u /auto/floppy
[ switch floppy ]
~ $> cd /auto/floppy
/auto/floppy $> ls
[some other stuff]

The same holds for CDs, just s/floppy/cd/.  Similarly for the USB devices.
Please note that you MUST use amq to unmount the USB device before removing it
from the machine!  Otherwise, you will cause the system to crash.

In order to be able to eject the cd or remove the USB device
, you need to have unmounted it first.  To do so, please use

amq -u /auto/cd

or

amq -u /auto/stick

Note that no other process may have an open file handle to /auto/cd.  That is,
make sure you 'cd' out of the directory and are not browsing the directory
with netscape, for example.  In order to find out which processes have a file
handle open to /auto/cd, use

fstat /auto/cd

12.3 "How can I write files to a floppy or a CD?"
=================================================

Unless you're faculty, you can't write files to the floppy.
The floppy drives are mounted read-only.

You can write files to a CD via the cdrecord(1) command, which needs to be
invoked via sudo(1).  Usually, you first need to create an ISO image of the
files you wish to burn to CD.  For example:

$ mkisofs -o image.iso file1 file2 file3
$ sudo cdrecord -dev=15,0,0 -data image.iso


12.4 "I found a bug in some software / how can I request software to be installed?"
===================================================================================

Our Problem Report (PR) system is available online at

http://www.cs.stevens.edu/support/gnats/

Furthermore, you can also manually fill out a problem report using the
send-pr(1) command -- just make sure to use /usr/pkg/bin/send-pr (the default;
/usr/bin/send-pr is used to report problems in NetBSD to the OS vendor).

Finally, you can also create a problem report simply by sending a mail to
bugs@, but that mail needs to have a specific format.  Save the file
http://www.cs.stevens.edu/support/gnats/send-pr.template somewhere convenient
and use it to prepare the email.  A filled out sample is available online at
http://www.cs.stevens.edu/support/gnats/send-pr.template.complete.

12.5 "Where can I learn about these wizardly UNIX commands?"
============================================================

http://www.stevens.edu/it/documentation/guides.shtml#11

http://www.google.com/search?q=basic+unix+commands

http://www.desktop-linux.net/quickref.htm

http://www.netbsd.org/Documentation/

http://www.unixhelp.org

12.6 "My machine's locked up.  I'm just gonna reboot it..."
===========================================================

No, you don't.  See above.  This is not a Windows machine.  You may
NOT reboot any of the machines in the lab.  Here's why:

NetBSD, as any UNIX-like Operating System is a multi-user operating
system.  That means, that at any given time several people might be
logged into the system.  Even if it seems to you that you can't use
the machine, that it's "frozen", it may very well be that it's only
the X Server that is hung.

Now imagine you log into lab.cs.stevens.edu from home (which will
dump you into any one of the machines in the lab) and you start
working on your homework assignments and suddenly - BAM - the machine
goes down and several hours of work are lost.  This is what could
happen, if you simply hit the "reset" button on the machine.

Furthermore, if the machine actually *has* become unusable, then it is
important that the System Administrators know about it.  We need to
determine what has happened, so we can prevent the problem from
occurring the next time.  Of course it is impossible for us to analyze
a given program if we can't determine the cause or what has happened.

So again, if you think that your machine has become frozen or does not
respond in any way, contact the Lab Assistant, sitting in the front of
the Lab.  Do NOT reboot the machines.

12.7 "Where's my TA?"
=====================

We don't know.  You may be able to find your TA during his or her office
hours in the TA room, which is the separate room within the CS Lab.


12.8 "Out of quota?"
=====================

Every student has only a limited amount of disk space available.  At the
moment the new default quota is 100MB -- significantly larger than the 25
MB we used to enforce.   If you have used up all your space, the system will
issue a warning and after a grace period of 7 days eventually refuse to
allocate more space for you.  In general 100 MB is more than enough for
average usage -- the most common case when you find yourself out of quota
is when an application (often netscape -- which is why we recommend using
firefox instead) crashes and dumps a core-file in your home-directory.

These core-files (usually called <application>.core) are rather big,
as they contain the debugging information that might be useful for you
to determine why the application crashed.  One large core-file might
be enough to use up all your quota!

So, if you find yourself running out of disk space, please search
through your home-directory (and all subdirectories) and delete all
files that you do not need to free up space.  Rarely accessed
directories can be compressed into archives -- please see tar(1),
gzip(1) and bzip(1).

Finally, if you run out of disk space and have tried to clean up your files
but _still_ need more space, you can send an email to the administrators
explaining *why* you need more space.  If you have a fair enough reason
(Examples: "I still have the old quota of 25 MB", "I'm writing an
application/library.", "I'm a TA for class XXX and need to store students'
assignments."), we will increase your quota.  If you do not have a valid
reason (Examples: "I want to keep all my mp3 files on my website.", "I
want to keep a spare copy of my Spiderman DVD online."), we will not.

12.9 "How can I compile my OpenGL homework?"
=============================================

Many people seem to have trouble with this.  So here's an example
Makefile to help you get started:
http://www.cs.stevens.edu/~jschauma/UsingUnix/Makefile


12.10 "Stuff in my ~/.bashrc is not executed!"
==============================================

Read the bash manual page, section 'INVOCATION'.  ~/.bashrc is only
executed for non-login shells, ~/.bash_profile is only executed for
login shells.  Most likely you want to symlink one to the other.  Read
ln(1).


12.11 "What software is installed on the workstations?"
=======================================================

The overwhelming majority of all installed software is installed via the
NetBSD Packages Collection, and resides under /usr/pkg/.  You can find a list
of all the software installed there using the pkg_info(1) command.  Take a
look at the manual page, it offers plenty of possibilities to specify your
search.

There are a few other applications that are installed in /usr/local -- most
notably the commercial applications Stevens has licensed.  They are:

- Maple 9.5 (see http://www.maplesoft.com/)
- Mathematica 5.1 (see http://www.wolfram.com/)
- Matlab 7 (see http://www.mathworks.com/)

Manuals in book format may be available in the CS Lab for your reference.

The complete list of other (pkg-managed) software is also available online at
http://www.cs.stevens.edu/support/index.php?file=PKGS
and, with detailed
description at http://www.cs.stevens.edu/support/index.php?file=PKG-DESC

For example, if you are looking for the ``netpbm'' library:

$ pkg_info | grep netpbm
netpbm-10.11.8    Toolkit for conversion of images between different formats
$

or

$ pkg_info -e '*netpbm*'
netpbm-10.11.8
$ pkg_info -d '*netpbm*'
Information for netpbm-10.11.8:

Description:
Netpbm is a toolkit for conversion of images between a variety of
different formats, as well as to allow a few basic image operations.
Netpbm is based on the widely spread Pbmplus package (release: 10 Dec
91).  On top of that, a lot of improvements and additions have been
made. After the latest release of Pbmplus, a lot of additional filters
have been circulating on the net. The aim of Netpbm was, to collect
these and to turn them into a package. This work has been performed by
a group of programmers all over the world.

Homepage:
http://netpbm.sourceforge.net/

$ pkg_info -L netpbm-10.11.8 | more

will give you the list of all files in the package.

12.12 "How do I know when software has been updated?"
=====================================================

When our workstations are updated, the latest changes are updated in the file
/etc/updates on each machine.  In addition, a mail is sent to our
system-updates mailinglist
(https://guinness.cs.stevens.edu/mailman/listinfo/system-updates).

12.13 "Why does my program suddenly no longer compile?  I swear, it worked last semester!"
===========================================================================================

Up until 2004-03-25, the default compiler on the NetBSD workstations currently
was still gcc 2.95.3.  Since then, the compiler toolchain has been upgraded to
gcc-3.3.3.  This version of the compiler is a lot less forgiving and will
actually error out if the code is not technically correct.  (The older version
did let you get away with certain things.)

While the older version of the compiler is still available in
/usr/pkg/gcc-2.95.3, we highly recommend adjusting your code to work with the
newer version -- relying on a certain compiler's quirks is really not a good
idea when writing software.  However, if you do wish to use the old compiler,
make sure you compile with the '-static' flag, as dynamically linked binaries
will get confused by finding the shared libraries for the newer compiler first.
(We're working on that issue.)

Most of the problems you may encounter are due to the way that namespaces work
in C++.  For example, if you replace this code: 
 
        cout << "Something." << endl;
 
with  

        std::cout << "Something." << endl;

then the latter will be correct C++ code (otherwise the compiler does not know
what namespace ``cout'' belongs to -- the old compiler lets you just get away
with it and assumes std-namespace per default).

Now of course this is a bit cumbersome, so C++ let's you specify which
namespaces you wish to use at the beginning.  You could instead add the
following line at the top of your file:

using namespace std;

and the compiler would then know to automatically try this namespace.  If you
search the internet (or your reference book) for ``C++ namespace'', you should
find many examples.


12.14 "How can I get access to a CVS repository?"
=================================================

If you would like to set up a CVS repository, you can find detailed
instructions in the document at
http://www.cs.stevens.edu/support/index.php?file=CVS.  Please note if you
need to get access to a repository of one of the faculty members (for example
because you are his/her research assistant), you need to have the faculty
contact Oliver Gould <ogould@cs.stevens.edu>.

If you wish to share code with other students for a particular project, please
do mention the details of the project (object of project, supervisor /
instructor, group members etc.) when you request the repository.


12.15 "How can I access my storage01 share?"
============================================

At the moment you can't access your storage01 network share from our regular
workstations.  However, you can log in to heineken.cs.stevens.edu and run
the command

/usr/local/bin/mount_storage01

to mount your share.  This program will create a directory ~/storage01
if that directory does not yet exist.  It will then prompt you for your
Campus Domain password and mount the share in ~/storage01.

To unmount the share, you need to use

/usr/local/bin/umount_storage01

These two commands are only available on heineken.cs.stevens.edu, and you
can access ~/storage01 only from that machine, not from the other machines.
Hopefully this will be fixed in the future.


12.16 "I deleted / lost a very important file!  Are there backups?"
===================================================================

Yes, we do have backups.  However, your file may not necessarily be part of
the last backup:  For example, if you created a file early in the morning and
accidentally deleted in late in the afternoon, then there is no way for us to
restore the file, as backups are run at night.

Otherwise it is possible that we can restore a lost file for you.


12.16.1 Requesting a Restore
============================

So you've lost an important file and need it to be restored.  In order for us
to locate the file(s) on our tapes, it is important that you provide us with
as much information about the file in question as possible.  At the very least
we need to know the absolute path to the file (for example
$HOME/subdir/subsubdir/filename) and the last known good timestamp as well as
the approximate time the file was lost.  Send your request to
<admins@cs.stevens.edu>.

When you request a restore, please keep in mind that it will take us several
hours to restore the file.  This is irrelevant of the number of files to be
restored:

Restores can not be done while the current backup cycle is running.  That is,
we will have to wait until the backups finish, which may take a long time.
The restoration process itself also may take several hours, so that in certain
cases it may take more than 24 hours to restore the file.  Under some
circumstances it may be easier or more efficient for you to recreate the file
from scratch.


12.16.1.1 A BAD Example
=======================

``Yo!  I lost this, like, really super-important file.  Gimme back todays
version.  Oh, right, it was called "blob.cpp" or "flopp.cpp" or something like
that.''


12.16.1.2 A Good Example
========================

``I've lost an important file and would like to request a restore.  My
username is "jdoe", the file was located in
"~jdoe/cs115/assignment1/hello.java".  I last saved it on 2004-12-01 around
15:30, didn't touch it for the rest of that day and accidentally deleted it on
2004-12-04 8:00.''


12.17 "How can I copy files from my personal machine to my home directory?"
===========================================================================

There are several ways to copy files from your personal computer to your
home directory. For Windows-based computers, we recommend WinSCP freely
available from http://www.winscp.net.
After opening the program, a screen prompts you for information about
connecting. In the "Host name" field type in lab.cs.stevens.edu and your
user name for the "User name" field. If you leave the "password" field
blank, you will be prompted for it later. Under "Protocol", select "SFTP
(allow SCP fallback)". This option should be the default. You may save
these session settings if you like. Click on "Login." If you have not
connected with this program previously, it will tell you that the
server's host key was not in your cache. Clicking "Yes" will add it to
the cache and you will not be prompted for this again. If you click "No"
you will connect to lab.cs.stevens.edu but will be prompted again the
next time you connect. "Cancel" will cancel your login.
You will have two panels presented to you upon a successful login. The
left panel is the local machine, the right panel is your home directory
at lab.cs.stevens.edu. You can drag and drop files between the panels to
transfer files.

We also recommend using the SSH Secure File Transfer Client that comes
bundled with the SSH Secure Shell available at http://www.ssh.com. Once
this program has been downloaded and installed, open SSH Secure File
Transfer Client.  Click on "Quick Connect" and in the resulting dialogue
box, type in lab.cs.stevens.edu for "Host Name:" and your username for
"User Name:" and click connect. When prompted for your password, type it
in and click OK.  In the "Local Name" section, navigate to the file you
wish to copy to your home directory. Click on the file and drag it to
the "Remote Name" section of the window. The file will then begin
transferring and a status bar will indicate it's progress. When you have
finished, you can disconnect using "Disconnect" from the "File" menu.

**NOTE**
Please be aware that if you open files from the remote host without
first transferring them to the local machine, a copy will be stored
locally in a temporary file. If closed properly WinSCP will
automatically delete the files and will warn you if you attempt to close
improperly that the files will remain. SFTP creates the files but does
not automatically delete them. It does, however, give you the full path
and file name of the temporary file and allow you to delete it from
within the program.

12.18 "How can I set some default options for my X programs?"
=============================================================

The file .Xdefaults is used to set various resources for programs in
XWindows. Resources control the behavior of the X Window programs. The
names of resources that can be set vary among programs and are often
listed in a program's man page.
The general format of a resource setting is:
program*resource: value

For instance, 
xterm*background: #000000 
would set the background color of xterm to black (#000000). Also,

xterm*font: -misc-fixed-medium-r-normal-*-10-140-100-100-c-100-iso8859-1

would set the default font. This particular font would be at size 10. 

xterm*font: -misc-fixed-medium-r-normal-*-20-140-100-100-c-100-iso8859-1

is the same font but at size 20.  More fonts can be found using the
xfontsel(1) program.

A sample .Xdefaults file can be found at 
http://www.cs.stevens.edu/~jschauma/UsingUnix/dotfiles/Xdefaults and
shows several resource settings for xterm and rxvt. 


12.19 "The machine is stuck displaying 'starting ypbind' - now what?
====================================================================

Sometimes when a machine is rebooted, it may fail to boot completely,
remaining in a status where it is stuck and displays

Starting ypbind

If this happens, please hit Ctrl+C -- this will allow the machine to finish
the boot process.  However, you will not be able to log in since ypbind is not
running.  Please email the system administrators -- they will be able to log
in and restart ypbind.

And yes, this is a problem that needs to be fixed.


12.20 "How can I grab a screen shot?"
=====================================

There are a many ways to grab a screen shot in X.

Some of the easiest ways include the import(1) command and xv(1).  Use
'import -help' for a list of options.  If you want to use xv, simply type
'xv', then right-click the xv window and click 'Grab'.

Other options include using gimp(1) (File -> Acquire -> Screenshot) and
xwd(1) (xwd -root -out filename.xwd).

Please refer to the man pages for these programs for more advanced
options.