Notes on Using the Lab for CS 3250 Students


Where do I find the lab? TB 217 (locaed on the ground floor of the TB bldg).

Logging on to the Lab Computers

Log in to the NT machines in the lab with the password "TB217" (without the quotes). There is no password

Logging on To Zonker

Follow these simple instructions:

  1. Click on the pretty "Putty" icon on the desktop. Enter "" for the hostname. Please click on "SSH" for the protocol. Then click OK. It might give you some business about "unknown host key", just click OK.
  2. At the following login prompt, you will need to enter your username, which is arranged thusly: UP TO the first 2 (two) letters of your first name, followed by UP TO the first four letters of your last name.

    Example #1: My name is Robert Frost. My login name is: rofros.

    Example #2: My name is Lao Tzu. My login name is: latzu. Note that because my last name is only three letters long, my username is shorter. There is no need to feel cheated.

    Please note that the username is all lower case. Everyone get it? I sure hope so.

  3. Right after you log in, you will be greeted with a password prompt. Your password, for the time being, is the same as your username. If you care at all about the security of the network (and you should) you will change your password after you log in for the first time. Instructions on how to do this will follow.
  4. Right after you log in, you will be in your home directory. Please make an 'ada' directory by typing mkdir ada. Then, change into that directory by typing cd ada.
  5. You are now ready to use the compiler. (See below on how to do that.)
  6. Once you're done doing what you need to do, type exit at the command line to disconnect and leave.

Note: If you are logging in from home, you will need to dial up to your ISP first, then you can telnet in as per the next step.

Additional Note: If you are logging in from anywhere else (i.e. work, the library, some "Internet Cafe" etc.) you will need to go through whatever steps are necessary to get a local login and gain access to the outside world. You should be getting the idea at this point that you need to get on the Internet to access the lab server.

Telnet Example:

If you have already logged in through SSH you can safely skip this part and jump ahead to "Changing Your Password".

Alternatively, you can telnet into the Zonker server. This is accomplished by typing at the command line: telnet It should tell you that it's trying to connect, and then present you with a login prompt once it's connected.

