----------------------------------------------------- Week 1 Notes for CST8129 ----------------------------------------------------- - 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) To Do in the Linux lab (T127) during Week 1: 1. Login to the lab workstation: Login - abcd0001 (use your own userid) Password - just2day If you do not change your password this week, your account may be disabled by the system administrator next week. Change it! Your instructor cannot change your forgotten password for you - only the system administrator (Dick Campbell) can do that: | From: Richard Campbell | I will reset student passwords during my regular office hours 8:00 | to 16:15. The student may come to room T124 with their student ID | card. An ITS Work Order will be completed for each incident. All the workstations share the same home directory; you can access your same files from any of the machines in the lab, and you can login remotely (from home) to any machine. 2. Find my course web page: - the CST8129 one for Fall 2005 with my picture on it - http://teaching.idallen.com/cst8129/05f/ - bookmark this! 3. Begin the online VIM text editor tutorial: vimtutor See file vi_basics.txt in the course notes for details. See the vi_refcard reference card in the course notes. You must complete the tutorial to do the upcoming Week 2 lab exercise. Attendance Attendance is critical to course success. (If you know the material and don't need to come to classes, ask for a Prior Learning Assessment. If you paid to be here, please be here.) Lab attendance is recorded - make sure you're signed in each week. Taking Notes You will need to take notes in class. Not everything I say ends up in these online files. If you have a question about course content, the first thing I will ask is to see your notes, to see what you wrote down about the topic. (Often the answer is there!) Textbook I will assign exercises that use the textbook. You need it. One copy is on reserve in the Library. Workload The overall CS Term 2 workload sometimes overwhelms students who try to leave everything to the last minute. You need to put in approximately an extra hour per day, per course, to keep up. There aren't enough hours in a day to catch up in mid-term. Timeliness Late assignments are penalized, usually resulting in a mark of zero. The due date for an assignment is given in the assignment. Read each assignment to know the due date. Preparation Lab time is precious. Most lab exercises are time-limited and will require you to have done advance preparation. If you haven't read the material and done the preparation, you won't finish on time. Standards Like any company, CST8129 has standards for its documents. Assignments must adhere to the published standard. See the course web page for the Standards document. Linux Working Environment The scripting taught and used in this course is intended to be portable; you can use most any Linux machine to write and test your code. The final test run must be on the machine given in the assignment specification. This might be one of the T127 lab machines, or it might be a different machine. Off-hours Lab Access You are encouraged to use the T127 lab outside of lab hours. The hours of operation are posted on the door. You may ask other instructors if you may work quietly at the back of their classes. Remote Lab Access From on campus, the dial-up modem pool, and via the College VPN, you can use the "ssh" protocol to connect to machines in the Linux lab in T-127 using IP addresses 10.50.15.1xx where xx ranges from 01 to 31. From home (off-campus) you must have the VPN installed and working to use these addresses. For information on getting the VPN working, look under the "Remote Connection" link on the ITS page: http://algonquincollege.com/its/ If you need help with the VPN, call the Help Desk at 727-4723 ext.5555 The "ssh" protocol is available in such programs as "ewan" and "PuTTY", which you can download for free from the Internet. Do a Google search for: putty The "telnet" program sends your password in clear text over the Internet. Don't use it. Only "ssh" provides an encrypted connection that is safe to use. Use the "ssh" protocol only. Running Linux at Home You may download and install most any Linux distribution at home for free. Most any distribution will be support the writing and running of the portable shell scripts taught in this course. Many Linux distributions (e.g. Knoppix, Mandrake Live) will boot directly from a CDROM and run entirely in memory, bypassing the need to do any disk installation at all. Be aware that when you shut down such an in-memory system, everything is lost - save any important files on real disk first. Since the College does not support VPN access for Linux, be aware that you may have trouble moving files from your home Linux machine directly to the T127 Linux lab. Your instructor may be able to provide you with a work-around for this problem. Linux User Groups See the Ottawa Canada Linux User Group (OCLUG): http://www.oclug.on.ca/ They meet on the first Tuesday of every month. Plagiarism http://www.cbc.ca/story/sports/national/2004/11/24/Sports/taylor041124 "The lead sports columnist of the Winnipeg Free Press has resigned after he was accused of plagiarizing parts of an article published earlier this month." You must attribute the source of material you use that isn't yours. Readings in "Unix Shells by Example": This book has many, many errors! See the file text_errata.txt in the Course Notes! Know how to find the "Table of Contents" and the "Index". Use them. Read these sections this week: Preface: "Playing the shell game" Chapter 1: "Introduction to UNIX/Linux Shells" - skip anything dealing with the C shells, csh, or tcsh - skip most examples using a prompt of '%' (csh) or '>' (tcsh) - skip the "chown" command p.21-22 - skip Figures 1.10 to 1.14 Appendix A: Useful Unix Commands - skim this Appendix; don't read it all! Questions on the readings in Chapter 1: - True/False: the Internet started on Unix machines p.2 - what is the purpose of a shell? p.3 - what is a script file? p.4 - what functions does a shell perform? p.8 - True/False: shells pass wildcard characters to programs p.8 - what is the full pathname of the Unix Password file? p.9, errata - True/False: name of the shell you are given at login time is kept in the Unix password file - what is a "token" to the shell? p.9 - True/False: command substitution is done after variable substitution p.10, errata - what is a "process" p.11 - True/False: processes can share ID numbers p.11 - what command shows processes? p.12 - what is "fork"? "exec"? p.14,15 - how can you kill a process? p.17 - what is the "sleep" command? p.18 - what is your "environment"? p.18 - what is your "umask"? p.19 - True/False: your umask is subtracted from the default p.19, errata - how do octal permission numbers (e.g. 755) relate to rwx style permissions? p.20 - what is your "working directory"? p.23 - if a child shell changes working directory, does it affect the parent shell process directory too? p.23 - what is the difference between a local and environment variable? p.23 - what are the full Unix names for "stdin", "stdout", and "stderr"? p.24 - what is "redirection"? p.25 - what is the difference to the shell between ">file" and ">>file" p.25 - how can I redirect stderr instead of stdout? p.27 Fig 1.7 - can I redirect stdout and stderr separately? p.26-27 compare Fig 1.5, 1.7 - (skip Fig 1.8 - it's for C shells) - what is the simple explanation of a Unix "pipe"? p.28 - what do most "signals" do to a process? p.30 [the book is wrong about signal 0 - see the text_errata.txt file] NOTE: Signal numbers and names may change from one version of Unix to another, especially signal numbers above 15. Don't memorize them. Most Unix systems agree on these numbers: HUP INT QUIT KILL and TERM - what key sequence usually generates a SIGINT signal? p.31 - what is a shell script? p.32 - True/False: to run a script, just type its name p.32, errata