Difference between revisions of "OPS235 Assignment 1 Fall 2013"

From CDOT Wiki
Jump to: navigation, search
(OPS235 Assignment #1 -- Summer 2010)
Line 18: Line 18:
 
{{Admon/note | Important | To complete the first task you may need to create an additional virtual disk image for the <code>fedora2</code> virtual machine.}}
 
{{Admon/note | Important | To complete the first task you may need to create an additional virtual disk image for the <code>fedora2</code> virtual machine.}}
  
#Setup your system so that the command <code>mount /assignmentdir</code> -- executed by any user -- will attach the logical volume <code>assignment-vol</code> from the volume group called <code>ASSIGNMENTGROUP</code> (minimum 100 MB) to the mountpoint <code>/assignmentdir</code> (The volume should NOT be automatically mounted at boot time)  
+
#Setup your system so that the command <code>mount /assignment</code> -- executed by any user -- will attach the logical volume <code>assign-vol</code> from the volume group called <code>ASSIGNGROUP</code> (minimum 100 MB) to the mountpoint <code>/assignment</code> (The volume should NOT be automatically mounted at boot time)  
#Setup your system login message to say '''The Open Source Community Is About Freedom And Choice''' (to be displayed on all virtual consoles after the login prompt)
+
#Setup your system login message to say '''The Open Source Community Is Changing The Computing World''' (to be displayed on all virtual consoles after the login prompt)
#Setup your system login banner to say '''Free as in --Free of Charge-- is good too.''' (User should see this before login to the system)
+
#Setup your system login banner to say '''Free as in Freedom.''' (User should see this before login to the system)
#Setup your system so that every user has a command alias called <code>rmtempdir</code> which will delete the contents of a directory called <code>~/temp</code> '''NOT''' the <code>/tmp</code> directory.
+
#Setup your system so that every user has a command alias called <code>deltemp</code> which will delete the contents of a directory called <code>~/temp</code> '''NOT''' the <code>/tmp</code> directory.
 +
#Setup the bash environment for the user '''root''' so that the prompt includes the current date.
  
 
==Finding your way==
 
==Finding your way==
Line 27: Line 28:
 
'''Research on your Fedora system to come up with sets of commands to accomplish the following tasks :(5 points for each completed task)'''
 
'''Research on your Fedora system to come up with sets of commands to accomplish the following tasks :(5 points for each completed task)'''
  
#Display a list of all the files under the <code>/etc</code> directory and its sub-directories that have been created or modified within the last 4 hours.
+
#Display a list of all the files under the <code>/boot</code> directory and its sub-directories that have been created or modified within the last 4 hours.
#Display a list of all the files under the <code>/var</code> directory and all its sub-directories that have been created or modified today (since mid-night).
+
#Display a list of all the files under the <code>/etc</code> directory and all its sub-directories that have been created or modified today (since mid-night).
#Display a list of all the files under the <code>/boot</code> directory and all its sub-directories that have been accessed or modified  within the last 30 minutes
+
#Display a list of all the files under the <code>/var</code> directory and all its sub-directories that were last modified more than 4 days ago
#Display a list of all the files under the <code>/home</code> directory and all its sub-directories that were last modified more than 4 days ago
 
  
 
Put each set of commands in a separate file. Name the file for task (1) as ass1-1, task (2) as ass1-2, etc. It must be possible to run these script files simply by typing their name (set the permissions appropriately).
 
Put each set of commands in a separate file. Name the file for task (1) as ass1-1, task (2) as ass1-2, etc. It must be possible to run these script files simply by typing their name (set the permissions appropriately).
Line 39: Line 39:
  
 
#Update sudo's configuration file (using the proper program) to allow your Learn account to run <code>sudo</code> for the following commands as <code>root</code>:  (8 points)
 
#Update sudo's configuration file (using the proper program) to allow your Learn account to run <code>sudo</code> for the following commands as <code>root</code>:  (8 points)
#*<code>mkfs</code>
+
#*<code>mount</code>
 
#*<code>fdisk</code>
 
#*<code>fdisk</code>
#*<code>ifconfig</code>
+
#*<code>passwd</code>
#*<code>less</code>
+
#*<code>lspci</code>
 
#Create a new user called <code>helper</code> and allow this user to run <code>sudo</code> for the following commands as your learn account: (4 points)
 
#Create a new user called <code>helper</code> and allow this user to run <code>sudo</code> for the following commands as your learn account: (4 points)
#*<code>find</code>
+
#*<code>head</code>
#*<code>grep</code>
+
#*<code>tail</code>
  
{{Admon/tip | Bonus Marks: | Allowing access to the <code>less</code> command through <code>sudo</code> creates a serious security issue. For '''5 BONUS MARKS''' Research why this is so and write a short paragraph describing your findings. Submit your typed response to your Professor on the day your assignment is marked.}}
 
  
 
==Package Management==
 
==Package Management==
Line 63: Line 62:
 
#*You will be asked to demonstrate how to switch to this desktop environment and back again without restarting the X server.
 
#*You will be asked to demonstrate how to switch to this desktop environment and back again without restarting the X server.
  
'''Review the procedures for compiling and installing software from source code and use them to: (7 points)'''
+
'''Review the procedures for compiling and installing software from source code and use them to: (8 points)'''
 
#Find and install the E3 text editor from source code. The project page for it can be found here: [http://freshmeat.net/projects/e3 E3 Project]
 
#Find and install the E3 text editor from source code. The project page for it can be found here: [http://freshmeat.net/projects/e3 E3 Project]
 
#*You will be asked to demonstrate how to create a file using this editor.
 
#*You will be asked to demonstrate how to create a file using this editor.
Line 69: Line 68:
 
==SysAdmin Portion==
 
==SysAdmin Portion==
  
'''Create a bash script called <code>/bin/snapshot.sh</code> to record the following information: (6 points)'''
+
'''Create a bash script called <code>/bin/snapshot</code> to record the following information: (6 points)'''
 
*A list of all recent bad login attempts.
 
*A list of all recent bad login attempts.
 
*A list of Logical Volumes, Physical Volumes, and Volume Groups.
 
*A list of Logical Volumes, Physical Volumes, and Volume Groups.
 
*A report of all mounted filesystems, the amount of space used and the amount of space available.
 
*A report of all mounted filesystems, the amount of space used and the amount of space available.
*The information should be appended to the file <code>/var/log/mysnapshot.txt</code>
+
*The information should be appended to the file <code>/var/log/snapshot.txt</code>
  
'''Research the <code>at</code> command and and schedule your script to execute at 2:00am on Wednesday March 31st. (2 points)'''
+
'''Research the <code>at</code> command and and schedule your script to execute at 2:00am on Wednesday August 4th. (2 points)'''
  
 
==Exploring Your Options==
 
==Exploring Your Options==
Line 84: Line 83:
 
*Video Editing
 
*Video Editing
 
*Accounting/Bookkeeping
 
*Accounting/Bookkeeping
*First Person Shooter Game
+
*Real Time Strategy Game
  
 
{| style="float: right; margin: 0 0 3em 2em; border: 1px solid black;"
 
{| style="float: right; margin: 0 0 3em 2em; border: 1px solid black;"
!style="background: #cccccc"| Assigned 2nd Distros for Winter 2010
+
!style="background: #cccccc"| Assigned 2nd Distros for Summer 2010
 
|-
 
|-
 
|[[OPS235_A1W10_A|Section A]]<br/>
 
|[[OPS235_A1W10_A|Section A]]<br/>
Line 121: Line 120:
 
*<code>/etc/motd</code>
 
*<code>/etc/motd</code>
 
*<code>/etc/bashrc</code>
 
*<code>/etc/bashrc</code>
*<code>/bin/snapshot.sh</code>
+
*<code>.bashrc</code>
 +
*<code>/bin/snapshot</code>
 
*<code>/etc/sudoers</code>
 
*<code>/etc/sudoers</code>
  

Revision as of 13:36, 2 June 2010

Note.png
Please take note!
Doing your assignment is part of your ongoing learning process. As such you will be tested on this material in future tests and exams. If you have any questions or need help, please consult your instructor in a timely manner. The due date for this assignment will not be extended. As it must be marked in class. This assignment will be marked partially through demonstration and partially through the submission of files.
Important.png
Important/warning!
Complete all parts of this assignment on your fedora2 virtual machine except for the installation of Linux on a new VM. Before starting your assignment make a backup of your virtual machine following the instructions in lab 3.

OPS235 Assignment #1 -- Summer 2010

Weight: 5% of the overall grade
Due Date: Last week before study week.
(Check with your Professor for exact date)
Due at the start of class.

Important.png
Very Important!
Before making any changes to your system configuration, backup the original configuration files into the /backups directory.

Basic Chores

Complete the following tasks on your system (4 points for each completed task).

Note.png
Important
To complete the first task you may need to create an additional virtual disk image for the fedora2 virtual machine.
  1. Setup your system so that the command mount /assignment -- executed by any user -- will attach the logical volume assign-vol from the volume group called ASSIGNGROUP (minimum 100 MB) to the mountpoint /assignment (The volume should NOT be automatically mounted at boot time)
  2. Setup your system login message to say The Open Source Community Is Changing The Computing World (to be displayed on all virtual consoles after the login prompt)
  3. Setup your system login banner to say Free as in Freedom. (User should see this before login to the system)
  4. Setup your system so that every user has a command alias called deltemp which will delete the contents of a directory called ~/temp NOT the /tmp directory.
  5. Setup the bash environment for the user root so that the prompt includes the current date.

Finding your way

Research on your Fedora system to come up with sets of commands to accomplish the following tasks :(5 points for each completed task)

  1. Display a list of all the files under the /boot directory and its sub-directories that have been created or modified within the last 4 hours.
  2. Display a list of all the files under the /etc directory and all its sub-directories that have been created or modified today (since mid-night).
  3. Display a list of all the files under the /var directory and all its sub-directories that were last modified more than 4 days ago

Put each set of commands in a separate file. Name the file for task (1) as ass1-1, task (2) as ass1-2, etc. It must be possible to run these script files simply by typing their name (set the permissions appropriately).

To sudo or not to sudo

Study the man page for the sudo command and:

  1. Update sudo's configuration file (using the proper program) to allow your Learn account to run sudo for the following commands as root: (8 points)
    • mount
    • fdisk
    • passwd
    • lspci
  2. Create a new user called helper and allow this user to run sudo for the following commands as your learn account: (4 points)
    • head
    • tail


Package Management

Research the rpm and yum commands to:

  1. Verify the integrity of a package using rpm to see if any of its files have been altered since installation. (you will be asked to demonstrate this when your assignment is marked)(4 points)
  2. Add the rpmfusion.org repository to the yum configuration. (you will be asked to demonstrate installing a package from the rpmfusion repository when your assignment is marked) (4 points)

Alternate Software Installation

Review the yum group* commands and use them to: (5 points)

  1. Find and install the XFCE dektop environment discussed in the following article: XFCE Review
    • You will be asked to demonstrate how to switch to this desktop environment and back again without restarting the X server.

Review the procedures for compiling and installing software from source code and use them to: (8 points)

  1. Find and install the E3 text editor from source code. The project page for it can be found here: E3 Project
    • You will be asked to demonstrate how to create a file using this editor.

SysAdmin Portion

Create a bash script called /bin/snapshot to record the following information: (6 points)

  • A list of all recent bad login attempts.
  • A list of Logical Volumes, Physical Volumes, and Volume Groups.
  • A report of all mounted filesystems, the amount of space used and the amount of space available.
  • The information should be appended to the file /var/log/snapshot.txt

Research the at command and and schedule your script to execute at 2:00am on Wednesday August 4th. (2 points)

Exploring Your Options

Research and install one software application for each of the following tasks: (4 points)

  • Desktop Publishing
  • Video Editing
  • Accounting/Bookkeeping
  • Real Time Strategy Game
Assigned 2nd Distros for Summer 2010
Section A

Section B
Section C
Section D
Section E
Section F
Section G

Install a second Linux distribution as a Virtual Machine. (10 points)

You will be asked to demonstrate booting the 2nd distro in class. To determine which Linux distribution to install, click on your section in the list to the right, then find your student ID number.

Important.png
Install the second Linux distribution in a new VM on your disk pack
Do NOT install the second Linux distro on fedora2 -- create a new VM on your disk pack and install it there.

Submitting your assignment

(10 points)

  • Parts 4, 5, & 7 will be marked in class
  • Parts 1, 2, 3, & 6 must be submitted on a filesystem image.

Make an 2MB (2048 1k blocks) ext2 formatted image file with a filesystem label that is your LearnID.

The image file should have the name <learnid>.img.

Copy the following files to the image file:

  • /etc/fstab
  • /etc/issue
  • /etc/motd
  • /etc/bashrc
  • .bashrc
  • /bin/snapshot
  • /etc/sudoers

Copy all of the script files created in part 2 to the image file.

Execute the following commands on your system:

  • atq >> assign1.data
  • lvs >> assign1.data
  • vgs >> assign1.data
  • pvs >> assign1.data

Copy your assign1.data file to the filesystem image.

Create a file called backups.txt that contains a directory listing of your /backups directory.

Copy the file called backups.txt to the filesystem image.

Upload the file system image file to http://cs.senecac.on.ca/~brian.gray/cgi-bin/assign1.cgi