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



Administrativa

Syllabus

Grade reports

Course outline
(under construction)


DETER net testbed
  home
  get/use an account
  FAQ
  tutorial


Information


Linux links

Remote Unix access with telnet

Remote Unix access with ssh

Variations among Unixes

vi - the Visual Editor

Line termination

Using ftp

Fundamental Unix Commands

System calls

File permissions

Filesystem analysis

Cheat sheet - bash shell

Shell script basics

Shell programming:
if and while

Shell programming book


Slide presentations

Intro/installation

Bootup & Init

Bootloaders

Nuts & bolts

More nuts, more bolts

vi editor

Users/permissions

The Shell

Linux GUI

Shell Scripting

Processes

Homemade shell

Process miscellany

Compilation

Installation

Patching

yum (auto-update)

ssh - Secure shell

Backup

Scheduled processes

Unix time

System control

Centralized logging

Kernel building

 

knoppix

Molay chapter 1 (more)

Line termination

 



 

FALL 2012
Section 4112 6:30p - 9:35p Fri Bus 263

This Website (http://homepage.smc.edu/morgan_david) 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.

Thank you - for your interest in the course and the subject. And your good humor. I enjoyed the class and hope it will serve you well. (12/14)

Other courses I teach - are known to you from the main website front page. There, you can see the class-specific pages from recent semesters for a fully concrete idea what they are. In Spring 2013 I will teach only CS70, networking, at SMC. (Traditionally it has been CS70 and CS40, operating systems, each spring and CS70, CS78, and CS41, linux, each fall.) I also teach related courses at UCLA Extension including a new one on shells and shell scripting (Winter/January) and a "linux intermediate" (Spring/April) which amounts to system administration topics that go beyond my SMC curriculum.. They are more costly than those of community college, but are public and available. (12/14)

Grades - updated at link entitled "Grade reports" at left. The two grades yet to be added are tonight's final exam and the "comparative UNIX" DETER exercise due on sputnik tomorrow. If your cumulative average is lower than you like, you've missed any assignments, and you'd like to still do something about it please speak/email to me. (12/14)

Paid internship opportunity - NASA Langely (Virginia) Research Center. (12/11)

Grades - updated at link entitled "Grade reports" at left, to include the fork/exec sample program assignment. ( 12/7 - infamy )

Final exam - is scheduled for December 14, 6:45pm. Please meet in room B259. It will be multiple-choice, closed book. There will be about 20 questions. Please bring a scantron form. (12/7 - infamy )

If you want to learn a lot of linux in a little time - I recommend the SCaLE 11x (Southern California Linux Expo) held Friday - Sunday February 22-24, 2013. It's intense, inexpensive, local. (12/7 - infamy )

Homework
do - this exercise on comparison among different flavors of UNIX. This is to be done on DETER, remotely, using the DETER accounts issued to you some time ago.
when to work - today through next Tuesday 12/11. As a class, we have reservations on DETER for machines till then.
what to turn in - as the product of this assignment, answer the 7 multiple-choice questions at the end of the exercise write-up. Please submit answers to them onto the remote Unix machine using these preparation and submittal instructions. Please name your file "comparisons.txt".  - due end-of-day Friday 12/14 (12/5)

Internship opportunity, summer 2013, NIST. Gaithersburg MD, Boulder CO.(11/27)

Homework
do the "fork/exec/processes" exercise in the homework column of section 8 of the course outline - due on paper in class 11/30.
read - the material about "time" (setting clocks and scheduling jobs) in the reading column of section 9 of the course outline. (11/16)

Grades - updated at link entitled "Grade reports" at left, to include the 2 shell scripts and the midterm. (11/13)

Homework
do the reading and activities about processes in section 8 of the course outline.  (11/9)

Job opportunity (11/5)

Test - 11/9. Will cover commands, permissions, shell and GUI. Please bring a scantron form 882. The test is closed book. (11/1)

Precedence order of commands - shell builtins versus binary executable files, sharing the same name. Builtin has precedence by default. You can "turn off" a builtin with "enable -n" and turn it on with "enable". (enable is itself a builtin.) You can look at a list of the state of all the builtins with enable -a.

[root@emach4 ~]# echo 'echo "this is my imposter script named \"cd\""' > /bin/cd
[root@emach4 ~]# chmod +x /bin/cd
[root@emach4 ~]# cd /etc
[root@emach4 etc]# enable -n cd
[root@emach4 etc]# cd /home
this is my imposter script named "cd"
[root@emach4 etc]# 
(10/29)

Documentation for builtins - is found within the manpage for bash. However you can bring up only that section of the manpage with "man builtin" or man command against any individual builtin command, e.g., "man read" or "man cd". (10/29)

Give me a nickel - every time any of these work for you
 - find (realtime search) or locate (snapshot based) to determine what files are on your system
 - "the root directory" or "the directory root"
 - filename completion
 - command recall with ctrl-r's incremental reverse search of history
 - virtual terminals with ctrl-alt-Fn keystrokes (10/29)

Homework
complete - the scripts from section 7 by Sunday, as assigned in the 10/19 homework posted last week.
do the reading and activities about the X Window System based gui in section 6 of the course outline.  (10/25)

Midterm - I expect it to be November 9. (10/25)

Grades - updated at link entitled "Grade reports" at left, to include the mock tech support exercise. (10/25)

Grades - updated at link entitled "Grade reports" at left. (10/19)

Homework
do the reading and homework in section 7 of the course outline, the 2 scripts due on sputnik end-of-day Sunday 10/28.
do - I got a de facto request for tech support for our 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 the email "linux support" and I will use an email filter to capture incoming messages by that name. Please send it to my non-smc email address. Send it by end-of-day Wednesday 10/24. You are the support technician. Here is the request I received:

(10/19)

"if" versus "test" in shell scripting - don't get syntaxes confused. The "condition" expression in an if statement is a command, and standard command syntax includes no such thing as surrounding square brackets for every command! 

(10/19)

IT job in Santa Monica, seeking SMC student. (10/17)

Homework
do the reading and activities about the vi editor in section 4 of the course outline. Do the reading about the shell in section 5. Then do the reading about shell scripting in section 7. (We will come back to section 6, about graphical interfaces.)   (10/12)

Grades - posted at link entitled "Grade reports" at left. (10/12)

Opportunity for you to work at Jet Propulsion Laboratory - yes I know, I didn't take it seriously before I worked there this summer either. They have a formal program to take in qualified SMC students-- they are looking for you. The environment at JPL is rich. It's linux Candyland. Merely by being in this class, you have de-facto preliminary qualification. If an internship might at all meet your needs, or if you're unsure, please find out about it and give it consideration. Two SMC students who interned at JPL will speak on campus Thursday (below) and JPL publishes information about the Student Independent Research Intern Program online. Here are some application procedure details (it is incorrect you must be a U.S. citizen, a permanent resident is also eligible).

Homework - due on sputnik end of day Sunday10/14
do - the assignment at the link entitled "permissions" in the homework column of the course outline. The passwords for the accounts involved are all "password#UCLA" and the server on which to remotely do the assignment is sputnik.smc.edu.
finish - last week's "Linux commands" homework (I didn't give a due date) by the end of Sunday 10/7. (10/5)

