Lab 2

Geol 300: Word processing, HTML, and a little Unix

Due February 7

 

 

Goals:  Learn how to create a simple document using Microsoft word on either a PC or a Mac.  Create a simple web-page and transfer it to rohan.

 

Stuff to be completed/handed in:

1)      A Word document with answers to the various questions in this lab, as well as the equation and table and the URL of your new web-page.  (50%)

2)      A web-page that I can look at on rohan. (40%)

3)       An email telling me where the web-page is on rohan. (10%)

 

 

 

Part 1. Microsoft Word

 

Note – I will try to write these instructions so that they work for both CSL 427 and the computer lab in the geology building (GMCS 244). You should have (and will need) card key access to this room. If you do not, see me. To log into the computers in the PC lab, you may need the username “geolab” with the password “baja”. You may want to print out the lab in the PC lab or at home. Most of the computers are PC but there are also several Mac’s and some Unix boxes. The goal here is to start using word (if you haven’t already) and learn how to use help.

 

PC

Go to the start button (lower left), programs, microsoft office, word.

 

Mac

These are new machines and there are four of them in the computer lab. They have a big apple on the side. Try starting word on them. Use the bar at the left. Move the mouse over the icons to figure out which one is word.

 

Try clicking on the X11 icon. This should open up a terminal window. Type “ls” – it should work the same as a Unix machine (which it is at a low level). You can also use the ftp command, for example “ftp rohan”.

 

 

Using Word

 

You should see a large window open with the words "Microsoft Word" at the top.

1.) Type in your name and date. Align it to the right. Type in something else- at least three lines. Select it. Copy it and paste it twice. Select each version and change the font and size. Also make one line bold and one italic and one italic and underline.

 

2.) Go under helpMicrosoft word help -  index - type in page – then read the section on creating web-pages. Note that there are several options that may come up under help, depending on whether the assistant is enabled. Pick the one that you like best.

 

3.) Go under help ŕ index - type in equation and follow the directions to run Microsoft equation editor. Type in this equation (equations may not be visible in “normal” layout [under view]).

 

Bonus points: what is S?

 

4.) Create the following table (3 rows by 3 columns with the last column half the width of the others).

 

X

0

0

0

X

0

X

0

X

 
Either go under table and try it or try using help.

 

5) Images. Importing images into word from other programs. This can be useful. One way on a PC, try cntl- PrintScreen (whole screen) (or cntrl-alt PrintScrn – individual window), then Edit, paste special. What does this do? Then if you right-click on the image, you get a menu to resize or change the layout. A frequent problem is having the image ‘jump’ around to places that you don’t want on the page. Changing the layout to ‘tight’ is sometimes useful.

 

6.) Fire up internet explorer, go to google (www.google.com), then do a search on “Microsoft word tricks”. Find one and try it. Explain what it does in your lab and show an example, if possible. For example, what does typing “=rand(4,5)” do?

 

7) Name one difference between word on a PC and word on a Mac.

 

7.) Printing. If you are in the PC lab, you can print directly to the printers (assuming it has ink and paper, which isn’t always the case). If you are CSL 427, you have several options. You can save the file to a zip or memory stick, email the file to yourself, or transfer it to rohan using ftp. Your call.

 

 

Part 2.  Web-page creation.

Note: There are several zillion web-creation programs available. Some are free and some cost money. Web-pages require that the content is written in a language named HTML. This can be typed in directly or created with a program. We will use word to automatically create the web-page at first, since we are already using word.  It’s not the best way but is quick and easy. To make a web-page, we need to create a file named index.html (or index.htm) and put it in a directory named public_html on your rohan account with the proper permissions. It will then appear as a web-page. Files named index.html (or index.htm) are automatically placed as the top file in your web-page.

 

In word, open a new file and type in your name and center it.  Under file use "save as HTML" and name it index.html. (note that files left on the desktop may get deleted after a few days).

 

Start up your favorite browser (e.g. netscape or internet explorer) - open page - choose file and then find your file (this may be tricky) and load it (On a Mac, go under open page). What does it look like? Go back to word and add a few words and save. Hit reload on the browser. Alternately, you can click on your directory and then double-click on the file to start the browser.

 

Under file, open your lab assignment. If you go under window, you should be able to switch back and forth between the two files within Word. Select the equation and copy it from your lab assignment. Then paste it into the word version of the html file. Save the file as “index.html”, then reload it in the browser. Do the same for the table. You can also switch between Word and Netscape.

 

Setting up a homepage on rohan.

Start up Netscape or Internet explorer and go to the URL http://www.rohan.sdsu.edu/permis.html. This shows the same information as in the lab, but may be easier to follow.

 

