% Week 09 Notes for CST8207 - Fall 2012 % Ian! D. Allen - idallen@idallen.ca - www.idallen.com % Fall 2012 - September to December 2012 - Updated Thu Nov 8 03:09:01 EST 2012 Readings, Assignments, Labs, and ToDo ===================================== - Read (at least) these things (All The Words): - [Week 09 Notes HTML] - This File - ** Read All The Words ** - [Frequently Asked Questions] - [List of Commands] - Read (All The Words), Do, and Save (but not for hand-in): - [Lab Worksheet #07 ODT] - [Lab Worksheet #07 PDF] - [Lab Worksheet #09 ODT] - [Lab Worksheet #09 PDF] - Quizzes will ask you about your answers in your saved worksheets. - Read (All The Words), Do, and then Submit via Blackboard: - [Assignment #07] - [Assignment #08] - [Assignment #09] - See the information about the November 5 Midterm Test in this file. - Write down the dates of your Final Exams from the [Course Home Page]. - **READ ALL THE WORDS** Midterm Test #2 - Week 10 - Monday November 5 - 25% ==================================================== - Midterm test dates are posted on the [Course Home Page]. - Midterm Test #2 (Mon Nov 5) covers: - anything from the previous midterm test, especially questions that were not answered correctly, plus: - [Week 04 Notes HTML] - [Week 05 Notes HTML] - [Week 06 Notes HTML] - [Week 07 Notes HTML] - [Week 08 Notes HTML] - [Assignment #05] - [Assignment #07] - [Assignment #08] - [Assignment #09] - [Lab Worksheet #05 ODT] [Lab Worksheet #05 PDF] - [Lab Worksheet #07 ODT] [Lab Worksheet #07 PDF] - [Lab Worksheet #09 ODT] [Lab Worksheet #09 PDF] - **UPDATED Sunday Oct 28**: See the [Practice Test #2 PDF] and answer file in the [Class Notes]. This one file now contains *two* practice tests (as of Oct 28). Try both of them. - Ignore the questions using **`awk`** and **`uniq`** for this test. - NEW: Midterm 2 Practice tests on Blackboard. See the left-side bar for a “midterm 2 practice” link. You can practice the test as many times as you like. Each practice selects 10 of the 261 practice questions and you get your mark at the end of each test attempt. Do it over and over! - You must read the [Test Instructions] before the test for important directions on how to enter your answers and the test version number on the mark-sense forms. - You must know which **Lab Section Number** you attend, and write that number on your question sheet. (**NOT** your lecture section number!) - The first 50 minutes of the two-hour class is for questions; the last 45 minutes are for the midterm test. There may be more questions on the test than you can answer in the time allowed; answer the ones you know, first. Learning the Material --------------------- - you learn the material because you want to be a Computer Systems Technician - you like doing this work; you want to be good at it - review your mistakes on the first midterm test (questions re-appear) - See the two-part [Practice Midterm Test #2][Practice Test #2 PDF] - review the commands used in each lab worksheet (and their common options) - [Unix/Linux Command List][List of Commands] - review how the shell works: GLOB, redirection, quotes - split on semicolons and pipes first, then do redirection - Know **why** the shell behaves that was. Copy/paste teaches you nothing. - What are the Four Rules for Output Redirection? Three Rules for Pipes? See: - [Unix Shell I/O Redirection (including Pipes)] Final Exam Schedule is Posted ============================= Your Final Exam schedule is posted in the ICT office and on the [Course Home Page]. Lecture Notes for This Week =========================== - Review last week. Did you do everything assigned last week? - Send me the Rap video! If you license it for public view, I’ll post it. - videos published: [CST8207 Rap Videos] - any more? From the Class Notes link on the Course Home Page ------------------------------------------------- - [Week 09 Notes HTML] - This File - ** Read All The Words ** - [Frequently Asked Questions] - [List of Commands] From the Classroom Whiteboard/Chalkboard ---------------------------------------- - Looking for things in the Course notes: - If you want to know what to do this week, look at the Week Notes file for this week. You’re reading one now: [Week 09 Notes HTML] - If you want to find anything else, look at the full [Class Notes] index. - This is the “by Category” link on the top left of the [Course Home Page]. - Use the Table of Contents to zoom in on the section you want. - Useful command to print the first field of each line of input: **`awk '{print $1}'`** - **`wc file | awk '{print $1}'`** - **`find . -ls | awk '{print $1}'`** - fields are delimited by white space (blanks and tabs) - change the **`$1`** to **`$2`** to print the second field, etc. - change the **`$1`** to **`$NF`** to print the LAST field in each line - Useful command to eliminate (or count) adjacent duplicate lines: **`uniq`** - Count the number of logins: **`last | awk '{print $1}' | sort | uniq -c | sort -n`** - [Edit File Recovery in VIM] ### Topic: Common Misunderstandings - Does **`sort foo bar`** sort each file and display the results one after the other, or does it combine both files into one input and sort the whole thing together? Where does the output of **`sort`** go? - `echo one "two three" four 'five "six" seven' eight` - `echo " * " ; echo ' * ' ; echo '' * '' ; echo "" * ""` - `echo ?nosuchfile ; ls ?nosuchfile ; echo "?nosuchfile" ; ls "?nosuchfile"` - `echo hi >a ; cp a b >file` - `echo hi >a ; ln a b >file` - `echo hi >a ; mv a b >file` - `echo hi >a ; rm a >file` - `head x >x ; tail x >x ; sort x >x ; wc x >x ; ls x >x` - `echo hi >.a ; echo * ; echo ?? ; echo [.]*` - `echo hi | cat /etc/passwd` - `echo hi >a ; cp a b | head` - `echo hi >"?abc" ; rm \?abc ; rm ./'?abc' ; rm ./././\?abc` - `echo a b c >out ; echo a b >out c ; echo >out a b c ; >out echo a b c` - `echo hi >a ; ls a ??? >out 2>errfile ; ls a ??? >out 2>&1` - `umask 111 ; rm -f foo ; echo hi >foo ; ls -l foo` - `umask 022 ; rm -f foo ; echo hi >foo ; ls -l foo` - `umask 033 ; rm -f foo ; echo hi >foo ; ls -l foo` - `echo hi >foo ; chmod 277 foo ; ls -l foo ; cat foo` ### Your in-class notes go here - take notes in class! Real Sysadmin Work ================== - Students who followed the advice about setting useful aliases in their .bashrc files are finding Assignment 07 much easier than those who are struggling with nongraphic characters in file names. > The Government of > Canada is pleased to announce that the next generation Open Data Portal > will be using the Open Government Platform. The Open Government Platform > (OGPL) is the result of a collaborative initiative between India and the > United States designed to promote transparency and greater citizen > engagement by releasing government data to the public through a freely > available, open source platform. By making data available in useful > machine-readable formats, the OGPL will allow developers, analysts, media, > and academia to develop new applications and insights based on public > sector data. By using an open source platform, an international OGPL > community will provide future technology enhancements, open government > solutions, and community-based technical support. - [File System “Porn”] - Unix-based operating systems [serve 63.6 percent of web services] - [Linux servers keep growing, Windows & Unix keep shrinking] - [Amazon EC2 cloud is made up of almost half-a-million Linux servers] - [Big Business, Big Linux] - [Microsoft reluctantly bows to Linux users] - “Running Linux on Azure has been a surprisingly big business-customer request.” […] The Cloud Market analysis of operating systems on the Amazon Elastic Compute Cloud (EC2) found that there were 6,556 Linux instance running compared to 1,120 Windows instances. By almost six to one, cloud users preferred Linux over Windows. […] Microsoft’s business customers are speaking, and they want Linux. If Microsoft doesn’t deliver the goods, Amazon, Red Hat, and VMware, to name three of its cloud rivals, are already happy to fully support Linux users on the cloud. ### Topic: Fun and You - *Simba kupata wewe.* - “Lion Get You” - The ISO 9000 Fun Standard: ![Too Much Power - XKCD] ![Studying] ![Ubuntu-Saurus ALLEN] ![Read All The Words] ![Read All The Words][1] -- | 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 [Frequently Asked Questions]: 007_freqently_asked_questions.html [List of Commands]: 900_unix_command_list.txt [Lab Worksheet #07 ODT]: worksheet07.odt [Lab Worksheet #07 PDF]: worksheet07.pdf [Lab Worksheet #09 ODT]: worksheet09.odt [Lab Worksheet #09 PDF]: worksheet09.pdf [Lab Worksheet #05 ODT]: worksheet05.odt [Lab Worksheet #05 PDF]: worksheet05.pdf [Practice Test #2 PDF]: practicetest2.pdf [Class Notes]: indexcgi.cgi [Test Instructions]: 000_test_instructions.html [Unix Shell I/O Redirection (including Pipes)]: 200_redirection.html [CST8207 Rap Videos]: 000_Rap.html [Edit File Recovery in VIM]: http://vimdoc.sourceforge.net/htmldoc/usr_11.html [File System “Porn”]: http://xkcd.com/981/ [serve 63.6 percent of web services]: http://www.wired.com/wiredenterprise/2012/03/mark-shuttleworth-ubuntu/ [Linux servers keep growing, Windows & Unix keep shrinking]: http://www.zdnet.com/blog/open-source/linux-servers-keep-growing-windows-unix-keep-shrinking/10616 [Amazon EC2 cloud is made up of almost half-a-million Linux servers]: http://www.zdnet.com/blog/open-source/amazon-ec2-cloud-is-made-up-of-almost-half-a-million-linux-servers/10620 [Big Business, Big Linux]: http://www.zdnet.com/blog/open-source/big-business-big-linux/10181 [Microsoft reluctantly bows to Linux users]: http://www.zdnet.com/blog/open-source/microsoft-reluctantly-bows-to-linux-users/10074 [Too Much Power - XKCD]: http://imgs.xkcd.com/comics/microsoft.png "Too Much Power - XKCD" [Studying]: data/studying.jpg "Studying" [Ubuntu-Saurus ALLEN]: data/ubuntu_saurus_allen.jpg "Read All The Words" [Read All The Words]: data/lesen_sie.jpg "Read All The Words" [1]: data/lesen_sie_binary.jpg "Read All The Words" [Plain Text]: week09notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/