Those of you who are telneting in from a non-command-line based environment will need to enter the appropriate information into whatever application you are using. Just be sure you get the hostname right (that's and it should work just fine. The following is a real-world example of a telnet session in action:

[mwhitley@listserv mwhitley]$ telnet
Connected to
Escape character is '^]'.

Red Hat Linux release 6.2 (Zoot)
Kernel 2.2.18-mosix on a 2-processor i686
login: markw
Last login: Tue Sep  8 12:01:25 from
[markw@zonker markw]$ 

Note that the password was not displayed when I typed it. This is a security feature. Note also how the last line is a shell prompt with the word zonker in it. This means I've arrived.

Changing Your Password

One of the first things you should do when you log in to the server for the first time is change your password. This is accomplished by doing the following:
  1. type passwd at the command line and hit return.
  2. You will be prompted for your old password. Type it and hit return.
  3. You will then be asked to type your new password. Enter a new password and hit return.
  4. You will then be asked to confirm your new password by typing it again. Do so, and hit return. Your password is now changed.
The following is an example of a password change in action:

[markw@zonker markw]$ passwd
Changing password for markw
(current) UNIX password: 
New UNIX password: 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully
[markw@zonker markw]$
That word "successfully" means that it worked.

FTP Is Your Friend

How do I upload files to the server? Some of you will be doing your homework assignments from home, from work, or from some location other than the lab computer. This means that eventually, you will have to send files to the server. I know this is the case, because that is the only way I will accept your homework. Follow these simple steps to accomplish the task:

  1. Getting connected, and logging in: Basically, all you need to do to get connected is follow the same steps you used for telnet (above) except instead of typing telnet you will type ftp instead. Just as it says in the instructions above, you will be required to enter a username and password to log on to the network.
  2. Setting ASCII mode: Having successfully logged in, you will then be greeted by the friendly ftp> prompt. Since you will be sending up source code, which is plain text, the first thing you will type is ascii to put the ftp program into text mode.
  3. Getting into the right directory: Next, get into the propper directory for the class. Since the class is about Ada, type cd ada. Note the lower-case 'ada'.
  4. Let the uploading begin! Once you're in the right directory, you will type: put localfile where localfile is the name of the file on your local machine. You will need to wait just a moment while it uploads the file, and then you will be told that it is finished and presented with another ftp> prompt.
  5. Logout: Once you're done, type bye or quit to disconnect and leave.

If you're interested in finding out more about ftp, you can type help at the ftp> prompt for a listing of common commands. A really handy one is ls which will show you a listing of files. This is useful for checking to see that your file actually uploaded properly.

You might be interested in using some neat-o GUI app for doing uploads like CuteFTP or some such. If so, I hope you can read help files, 'cuz you're on your own as far as I'm concerned.

FTP Example:

The following is a real-world example of an FTP session in action:

[mwhitley@listserv mwhitley]$ ftp
Connected to
220 FTP server (Version wu-2.4.2-academ[BETA-15](1) Sat Nov 1 03:08:32 EST 1997) ready.
Name ( markw
331 Password required for markw.
230 User markw logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ascii
200 Type set to A.
ftp> put assn1.adb
local: assn1.adb remote: assn1.adb
200 PORT command successful.
150 Opening ASCII mode data connection for assn1.adb.
226 Transfer complete.
5681 bytes sent in 0.0172 secs (3.2e+02 Kbytes/sec)
ftp> bye
221 Goodbye.
[mwhitley@listserv mwhitley]$

Note that the 'Transfer complete' line that showed up at the end of the transfer. This means it worked.

GNAT is your friend

Okay, gang, let's learn how to use the GNU Ada compiler! This assumes you have telnet-ed in and have chdir-ed into your 'cs3250' directory. Here is the typical life cycle of writing an Ada program:
  1. Fire up an editor: There is a nice buffet of editors on the Zonker server. Sensible people will want to use Emacs or Pico. Real men use vi.
  2. Write your program: And keep your Ada book handy, cuz the online help is pretty skimpy, if not non-existant.
  3. Invoke the compiler: This is done by typing gnatmake filename from the command line where filename is the name of your program file. Most all editors will allow you to escape to a shell so that you don't have to constantly exit and re-enter the editor between compiles.
  4. Lather, Rinse, Repeat: Look at the errors / warnings the compiler spits out, fix 'em, and recompile. When your program is error-free and runs like a charm, log out, 'cuz you're done.

An Important Note on Naming Conventions

No, I am not going to talk about how you should name your variables, rather I'm going to lay out how I want you to name your files.

Firstly, all ada programs must end with the suffix .adb. Why end in .adb and not .ada? Dunno. It's a mystery. If any student can provide me with an answer, they will be awarded extra credit.

Secondly, I want you to name your homework assignments according to the assignment number. This means the first assignment will be called assn1.adb, the second will be called assn2.adb, the third will be called assn3.adb and so forth.

Why is Mark making us do this? Here's why: I will write a script which will race through your 'ada' directories on test nights (when assignments are due) and find out who's got assignments turned in and who doesn't. This is to make correcting assignments easier on me; it's a selfish motivation. Hopefully it will make things easier on you too, but I wouldn't count on it.

GNAT Example:

The following is a real-world example of the GNAT compiler in action:

[markw@zonker cs3250]$ gnatmake assn1.adb
gcc -c assn1.adb
assn1.adb:2:11: warning: file name does not match unit name, should be "hello.adb"
gnatbind -x assn1.ali
gnatlink assn1.ali
[markw@zonker cs3250]$
Note the warning in the output of the gnatmake command. This is because my main procedure name is different than the file name. You don't need to worry about this. If it really bugs you, you can change the name of your procedure, but don't you dare change the name of the file.

You might also notice that if you do an ls after compiling your programs, there will be a few intermediate files generated that end in a .adi and .o suffix. Don't let those scare you. We'll talk about why those are important in class.

Any Questions?

If you have any questions as to how any of this stuff should work, ask the lab aide, ask a fellow student, or ask me. Whatever you do, don't remain silent; you need to know how to use the lab.