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,

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.

Getting UNIX account set up

  1. Get an ECC Unix account.
    1. You can get an account by going online to the ECC Management Account Portal
      For this class you want an ECT account. Distance students too - this might be necessary due to firewalls at your location.

  2. On campus use of PCs Logging on:
    First, make the Domain choice be ECC
    (other (undesired) option is 0251-xx (this computer) - where the xx is the number for that specific machine and 251 is the room number)

  3. You can change the password on the windows machines if desired but need three of the 4 character types (numbers, symbols, capital, lower)
    Ctrl Alt Delete will open a window which has an option to change Password. Note that this will change the password for the Windows machine login but not for other UNIX logins.
    If you have numbers in the passwords, do not use the keypab on the side - instead use the numbers above the letters. For some reason that seems to work better.


Getting account on the WEB SERVER set up, making a home page and creating folders with links

Your Unix account and the web server are on two separate machines. Thus you need to get the account on the web server going as well.

  1. With the tool WinSCP, we can both move files back and forth between our PC's and the campus UNIX machines as well as edit files on UNIX and give commands there. In the past, we needed to use two tools, FTP and puTTY (or telnet) to do this. For those not familiar with either of these tools, I suggest WinSCP. The first thing to do is become familiar with the tool. Here is a demo page. READ it to know how it works.
    You may need to go back to this demo page to remember how to do the things I tell you to do below.

  2. Create a personal web site on the ect servers by opening a terminal on WinSCP (or using Putty) to get a command prompt on the UNIX machine and typing the following command. 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. You should be able to see it in the WinSCP window. Click on the public_html directory to change into it so we can create a short web page. If you were on a UNIX machine you do this with the command:

    But with the WinSCP tool you can just click on the folder icon.

    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.
    If using WinSCP you can see where you are just like on Windows (note drop down menu with file picture). You simply click on the directory you want to be in.
    On a UNIX machine, try the command

    This returns the name of the directory you are currently in. If you are already in your public_html/csci111 (or public_html/csci15a) then you want to do or click on the lab1 folder icon in WinSCP. Ultimately you want to be in public_html/csci111/lab1 at this point.
    If you want your prompt to be the directory you are in rather than the $, see this page


Doing a First Java Lab on the Web

  1. Now lets get started with lab 1. Once you are sure that you are in the correct folder (public_html/csci111/lab1) you want to create a new file named Now you should be in the 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. For a shortcut, you can cut and paste from this page to the new file. You should save this file and then exit the editor. Now open a command prompt and 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. We will look at permissions later. Another way to do this with WinSCP is through Files:Properties

    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 WinSCP (and/or Putty session) should still be open.

  2. Go back to your WinSCP session and create Java program (so far you made an html page) by creating a new file with the name HelloWorld.java

    Now type in the following program into the file and save it once done (or you can use the Swing version and JApplet. even easier)

    Don't forget to SAVE and then Exit once you are done entering the program.

  3. On the UNIX side, enter the following command to compile the program and convert it from the text we typed into a form the computer understands. 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. Edit your already created lab1.html file in order to enter the following line into the lab1.html file before the last    </body>    and    </html>    tags. Save again and exit.

    Get a UNIX command terminal and type the following command

    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 (or you can make this file using WinSCP)
    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

    • ls    list files and directories in the current directory.
    • ls -F    lists, but distinguishes directories with slash
    • cd    change directory
    • pwd    path name of the current working directory
    • man    manual pages
    • mv    move a file: usually used with two arguments (2 files or 2 folders) mv file 1 file2 will rename file1 to the name file2
    • rm    remove a file careful with this one!
    • pico    simple text editor
    • pine    simple email program
    • java    Java virtual machine is used to run Java based programs
    • javac    Java compiler
    • mkdir    create a directory
    • websetup    create a space on the ect web server to host your web pages ( not standard Unix )
    • more    view a file
    • help    list the help file which includes a short introduction to the Unixcommands
    • lynx    a text only web browser

    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 jaguar.ecst.csuchico.edu, IP address: 132.241.6.22

    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