Now we want to transfer the file to the machine “rohan” so that we can start building a web-page. First, we need to do to set file permissions on rohan so that people can see your web-page.

 

Logging in to rohan.

 

On PC’s go to start, run, and then type telnet rohan.  This should open a window which will allow you to login into rohan. On Mac, try opening an X11 terminal (click on X11 at the side), then type telnet rohan.

 

You should see something like this:

SunOS 5.6

 

This system is for the use of authorized users only.  Individuals using this computer system without authority, or in violation of state or federal laws are subject to having their activities monitored by law enforcement officials

 

login:

 

Type in your username and password for rohan. You should see some message and then:

 

rohan%

 

Rohan is unix. It is a “command line” operating system (at least, using telnet). You need to type in what you want to do using commands. This may seem like a pain in the neck compared to using a mouse, but once you know it, it has significant advantages. Trust me.

 

Type in “ls” and hit return.

 

rohan % ls

 

This shows the file in your directory. Now type in “ls –l”

 

Rohan% ls –l

rohan% ls -l

total 264

drwx------   2 rmellors rmellors     512 Feb 23  1999 bin

-rw-r--r--   1 rmellors rmellors     187 Feb  9  1999 hello.html

drwx--x--x   6 rmellors rmellors     512 May 26 15:13 public_html

drwx------   2 rmellors rmellors     512 May 19 10:27 tmp

 

 

This shows information about all the files in the directory (it will be different for you).

The first column shows permissions, the third column shows the owner, the fifth column shows the size of the file, and the last column shows the name. What do you think the sixth column shows?

 

But it shows an important feature of Unix, that commands have many variants. Now type “man ls”. This should bring up text that looks like this (hit spacebar to continue).

 

rohan% man ls

Reformatting page.  Wait... done

 

User Commands                                               ls(1)

 

NAME

     ls - list contents of directory

 

SYNOPSIS

     /usr/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file...  ]

     /usr/xpg4/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file...  ]

 

DESCRIPTION

     For each file that is a directory, ls lists the contents  of

     the  directory;  for  each file that is an ordinary file, ls

     repeats its name and any other information  requested.   The

     output  is  sorted alphabetically by default.  When no argu-

     ment is  given,  the  current  directory  is  listed.   When

     several  arguments are given, the arguments are first sorted

     appropriately, but file arguments appear

 

Files in Unix are stored in things called directories, which are basically the same thing as folders. We want to make a directory named “public_html”. The command to make directories is “mkdir”. Type “mkdir public_html”. Now do an “ls”. You should see the new directory “public_html” appear. Now we want to go into the directory using the command “cd” (as in change directory”). Type “cd public_html”. You are now in the new directory.

 

Now we want to transfer the html file (your new webpage that you created using word) from the PC (or Mac) to rohan.  We will use a special program(s) (ftp, ws_ftp, fetch) to connect from one computer to another. I will show two options for transferring files from a PC to unix. The first option, ftp, is more complicated but should work on all PCs. The second option, ws_ftp, is a graphical version but may not be installed on all PC’s.

 

ftp

On the PC, go to start, run. Type in “ftp rohan”, then login with your username and password. Then, in ftp, type “cd public_html”. This changes the directory of the ftp program. Then type “put index.html “. This puts the file from the PC to rohan. If you get a “file not found” you may be ftp’ing from the wrong directory on the PC.  Try “lcd d:\” at the ftp prompt to fix.

 

ws_ftp

On the PC, go to start and find ws_ftp on the list of programs. Start it and it will ask you for a host, username, and password. Type in the correct answers and you should see two boxes with files listed. The box on the right represents the “remote” machine (in this case rohan) and the box on the left is the “local” machine (your PC). You want to transfer files from the PC to rohan, so highlight the file on the PC and click on the transfer arrow pointing to the remote machine.

 

Mac

On a Mac, open a terminal and ftp to rohan. It should work the same as in the PC ftp example.

 

Now the files are on rohan. Now, we need to set permissions. Remember, permissions control who can read what files. We need to set the permissions so that anyone can read (but not write or change) your files. In the directory “public_html”, type “chmod 644 filename”. (644 is obscure Unix syntax for the permissions you need). Now type “cd ..” [This moves up a directory] and do an “ls –l”. Now type “chmod 711 public_html”. This changes the permissions on the directory also. Finally, type “chmod 711 ~”. This changes the permissions on your home directory. See also the URL.

 

Now, if you type in the URL “http:/www.rohan.sdsu.edu/~username” where username is your username, the web-page should appear….Send me email when done.