% CST8207 Week 07 Notes – Variables, Start-Up, PATH, Quoting % Ian! D. Allen – – [www.idallen.com] % Winter 2015 - January to Apil 2015 - Updated Thu Mar 5 09:46:15 EST 2015 Readings, Assignments, Labs, Tests, and ToDo ============================================ - Read (at least) these things (All The Words): 1. [Week 07 Notes HTML] – this file – **Read All The Words** 2. [Start-Up Files] 3. [Shell Variables] 4. [Search PATH] 5. [Quoting] 6. [List of Commands You Should Know] 7. [Video Tutorials on Lynda.com] - Create your [lynda.com] account and watch [Unix for Mac OS X Users] - **3. Working with Files and Directories** - Naming files 5m 41s - use quotes to surround names with blanks or special characters - **5. Commands and Programs** - The PATH variable 4m 13s - **7. Configuring Your Working Environment 41m 28s** - Profile, login, and resource files 9m 11s - Setting command aliases 6m 59s - saving aliases in your `.bashrc` file - Setting and exporting environment variables 4m 54s - Setting the PATH variable 6m 10s - using double quotes instead of single quotes Assignments this week --------------------- Check the due date for each assignment and put a reminder in your agenda, calendar, and digital assistant. - Read All The Words, Do, and then Submit via Blackboard: - Bonus (optional) [Assignment #04 HTML] – the VIM text editor - [Assignment #05 HTML] – using GLOB patterns and redirection - Bonus (optional) [Assignment #06 HTML] – Midterm #1 corrections - [Assignment #07 HTML] – start-up files, environment, search PATH, quoting, hard and soft links, disk usage - Really do **Read All The Words**. You don’t get a second chance to get it right. ### Worksheets The worksheets are available in four formats: Open Office (ODT), PDF, HTML, and Text. Only the Open Office format allows you “fill in the blanks” in the worksheet. The PDF format looks good but doesn’t allow you to type into the blanks in the worksheet. The HTML format is crude but useful for quick for viewing online. Do **NOT** open the ODT files using any Microsoft products; they will mangle the format and mis-number the questions. Use the free Libre Office or Open Office programs to open these ODT documents. On campus, you can [download Libre Office here]. - [Worksheet #04 ODT] – shell GLOB patterns and Aliases - [Worksheet #04 PDF] - [Worksheet #04 HTML] - shell GLOB patterns (wildcards), Aliases: `alias, sum, unalias` - [Worksheet #05 ODT] – shell I/O redirection (including pipes) - [Worksheet #05 PDF] - [Worksheet #05 HTML] - shell I/O redirection, `date, head, nl, tail, tr, wc` - [Worksheet #06 ODT] – *Optional* Bonus VIM Text Editor Practice - [Worksheet #06 PDF] - [Worksheet #06 HTML] - This is an *optional* worksheet for a BONUS assignment using `vim` - Optional command-line VIM tutorial: the `vimtutor` program on the CLS. - Optional Reading: [The VI (VIM) Text Editor] - Bonus (optional) [Assignment #04 HTML] – the VIM text editor Lab work this week ------------------ - Bonus (optional) [Assignment #04 HTML] about VIM has a new due date - [Assignment #05 HTML] was due this week - Bonus (optional) [Assignment #06 HTML] about Midterm #1 is ready - [Assignment #07 HTML] is ready (start-up files, environment, search PATH, quoting, hard and soft links, disk usage) - Work on the above assignments in your lab period; ask questions. Upcoming tests and quizzes -------------------------- Read the [Test Instructions] (all the words) before your next midterm test. 1. Second Midterm test: 45 minutes; in class 8am Thursday in Week 9 (March 12) - Midterm Tests take place in your 8am lecture hour, not in your lab period. 2. Final Exam: 180 minutes; Tuesday April 21 11am to 2pm in room C144 - Take a bathroom break before you sit down for three hours! Midterm Test #1 Analysis (secondary) ------------------------------------- 100/107 people. Two students still haven’t filled out their mark-sense form correctly so that I can send it to be marked. - Number of students (out of 100) who did not fill in the mark-sense form correctly so that I could mark it: `32` - Number of students (out of 100) who entered their own name incorrectly on the mark-sense form (usually by shortening it): `9` - Number of students who got question `#45` wrong even though the answer was given in the **Test Instructions** printed at the top of the test: `12` *(Number who copied the same answer as on the practice test: `6`)* - Class scores for 100 (out of 107 registered) students: 100 100 97.8 97.8 95.6 95.6 95.6 95.6 93.3 93.3 93.3 93.3 91.1 90.5 88.9 88.4 86.7 86.7 86.2 86.2 84.4 84.4 82.2 80 80 80 79.8 77.8 77.8 77.6 77.6 75.6 75.4 75.4 75.4 73.3 73.3 73.3 73.3 73.3 73.3 71.1 71.1 71.1 69 66.7 64.7 64.4 62.5 62.2 62.2 62.2 62.2 62.2 57.8 55.6 55.6 53.9 53.9 53.9 53.3 53.3 51.7 51.1 51.1 49.6 48.9 48.1 47.4 46.7 44.4 44.4 43.1 42.2 42.2 38.8 37.8 37.8 36.6 36.6 35.6 35.6 35.6 33.3 33.3 32.3 31.1 30.2 29.3 28.9 28 28 27.2 26.7 26.7 24.4 22.2 22.2 19.4 -00 -00 98: Pass 66 (67.3%) Fail 32 (32.7%) 27 A (27.6%) 7 A- 6 A 14 A+ 17 B (17.3%) 3 B- 10 B 4 B+ 10 C (10.2%) 5 C- 3 C 2 C+ 12 D (12.2%) 4 D- 7 D 1 D+ 32 F (32.7%) 25 F- 3 F 4 F+ 90% - 100% 14 ************** 80% - 90% 13 ************* 70% - 80% 17 ***************** 60% - 70% 10 ********** 50% - 60% 12 ************ 40% - 50% 9 ********* 30% - 40% 12 ************ 20% - 30% 10 ********** 10% - 20% 1 * 0% - 10% 0 - You can see the errors in [Midterm Test #1 PDF]. From the Class Notes link on the Course Home Page ================================================= - Review last week. Did you do everything assigned last week? From the Classroom Whiteboard/Chalkboard ======================================== - This week: - review the midterm test results - create start-up files - learn some environment variables - find out how the shell finds commands - know how to quote to hide things from the shell - Useful command: `hostname` - Needed for [Assignment #07 HTML] Real Sysadmin Work ================== Linux System Administrator – well paid -------------------------------------- - “Become a Linux system administrator and rake in the cash.” - “The Linux job market has been hot for a while, and system administrators make top dollar.” Linux System Administrator – bilingual – Montreal ------------------------------------------------- Responsibilities: Perform all the work related to a System Admin, such as : - Configure client’s environment; - Support daily operation of client’s environment et fulfill his needs ; - Provide support to production and migration environments. Required Knowledge : - Strong know-how in Virtualization, Linux , VMWare, Apache, lighthttpd, NFS; - Experience as Linux administrator; - Experience with CHEF and GIT. (required) ; - Bilingual preferred, otherwise French - Able to work under pressure; - Being client oriented - Team player. Required Skills & Abilities - Linux (CentOS / Ubuntu) - Apache - CHEF - GIT - VMWare - NFS Required Experience : - 7 to 12 years as Linux administrator Locked out of Course Linux Server #1 ------------------------------------- A student sends me email, knowing he has locked himself out of the CLS using WinSCP. He doesn’t understand why his password has stopped working. The student is not following the rules for [asking good questions], which require you to tell me exactly what userid and host name you are using when you report a problem. I ask what userid and host name the student used in WinSCP. The student then tells me what his userid is. I say that I know what his userid is; he doesn’t need to tell me that. What he does need to tell me is actually **what settings he used in WinSCP**. Only then does the student check WinSCP and realize that he is using a blank userid: Feb 9 21:21:13 Accepted password for XXXXXXXX from 99.241.61.183 Feb 9 22:03:27 Invalid user from 99.241.61.183 Feb 9 22:03:37 Failed password for invalid user from 99.241.61.183 Feb 9 22:03:45 Failed password for invalid user from 99.241.61.183 Feb 9 22:04:09 Invalid user from 99.241.61.183 Feb 9 22:04:21 Failed password for invalid user from 99.241.61.183 Feb 9 22:04:29 Failed password for invalid user from 99.241.61.183 Feb 9 22:04:49 Failed password for invalid user from 99.241.61.183 Linux people! In Week 1 as part of using the CLS I told you [How to ask good questions and report problems well][asking good questions]. When you report a problem, don’t send me what you **think** you typed, send me what you **really** typed. Locked out of Course Linux Server #2 ------------------------------------- Another student locked out at home (Rogers) by using a blank userid: Feb 9 11:55:40 Accepted password for XXXXXXXX from 99.246.116.39 Feb 12 20:29:34 Invalid user from 99.246.116.39 Feb 12 20:29:42 Failed password for invalid user from 99.246.116.39 Feb 12 20:29:50 Failed password for invalid user from 99.246.116.39 Feb 12 20:32:52 Invalid user from 99.246.116.39 Feb 12 20:33:07 Failed password for invalid user from 99.246.116.39 Feb 12 20:33:20 Failed password for invalid user from 99.246.116.39 Feb 12 20:34:14 refused connect from cpebc1401e66f13-cmbc1401e66f10.cpe.net.cable.rogers.com (99.246.116.39) Check your userid before you use WinSCP! Locked out of Course Linux Server #3 ------------------------------------- Another student locked out at home (Rogers) by using first an invalid userid and then a blank userid: Feb 22 23:49:24 Accepted password for XXXXXXXX from 99.245.232.208 Feb 23 22:40:22 Invalid user XXXXXXXX from 99.245.232.208 Feb 23 22:44:13 Invalid user from 99.245.232.208 Feb 23 22:44:21 Failed password for invalid user from 99.245.232.208 Feb 23 22:45:10 Failed password for invalid user from 99.245.232.208 Feb 23 22:45:20 Invalid user from 99.245.232.208 Feb 23 22:45:28 Failed password for invalid user from 99.245.232.208 Feb 23 22:45:34 Failed password for invalid user from 99.245.232.208 Feb 23 22:46:35 refused connect from cpe84948c505b11-cm84948c505b10.cpe.net.cable.rogers.com (99.245.232.208) Check your typing, and make sure you have a userid before you use WinSCP! Attacks on the Course Linux Server ---------------------------------- - Count the attacks: `fgrep -c "refused connect" /var/log/auth.log` - Another way to count the lines (less efficient): `fgrep "refused connect" /var/log/auth.log | wc` - Only show the last 10 lines: `fgrep 'refused connect' /var/log/auth.log | tail` - See the current list of *evil* host IPs: `less /etc/hosts.evil` Reading text on paper to minimize distractions ---------------------------------------------- [The case against E-readers (from Slashdot)] > Michael Rosenwald writes in the WaPo that textbook makers, bookstore owners > and college student surveys all say [millennials still strongly prefer > reading on paper for pleasure and learning]. This bias surprises reading > experts, given the same group’s proclivity to consume most other content > digitally. “These are people who aren’t supposed to remember what it’s like > to even smell books,” says Naomi S. Baron. “It’s quite astounding.” Earlier > this month, Baron published *Words Onscreen: The Fate of Reading in a > Digital World*, a book that examines university students’ preferences for > print and [explains the science of why dead-tree versions are often > superior to digital] (PDF). > > Her conclusion: readers tend to skim on screens, distraction is inevitable > and comprehension suffers. Researchers say [readers remember the location > of information simply by page and text layout] — that, say, the key piece > of dialogue was on that page early in the book with that one long paragraph > and a smudge on the corner. Researchers think this plays a key role in > comprehension — something that is more difficult on screens, primarily > because the time we devote to reading online is usually spent scanning and > skimming, with few places (or little time) for mental markers. > > Another significant problem, especially for college students, is > distraction. The lives of millennials are increasingly lived on screens. In > her surveys, Baron was surprised by the results to the question of whether > students were more likely to multitask in hard copy (1 percent) vs. reading > on-screen (90 percent). “[When a digital device has an Internet connection, > it’s hard to resist the temptation to jump ship].” * * * * * ![Take Notes in Class] -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [www.idallen.com]: http://www.idallen.com/ [Start-Up Files]: 350_startup_files.html [Shell Variables]: 320_shell_variables.html [Search PATH]: 400_search_path.html [Quoting]: 440_quotes.html [List of Commands You Should Know]: 900_unix_command_list.html [Video Tutorials on Lynda.com]: 910_lynda_index.html [lynda.com]: http://algonquincollege.com/onlineresources/mobileStudent/lynda.htm [Unix for Mac OS X Users]: http://www.lynda.com/Mac-OS-X-10-6-tutorials/Unix-for-Mac-OS-X-Users/78546-2.html [download Libre Office here]: 050_course_introduction.html#install-libreoffice-or-openoffice-into-windows [The VI (VIM) Text Editor]: 300_vi_text_editor.html [Test Instructions]: 000_test_instructions.html [Midterm Test #1 PDF]: midterm1.pdf [asking good questions]: 008_how_to_report_problems.html [The case against E-readers (from Slashdot)]: http://news.slashdot.org/story/15/02/24/2259247/the-case-against-e-readers----why-digital-natives-prefer-reading-on-paper [millennials still strongly prefer reading on paper for pleasure and learning]: http://www.washingtonpost.com/local/why-digital-natives-prefer-reading-in-print-yes-you-read-that-right/2015/02/22/8596ca86-b871-11e4-9423-f3d0a1ec335c_story.html?postshare=941424654403958 [explains the science of why dead-tree versions are often superior to digital]: http://llt.msu.edu/issues/october2010/review2.pdf [readers remember the location of information simply by page and text layout]: http://www.newrepublic.com/article/120765/naomi-barons-words-onscreen-fate-reading-digital-world [When a digital device has an Internet connection, it’s hard to resist the temptation to jump ship]: http://www.washingtonpost.com/posteverything/wp/2015/01/12/the-case-against-kindle-why-reading-paper-books-is-better-for-your-mind-and-body/ [Take Notes in Class]: data/remember.jpg "Take Notes in Class" [Plain Text]: week07notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/