Homework - do Linux commands. You should by now have done the reading in Course outline sections 1-4. Now do the reading in section 5. Topics we will cover next are the shell, and permissions. (9/28)

Sputnik restored - it's up and running. (9/26)

Procedures for using class laptops (9/20)

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 94-91, about the man command, the related info command, and the top sources for getting linux doc and information when you need it. (9/21)

Homework -
read - article Multibooting with GRUB
 part1  (alternate link)
 part2  (alternate link)
read to get the flavor of GRUB's architecteture, purposes, and capabilitities as a representative of the bootloader program category. Not to become a GRUB expert.
(9/21)

Homework -
read -
article Linux System Startup about Unix SysV startup procedure
article Inside the Linux Boot Process IBM
Sobell ch 5 "The Linux Utilities" - a catalog of important commands. Read it but skip discussion of the following less important commands: hostname, lpr, uniq, diff, mcopy, gzip/gunzip/bzip, apropos, finger, w, write/talk/mesg. Skip vim tutorial. While reading, I suggest you sit before a linux system and try out the commands and his examples hands-on. (9/7)

Laptop assignments - students are assigned to use and handle only specific laptops. (9/5)

Neil Armstrong R.I.P.

"In 2007, Forbes, where I then worked, asked 50 prominent individuals their thoughts on the American Dream. I asked Armstrong to participate and, no surprise, he declined, writing: 'To me, the American Dream today seems like nothing more than sitting back and being entertained.'"
  -- James Clash, "Memories of Neil Armstrong, Shy hero, American Patriot" 

Prove him wrong. (8/31)

