Computer Lab Automation

From CDOT Wiki
Revision as of 20:55, 3 August 2011 by Msaul (talk | contribs)
Jump to: navigation, search

Automation and Computer Lab Maintainance


Linux system administration can be a number of task which may include:


  • Checking / maintaining smooth operation of the server / workstations (run benchmarks)
  • Replace defective server / workstation hardware
  • Perform computer hardware upgrades
  • Install applications
  • Upgrade Linux OS / Upgrade applications
  • Create / Remove / Suspend Linux computer accounts
  • Create / Enforce Acceptable Use Policy of Computer Lab
  • Maintain security (from within / outside) the computer lab
  • Write programs (including shell scripts) to automate routine tasks


As the saying goes "necessity is the mother of invention". When you set up a Linux computer lab, you may be required to provide (or train users) support for that system. One advantage of providing (volunteering) support is that users will ask you questions which will encourage you to automate or fix problems, instead of you having to think ahead of what tasks to automate. There is simply no better experience (other than working in IT for a company)...


Automating Routine Tasks

As a Linux system (LTSP computer lab) administrator, Your job is to "look after" the smooth operation of the computer lab. This will require you to either use graphical applications (programs) to administer the computer lab, or open a command prompt (called a "shell" in Linux terminology) to issue Linux operating system commands.


What ?!? Issue old fashioned Linux commands? Yuk!

Well hold on here a minute... I didn't say you always had to issue Linux commands, there are a lot of graphical programs that act as graphical "frontends" to achieve the same result from issuing Linux commands. But sometimes it is nice to know you can resort to Linux commands if a graphical administration tool is not available. Also, Linux commands can be placed into a file to run (like MS Windows "batch" files) to automate routine tasks. This allow you to create you own "customized" programs!


A wise Unix/Linux user once mentioned, "With Linux, learn it once, know it always". In other words, if you take the time to learn Linux commands and understand the system/setup files, you can perform all of the tasks with or without graphical administration programs. People that were working on UNIX systems in the 70's can still work on Linux systems (and not have to pay $10.000 every 4 years to maintain their designation, or learn new graphical administration tools)... cool!


Knowing which type of programming language to use when automating a task is based upon a programmers knowledge base and experience. In other word, knowing which is the "best tool for the task". Should the program be compiled (like C, C++, etc) for efficient operation? Should program be interpreted (eg. Shell Script, Perl Script, JavaScript) for ease of programming? Many factors are involved here, but shell scripting is definitely an easy way for the administrator to automate routine tasks... I will only be discussing Shell Scripting in the WIKI, although, you can access by webpage to learn other programming languages (like C - Course: IPC144)...


Many of the shell scripts on the Internet are "open-source" so instead of trying to "re-invent the wheel", you may be able to download, use, and/or modify the contents to meet your own needs...

Bash Shell Scripts used in Westminster United Church Computer Lab

Automatically Power-up Workstations (Wake-on-Lan)

This program (shell script) uses WOL (Wake-on-Lan) signal to automatically start-up workstations that are powered-off.
There are several advantages of this method:
  • All computers (server/workstations) can be shut-down when not in use (saves energy).
  • Saves time for teacher/volunteer by clicking on icon to automatically powering up workstations as opposed to powering up each workstation individually.
  • Workstations powered-up in one second intervals to balance the electrical load on church's circuits.
  • Allows teacher/volunteer to power-on and power-off all workstations by one power outlet switch, thus allowing monitors to be powered up (i.e. don't have to power-on or power-off workstation monitors).
Here is the bash shell script for powering the workstations: Power Up Workstation Script


Note: The workstationMacAddress.txt just contains the MAC ADDRESSES OF EACH WORKSTATION (on separate lines)


Acceptable Use Policy Dialog Box

For any computer lab to be used, it is highly recommended to not only develop an "Acceptable Use Policy", but to remind users of this policy every time they login to a computer account on that system. Below is a link to a sample of this policy - a dialog box that appears whenever a user logs in:
Acceptable Usage Policy Script
It has some neat features:
  • Logs-out if CANCEL is pressed.
  • Logs-out if user closes dialog box.
  • Logs-out if user ignores dialog box message for over 20 seconds.
Of course, the user can always click OK to confirm and disregard policy, but that becomes the individual's problem, and they are now open account privilege removal....



Manage Workstations

The Italc application is used to allow a teacher (from the computer server) to control all student workstations.
The following script is required to run (at user start-up) to launch the Italc application for the teacher.
Here is the bash shell script for launching Italc: Start Italc Application for Teacher


Note: This program can be launched upon user login by Selecting in the main menu:
PREFERENCES -> STARTUP APPLICATIONS, and adding a new application to be automatically launch upon user log-in.

Grab Student Work

The LTSP computer lab is designed to have several numbered generic accounts to represent each workstation.
For example:
  • jamm1 - jamm7 (workstations #1 - #7 for jamm accounts)
  • studio1 - studio7 (workstations #1 - #7 for studio accounts)
Instead of having the instructor place a USB stick into each and every workstation, a shell script has been created to "grab" the work to a teacher's USB device plugged into the server, with the option to remove the "grabbed"work.


Here is the bash shell script for grabbing student work: Grab Student Work
NOTE: Needless to say, for the successful operation of this program, students MUST save their work in the designated and default setting for each file type when creating their documents...
Murray Saul (author) uses Ubuntu Studio and his net-book to transform his simple keyboard controller into a Hammond B3, Rhodes Piano, Grand Paino, etc, etc, etc. Here is the band called "The Lucky Bleeders" performing at the Cameron House, Toronto, ON, Canada

Start Recording Studio Session

It is this author's opinion that having a recording studio for the Westminster computer lab (both server and FAT disk-less clients) makes this computer lab very unique and special.


From my Internet reading Linux usually gets a "bad-rap" users of other operating systems. One of the main "sticking points" is that there are too many applications to use and patch together to create a song (for example patching via the Jack audio server). But a shell script can be used to automate this process to make it "seemless" for the "budding" musician.


Here is a link to a shell script that was created to launch a recording session (with options) for the Westminster Computer Lab: Launch Recording Session
This program can be created as a desktop icon to launch when required, or added as a "Start-Up" application to launch automatically upon user account login...