----------------------- Exercise #01 for NET2003 due January 5, 2006 ----------------------- -Ian! D. Allen - idallen@idallen.ca Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) Global weight: 0% of your total mark this term (this is for practice only) Due date: Before the end of your Lab period. The deliverables for this exercise are to be submitted online on the Course Linux Server using the "netsubmit" method described in the exercise description, below. No paper; no email; no FTP. Late-submission date: I will accept without penalty exercises that are submitted late but before 12h00 (noon) on Tuesday, January 10. After that late-submission date, the exercise is worth zero marks. Exercises submitted by the *due date* will be marked online and your marks will be sent to you by email after the late-submission date. This exercise is due before the end of your Lab period. Exercise Synopsis: You will use "vim" to create a text file, read in another file, perform some simple edits, and save the result. Where to work: Do your Unix command line work on the Course Linux Server via remote login from a terminal window in your Knoppix system. Try both of the remote login lines below (in different terminal windows) and use the one that provides the fastest response: ssh -p 2003 abcd0001@net2003.idallen.com ssh -p 2003 abcd0001@10.50.254.230 (On-Campus ONLY!) Use your own userid, not "abcd0001". See Ian! (not ITS) for password problems on the Course Linux Server. ITS does not maintain this server. The files you work on will remain on the server even after you log off. Do not erase your files after submission; always keep a spare copy of your exercises. WARNING: Nothing is saved under Knoppix. If you create files under Knoppix, remember to copy them to the Course Linux Server. WARNING: Do not attempt this exercise on a Windows machine - the text file format is different. You must connect to and work on Unix/Linux. Note that you may connect to the Course Linux Server *from* a Windows machine (using PuTTY); however, you may not use the Windows machine itself to do your work. Use the vim editor on the Course Linux Server. Location of the course notes on the Course Linux Server: You can find a copy of all the course Notes files on the Course Linux Server under directory (note the leading tlide character): ~idallen/public_html/teaching/net2003/06w/notes/ You can copy files from this directory to your own account for modification or study: cp ~idallen/public_html/teaching/net2003/06w/notes/README.txt . (To avoid plagiarism charges, you must credit any material that you copy and submit unchanged.) Exercise Preparation: A. Know where to find an online copy of all the course Notes on the Course Linux Sever. (See above and in course_linux_server.txt) B. Complete the VIM tutorial on Knoppix or the Course Linux Server: vimtutor See also the Class Notes file: vi_basics.txt Any questions? See me in a lab or post questions to the Discussion news group (on the top left of the Course Home Page). --------------------------------------------- Exercise Details (on the Course Linux Server) --------------------------------------------- Part I - exercise01text.txt ------ 0. Have you done all the preparation steps? If not, go back and do them. 1. Using VI/VIM, edit a new file named exercise01text.txt on the Course Linux Server. (Do not do this on Knoppix - the file will be lost when you reboot!) The spelling of the file name must be exact, othewise it won't be marked. The spelling must be exact. Exact! 2. At the top of the file, create an Exterior Assignment Submission label following the example you will find under the "Assignment Standards" button on my teaching home page (teaching.idallen.com). (The Teaching home page is not the same as the Course home page.) For full marks, follow the directions for the label exactly. The label has exactly 7 lines, plus an optional Comments line. The spelling of the label fields on the seven lines must be exactly as shown. The spelling must be exact. Exact! 3. Preface each of the seven lines of the label with the two characters "# " (octothorpe and one space). The lines do not have to be numbered. Leave a blank line below the label. Do the following in your exercise01text.txt file on the Course Linux Server, below/underneath/after your Exterior Assignment Submission label: 4. From the file opt_why_shell.txt in the Notes directory use VIM to extract just the one 16-line paragraph that starts with the words "Back in" and include it in the bottom of your exercise submission file. (Hints: you could read the entire opt_why_shell.txt file into your exercise file and edit away the unnecessary lines, or, you could copy the opt_why_shell.txt file to a temporary file and edit away the unnecessary lines, then read the edited version into your exercise file.) Do not change the indentation, spacing, or formatting of this 16-line paragraph. Do not use a mouse-based copy/paste. Use the VIM command that reads in a file at the current cursor position (Hint: VIM tutorial Lesson 5.4.). Make sure a blank line separates the assignment label from your paragraph in this file. 5. Note the start and end line numbers of this single paragraph and use a single VIM command to globally change *all* occurrences of the three characters "and" to "***" in this paragraph only. (Hint: VIM tutorial Lesson 4.4.) Change *all* occurrences on each line. Part II - exercise01diskinfo.txt ------- 6. Shut down and turn off your computer. Insert your hard drive caddy. Power on and boot from the Knoppix CDROM. Notes Reference: knoppix_booting.txt - Using the Knoppix Linux CDROM The steps given below will do this: From a root (super-user) shell prompt, use shell output file redirection to save a copy of the partition table to a file. Then append a copy of the hard disk information. Then append a copy of the disk transfer speed. Finally, copy the file from Knoppix to the Course Linux Server: knoppix$ su # become root (super-user) knoppix# fdisk -l > exercise01diskinfo.txt knoppix# less exercise01diskinfo.txt [... You should see a half-dozen lines of information about hda here ...] [... If your fdisk command shows no output, see your instructor. ...] knoppix# hdparm -i /dev/hda >> exercise01diskinfo.txt knoppix# less exercise01diskinfo.txt [... Your caddy may be jumpered as /dev/hdb; try /dev/hdb if needed ...] [... The hard drive info should be appended to the file ...] [... Note the use of ">>" vs. ">" to append to vs. overwrite a file ...] knoppix# hdparm -t /dev/hda >> exercise01diskinfo.txt knoppix# less exercise01diskinfo.txt [... Your caddy may be jumpered as /dev/hdb; try /dev/hdb if needed ...] [... The hard drive transfer speed should be appended to the file ...] [... Note the use of ">>" vs. ">" to append to vs. overwrite a file ...] knoppix# exit knoppix$ scp -P 2003 -p exercise01diskinfo.txt abcd0001@net2003.idallen.ca: Use your own userid in place of abcd0001, above. Don't forget the trailing ":" punctuation after the host name on the scp command line. Notes Reference: file_transfer.txt - File transfer between machines Notes Reference: redirection.txt - Unix Shell I/O Redirection 7. Login remotely to the Course Linux Server and edit the exercise01diskinfo.txt file to add your Exterior Assignment Submission label to the top (beginning) of the file. 8. Preface each of the seven lines of the label with the two characters "# " (octothorpe and one space). The lines do not have to be numbered. Leave a blank line after (below) the label, between the label and the rest of the information you put in the file. Submission ---------- Reference Class Notes file: netsubmit.txt - Using the netsubmit command Submit both the finished and labelled exercise01text.txt and exercise01diskinfo.txt files for marking as Exercise 01 on the Course Linux Server, using the following *single* netsubmit command line: $ netsubmit 01 exercise01text.txt exercise01diskinfo.txt This "netsubmit" program will copy the two selected files to me for marking. Always submit all your files at the same time. Do not delete your copies; keep them. Verify that you submitted all your files, using this command line: $ netsubmit 01 -list Note that the digit "1" and the letter "l" (lower-case "L") are different. Do not confuse the two. You may redo this exercise and re-submit your results as many times as you like; but, you must always submit *all* your exercise files every time. The "-delete" option of netsubmit will delete the most recent submission you have made. I will mark only the most recent submission that is submitted before the final hand-in cutoff date. For Exercise 01, always use "01" as the first argument to "netsubmit". Always submit *all* the files each time you submit an exercise. A correct exercise01text.txt is worth 40% of the mark. A correct exercise01diskinfo.txt is worth 60% of the mark. P.S. Did you spell all the label fields and file names correctly?