CptS 203: Getting Started


  1. Finding a computer.

    The computers for this class are located in Sloan 353 which is actually a collection of four rooms.  This lab is open 24 hours a day, but the building is not.  So, if you want to work all night long, make sure you are in the lab prior to 11:00 p.m.  For a first-time session, you should probably go beyond the first two rooms to locate a computer (though many of the ones in the first two rooms will work for you as well).  The first time you attempt to log on, make sure you have found a machine displaying the Windows log-on information (it should not say "redhat" and have a logo of a person wearing a red hat in the upper left corner of the screen).  Your login name will usually be the first letter of your first name followed by up to seven letters of your last name.  For example, if your name is John Schneider, your login name will be jschneid.  If your name is Sarah Hill, your login name will be shill.  Your password is your student ID number.  There are exceptions to this.  For example, if somebody has previously had an account who has the same first initial and last name as you (at least up to seven letters), then your account name will not be "standard."

    If you have any trouble logging in, see the helpful folks at the EECS help desk immediately!  The EECS help desk is in Sloan 358 (across the hall from the computer lab) and the phone number is 335-6773.  Don't bother coming to see me since I cannot set up or change accounts.

    Note that your login name corresponds to your EECS email address.  Just tack on @eecs.wsu.edu to get the full address.  If you want to send email to Sarah Hill, you would address it to shill@eecs.wsu.edu (actually, you can just send it to shill if you are sending it from one of the EECS machines). Note that my login name, schneidj, doesn't follow the convention.  If you want to send me email, you'll have to remember that.  We'll have more to say about email in a bit.

  2. Setting password (part I).

    After you get past the Windows log-in prompt, you will be asked to change your password if this is your first time using an EECS account.  Give some suitably cryptic password (think about it a bit and make sure you remember it!).

    That's it for Windows!  That is the last you we will see of Windows in this class.

  3. Rebooting computer.

    We now need to shutdown Windows and reboot the computer into Linux.  Read all of the instructions in this item before you do anything else.  Click on the Start button in the lower left corner and select Shutdown.  A window will pop up that asks "What do you want the computer to do?" Select Restart and then click on OK.

    Windows will say various things about the shut-down.  The screen will go blank for a couple of seconds and then the computer will start coming back to life.  Something may be displayed about an Intel motherboard and then, finally, you will see a screen that says RedHat Linux and on the left side of the screen will be "windows2000" and the "linux", written one above the other.  Hit the down arrow (i.e., the down cursor key) once.  This will cause "linux" to be selected, and then hit enter.  Don't wait too long to make this selection or the machine will boot back to Windows.

    Linux will now take over the computer.  Since Linux users are nerds, you will see lots of diagnostic messages about how the reboot is proceeding.  You can ignore all those.  It takes around two minutes to get from Windows to Linux.

  4. Logging in under Linux

    Eventually you will be shown the log-in window.  Enter your user name and password.  There is a chance that it will take a few minutes for your new password to propagate through our various databases.  If you don't get in at first, wait about three or four minutes and try again.  If you continue to have problems, go see the helpdesk folks.

    After you successfully log in, you will be shown a "Gnome Hints" window.  You may not find these very useful so feel free to click on the button to disable the future display of this window.

  5. Starting a terminal.

    You now need to start a "terminal" to be able to communicate with the computer.  Click on the icon on the bottom that looks like a screen with a foot in front of it (if you move the cursor over this icon, it will say "Terminal emulation program").  After you click on that a window will pop up with a prompt that is the computer (host) name followed by a percent sign (e.g., pc353a1-24%).  You now having a running UNIX shell (the C shell, to be precise) and can issue all the commands you want.

    In case you are like I am, you prefer black text on a white background which is not what you get by default.  To get that, click on Settings at the top of the window and select Preferences and then Colors from among the various tabs.  For the "Fore/Background Colour" (I guess somebody is British?), select "Custom colors".  Then click on the little square of color next to the foreground field and select whatever suits your fancy.  Similarly for the background.

  6. Setting password (part II).

    IMPORTANT!  We have one more password change we have to make to ensure that your UNIX passwords are well protected.  In the terminal window issue the command "yppasswd".  Enter your old password (which should still be your user ID) and then your new password (which should probably match what you entered for your new password under Windows, but doesn't need to -- this password is needed for various machines around the School that you won't be using).

  7. Editors.

    Now, you must decide what editor you will use. There is no single best choice.  Valid arguments can be made for using any number of editors.  However, I strongly encourage you to learn the emacs editor but if you aspire to be a real nerd, you may be interested in using vi (which is available pretty much universally on UNIX systems).  If you decide to use an editor other than emacs, I'm afraid I won't be able to help you if you have any editor questions.  emacs has a built-in tutorial that you should find helpful (this tutorial is how I first learned how to use emacs and it provides you will all you need to know to get going).

    There are two important advantages emacs has over vi (though some purists would also argue that these are disadvantages).  First, it is a full-blown X application.  When you type emacs on the command line, a new emacs window will pop up.  You can use the mouse to select text, access pull-down windows, reposition the cursor, etc.  Second, emacs is sensitive to the type of document you are editing and will modify its behavior accordingly. Thus, when you edit a file that ends in .f, emacs knows that you are editing FORTRAN source code and will help you along (more on that later in the class).  Although emacs is an X application, it can be used as a traditional screen editor directly from terminals (this can be important if you are accessing the system via a terminal emulator over the phone lines).

    To start emacs, type the following on the command line

      emacs &
    
    (The & just puts emacs into the background and returns your command-line prompt to you right away.)  You now have an active emacs session with which you can work.  You can use the mouse to click on the text at the top of the window to access the pull-down menus.  At this point you should probably click on Help, hold the mouse button down, scroll down until Emacs Tutorial is highlighted, and release the mouse button.  Please work your way through the entire tutorial.  That really should be enough to make emacs a usable editor for you.

    When you start emacs you can also give the name of the file you wish to edit.  For example

      emacs mombo.f &
    
    will start the emacs session such that you are editing the file mombo.f.  If this file didn't previously exist, it will be created.  If you don't supply a file name on the command line (and even if you do), you can use the File pull-down menu after emacs has started to open files (you can have multiple files open for editing at the same time). I would suggest the first thing you do with emacs after working through the tutorial is open a file called .emacs (yes, you do want that dot in the front of the file name) and put this in that file:
      (global-font-lock-mode t)
    
    That's it.  Now save the file.  In the future, this will turn on the colorization of fonts in emacs and this helps make computer code a bit easier to read (for example, comments in a FORTRAN program will now appear in red).  Note that is if you list the contents of your directory (how you do that is explained later), you will not see the .emacs file.  Files that start with a dot are not listed by default.

  8. Web browsers.

    The supplementary material for this class will come mostly from the class web page.  To access this material you need to use a web browser.  I recommend that you use either netscape or mozilla (mozilla is essentially a few steps ahead of netscape development).  On the command line, type

      mozilla &
    
    or, click on the netscape icon on the bottom of the screen (the big white N).  Be patient.  Eventually, a window will appear.

  9. Email.

    IMPORTANT!  The first thing you should do in the browser is click on the Location field and type

      http://mailserver.eecs.wsu.edu
    
    followed by Enter.  You will now set up our mail server so that the mail that is delivered to your EECS account actually makes it to you.  (Don't worry, there shouldn't be much traffic coming from this address, so spam shouldn't be a problem.) You will see a field that says "Your E-Mail Address" and it already has "@eecs.wsu.edu" filled in.  Add your user name to the beginning of this.  Then, fill in the "Mail Account/POP3 Password" with your password (this should be your the password you entered when you updated your password on Windows, but it may still be your user ID number -- try one and then the other if the first doesn't work).  Then click on the "Authenticate" button.  The second item on the subsequent page says "Select Mail Delivery Method." Click on that.  You now must do two things:

    1. Click on the "POP3 Delivery" button so that it no longer appears depressed.

    2. Fill in the forwarding field to say where you would like your mail delivered (e.g., tree_hugger@yahoo.com or clear_cut@husqvarna.com).

    In the future, if your "real" email address changes, you can go back to this site and change the forwarding appropriately.

    If you do not have email services provided elsewhere, you can potentially use the School of EECS to provide you with all your email needs.  However, I am not prepared or able to instruct you how to go about this.  You will need to either use Outlook under Windows or something like mutt under UNIX.  You'll have to check with the helpdesk folks for more details.

  10. Logging out.

    When you want to log out, click on the foot-shaped icon in the lower left corner of the screen.  From the pop-up menu select Log out and click on OK when asked to verify your selection.

    Be sure you have properly logged off of your account!  When you see the log-in window again, you're safe.  Remember, if somebody ends up with your files, you could fail the course.  Keep your account secure!

    If you need to return to Windows after using Linux, you can again reboot the machine.  To do this, click on "System" at the top of the log-in window, select "reboot" and verify your selection.  When it gets to the boot prompt where you previously selected Linux, now leave the default selection as "windows2000" and just hit Enter.

  11. Logging in again.

    In the future, if you come to a machine and find the Windows log-in window, you do not have to log into to Windows to reboot the machine.  You can just click the "Shutdown" button that appear on this log-in window and proceed as outlined above.


