CMSC 10100 HOMEWORK 0: Due Friday of first week at 23:59:59 Get a classes Account and set up your directories for homeworks. First, Request a CS account at: https://www.cs.uchicago.edu/info/services/account_request. (Other information can be found at: http://www.cs.uchicago.edu/info/services. ) Second, once you have your account confirmed, then you need to Activate your CGI Service account. Be sure to select the "CMSC CGI" option so that everyone in the class has the same directory structure. You do this at: https://tools.cs.uchicago.edu/activate_cgi_service Third, after you have done 1 and 2, you need to register with the TA's for grading at: http://cgi-cmsc.cs.uchicago.edu/~mirsattari/register2009.cgi Note: We are making changes for how web programming is done this year so there may be further steps in addition to those given below. ---- There will be 6 homework assignments during the course of the class. For delivery, each assignment must be placed in its own directory within the html directory of your CS account. The graders will look for assignments in specific directories. Hence, the assignment directories must have prescribed names as in: hw1, hw2 ... hw6. If they are not where they are supposed to be and exactly as prescribed, they CANNOT be graded. Naming conventions are important. If you are asked to name a directory or homework file a certain way, it is your responsibility to follow the instructions exactly. Do not count on the graders browsing through your directories and files to locate your assignment. Also, your grader may not look at your homework by typing a URL. Instead the grader will use a program. Chances are the program will not be smart enough to check for typos. Note that there will be introductions to unix I in first week at the MacLab, and unix 2 offered at the MacLab sometime in the second week of the quarter. Go and find out what all the cryptic commands in unix mean! Check http://maclab.cs.uchicago.edu/ for times and days. General Submission Instructions: Homework will be turned in by placing all your files on the Computer Science server in the proper location by the deadline. Each homework should be in a directory: /stage/cgi-cmsc/yourAcct/public_html/cs101/hwx where x is the number of the assignment. (This is in the special CGI Service directory "/cgi-cmsc/" you requested, not in your "/home/" directory.) The final project will be placed in: /stage/cgi-cmsc/yourAcct/public_html/cs101/final. Make sure that the permissions are properly set so that we can enter the directories, view the files, and execute any scripts that we need to. (See below.) The following is the detailed description of how to create the above directories: 0. Login to your /home/directory. If you check your current "path" by issuing the "pwd" (pATH TO wORKING dIRECTORY) command, it will respond with this information: /home/yourAccount You will need to "cd" (cHANGE dIRECTORY) to your CGI directory by issuing cd /stage/cgi-cmsc/yourAccount/public_html/ with your personal account name. 1. Create a directory named cs101 in your CGI directory. Make sure you are at the proper directory level. (You can always check your current directory with the pwd command.) Use the "mkdir" (mAKE dIRECTORY) Command to actually create the directory: mkdir cs101 The full path to your end result should look like: /stage/cgi-cmsc/yourAccount/public_html/cs101 2. Make sure cs101 directory has 755 permissions That is, drwxr-xr-x, which gives you the ability to edit, and the world the ability to see and execute. This is the information you see when you "ls" (lIsT your files). (They are abbreviations for: d = directory; r = read; w = write; x = execute; - = none. They occur in groups of 3 after "d" for: owner/subgroup/world. Go the the unix minicourse to learn more about the number scheme for permissions.) Commands to use: ls -ld cs101 to list the permissions of the directory you just created. chmod 755 cs101 to change the permission to 755 if the permissions are not correct. (chANGE modE.) 3. Change directory (i.e. navigate) to go into the cs101 directory. Command: cd cs101 4. While in the cs101 directory, for each assignment, create a corresponding directory (for example, hw1 for assignment 1. See below on how to generate directories for the other assignments.) Command: mkdir -m 755 hw1 Note there is now a flag, "-m" for mODE, with an argument "-m 755" that does the work of changing the permissions all in one command. This is one of the powers of unix. 5. Make sure hw1 directory has 755 permissions. Command: ls -ld hw1 to list the current permission. Use chmod 755 hw1 to change the permission to 755 if not drwxr-xr-x. 6. Using a text editor (e.g., emacs, vi, or upload from your local machine's wordprocessor such as SubEthaEdit on the Mac or TextPad on Windows, create a file for an HTML page called 'index.html' in the hw1 directory. For now, this page will just serve as a dummy template. It should not contain any content but only the basic structural tags of an HTML page. (See Pence, page 8-9.) Use chmod 755 index.html to change the permissions for index.html to 755. For (-rwxr-xr-x) 7. Move back up one level into the cs101 directory by issuing Command: cd .. Now make five copies of the hw1 directory (and its subfile), named hw2, through hw6 respectively. Directories cannot be copied like simple files with the 'cp' (cOpY) command. They also need the '-r' flag (rECURSIVE) to copy the contents of the directory as well. For example, to create the directory for the second assignment, enter the following on the command line: cp -r hw1 hw2 This will copy both the hw1 directory, renaming it to be hw2, and the file inside hw1 into hw2. Eventually you should have six subdirectories in your cs101 directory, hw1 through hw6, and each of these directories should contain a file for a blank HTML page, called 'index.html'. Go ahead and do this one more time with "final" as the last new directory name. 8. You will put all your solutions into the corresponding homework directory (if you are submitting an HTML document, make sure index.html file is present in the directory). 9. Make sure ALL the HTML documents you submit have permissions 755 (-rwxr-xr-x). This allows you to edit, and everyone else to read it without editing). The figure below shows the final directory hierarchy. (Make sure there is an index.html file in each homework directory). Also, path names are case sensitive. Please keep all names of your directories in lowercase letters (hw1 not HW1, etc.) / <-- server's root stage / cgi-cmsc / <your cs account> / public_html / cs101 _/_________...___ / / / hw1 hw2 ... final So the full path to hw2 would be: /stage/cgi-cmsc/yourAccount/public_html/cs101/hw2, etc.