To do these lab exercises, log in to your Math/CS account and open a terminal window.
Type "mozilla" and wait for Mozilla to launch. What happens in the terminal window? What happens in the terminal window when you quit mozilla.
Do it again, and wait for Mozilla to launch. Now type Ctrl-C in the terminal window. What happens?
Type "mozilla&" and wait for Mozilla to launch. What happens in the terminal window (that is, what effect did the ampersand have)?
Type "top". top allows you to view the processes that are running on your machine. While top is running, type A and then Enter. This sorts the processes by age, so you should see the processes you have launched at the top of the display. Note that Mozilla (assuming you are running it still) is near the top, as is top itself.
Keep top running and open a new terminal window. Edit some file with pico. What happens in the top display in the other window?
Exit top by typing q.
You are currently logged in to the computer that is physically right next to you. Now we're going to connect to prism.mathcs.carleton.edu, which is in the locked room in CMC307. Type "ssh yourusername@prism.mathcs.carleton.edu". If you are asked a complicated question about trusting the key from prism, say yes. Enter your password when prompted.
Now you're in your account again, but on a different machine. Because prism and the machine in front of you use the same collection of files, this is not very exciting. However, you can use the same ssh command to connect to prism from elsewhere (from a Terminal window on a MacOS X machine, for example, or on a Windows XP machine if you have installed ssh).
Try typing "mozilla" at the prism prompt. What happens? Why do you think it happens?
Type "top" at the prism prompt. Who else is logged on to prism? Can you tell what they are doing?
Quit top and type "exit" at the prism prompt to log out from prism.
ssh, by the way, stands for "secure shell". A shell is a program that accepts your commands and then executes them. The terminal window program is a shell. A secure shell encrypts everything you type before sending it to the destination machine. Thus, for example, your password is encrypted before being sent to prism. prism then uses a "key" to decrypt the password to check it for correctness. We'll talk a lot more about encryption sometime in late May.
We talked about the RFC's in class the other day. Let's go get an interesting one, as an illustration of the "File Transfer Protocol", and how it is used to move files around.
Type "ftp ftp.rfc-editor.org".
When asked for a user name, you should type "anonymous". For a password, use your actual e-mail address (that's the polite thing to do, though it is not technically required--you can type gibberish for a password if you wish).
Type ls to see the many directories in the rfc editor's FTP repository.
Type "cd in-notes", and then "ls" again. That's all the RFCs--how many of them are there?
Type "get rfc2235.txt".
Type "quit".
Now that you're back at your normal prompt, use "ls" to see whether the file is in your account. Use "more" to look at it. Read as much as you wish.
In class the other day, I showed how you can use the "telnet" program to talk to a web server in its own language. Let's start by talking to a simpler server--the "daytime" server. The daytime server, if running on a particular machine, "listens on port 13". That is, when you ask to speak to the process that is associated with the number 13 on a particular computer, that computer will send your request to the daytime server. Most computers do *not* have a daytime server.
The National Institute of Standards and Technology has a daytime server. To talk to it, type "telnet time-b.timefreq.bldrdoc.gov 13". The conversation will be brief. What happens?
Now let's talk to the web server on www.mathcs.carleton.edu. Type "telnet www.mathcs.carleton.edu 80".
No prompt will come back. Now type "GET /faculty/jondich/cs107/index.html HTTP/1.1" followed by the Enter key, then "Host: www.mathcs.carleton.edu" followed by Enter twice.
Do the same thing again, but with "HEAD" instead of "GET". What information do you get? Does it make sense?
Try getting a file from somebody else's server this way. Try to get Google's home page, for example.