----------------------- Exercise #1 for NET2003 due January 10, 2005 ----------------------- -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: 1% of your total mark this term Due date: Before the end of your Lab period on Monday, January 10. The deliverables for this exercise are to be submitted online on the Course Linux Server using the "datsubmit" 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 21h00 (9pm) on Monday, 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 on January 10. Exercise Synopsis: Marks: 1% You will use "vim" to create a text file, read in another file, perform some simple edits, and save the result. You will scan your hard drive caddy for partition information, copy the information to the Course Linux Server, and submit your findings. Where to work: Do your Unix command line work on the Course Linux 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: 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 Linux Server under directory: ~idallen/public_html/teaching/net2003/05w/notes/ You can copy files from this directory to your own account for modification or study, if you like. (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 and all the readings. 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) --------------------------------------------- 0. Have you done all the preparation steps? If not, go back and do them. Part I - exercise01text.txt ------ 1. Using VI/VIM, edit a new file named exercise01text.txt on the Course Linux Server. 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). 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+space). The lines do not have to be numbered. 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 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 paragraph. Do not use a mouse-based copy/paste. (You won't have a mouse when you are setting up a bare-bones Linux network server.) 5. Note the start and end line numbers of this single paragraph and use a single VIM command to globally change the three characters "and" to "***" in this paragraph only. (Hint: VIM tutorial Lesson 4.4.) Do not change the indentation, spacing, or formatting of this paragraph. Do not use a mouse-based copy/paste. (You won't have a mouse when you are setting up a bare-bones Linux network server.) Part II - exercise01diskinfo.txt ------- 6. Shut down and turn off your computer. Insert your hard drive caddy. Power on and boot the Knoppix CDROM. Reference: knoppix_booting.txt - Using the Knoppix Linux CDROM 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 [... 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 [... 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. Reference: file_transfer.txt - File transfer between machines Reference: redirection.txt - Unix Shell I/O Redirection 7. On the Course Linux Server, 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+space). The lines do not have to be numbered. Submission ---------- Reference: datsubmit.txt - Using the datsubmit 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* datsubmit command line: $ datsubmit 01 exercise01text.txt exercise01diskinfo.txt This "datsubmit" 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: $ datsubmit 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 datsubmit 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 "datsubmit". 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?