CSC104: Lab Familiarization Handout This is a set of tasks designed to help you learn to work with the CDF computers. Some of you will be able to get through this rather quickly, but some of you may need help. Regardless, you should all try working through this particularly as things that might seem easy on a computer that you are familiar with using may actually end up being quite different on the UNIX system that CDF uses. 1. Find a CDF Lab Room, if you need help this should be BA2220 during lab hours. If you don't need help this can be any of: BA2210, BA2220, BA2240, BA3175, BA3185, BA3195, or BA2270. However the last four of these are sometimes used for tutorials/labs and may be in use so I'd recommend trying one of the 3 main labs on the 2nd floor. If you are enrolled in CSC104 your student card should open the doors. If you have just enrolled there is likely to be a slight delay in getting your card to let you in, and your CDF account might not exist yet. 2. Find a working available computer and log-in. To find your user name (or account name, user id, login name, or logname—all of these terms mean the same thing), use the lookup facility at http://www.cdf.toronto.edu/cgi-bin/webfinger. If you don’t have access to the web from anywhere else, get someone else in the lab to look up your account name for you—a lab TA, me (your course instructor), or anyone else who seems friendly. Your initial password is your nine-digit student number. Note: If you have taken a course using CDF in previous years, your former CDF account probably still exists (with the password you last used). 3. Change your password. When you log in successfully for the first time (using your student number as a password), the system will force you to change your password. Until you do this, the automatic assignment submission system will not work, so please do this now. 4. If you haven’t used a mouse before, start getting used to it now. (It might take a while until you are really comfortable with it; some people find it very intuitive and some don’t.) Click with the left mouse button to select things. ‘‘Double-click’’ (by clicking in the same place twice rapidly) the left mouse button to run a program. Experiment by running some of the programs whose icons appear on the left by double-clicking on them. Experiment with moving windows around by dragging the ‘‘title bar’’, the strip at the top of the window. To ‘‘drag’’ something, move the mouse pointer on top of it; hold the left mouse button down; move the mouse as desired; then release the button to stop dragging. Experiment with changing window sizes (drag in the lower-right corner), raising a window (so that it seems to be on top of the other windows, in the places where they overlap), and directing the ‘‘focus’’ (which controls into which window your typing goes). The little icon at the left side of the strip along the top of the window has a menu associated with it. Click once on the icon to get the menu. One of the choices (near the bottom) is to close the window. If you are having difficulty getting the menu, make sure that the pointy end of the pointer is in the middle of the icon when you click. Try some of the other commands. (There are also a number of little buttons on the right end of this strip which accomplish a particular one of these functions with a single click.) If you are familiar with using a mouse on a different computer operating system take a moment to see which window buttons are familiar and which are different. 5. In many cases we will want to interact with the computer using a ‘‘command-line interface’’, in which you type a command, press the ‘Return’ (or ‘Enter’) key, and then see output resulting from your command. To get a command-line prompt, run the ‘‘terminal program’’ by clicking on its icon on the bottom of the screen, fourth from the left. The icon looks like a CRT monitor. For a simple example, at the ‘%’ prompt, type ‘‘date’’ into the terminal window. This is the name of a program which tells you the date and time. When you press the ‘Return’ key, it will run that program. We will use the command-line interface substantially in this course. 6. To create and modify your files (computer programs and other files) you will use an application program called an ‘‘editor’’. In this course I am recommending the ‘‘nedit’’text editor, which you can find in the ‘‘Editors’’ submenu of the ‘‘Programs’’submenu of the ‘K’ menu in the lower left of the screen (or you can just type ‘‘nedit’’ in a terminal window). Start ‘‘nedit’’, type a sentence, and then use the ‘‘File’’ menu (the top of the nedit window) to save your file. Give it an informative name. For the ‘‘jython’’ programming language I will recommend a different editor which is tailored to jython, but for general text file editing I recommend ‘‘nedit’’. 7. Use a ‘‘file manager’’ to look at your files. In this course we recommend the ‘‘Konqueror’’file manager, available by double-clicking on the ‘‘Home’’ icon on the desktop. In Konqueror, double-click on a file to view it. Particularly useful buttons along the top of the Konqueror window are the ‘back’ button (left-pointing arrow, on the left) and the ‘home’ button (fourth from the left). 8. You will have heard of (and likely have used) the ‘‘world-wide web’’. You can run the‘‘Firefox’’ web browser by clicking on the Firefox icon at the bottom of the screen. It looks like a blue globe which is encircled by a fiery orange fox. Web pages are identified by a ‘‘URL’’, which is a string consisting of ‘‘http://’’, an internet host name, another slash, and then a path name on that host. To look at the CSC 104 home page, erase or type over the default URL you see near the top of Firefox’s window, and enter the URL: http://www.cs.toronto.edu/~capestim/csc104/ You can ‘‘bookmark’’ this URL so that you can go back to it quickly in future. In unix, the web browser ‘‘bookmarks’’ are stored separately for each user. 9. (slightly more advanced, although not a mystery by the end of the course) Create a program in the ‘‘shell script’’ programming language to display a short message. Use nedit to create a one-line file in your home directory. Its contents will be the ‘‘echo’’ command followed by your desired message. Most punctuation, including quotation marks and apostrophes, requires extra care, so omit that for now. Example: echo Hello I am a friendly computer Now run your little program by using aterminal window and typing ‘‘sh file’’, where ‘‘file’’ isthe file name you saved your shell script as. (‘‘sh’’ stands for ‘‘shell’’.) 10. When you are done with the computer, don’t forget to ‘‘log out’’. Again, this command is available from the ‘K’ menu in the lower left corner of the screen, and then requires confirmation. (Do not turn the computer off.) If you don’t log out, then whoever next uses the computer can impersonate you and modify your files, etc, so be sure to avoid this. On the other hand, if you come upon a computer on which someone has forgot to log out, you must log them out and log in as yourself.