Open main menu

CDOT Wiki β

Changes

OPS245 Lab 1 dev

626 bytes added, 22:53, 14 February 2023
no edit summary
=LAB PREPARATION=
[[Image:vmware-1a-rhel.png|thumb|right|450px|The VMware Workstation application will allow you to create and administer '''4 different virtual machines''' ('''VM'''s) on your computer system. ]]
===Purpose of Lab 1===
| |[[Image:ssd.png|thumb|left|175px|<b>Solid State Drive</b><br>Minimum Size: 250GB]]
| [[Image:log-book.png|thumb|left|100px|<b>Lab Logbook</b><br>[[:Media:OPS245-Logbook-Online.doc|(lab 1Click Here to Download)]]]]
| style="padding-left:15px;" |Package Management
| style="padding-left:15px;"|Matrix on-line tutorials<br><ul><li>Linux Basics:<br>'''/home/ops235/linux-basics'''</li><li>Using the vi Text Editor:<br>'''/home/ops235/vi-tutorial'''</li><li>Shell Scripting - Part I (Scripting Basics):<br>'''/home/ops235/scripting-1'''</li></ul>
|}
 
= INVESTIGATION 1: CREATING A RED HAT ACCOUNT AND DOWNLOADING THE ISO =
<li>Add a line that will print out the heading '''System Report'''<br />
<code style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;font-weight:bold;">
print('System Report\n')
</code>
</li>
<li>Save your script and run it. Does it work?</li>
<li>You'll notice that the python script is currently sending its output to your terminal. Since we haven't covered how to write to a file yet, this is ok for now. Just use output redirection on the command line when you run the script to send the output to '''~/bin/pythonreport.txt'''.</li>
<li>Add Open your script in a text editor (like Vi) again, and add the following lines below the print statement:</li><pre style="color:#3366CC;font-family:courier;font-size:.9em;margin-left:20px;>&#35; Import the Operating System moduleimport os &#35; Print a heading for the date command outputprint('Current Date:') &#35; Call the date command using the os moduleos.system("date +'%A %B %d, %Y (%I:%M %p)'")</pre><li>Save your script and run it again. Observe the output. What do you think the os.system command did?</li><li>Based on the above example and output, add the extra commands for your python script to also output (with appropriate headings):
<ul>
<li>The current date.</li>
<li>The hostname of the machine.</li>
<li>The kernel version.</li>
# Install git by issuing the following command: <code>sudo dnf -y install git</code>
# Download all the lab check scripts into your bin directory: <code>git clone https://github.com/ops245/labs/ /home/your-seneca-id/bin</code>
 
<!-- #Download the checking script by issuing the following Linux command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">wget https://raw.githubusercontent.com/OPS245/labs/main/lab1-check.bash</span></code></b><br><!--For Andrew's sections use this script instead:<br><b><code><span style="color:#3366CC;font-size:1.2em;">wget http://littlesvr.ca/ops245/lab1-check-andrew.bash</span></code></b><br>-->
# Give that downloaded shell script file execute permissions (for the file owner).<br><br># Run the shell script using '''sudo''' and if there are any warnings, make fixes and re-run shell script until you receive a "congratulations" message.: <brcode>sudo ./lab1-check.bash<br/code>#Arrange evidence (command output) for each of these items on your screen:
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Run the '''lab1-check.bash''' script (must have all <span style="color:#66cc00;border:thin solid black;font-size:1.2em;">&nbsp;OK&nbsp;</span> messages, and the congratulations message)
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Proof that r9host VM is set for '''virtualization''' (Refer to: '''INVESTIGATION 2''' - '''Part 1''' - '''Step #29''')
: 78. Take a screenshot of the evidence and upload it, the file generated by the lab1-check.bash script, your logbook, and your myreport.py to blackboard.
= Practice For Quizzes, Tests, Midterm &amp; Final Exam =