Basic UNIX File and Directory Manipulation

NOTE: Please refer to the man pages (i.e., the "manual" pages) if you want more information on the following commands.  For example, at the command-line type man ls to obtain all the details about the ls command.


Compiling

To compile a FORTRAN program, you can use the g77 compiler.  To compile a program called hello.f on one of the Linux workstations, you would type
  g77 -Wall hello.f
The -Wall flag tells the compiler that you want the compiler to give you all warnings (some things may be valid FORTRAN but of a questionable nature).  If there are no bugs, the compiler works "silently."  When it is done there will be an executable file named a.out in your directory.  On the command line you merely type a.out to run it.  If you want to have the compiler name the executable output something else, you can specify the output file name using the -o flag.  If you want to call the executable hello, you would enter
  g77 -Wall hello.f -o hello

Finally, note that the executable code compiled on one type of computer or for one type of operating system will not run on another type of computer.  So, code compiled on a Linux workstations will run under Windows machines (even if the computer hardware is the same).  However, the whole point of higher-level languages such as FORTRAN and C is that they are machine independent.  If your FORTRAN source code is valid, it should compile and run on any machine on which you have a FORTRAN compiler.  If you happen to have access to a FORTRAN compiler on another machine and prefer to work there, that is fine with me. However, ultimately you will have to submit your programs and you must do that via the lab machines.

I absolutely will not accept emailed programs.  You can put your programs on a DOS-formatted disk and bring them into the lab machines.  Put the disk in the floppy drive and then issue the command:

  mount /mnt/floppy
You can then cd to /mnt/floppy and find the contents of the disk (or copy files from there or do whatever you like).

IMPORTANT!  When you are done with the floppy you must issue this command before removing the disk from the floppy drive:

  umount /mnt/floppy
You have to do this so that all the buffers are flushed and the disk is put in a pristine state.  If you don't do this, you may corrupt the disk.  Also, make sure you are not cd'ed onto the floppy or have any of the files on the floppy open when you issue this commands.  If you are doing anything with the disk, you'll get a message that says the device is busy.  Just cd back to your home directory (or close the files or whatever) and reissue the umount command.


Back to CptS 203 homepage.

John B. Schneider, schneidj@eecs.wsu.edu, January 13, 2002.