Scripting Compatibility for Current OPS235 labs: (Week-by-week)

From CDOT Wiki
Revision as of 15:08, 17 January 2015 by Msaul (talk | contribs)
Jump to: navigation, search

Purpose of this Resource:

To match compatibility of scripting elements for current OPS235 labs. Emphasis will be placed on practicality, creativity, and listing scripting items that can be used to match and compare towards existing scripting course OPS435 to provide information for CNS / CTY curriculum discussions. This resource will concentrate initially with short-term "fits" (i.e. no major structural changes to course from existing learning outcomes, topics and core skills.


Lab 1:

When executed as root or using sudo command, prompts for elements to include in report
Notifies completion of report and file pathname of report
Scripting for Lab1. Lab 1 could be modified to have students generate a report regarding the collection of Linux information after an install. Certainly command substitution could be taught and to reinforce redirection >> to add content to a filename (i.e. not over-ride). It would be interesting to expose students to the zenity command to allow a menu to give user choice of report elements to include in the generated report. Perhaps a link to a "fancy" Bash shell script to generate a web-page so students can view the contents in a nice format. This scripting element could easily be added to assignment #1.

OPS435 Elements:
  • command substitution (shell grammar?)
  • redirection (> vs >>)>
  • IO Stream vs Graphical Interaction (eg. zenity)
  • Scripting Samples (View and adapt- don't "re-invent the wheel completely")
  • Exposure to for loop with positional parameters (storing checkbox selections) for report


Example of Shell script Demo: [ report.bash ]

Listing of Scripting Skills from Demo Listed Above:
  • if statement
  • exit command
  • USER Environment Variable
  • redirection (both > and >>)
  • zenity
  • for loop
  • command substitution
  • sed
  • set command (positional parameters)


Connection with ULI101 Scripting Skills (Course Outline):
Connection with OPS435 Scripting Skills (Course Outline):

Practical Consideration for scripting in lab1: Do students create simple bash shell script, add elements, then have them copy and paste, then run this more complex script? Key elements of scripting elements should be contained in information boxes in lab. Should midterm and/or final exam contain a scripting question? (recommended)

Lab 2:

Scripting for Lab2. Lab 2 could be modified to have students create or be exposed to shell scripts with use the virtual shell (virsh) to display in zenity available VMS in checkbox form to select and launch. Likewise, script can be launched to display in zenity VMs that are currently running in order to shutdown (perhaps in same fashion as a zenity dialog box).
OPS435 Elements (Scripting Demo Contents):
  • if statement
  • for loop
  • Command Substitution
  • Advanced awk
  • positional parameters
  • sed
  • IO Stream vs Graphical Interaction (eg. zenity)
  • Scripting Samples (View and adapt)- don't "re-invent the wheel completely")
  • virsh command


Example of Shell script Demo 1 (untested):
[ vm-start.bash ]
Example of Shell script Demo 2 )untested):
[ vm-stop.bash ]

When executed as root or using sudo command, provides VM status and opportunity to start VMs
When executed as root or using sudo command, provides VM status and opportunity to stop running VMs
Connection with ULI101 Scripting Skills (Course Outline):
Connection with OPS435 Scripting Skills (Course Outline):

Practical Consideration for scripting in lab2: Do students create simple bash shell script, add elements, then have them copy and paste, then run this more complex script? Is lab2 too long for scripting element to be included? Key elements of scripting elements should be contained in information boxes in lab. Should midterm and/or final exam contain a scripting question? (recommended)

Lab 3:

This lab deals with software installation and introduction to LVM. Not certain shell scripting would benefit software installation with yum, since can use yum to install multiple instances of software. On the other hand, would be useful to expose students to shell scripts that manage LVM for practical situations (i.e. case scenarios - real world situations). Should consult with professors and industry SMEs to provide good examples of scripts involving LVM. LVM scripting example should be included in this lab since lab4 is a big lab and keeps students very involved.
OPS435 Elements (Scripting Demo Contents):
  • x
  • x
  • x
  • x
  • x
  • x
  • x)
  • x
  • x


Example of Shell script Demo 1 (untested):
[ x.bash ]

Lab 4:

One scripting example that would apply here is user account management. Could use zenity to create a dialog box to select specific operations. Additional zenity dialog boxes can use text-boxes to obtain information such as username, fullname, etc.
OPS435 Elements (Scripting Demo Contents):
  • x
  • x
  • x
  • x
  • x
  • x
  • x)
  • x
  • x


Example of Shell script Demo 1 (untested):
[ x.bash ]

Lab 5:

A shell script could demonstrate the automation of obtaining a zipped tarbar via url (wget), decompression zipped tarball, change to source directory, logic to see if ./configure command needs to be run, compile and run software or provide error or problems of failure to install software or this would be a good task for assignment #2.
OPS435 Elements (Scripting Demo Contents):
  • x
  • x
  • x
  • x
  • x
  • x
  • x)
  • x
  • x


Example of Shell script Demo 1 (untested):
[ x.bash ]
/blockquote>

Lab 6:

Lab 7:

Lab 8:

Assignment 1:

  • Add element to existing assignment to develop an asset inventory for installed Linux system. Perhaps use html template to create nice-looking report based on required content.
  • Add element to create a shell script to backup VMs from /var/lib/libvirt/images to a USB device.

Assignment 2:

  • Add a shell script requirement to automate compilation of source code. For example: obtaining a zipped tarbar via url (wget), decompression zipped tarball, change to source directory, logic to see if ./configure command needs to be run, compile and run software or provide error or problems of failure to install software.

Quizzes:

Additional Comments

Additional Resources