CPS 116 (Fall 2006):
Introduction to Database Systems

Course Information   Lecture Notes   Assignments   Tentative Syllabus   Programming Notes   Blackboard (Grades)
Getting Started with rack040   Getting Started with Gradiance   Using ra   DB2 SQL Notes   Tomcat Notes   XML Notes

Getting Started with rack040


Index


General information

Most of the programming work in this course can be completed on rack040.cs.duke.edu, which is a Linux (CentOS) erver running the IBM DB2 database server. Please be considerate in using this server since it is shared by all students in CPS116 and CPS216. Refrain from running anything unrelated to the course. Quit all your applications and log out after using the server (in the past, we have found idle XEmacs processes to be the top culprit in server slowdowns). If something terminates abnormally, kill any runaway process manually (e.g., J2EE application servers, if not shutdown properly, can leave dozens of Java virtual machines running). You can see what processes you have currently running using the Unix command "ps f", and you can kill a process with pid using "kill -TERM pid" (or if that does not work, "kill -KILL pid"). To kill all your processes, try "kill -KILL -1" (which will also log you out).


Logging in and out

In the following, your "work computer" refers to the machine from which you access rack040 remotely.

Use your favorite SSH client to log into rack040.cs.duke.edu remotely. For example, if your work computer is a Unix/Linux or Mac machine, run the following command (replace user below with your rack040 account name) from your Unix/Linux shell or Mac terminal:

ssh rack040.cs.duke.edu -l user
If your work computer runs Windows, you can use SSH.com's SSH client, which can be downloaded here from Duke OIT. Other SSH clients are also okay.

After logging in, you should be inside your rack040 login shell, which is bash by default. If this is the first time you log in, remember to type the Unix "passwd" to change your default password to something more secure. After you are done using rack040, remember to log out using the Unix "exit" command.


Advanced SSH setup

You need to use advanced SSH setup if any of the following applies: (1) You would like to launch X windows applications (such as firefox and emacs) from rack040 and run them from your work computer. (2) For security reason, access to most of the ports on rack040 has been blocked. However, you would like to host your own services (such as Web servers) on rack040, which must be accessed through these blocked ports.

To perform the SSH setup, follow the appropriate instructions below.

If you use OpenSSH

OpenSSH is usually available by default on Linux/Unix or Mac machines. It is the command ssh that you run through the command-line interface of a Linux/Unix shell or Mac terminal.

  1. Log into rack040, and run the command "/home/dbcourse/bin/gen-my-ssh-config.sh > ~/rack040-ssh-config". This will create a file containing SSH configuration information in your home directory on rack040. Log out.
  2. From your work computer shell/terminal, run the command "scp user@rack040.cs.duke.edu:rack040-ssh-config ~/", where user is your rack040 account name. This command will copy the SSH configuration file you created from rack040 to your work computer.
  3. From this point on, to log into rack040 from your work computer shell/terminal, run the command "ssh -F ~/rack040-ssh-config rack040.cs.duke.edu". The extra option tells ssh to set up X11 forwarding and appropriate tunneling.
    To see how what default tunnels have been set up for you in rack040-ssh-config, run the command "/home/dbcourse/bin/show-my-ports.sh" on rack040. There is no need to change the default settings unless you want to run other services not supported by the course staff. If you do, please take a note of the range of ports reserved for you (shown at the beginning of the output from show-my-ports.sh). Do NOT run services outside this range as it may conflict with the services run by your classmates.

If you use SSH.com's SSH client

SSH.com's SSH client can be downloaded here from Duke OIT. Instructions below may apply to other SSH clients (such as F-Secure) too, with little modification.

  1. Log into rack040, and run the command "/home/dbcourse/bin/show-my-ports.sh". Take a note of the default settings (you might want to copy then down to a piece of paper). A typical line of default settings looks like the following:
        ServiceName    LocalPort    PortOnRack040
    
    There is no need to change the default settings unless you want to run other services not supported by the course staff. If you do, please take a note of the range of ports reserved for you (shown at the beginning of the output from show-my-ports.sh). Do NOT run services outside this range as it may conflict with the services run by your classmates.
  2. Go to "Edit->Settings", and find the setup for "Tunneling". For each line above, add an "Outgoing Tunnel" as follows (replace ServiceName, LocalPort, and PortOnRack40 with appropriate values from the line):
    • Display name: ServiceName
    • Type: TCP
    • Listen Port: LocalPort
    • Destination Host: rack040.cs.duke.edu
    • Destination Port: PortOnRack40
    Also, find the setup for "X11 tunneling", and choose to tunnel X11 connections. When you are done with the setup, go to "File->Profiles->Add Profile", and add the profile with name rack040. Finally, go to "File->Save Settings" to save your setup.
  3. From this point on, to log into rack040 using your SSH client, simply choose the connection profile rack040, and X11 forwarding and appropriate tunneling will be set up automatically for you.

Reporting problems

Send email to Jun (junyang@cs.duke.edu).

Last updated Thu Oct 19 00:34:21 EDT 2006