The Picture

 

CS41 - Linux Workstation Administration
David Morgan
Santa Monica College
see syllabus for email address



Administrativa

Course outline

Homework schedule

Syllabus

Grade reports

SMC dates/deadlines


Information

Remote Unix access with ssh

Variations among Unixes

vi - the Visual Editor

Line termination

System calls

File permissions

Filesystem analysis

Cheat sheet - bash shell

Shell script basics

Shell programming:
if and while

 

SUMMER 2021
Section 1235 Online

This Website (http://classpage.dmorgan.us/) will be used extensively to communicate with you. Announcements, grade reports, and assignments will be posted here. The site can be viewed from an internet-connected browser anywhere. You are responsible for awareness of the information posted here.

Recording of today's Zoom office hours meeting. (8/12)

Final test - there will be none. You have done more than enough lab exercises to account for yourselves. 

Homework - final homework
read - open and scan (visually) the links in course outline section 12 Reading column. I just want you to be aware of them as resources.
listen - the three sets of narrated slides in course outline section 12 Slides column, about bc, find, and xargs. Expect a short Canvas quiz with a couple of questions about each presentation not so much to test its subject matter but to determine that you took the time to listen to it. (note: there is a "bc exercise" in section 12 but it isn't assigned)
do - exercise at link entitled "capstone exercise" in course outline section 13 Homework column
   - due in your assignments directory on the sputnik remote server end-of-day Sunday 8/15
 (8/10)

Grades - have been updated, at the link entitled "Grade reports" at left. They include the user management (toggle-states.sh), ansible, and webmin assignments. You may do assignments you have missed. (If you do, please tell me so that I will know I need to grade it.) Please call any anomalies to my attention. (8/10)

Homework
The topic is task scheduling with cron (and at, and ancron) 
read - the item listed in course outline section 11 reading column
listen - the narrated slides, "Scheduled processes" in course outline section 11 Slides column
do - exercise at link entitled "scheduled jobs" in course outline section 11 Homework column
   - due in your assignments directory on the sputnik remote server end-of-day Thursday 8/12
 (8/9)

Homework
The topic here is remote management via webmin 
read - the item listed in course outline section 10 reading column
do - exercise at link entitled "explore webmin" in course outline section 10 Homework column
There is nothing to listen to; the assignment is easy.
   - due in your assignments directory on the sputnik remote server end-of-day Monday 8/9
 (8/7)

Homework
The topic here is automated remote configuration management with ansible 
browse - the items listed in course outline section 9 reading column
listen - the narrated slides, "ansible" link in course outline section 9 Slides column
do - exercise at link entitled "ansible" in course outline section 9 Homework column 
   - due in your assignments directory on the sputnik remote server end-of-day Saturday 8/7
 (8/3)

Grades - have been updated, at the link entitled "Grade reports" at left. They include the categrorize-states.sh assignment and the midterm. I have some grading outstanding that I must adjust, from email messages you've sent me, that are not reflected here. You may do assignments you have missed. (If you do, please tell me so that I will know I need to grade it.) Please call any anomalies to my attention. (7/30)

Homework
The topic here is user accounts and account management 
   - read and listen first, and do second

read - the readings in course outline section 8 reading column
listen - the narrated slides, "User administration" link in course outline section 8 Slides column
do - exercise at link entitled "user management script" in course outline section 8 Homework column 
   - due in your assignments directory on the sputnik remote server end-of-day Wednesday 8/4
 (7/29)

I have a $( echo "random thought" ) that was prompted by a student question. 

Any time you want some text, and you know command(s) that produce and print it (possibly involving extensive computation), that text is yours if you enclose the command(s) in command substitution syntax: $( ... )
Use that expression anywhere and you will get the text in place of the expression (that's why it's called "substitution").

I want some text:
   the IP address of an interface
I know command(s) that will generate it:
   ifconfig | grep -A1 enp2s0 | grep inet | gawk '{print $2}'

Therefore if I want to shout that information from the rooftops I can do:


Test
- please take it any time either Sunday 7/25 or Monday 7/26. It appears on Canvas under Quizzes as "test1". Once you start it you have 70 minutes to complete it. It consists of 35 questions, all multiple choice:
 general - 8 questions
 individual commands - 12
 permissions -7 
 the shell -8
At midnight Monday night you will be cut off, so in order to have the allotment of 70 minutes start by 10:50pm. (7/22)

Homework
The topic here is shell scripting.
read -course outline section "shell scripting" Reading column
listen - the narrated slides, "getting started" link in course outline secrtion 7 Slides column
             the narrated slides, "Shell Scripting" link in course outline section 7 Slides column
do - the scripting exercise "categorize states" link in course outline section 7 Homework column    due in your assignments directory on the sputnik remote server end-of-day Wednesday 7/28
(7/22)

Grades - have been updated, at the link entitled "Grade reports" at left. They include the 4 assignments that were due last night. Please call any anomalies to my attention. (7/19)

Drop for non-participation - I have dropped students for whom I can find no evidence of participation to this midpoint of the course. (7/19)

Office hours recording - of tonight's optional Zoom meeting. In it I discuss the prospects for the upcoming test and 2nd half of the course. (7/17)

Grades - have been updated, at the link entitled "Grade reports" at left. They include the fundamentals, permissions, and permissionbits assignments. Please look yourself up by the same anonymous 5-digit value you derived in calculating your sputnik remote server password. Please call any anomalies to my attention. (7/15)

Way beyond our level - but worth your attention. The Advanced Bash-Scripting Guide is an extensive and unique collection (few hundred pages) of contributed, clever examples covering seemingly all the scripting features in the "language." Please be aware of it for the future occasions when you may want to find shell script examples of, just about everything. (7/15)

Test - this is the fourth week of the eight-week course. I am composing a test from the material we have covered, to be given soon. (7/13)

Homework
The topic here is commands and various bash features. The assignments involve guided scripting.
read - the readings in course outline section 6 reading column
listen - the narrated slides, "interactive bash" link in course outline section 6 Slides column,
 and also "text processing tools" link
do - the four assignments in course outline section 6 Homework column
  all 4 due in your assignments directory on the sputnik remote server end-of-day Sunday 7/18
(7/13)

Homework
learn - these commands, with textbook page number annotation
please refer to the book and check the man page for each command to become familiar and conversant with them. They are commands of frequent importance that may not be covered explicitly in slides.

cp - copy files and directories, p. 126
du/df - disk usage, p. 523/804
grep - print lines that match patterns, p. 232
kill - terminate a process, p. 465
locate/updatedb - find files by name p. 256
mv - move (rename) files, p. 237
ps - snapshot of current processe, p.s 374
rm - remove files or directories, pp. 126,186
tar - an archiving utility, p. 249
wc - print line, word, and character counts for each file, p. 244  
due, in your head, at a future test     (7/10)

Grades - have been updated, at the link entitled "Grade reports" at left. They include the Linux commands, simpleshell, and mock tech support assignments. Please look yourself up by the same anonymous 5-digit value you derived in calculating your sputnik remote server password. Please call any anomalies to my attention. (7/8)

Homework
The topic here is permissions of the ext filesystem family. Suggestions: 
   - read and listen first, and do second
   - be at a shell prompt as you are reading and listening
read - the readings in course outline section 5 reading column
listen - the narrated slides, "Permissions" link in course outline section 5 Slides column
do
1 - exercise at link entitled "Permissions intro" in course outline section 5 Homework column 
  due in your assignments directory on the sputnik remote server end-of-day Monday 7/12
2 - exercise at link entitled "permissions" in course outline section 5 Homework column 
  due in your assignments directory on the sputnik remote server end-of-day Monday 7/12   (7/8)

Man pages as scripture. (7/6)

Man page "section" categorization:

"Each man page should be categorized in a specific section, denoted by a single
character. The most common sections under Linux, and their human readable
names, are...:

1 User commands that may be started by everyone. 
2 System calls, that is, functions provided by the kernel. 
3 Subroutines, that is, library functions. 
4 Devices, that is, special files in the /dev directory. 
5 File format descriptions, e.g. /etc/passwd. 
6 Games, self-explanatory. 
7 Miscellaneous, e.g. macro packages, conventions. 
8 System administration tools that only root can execute. 
9 Another (Linux specific) place for kernel routine documentation."

from the "Linux Man Page Howto." Take a peek into /usr/share/man on Fedora, wherein all the man pages are actually stored. See also the Sobell textbook, pages 128-33, about the man command, the related info command, and the top sources for getting linux doc and information when you need it. (7/6)

Office hours recording - of last night's optional Zoom meeting. The recording covers the last 42 minutes of the meeting. It was preceded by a half hour that, regrettably, I did not record. (7/6)

A shell script sample - after I wrote a script to grade your homework about the exec( ) system function, I thought it worth while to annotate it as a general demonstration of several of the scripting features it contains. It was discussed in tonight's optional Zoom office hours meeting. (7/5)

Homework
The primary topic here is the shell, particularly the bash shell. You have learned that under the hood shells are engines/wrappers for the launching of programs, and that the lauching of programs means coordinated use of fork( ) and exec(). Now,what do shells look like from the outside in terms of features and usage? The secondary topic is to introduce, with an assignment, a few of the most basic verbs in the native language of linux environments.
Suggestions: 
   - read and listen first, and do second
   - be at a shell prompt as you are reading chapter 5
read - the reading in course outline section 4 reading column, Sobell ch. 5 about the shell
listen - the narrated slides, "The Shell" link in course outline section 4 Slides column
do
1 - exercise at link entitled "Linux commands" in course outline section 1 Homework column 
  due in your assignments directory on the sputnik remote server end-of-day Wednesday 7/7
2 - assignment at link entitled "simpleshell" in course outline section 4 Homework column
  due in your assignments directory on the sputnik remote server end-of-day Wednesday 7/7
3 - assignment at link entitled "filename expansion" in course outline section 4 Homework column
  nothing to turn in
4 -  I got a de facto request for tech support for a class lab. Your homework is to compose an email response to it, explaining what went wrong and how to make it go right, and send the response to me via email. Please title your message "linux support" exactly, because I use an email filter to capture incoming messages with that subject title (different title, no capture). Please send it to dmorgan@dmorgan.us (as opposed to my @smc.edu address). 
  send your email message by end-of-day Wednesday 7/7
You are the support technician. Here is the request I received:

(7/1)

Demonstration programs for unix process mechanism "fork/exec" - If you wish to examine or experiment, here is the series of 11 programs used in my slides demonstrating the workings of fork and exec. You can find them in the remote server as /home/public/fork-sourcefiles-process-creation.zip. (Use them on the server directly, or copy the zip into your home directory and from there download/scp  it out.) Find them under the same names by which they appear in the slides shown in class: fork1.c, fork2.c,..., fork11.c. If you want to compile so you can run them, the command to compile would be, for example:

  gcc  fork1.c  -o  fork1

The summary of the point of these programs is:

Version Purpose
fork1 shows fork, demonstrates that 2 processes result
fork2 shows PIDs (process id numbers) of these processes, and that they're distinct
fork3 shows fork's return value to the child copy (zero) and its return value to the parent copy (child's PID)
fork4 shows how to code differentiated behavior via an "if" structure conditioned on fork's return value
fork5 incorporates an exec call in the child
fork6 introduces exit call in child and wait call in parent, to give orderly discipline to their relative timing
fork7 gets the name of the program to be exec'd from the user via the command line
fork8 interactively gets the name of the program to be exec'd by prompting user
fork9 puts the activity inside a loop to extend it to second, third, fourth,... commands
fork10 shows a zombie process
fork11 shows an adopted child, init process as its step-parent after being pre-deceased by its original parent

(6/30)

Grades - have been published, at the link entitled "Grade reports" at left. Please look yourself up by the same anonymous 5-digit value you derived in calculating your sputnik remote server password. Please call any anomalies to my attention (e.g., you submitted but no grade shows, you did not submit and still want to, etc.) (6/29)

Homework -
listen - lectures at links entitled
 "linux vs UNIX, linux vs linux distributions," course outline section 1
 "roles of OS, shell, programs," section 1
 "How programs get run," section 3
 "Processes" (narrated), section 3
watch - videos (3) under the heading "Videos:" course outline section 3
read - textbook excerpts noted in Reading column, course outline
do - exercises at links entitled
"fork system call," section 3
"exec system call," section 3
  due in your assignments directory on the sputnik remote server end-of-day Sunday 7/4
(Note: a couple of the videos were published here, you may have watched, already. "Videos" are technical about coding, beyond our level of involvement, but revealing concerning processes and by a good presenter. Suggest you do the listening/watching in the above order. Then do the exercises, which draw on what you will have watched.)   (6/27)

Little lecture - please see The Picture (upper left corner of this page). It packs a number of ideas into a diagram. It tries to depict how programs get run. It needs some explanation. That's what the lecture tries to provide. Please listen. (6/22)

Welcome/Kickoff lecture - please listen (6/21)

Homework -
install
 - VirtualBox from https://www.virtualbox.org/
 - import into it the fedora31-spring21 virtual machine, following the detailed instructions at the link entitled "Obtaining and installing" in the section below headed "A virtual machine (VM) for you"
listen -
 - lecture at link entitled "Bootup" (narrated version) in Slides column of course outline section 2
read -
- readings in the "Reading" column of section 1 of the course outline
- article Inside the Linux Boot Process IBM from course outline section 2
do -
 - homework exercise at link entitled "systemd" in the Homework column of course outline section 2 due in your assignments directory on the sputnik remote server end-of-day Sunday 6/27  (6/21)

Apple's launchd - the inspiration for systemd. You can see the strong parallels between this article's description of launchd and our discussion of systemd. (6/21)

FreeBSD startup - I logged in. Note the greeting I got.

This reflects operation of the SysV system initialization method in FreeBSD. FreeBSD has not adopted systemd. It is not expected to do so because systemd uses linux-specific facilities. (6/21)

Take-away from presentation on bootup, initialization, and service management:

 


Course outline - with approximate weekly topic coverage corresponded to related readings, homework assignments, and in-class slides I will use. 

Sobell textbook author Mark Sobell has a website

Information sources about linux - see the latter several slides in the presentation at the link "Intro/installation" 

Replacing BIOS - including replacement for the MBR disk scheme. Necessitated to enable support of drives over 2TB. Dubbed "extensible firmware interface." 

Homework -
read -  from Sobell textbook-
Sobell ch 1 "Welcome" - read lightly, as casual background and overview
Sobell ch 2 "Installation Overview" - omit RAID and LVM sections. Omit sections on obtaining and burning source data on CDs.
Sobell ch 3 "Step-by-Step Installation" - read it over, up to section on X Window System; omit that and remainder of chapter. Describes installation steps.
view - this video of Marc Sobell, our textbook author, on a 1985 broadcast panel discussion about Unix. 

 

A virtual machine (VM) for you - hands-on lab exercises will be performed on a virtual machine that you can run in your own computer.
- Obtaining and installing your VM (link to fedora31-spring21.ova virtual machine image file)
- Transferring files in and out of it if necessary (accompanying howto video)
- Your VM's configuration
- VirtualBox networking "complete guide" - a good website on the subject

A Remote Unix system account is available for your use.

Using ssh (secure shell). ssh is an important tool you will use for interacting with remote computers. For that you will need an ssh client. There are a number of ssh client alternatives.

At home - I have an older page about various options for Running linux at home. However, the VM I give you this semester in effect sets you up to do just that. But you might want to consider other ways to get it going at home and this link suggests a few of them.

 


Eniac - 1946

Milestone in the history of computation

 

Assignments
see course outline

In-class exercises
see course outline