Linuxcbt Scripting Edition
Linuxcbt Scripting Edition
Serious
Linux IT-professionals are expected to have a command of various scripting environments for
administrative purposes. LinuxCBT Scripting Edition consists of the following 7 Modules:
LinuxCBT Scripting Edition, is unparalleled in content, depth and expertise. LinuxCBT Scripting
Edition prepares you or your organization for successfully developing and implementing businesscritical GNU/Linux-based scripting solutions. Linux automation requires a solid scripting foundation.
Recommended Prerequisites:
Open mind & determination to master Linux Scripting Solutions - BASH/Perl/Python/PHP
Access to a GNU/Linux-based PC to perform exercises in LinuxCBT Scripting Edition
Bourne Again Shell (BASH) Scripting - Module I
Introduction to BASH Command Line Interface (CLI)
Identify BASH installation & key configuration files on RedHat & Debian GNU/Linux
distros
.profile/.bash_profile/.bashrc/.bash_history
Identify & use common built-in BASH commands (pwd,cd,set,unset,export,source,etc.)
BASH Command-line Expansion
Brace Expansion
Tilde Expansion
Parameter & variable Expansion
Command Substitution
BASH Reserved words
BASH History identification & configuration
Aliases (ls,du,df,rm,cp)
Backticks - command expansion & execution
BASH Prompt configuration
Command chaining
Error level/Return code (Command Exit Status) identification
Conditional execution of subsequent commands (&&,||)
Redirection | Error Handling
Standard Input
Direct input from STDIN (Standard Input)
Redirect input from a file
Standard Output
While Loops
Until Loops
General Perl Information I
Block Definition
Use the X Functions for file system testing
Positional parameters - ARGV
Determine number of command line arguments
Record Separators
Internal Perl Variables
Modules
Explore the module path and applicable variables
Discuss various ways to install Perl modules
Install modules
File I/O
File Handles
Open Function
Discuss rules regarding file handles and use of the open function
Assign file handles to Perl arrays for iteration
Process text files using applicable file I/O functions and foreach loops
Generate data files using file I/O functions
Die function
Error handing with Perl's built-in variables
Count records from input file
Use the Split function to separate fields based on various delimiters
Use Join to assemble lists
General Perl Information II
References
Chomp - strip superfluous characters
Command substitution
Use execute function to launch external programs
Use system function to execute external commands and evaluate return status
Regular Expressions discussion
Demonstrate the many rules of Regular Expressions
Process arrays using push/pop functions
Generated data files and process them using split and field determination
Mail integration using Sendmail
Mail integration using downloaded Perl mail module
Define and execute Perl one-liners
Common Gateway Interface (CGI) - Apache 2.x integration
Process GET & POST variables
MySQL Database integration
Identify required modules for MySQL integration
Define connection object
Use control structures to generate output for use in File I/O exercises
Use the open function to read a file into a file handle
Iterate through the lines within the opened file using readline functions, etc.
Open file handles for writing
Open multiple file handles
Write strings to files using string formatting options and variable substitution
Parse source file by extracting columns to be stored in destination file
Regular Expressions
Discuss Regular Expressions
Import Regular Expressions module (re) for usage
Implement Regular Expressions (REs)
Regular Expressions Matching of strings and variables
REGEX Repeaters
Integrate Regular Expressions with text file processing
Exception Handling
Try & Except
Modules
Identification of default Python modules
Import modules (sys, os, etc.) for usage
Use the dir function to ascertain the classes and methods available within modules
Use the SHUTIL module for advanced, high-level File I/O (Copy, Move, etc.)
Python - Syslog integration
Define script using the Syslog module to log to syslog
Common Gateway Interface
CGI Discussion and applications
Implement Python CGI with Apache 2.x
Evaluate results of CGI integration
Globbing
Dictionaries
Further exploration of dictionaries
Parse log files into dictionary data structure
Organize results
Analyse data
Time
Review properties of various time functions
Export time with various functions
Use time functions to create log entries in process akin to Perl
Evaluate results
top
PHP - Hyper Text Pre-Processor - Dynamic Web Applications & CLI - Module IV
Installation
Identify Online PHP resources
Download PHP
Identify Apache prerequisite packages and programs - Modular support (mod.so)
Extract, compile and install PHP with Apache modular support
Compile and install PHP with Command Line Interface (CLI) support
Identify key PHP configuration files & directories
Configure Apache httpd.conf with PHP integration to provide PHP support
Configure Apache with PHP binary and source support
PHP Basics
Explain PHP-supported long/short/ASP parse-tags & identify configuration changes in
php.ini
Hello World script output using echo to the web browser
Describe the various comments supported by PHP
Examine the ouput of PHP-maintained variables using phpinfo()
Explain supported data types via variables (integers, strings, floating points, here
documents, arrays, etc.)
Test instantiation of supported variables with default types
Explain Quoting rules and variable interpolation
Demonstrate escape sequences such as tab, new lines, spaces, etc.
Exercise the echo command
Define basic associated arrays (i.e. hashes/dictionaries)
Define nested associative arrays
General Information
Examine key CGI PHP-server variables
HTTP_USER_AGENT
PHP_SELF
REQUEST_METHOD
DOCUMENT_ROOT
REMOTE_ADDR
HTTP_REFERRER
Explore HTTP GET Request Methods via the URLString and Forms
Explore HTTP POST Request Methods via the URLString and Forms
NULL Variables
Basic Math - PEMDAS
Integer and String Comparison Operators
Examine execution operators for executing Linux Shell commands and obtaining the
ouput
Variable assignment via execution operations
Illustrate the usage of nested arrays
Control Structures
IF - comparisons against integers and strings
Else/Elseif - comparisons against integers and strings
Test whether variables are of the same type
Comparison negation
Metacharacters
Enumerate important metacharacters
Provide examples of asterisk '*' usage
Apply simple character classes to searches
Perform searches in the Bluefish editor using literals and metacharacters
Explain and apply anchors: '^', '$'
Character Classes
Discuss features and applications
Perform searches in the Bluefish editor using character classes
Search for case-insensitive characters
Negate character class values using the circumflex character: '^'
Specify ranges and inclusions
Search for string boundaries
Alternate between POSIX and Perl-compatible Regular Expressions in Bluefish Editor
RegExes with GREP & EGREP
Discuss features and applications
Perform simple GREP searches
Use EGREP to find strings based on RegExes
Parse installed applications using EGREP
Extract 'su' attempts from the system log file: /var/log/messages
Parse log file entries based on specific dates
Parenthetical Expressions
Discuss features and applications
Compare and contrast with character classes
Search for strings using the Bluefish Editor
Combine anchors with parenthesis and evaluate results
Search for multiple groups of strings using alternation
Use parenthetical expressions with EGREP
Nest expressions using parenthesis
Quantifiers
Discuss features and benefits
Define RegEx tokens
Enumerate and discuss RegEx quantifiers
Test '?' using the Bluefish Editor and EGREP
Test '*' using the Bluefish Editor and EGREP
Test '+' using the Bluefish Editor and EGREP
Test '*' using the Bluefish Editor and EGREP
Test '{ }' - arbitrary quantifiers with the Bluefish Editor and EGREP
Combine anchors, parenthesis and various quantifiers
Shortcut Sequences - POSIX & Perl
Discuss features and benefits
Enumerate and discuss key shortcut sequences
Test shortcut sequences using the Bluefish Editor
Shell Basics
Create KornShell users on various systems
Identify key KornShell binaries and configuration files
Explore key KornShell variables
Discuss shell redirection and piping
Command Chaining | Substitution
Discuss features and applications
Explain general usage of 'test' command
Evaluate sequential execution of processes
Invoke commands contingently using logical AND and OR
Implement command substitution
Evaluate defined variables using command substitution
Variables
Discuss features and applications
Discuss and reference positional parameters
Explore standard command exit status variable
Learn how to define variables
Define persistent variables
Unset variables and evaluate
The Prompt - $PS{1..4}
Discuss various prompt shell variables
Setup vi-style command history access
Customize primary prompt with useful KornShell variables
Define a persistent prompt
Evaluate results
Functions
Discuss features and benefits
Explore POSIX and KornShell functions
Define useful functions in a script
Reference functions from a script
Discuss how positional parameters are supported with funcitons
Evaluate results
Loops
Discuss features and benefits
Identify the supported iteration mechanisms
Implement for | while | until loops
Create finite and infinite loops
Evaluate results
Conditions
Discuss features and applications
Explore comparison testing
Perform numeric comparisons
Perform string comparisons
Explain usage
Create cases based on simple RegExes
Write script to identify file types using case
Explore case usage in system scripts
Evaluate results
Job Control
Discuss features and benefits
Background and foreground jobs
Interact with running jobs
Isolate jobs from TTY
Evaluate results
Typeset
Discuss features and benefits
Define variables of disparate types
Justfiy variables
Transform positional parameters and variables
Enumerate system variables
Scope variables in and out of functions
Evaluate results
Input Validation
Discuss features and benefits
Ensure the requisite number of positional parameters
Confirm input prior to execution
Evaluate results