Open main menu

CDOT Wiki β

Changes

no edit summary
{|cellpadding="15" width="100%"
|-
|<blockquote><blockquote>'''Script #1 :Start/Stop VMs (graphically):'''<br>[ [https://scs.senecac.on.ca/~murray.saul/vm-start.bash vm-start.bash] ] [ [https://scs.senecac.on.ca/~murray.saul/vm-stop.bash vm-stop.bash] ]<br><br>'''Scripting Skills:'''<blockquote><ul><li>'''if''' statement</li><li>'''for''' loop</li><li>'''Command Substitution'''</li><li>Advanced '''awk'''</li><li>'''positional parameters'''</li><li>'''sed'''</li><li>'''IO Stream vs Graphical Interaction''' (eg. zenity)</li><li>'''Scripting Samples (View and adapt)'''- don't "re-invent the wheel completely")</li><li>'''virsh''' command</li></ul></blockquote><br><br>'''Practical Consideration for scripting in lab2:<br><blockquote>''' Students use '''wget''' to download existing shell script and run it to see what happens. Students are '''encouraged to view contents of more advanced shell script(s)''', to see where the commands are being used (from previous shell script), but are '''not required to understand more complex elements''' of these shell scripts.<br><br>
|[[Image:lab2-script-1.png|thumb|left|175px|When executed as '''root''' or using '''sudo''' command, provides VM status and opportunity to '''start''' VMs]]
|[[Image:lab2-script-2.png|thumb|left|175px|When executed as '''root''' or using '''sudo''' command, provides VM status and opportunity to stop '''running''' VMs]]
{|cellpadding="15" width="100%"
|-
|<blockquote><blockquote>'''Script #2: Backup VM images:'''<br>[ ] (to be created)<br><br>'''Scripting Skills:'''<blockquote><ul><li>x</li><li>x</li><li>x</li><li>x</li><li>x</li><li>x</li><li>x</li><li>x</li><li>x</li></ul></blockquote><br><br>'''Practical Consideration for scripting in lab2:<br><blockquote>''' Students use '''wget''' to download existing shell script and run it to see what happens. Students are '''encouraged to view contents of more advanced shell script(s)''', to see where the commands are being used (from previous shell script), but are '''not required to understand more complex elements''' of these shell scripts.<br><br>
|[[Image:lab2-script-3.png|thumb|left|175px|When executed as '''root''' or using '''sudo''' command, allows for selection of VM images in '''/var/lib/libvirt/images''' directory and backs-up to various media options]]
|}
{|cellpadding="15" width="100%"
|-
|<blockquote><blockquote>'''Scripting Demo (user account management):''' [ [http://cs.senecac.on.ca/~murray.saul/create-users.bash create-users.bash] ]<br><br>'''Scripting Skills:'''<blockquote><ul><li>'''if''' statement</li><li>'''Testing for existence of regular file'''</li><li>'''Arrays'''</li><li>'''Math''' Expressions</li><li>'''exit''' command</li><li>USER '''Environment Variable'''</li><li>'''redirection''' (both &gt; and &gt;&gt;)</li><li>'''useradd'''</li><li>'''for''' loop</li><li>'''command substitution'''</li><li>'''mail'''</li><li>'''awk''' command ('''positional parameters''')</li></ul></blockquote><br><br>'''Practical Consideration for scripting in lab4:'''<br><blockquote>
'''Practical Consideration for scripting in lab4:''' '''Possible "teachable area" to add as end of lab4 for students to learn manipulating data files for mass (batch) processing'''. 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)<br><br>
|[[Image:lab4_1.png|thumb|left|375px|When executed as '''root''' or using '''sudo''' command, allows for creation of many user accounts (stored in a user database in /root/new-users.txt]]
13,420
edits