% Week 14 Notes for CST8207 - Fall 2012 % Ian! D. Allen - idallen@idallen.ca - www.idallen.com % Fall 2012 - September to December 2012 - Updated Thu Dec 13 15:50:47 EST 2012 Readings, Assignments, Labs, and ToDo ===================================== - Here are the results of this term’s [Course Evaluation Survey] - Read (at least) these things (All The Words): - [Week 14 Notes HTML] - This File - **Read All The Words** - [Delayed and Repeated Scheduled Execution - at, cron, and crontab] - [List of Commands] - Read (All The Words), Do, and Save (but not for hand-in): - [Lab Worksheet #13 ODT] - [Lab Worksheet #13 PDF] - Read (All The Words), Do, and then Submit via Blackboard: - [Assignment #13] - Write down the dates of your Final Exams from the [Course Home Page]. - [PDF course slides from a previous term] - **READ ALL THE WORDS** Final Exam - December 10 3pm ============================ - Your Final Exam schedule is posted in the ICT office and on the [Course Home Page]. - Your Final Exam covers the entire course, with emphasis on material since the second midterm test, and material that students did not answer well in the previous two tests. - 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!) - There may be more questions on the test than you can answer in the time allowed; answer the ones you know, first. Four Practice Tests ------------------- There are four sets of practice questions available, one of which (on Blackboard only) is a cumulative union of the three practice tests plus both midterm tests: - See the [Practice Test #1 PDF] and answer file in the [Class Notes]. - See the [Practice Test #2 PDF] and answer file in the [Class Notes]. - See the [Practice Test #3 PDF] and answer file in the [Class Notes]. - On Blackboard, look under the “Practice” link in the left-side bar for short practice tests using the above questions. You can practice each test as many times as you like. Each practice selects 10 of the practice questions and you get your mark at the end of each test attempt. Practice each test over and over! Final Exam Results ------------------ Scores: 98.6 97.3 95.3 95.3 95.3 95.3 92.6 91.9 91.9 91.9 91.2 89.9 89.9 89.2 89.2 87.2 87.2 86.5 85.8 85.8 84.5 81.8 79.7 79.7 79.7 79.7 79.7 79.7 77.7 75 72.3 72.3 72.3 71.6 70.3 69.6 69.6 69.6 68.2 67.6 67.6 66.9 66.9 65.5 65.5 62.8 62.8 62.2 61.5 61.5 61.5 61.5 60.8 56.1 55.7 54.7 53.4 53.4 52.7 52 51.4 50.7 50 50 45.9 45.3 45.2 44.6 44.6 44.6 43.9 43.9 43.9 42.6 41.2 40.5 39.9 39.9 39.2 38.5 37.8 37.2 34.5 33.8 33.1 31.1 30.4 29.1 28.4 26.4 26.4 24 23.6 23 21.6 15.5 6.8 ### Did not Read All The Words The first and last questions on every exam were the same. They asked “**Did you read all the words of the test instructions at the start of this test?**” The test instructions gave the correct answer to both of these questions - two free marks. The answer was located *one half inch* (1 cm) above the question on the first page of the test; all you had to do was actually read all the words, just as the question asked. Number of students who got one or both of these questions wrong: 18 (out of 99), which should be impossible because by answering “Yes” to “Did you read all the words”, you would have read the correct answer. Conclusion: People don’t read all the words, and they are willing to **lie** about it. ![Read All The Words] Lecture Notes for This Week =========================== ![Ignoring Advice]  - Review last week. Did you do everything assigned last week? - This course is 3/2/4 - 3 hours lecture, 2 hours lab, 4 hours **HOMEWORK** From the Class Notes link on the Course Home Page ------------------------------------------------- - [Week 14 Notes HTML] - This File - **Read All The Words** - [Delayed and Repeated Scheduled Execution - at, cron, and crontab] - [List of Commands] From the Classroom Whiteboard/Chalkboard ---------------------------------------- - Useful command: Find files using a database (much faster than **`find /`**): **`locate`** (sometimes named **`slocate`**) - Answering prompts: When you see a prompt ending in **`[yN]`** it means that you must type either **`y`** or **`n`** and if you just push *Enter* the default will be **`n`** (because the **n** is UPPER CASE to indicate what the default action will be). Your in-class notes go here - take notes in class! ================================================== ![Remember]  If you’re not actively taking notes in class, why are you here? Real Sysadmin Work ================== More HTTP attacks on my web server: ns367672.ovh.net - - [29/Nov/2012:11:20:39 -0500] "GET /cstech/bootdisk.htm/cart.php?a=ProlinkIRC&templatefile=../../../configuration.php%00 HTTP/1.1" 404 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.2; Windows NT 5.1;)" ns367672.ovh.net - - [29/Nov/2012:11:20:39 -0500] "GET /cart.php?a=ProlinkIRC&templatefile=../../../configuration.php%00 HTTP/1.1" 404 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.2; Windows NT 5.1;)" ns367672.ovh.net - - [29/Nov/2012:11:20:39 -0500] "GET /cstech/cart.php?a=ProlinkIRC&templatefile=../../../configuration.php%00 HTTP/1.1" 404 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; rev1.2; Windows NT 5.1;)" Linux computer inside a mint tin: My Personal Sysadmin Toolkit ---------------------------- ### I keep a huge history, with time stamps, no duplicates: export HISTFILESIZE=1000000 _temp=$( [ -r /proc/meminfo ] && awk ' $1 == "MemTotal:" { big=int($2/1000); exit } END { print (big) ? big : 1000 } ' /proc/meminfo ) export HISTSIZE=${_temp:-1000} export HISTTIMEFORMAT= export HISTCONTROL=ignoredups # output last exit status and append new lines to history file: export PROMPT_COMMAND='status=$? ; [ $status -ne 0 ] && echo 1>&2 "Exit $status" ; history -a' # turn on history; allow !! history; append to history file: set -o history set -o histexpand shopt -s histappend ### Variables (also used by the Aliases below): tauth=/var/log/auth.log tcups=/var/log/cups/error_log thttp=/var/log/apache2/access.log thttpe=/var/log/apache2/error.log tmail=/var/log/mail.log tsyslog=/var/log/syslog ### Aliases and Shell Functions: alias a='alias' alias j='jobs -l' alias jj='jobs -l' alias 1='%1' alias 2='%2' alias 3='%3' alias 4='%4' alias 5='%5' alias 6='%6' alias 7='%7' alias 8='%8' alias 9='%9' function - () { %- } alias 00='pushd +0' alias 11='pushd +1' alias 22='pushd +2' alias 33='pushd +3' alias 44='pushd +4' alias 55='pushd +5' alias 66='pushd +6' alias 77='pushd +7' alias 88='pushd +8' alias 99='pushd +9' alias d='dirs -v' alias b='popd' alias pd='pushd' alias sd='pushd' function del () { popd +"$@" } alias save='dirs -l -p >| "$_CWD"' function here () ... function me () { pushd "$HOME"/"$@" } alias bksd='pushd "${back[0]}" >/dev/null && pushd' alias cp='cp -i -p' alias mv='mv -i' alias scp='scp -p' alias grep='grep --color=auto' alias l='less' alias df='df -k' alias dfn='dfnn -h' alias dfnn='df -x debugfs -x tmpfs -x usbfs -x nfs -x iso9660 -x none -x udf -x unionfs -x devtmpfs' alias h='history' alias hh='history | sort -rn | sort -u -k 2 | sort -n' function hg () { history | grep --color=auto -e "$*" | sort -u -k 2 | sort -n } function hv () { HISTTIMEFORMAT="%s %c " history | grep --color=auto -e "$*" | sort -n -k 2 | uniq -f 1 } alias savehist='history -a' alias loadhist='savehist && history -r' alias ls='ls -abp --color=auto' alias lsl='ls -l' alias lsld='lsl -d' alias lsll='lsl -L' alias lslt='lsl -t' function lsltl () { ls -abp --color=auto -l -t "$@" | less } function lslth () { ls -abp --color=auto -l -t "$@" | $head1 } function lslthh () { ls -abp --color=auto -l -t "$@" | $head2 } alias lsltr='lslt -r' alias tauth='ttail $tauth' alias tauthh='tac $tauth | grep -v -e " CRON" | hhead | tac' alias tcups='ttail $tcups' alias thttp='ttail $thttp | grep -v http.monitor' alias thttpe='ttail $thttpe | grep -v http.monitor' alias tlog='tsyslog' alias tsys='tsyslog' alias tsyslog='ttail $tsyslog' alias tmail='ttail $tmail' alias tmes='tac $tmessages | grep -v -e "-- MARK --" -e "modprobe: WARNING: Not loading blacklisted module ipv6" | hhead | tac' alias tmess='tac $tmessages | grep -v -e "-- MARK --" -e "modprobe: WARNING: Not loading blacklisted module ipv6" -e " pppd" -e " hdparm: " -e "sh/doroute" -e "ppp/ip-up" -e " rsyncd" -e " sshd" | hhead | tac' alias tsec='ttail $tsecure' alias trace='strace' alias xtl='dset ; savehist ; command xtl' alias xtu='dset ; savehist ; command xtu' ### My cover scripts for system commands: for f in $( cd /bin && ls ; cd /usr/bin && ls ) ; do if [ -s "bin/$f" ] ; then wc -l "bin/$f" | awk '{print $2, $1}' fi done bin/cp 3 bin/df 5 bin/tar 8 bin/a2ps 13 bin/du 3 bin/exifautotran 81 bin/firefox 24 bin/html2text 11 bin/mail 25 bin/mtr 8 bin/mutt 26 bin/print 68 bin/rename 123 bin/scp 68 bin/script 40 bin/startx 25 bin/wget 3 ### Lots and lots of little scripts: $ ls ~/bin | wc 273 273 2255 -- | 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 [Course Evaluation Survey]: 999_course_evaluation.html [Delayed and Repeated Scheduled Execution - at, cron, and crontab]: 830_crontab_scheduler.html [List of Commands]: 900_unix_command_list.txt [Lab Worksheet #13 ODT]: worksheet13.odt [Lab Worksheet #13 PDF]: worksheet13.pdf [PDF course slides from a previous term]: ../../11f/notes/indexcgi.cgi [Test Instructions]: 000_test_instructions.html [Practice Test #1 PDF]: practicetest1.pdf [Class Notes]: indexcgi.cgi [Practice Test #2 PDF]: practicetest2.pdf [Practice Test #3 PDF]: practicetest3.pdf [Read All The Words]: data/jes.png "Read All The Words" [Ignoring Advice]: data/watch.jpg "Ignoring Advice" [Remember]: data/remember.jpg "Remember" [Plain Text]: week14notes.txt [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/