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 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, you can get an account by going to O'Connell 249 between 3:30 and 5 M-F. The system administrator will be there at that time to open an account for you. Bring your valid student ID card as well as your (portal) student number.
    (The accounts set up in the library are wildcat accounts - for this class you want an ECT 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.

  2. On campus use of PCs The first time you log onto one of the PCs in the campus labs, you will have a temporary password. Note that the PCs have a different password than the one that you may have set when you signed up for your unix account. On the PC, for the first time you log in, your username will be the same as what you stated with your unix account, but the password will be your username and the last four digits of your student (portal) ID number. Specifically, if your username is fred and the last 4 digits of your student ID number are 1234, then your initial password is fred1234. You should log on with this username and password and then you are immediately prompted to change your password. If you are not prompted to change the password, do Ctrl/Alt/Delete. This gives an option of Change Password at the bottom left.
    May I suggest that you use the same password as your unix password so that you have the same username and password for both the ECST PCs and UNIX. 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.

  3. 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.

  4. 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 the First Java Lab

  1. Now lets get started with lab 1. In 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.

    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 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
    • 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.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