LINUX ENVIRONMENT ASSESSMENT QUESTIONS

Which Ubuntu installation feature controls alphabetic sort order and the way dates and numbers are displayed?

Task 1: User management A company has set up a new site and transfer staff and visitor accounts to the new site. Your task is to write a Bash script to create user accounts for all staff and visitors. The supplied user file Usernames.txt is a text file containing a username and its type delimited by comma per line. There are two types of users: staff and visitor. Staff users are added to the staff group and visitor users to the visitors group. 1. Write a Bash script, called createUsers.sh, to do the followings. a) Create a group called visitors; b) Create an account for each user and add the user to its group in one command. All user accounts are created with an initial password the same as their username; a home directory with the same name as their username in the /home directory; all accounts use Bash shell program. c) Write messages to syslog for all of the above events (new group, new user creation). Note that while the current need is to handle limited number of usernames from the given user file, your script should be able to handle an arbitrary number of usernames. (4 marks) 2. Write a Bash script, called reportVisitors.sh, to report the members of visitors group to the file /tmp/visitors.txt. (1 marks) 3. Create a crontab entry to call the reportVisitors.sh script at 8:00AM and 9:00PM on every weekdays. (1 marks) Task 2: Web log analysis From the supplied (historical) NASA web server access log (NASA_access_log_Aug95.txt): a) How many POST events appear in the log? Show the command you use to determine the number. b) Write a one-line command to find the last nasa.gov GET request for the /history/skylab/flight‐summary.txt file. The output should list the fully qualified host name and its time of access. (Don’t worry about removing any square brackets.) c) Write a one-line command to compile and print all of the Expendable Launch Vehicle names listed in the log. The ELV names are all listed in capital letters under the /elv directory. Your output should appear in the format of one name per line, with no duplicates: ALICE BOB CHARLIE Save your output in a text file called elv.txt. (4 marks) Submission Submit individual work as a zip file called a1_yourUserID.zip, containing all your scripts, visitors.txt, and a file answer.pdf containing your answer to Task 1.3 and Task 2 to Moodle submission drop box before the due time. For example, if your user ID is abc123, name the file as a1_abc123.zip.

Task 1: User management

Please note: the below task will perform from Oracle VM VirtualBox – Ubuntu Linux server and desktop environment.  I need the step how to perform the tasks as well so I can demonstrate to the teacher

A company has set up a new site and transfer staff and visitor accounts to the new site.

Your task is to write a Bash script to create user accounts for all staff and visitors. The supplied user file Usernames.txt is a text file containing a username and its type delimited by comma per line. There are two types of users: staff and visitor.

Staff users are added to the staff group and visitor users to the visitors group. 

1. Write a Bash script, called createUsers.sh, to do the followings.

a) Create a group called visitors;

b) Create an account for each user and add the user to its group in one command.

All user accounts are created with an initial password the same as their username; a home directory with the same name as their username in the /home directory; all accounts use Bash shell program.

c) Write messages to syslog for all of the above events (new group, new user creation).

Note that while the current need is to handle limited number of usernames from the given user file, your script should be

2. Write a  Bash script,  called  reportVisitors.sh,to  report the  members of   visitors group to the   file   /tmp/visitors.txt

3. Create a crontab entry to call the reportVisitors.sh script at 8:00AM and 9:00PM on every weekdays.

Task 2: Web log analysis

 From the supplied (historical) NASA web server access log (NASA_access_log_Aug95.txt):

a) How many POST events appear in the log? Show the command you use to determine the number.

b) Write a one-line command to find the last nasa.gov GET request for the /history/skylab/flight‐summary.txt file. The output should list the fully qualified host name and its time of access. (Don’t worry about removing any square brackets.)

c) Write a one-line command to compile and print all of the Expendable Launch Vehicle names listed in the log. The ELV names are all listed in capital letters under the /elv directory. Your output should appear in the format of one name per line, with no duplicates:

ALICE 

BOB 

CHARLIE

Save your output in a text file called elv.txt. 

ASSESSMENT DESCRIPTION: Your task is to design, develop and test a small application which will allow a mobile phone user to compare the cost of their phone usage on particular day under plans from three different phone providers and find the most expensive and cheapest from them. Task 1- Design This stage requires you to prepare documentation that describes the function of the program and how it is to be tested. There is no coding or code testing involved in this stage. Requirements: 1) Read through Task 2: Program Development to obtain details of the requirements of this program. 2) Write pseudocode that describes how the program will operate. a. All program requirements must be included, even if you do not end up including all these requirements in your program code. b. The pseudocode must be structured logically so that the program would function correctly. 3) Prepare and document test cases that can be used to check that the program works correctly once it has been coded. You do NOT need to actually run the test cases in this stage; this will occur in Task 3: Testing. a. Test cases should be documented using a template which is week 6 lecture and tutorial. You may include extra information if you wish. At this stage, the Actual Result column will be left blank. Two test cases per group member are required to gain full marks in this task.

Task 2: Program Development Using the Design Documentation to assist you, develop a Java program that allows the user to enter details of their phone usage and then compare the bill which would result from this usage under different billing plans. All requirements require that you follow coding conventions, such as proper layout of code, using naming conventions and writing meaningful comments throughout your program. Requirement 1: Display a welcome message when the program starts • The welcome message should have a row of “*” at the top and the bottom, just long enough to extend over the text. Hint: Use a loop for this. • The first line of the message should read “WELCOME TO PHONE BILL COMPARISON SYSTEM” • The second line of the message should be blank. • The third line should read “Developed by” followed by your names and a comma, then “student ID”, then your student ids of all group members. • The fourth line should display “OODP101 Object Oriented Design and Programming” • The fifth line should display the current date and time of system. You are expected to do a research to complete this task. • The sixth line should be blank, and the seventh line should be another row of “*”Requirement 2 Provide a menu from which the user can select to Enter Usage Details, Display Cost Under Provider 1, Display Cost Under Provider 2, Display Cost Under Provider 3, Clear Usage, or Exit System. This menu should be repeated each time after the user has chosen and completed an option until the user chooses to Exit. The user selects an option by entering the number next to it. If an invalid number is selected, the user is advised to make another selection.

Requirement 3 When the user selects the Enter Usage Details option, provide another menu from which the user can select Phone Call, SMS, Data Usage, or Return to Main Menu. The user selects an option by entering the number next to it. If an invalid number is selected, the user is told to make another selection.

Requirement 3.1 If the user selects Phone Call, they are prompted to enter the length of the call in seconds. If user selects this option more than once then it means that there are more than one calls that user had made on particular day so your program should be able to consider all calls in billing system. The value entered must be positive – if not, the user should be prompted to re-enter a new value. After entering a valid call length, number of calls should be displayed and the user is returned to the Enter Usage Details Menu so that they may choose to enter additional usage details.