CSCI 111 LAB 1

	 Lab Time(s) 
	           

Assignment due: no date for video, otherwise see schedule
Worth: 10 points

Welcome to the 111 lab session,
For a version of this lab that uses WinSCP rather than ssh, go to this page .
WinSCP is easier for new users.

Today's Tasks: There are a lot of steps to do here. Make sure that you think about what you are doing at each step. As the course goes on, you need to do some of these steps over and over. Hence you want to know what you are doing so you can repeat them. Don't just do them, think about what you are doing. Take your time.

One of the primary goals in this lab is to get you used to working with a "remote" machine (often a PC in a lab setting or your home machine) and the campus UNIX machine where your web pages will be placed. You need to become accustomed to going back and forth between machines.

  1. get an ECT Unix account. Off-site people can get an account here as well. This might be necessary due to firewalls at your location. For Chico students, this can be done by going to O'Connell 136. One of the machines there (as you walk in by the soda machine) has a little device in which you can swipe your student ID card so that the machine can identify that you, indeed, are taking a computer science course. Bring your valid student ID. For more specifics, see here (The accounts set up in the library are wildcat accounts - for this class you want an ECT account.) This is the same as the pine email account. If you don't have any account during lab time, watch the steps as someone else goes though them and perform these tasks at a later time.

    If you have problems getting the ECT account but you do have a wildcat account see this

  2. use ssh ( putty on the local PCs) to logon to your Unix account......depending on your registration you will connect to one of the following systems, *additional machines*

    If you do not get onto tiglon, you need to see the sys ad and tell him you need an account on the SUNs.

  3. Create a personal web site on the ect servers by typing the following command at the dollar sign prompt.
      websetup -c
    see
    this page if problems. Capital C just creates the directory; Lower case c makes an example index.html

    This will create a directory called public_html in which you will place your web pages for display on the web. Enter the following command to change into the public_html directory so we can create a short web page.

    Now, to set up your directories for the whole course and create a short web page, you should now use my "cheat sheet" . At this point only do numbers 1 to 4 of the cheat sheet so you do not get too confused. Notice you have already done some of number 1. OK, go do it.
    When you come back to this point, you want to get into your lab1 directory. How do you do that? It depends on where you are now. Try the command This returns the name of the directory you are currently in. If you are already in your public_html/csci111 then you want to do Ultimately you want to be in public_html/csci111/lab1 at this point.

Doing the First Java Lab

    Remember, you need to be in your public_html/csci111/lab1 directory.

  1. Now lets get started with lab 1. Do this command Now you should be in the pico editor and editing the file lab1.html. Enter the following text to create a short web page, enter your name where it asks for it. You can save this file by typing ctrl-o (which means hit the control key and the o) then hit return and then exit pico by typing ctrl-x. (ctrl is Control. On some tools (like pico), it uses ^C or ^X to mean hit the Control key and c or the Control key and x) Now type the following command so that your page can be viewed by others. The chmod command changes the permissions on the file so that others may read and use it. Now startup Firefox (i.e., a browser window) and open the following address to view your web page......substitute your login in the address. Your putty session should still be open. If you have not gotten your ect account yet and are working with your wildcat account, the web address is
    http://web.csuchico.edu/~your_wildcat_login

  2. Go back to your ssh/putty session and enter the following commands to start up pico and create a Java program
      pico HelloWorld.java
    Now type in the following program into pico and save it once done (or you can use
    the Swing version and JApplet. even easier) Don't forget to SAVE and then Exit pico once you are done entering the program.

  3. Enter the following command to compile the program and convert it from the text we typed into a form the computer understands.
      javac HelloWorld.java
    You should get a file called HelloWorld.class as a result of compiling. If you get an error return to task 4 and make sure you typed in the code correctly. Repeat steps 4 and 5 until the program compiles with no errors.

  4. Using pico (from the ssh session do the command pico lab1.html again) enter the following line into the lab1.html file before the last    </body>    and    </html>    tags.
      <applet code="HelloWorld.class" height=75 width=150> </applet>
    Save again and exit pico.

    At the dollar prompt (on the ssh/putty session) type the following command

      chmod ugo+rx *
    and then go back to Firefox (i.e., your browser) and reload your web page. You should now see the applet being displayed in your web page.

  5. Submission:

    Finally. Now that you have a UNIX account, you have both a website and a new email address. If you do not want your mail to come to this address (you can read it by using the command pine) you can create a new file that will redirect your mail to where ever you want. To do so,

    1. go to your top level in UNIX (you can do this with the command cd...just simply type cd and hit return)
    2. give the command pico .forward to edit a .forward file
    3. type in the address where you want your email redirected to and then hit return to get to the next line
    4. In pico, Ctrl o (as in oh) saves, do this, then hit return to keep the name .forward
    5. In pico, Ctrl x exits. Any new mail that comes into this account will now go to where you told it to go

    Unix Commands

    Help Full Web Sites


    SUN workstations

    If, for some reason, these machines are not connecting for you, you can also log onto the SUN workstations. Presently, all SUNs should be available through a connection to ect-unix.ecst.csuchico.edu which defaults to tiglon.ecst.csuchico.edu, IP address: 132.241.6.18

    The list below should all work now as well but ect-unix is your best bet.

    Some on the .6 subnet

    and some on .7