A remote Unix system utility account has been created for you.
Your username - your last name as it appears on my class list, all lowercase.
Your password - is 5 digits extracted from your phone number. If your phone number is 123-456-9876, then your password will be 56987 (final 2 digits from the 3-digit exchange, plus first 3 digits of the 4-digit number).
The target computer - is sputnik.smc.edu
Usage method - you will use it by independent methods for two independent purposes:
 - to log in to it remotely, obtaining a shell and conducting a usage session
 - to transfer files back and forth between it and the computer you are using locally
Students sometimes confuse these 2 different access methods and purposes.
To log in, use ssh as described in the "Remote Unix access with ssh" link at left. Accordingly if your name is John Smith for example, and you are using a command-line ssh client:

  ssh  smith@sputnik.smc.edu

and give your password when then prompted.
To transfer files, use any graphical ftp client that also supports sftp, and point it to sputnik.smc.edu. A good free graphical multi-platform client is filezilla. Alternatively use sftp and/or scp. They are command-line file transfer components of the ssh program. They are built-in to Filezilla, see this youtube tutorial. sftp and scp could also be used on the command line in OpenSSH/linux, or as "pscp" and "psftp" as part of PuTTY. When you perform an ftp or sftp login, you will be in a private directory on the remote sputnik computer. Each student has his own. It would be named /home/smith for our hypothetical friend John Smith. There, you'll see a subdirectory named "assignments." To use scp from the command line, the most quick-and-dirty option, the syntax is:

scp  <filename>  <user>@<server address>:/home/<user>

I will ask you to transfer homework files into your "assignments" subdirectory as the means of submitting them. (8/30)

Distributing files to you from sputnik - the above file transfer discussion describes file movement to and from your own home directory, exclusive to you. Sometimes I will want to have someplace to put a file so everybody can get to it and download it. When I do that, here's how to download them. (8/31)

ssh client alternatives - we use ssh as a connectivity tool. Here are some ssh clients. If your machine is a linux machine ssh is very likely already installed as a command-line utility. If it's a Windows machine you need to install a client. Depending if you prefer command lines or GUI dialogs, get OpenSSH for Windows or PuTTY. There are also a few others. OpenSSH delivers ssh to Windows in the same command-line form as it's found in linux, while PuTTY is graphical A particular version of PuTTY useful for portability is portaputty. It's a version of PuTTY that avoids the registry so as to be portable. So, you could carry it around to different computers on a USB flash drive and have your accustomed configuration right there with you instead of in the registry back home. Read the link at left entitled "Remote Unix access with ssh." (8/31)

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

Slides we're viewing - let me call your attention to the links for your review:
Intro/installation
Bootup
Bootloaders
Nuts & bolts
More nuts, more bolts (8/31)

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

Sobell textbook author Mark Sobell has a website. (8/31)

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. (8/31)

Running linux at home - your option, a useful idea though not required
 - install it to hard drive (get it from e.g. http://www.fedoraproject.org)
 - install VMWare and run it under that. Free, works great. www.vmware.com . There are a variety of other free virtualizers you could consider (virtual PC from Microsoft, virtualbox from Sun Microsystems, parallels on Macs).
 - boot from a "live CD" - here's a list of various self-contained bootable linux CDs. They typically convert memory into a RAM-disk, populate it with foundation files for the operating system, and proceed to boot linux. They do not molest your hard disk. But they are not storage-persistent. The best known is probably knoppix. FYI.
 - boot from a USB drive
 (8/31)

Some student self-drop deadlines:
9/9 - Last Day to Withdraw to Receive an Enrollment Fee Refund
9/9 - Last Day to Withdraw to Avoid a "W" Grade on the Transcript
11/18 - Last Day to Withdraw for a Guaranteed "W" Grade on the Transcript (8/31)

 

 


Eniac - 1946

Milestone in the history of computation

 

Assignments/due

Linux commands

knoppix

ftp

A vi assignment

permissions

Shellscript 1

Shellscript 2

sort command

fork/exec/processes

In-class exercises

adjustments

device vs file

line termination

boot sequence

runlevels

filename expansion

window managers
(in-class)

permissions intro
(in-class)

users/groups/access

rpm economics
 (in-class)

yum and rpm
 (in-class)

centralized logging
 (in-class)

rotating log files
 (in-class)

monitoring log files
 (in-class)

syslog-ng
(in-class)

compiling a program

ssh key setup
 (in-class)

backup
 (in-class)

scheduled jobs
 (in-class)

Unix time
(in-class)

compiling the kernel-FC4
(in-class)

compiling the kernel-FC5
(in-class)