Lab 2 04-22-2024
.docx
keyboard_arrow_up
School
Towson University *
*We aren’t endorsed by this school
Course
274
Subject
Computer Science
Date
Apr 29, 2024
Type
docx
Pages
11
Uploaded by ojomark025 on coursehero.com
ITEC 274: Linux Lab
Mark Ojo, ITEC274
Instructions
Answer the questions below thoroughly and completely (half complete commands will not be sufficient for some questions)
. You will submit your answers for this part of the homework via this word document
. No other documents or formats will be accepted. Submit via BlackBoard /
LAB
. *Perform the following using the Ubuntu VM you created in class.
**All work is to be done from the Linux terminal console window NOT the GUI. You will lose points otherwise.
Note:
Your screenshot must be clear enough to understand what is on the image. You will lose points if screenshots are not clear. 1.
Working with User and Group from the Linux command line a.
Create two new user account, one call testuser2 and the other use your < last-name> for the second account. Set the passwords to different values, but don't use passwords that you actually use in other systems.
i.
What command did you use to create the user accounts? [ give full command- type this out
]
Ans. sudo adduser test1 (accidentally types test1 instead of testuser2
b.
Show the password information stored for both user account created above
i.
Paste only the section that shows both accounts information here
c.
Create one (1) new group, call the group itec274. Check that the group was created i.
What command did you use to check that the group was created? [ give full command – type this out
]
Ans. getent group
ii.
Assign both user accounts created above to the group itec274
Show that the user accounts are added to the
group itec274
<Paste screenshot here…>
What command did you use to show that the user accounts are added to the group itec274? i.
Give full command – type this out Ans. groups test and groups ojo
2.
Working with Permissions and Access Control
a.
Login to the second user account created with your last-name. i.
Create two directories label [dirY, dirD] and three files label [hw3.txt, hw4.txt, hw5.txt] inside home directory.
ii.
Add some text to at least two (2) of the files created above b.
Show the contents of the second user account home directory? (include permissions, file / directory names, size, date and time stamps)
Hint: use long option
[Paste a screen shot showing the contents of second user account home directory…]
c.
Move hw4.txt and hw5.txt
to directory dirD and Copy hw3.txt to dirY directory. i.
Show that the files have been moved and copied
to the intended directories. <past screenshot here…>
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
n this assignment, you are required to make an application using assembly code that takes two numbers from the user and returns the result of dividing the first number by the second number.
Important notes:
1- You should allow the user to Enter to digits number "For the first number only"
2- You should allow two-digit results if necessary.
Stretch goal "optional":
Handle the remain of the division process and print it on the screen.
Submission:
Provide two files (.asm and screenshot).
Use your university ID for files naming.
arrow_forward
Description
Greetings!
Task: Write a program that will ask for the user's name and output their name mixed with a command
line argument given as the greeting.
Command line args will be formally introduced next week, however, you're encouraged to do
some of your own research for this challenge! Python docs:
https://docs.python.org/3/library/sys.html#sys.argv
PYTHON
1 import sys
2
3 # e.g. $ python main.py foo bar
4 # Arguments would contain:
5
6 sys.argv[0] # => main.py
7 sys.argv[1] % => foo
8 sys.argv[2] # => bar
Your program should read the greeting from command line arguments, ask the user for their
name, and then output a custom greeting, like so:
Example 1
$ python greet.py Yo!
What's your name? Jamal
Yo! Jamal
Example 2
$ python greet.py "G'day"
What's your name? Summer
G'day Summer
Tip: For G'day, be sure to include in double quotes, so Bash treats it as one argument.
arrow_forward
Complete this javascript file according to the individual instructionsgiven in the comments.
*** DO NOT CHANGE any of the code that you are not instructed to. */
////////////////////////// NOTE: Use the API endpoints available at// https://jsonplaceholder.typicode.com/// to get the data required in these exercises.// HINT: Read the documented Resources and Routes.// Also the guide:// https://jsonplaceholder.typicode.com/guide////////////////////////
Create a function named "getComments".// This function needs to accept a "postID"// parameter.// Use Fetch with Async/Await to request// all the comments for the postID that// is passed in as a parameter.// The function should return all the// comments for the requested postID// as JSON data.
arrow_forward
Using the IDLE development environment, create a Python script named tryme4.py. (Note: an alternative to IDLE is to use a free account on the pythonanywhere website: )
IDLE has both an interactive mode and a script mode. You must use the script mode to develop your script. Your script must use meaningful variable names and have comments that describe what is happening in your script. Comments may describe the assignment of a value to a variable, a computation and the assignment of the result to a variable, or the display of the result.
Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines.
Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function.
The function three_lines and new_line are defined below…
arrow_forward
omplete this javascript file according to the individual instructionsgiven in the comments.
*** DO NOT CHANGE any of the code that you are not instructed to. */
////////////////////////// NOTE: Use the API endpoints available at// https://jsonplaceholder.typicode.com/// to get the data required in these exercises.// HINT: Read the documented Resources and Routes.// Also the guide:// https://jsonplaceholder.typicode.com/guide////////////////////////
Create a function named "getUser".// This function needs to accept a "userID"// parameter.// Use Fetch with Async/Await to request// the data for the requested user.// The function should return JSON data.
arrow_forward
Linux OS and uses commands
Create a group with Coworkers then create four different users as a members of the group but before that they must have the following parameters:A) user I'd must be 2023,2022,2021 etc...B) a month name as user nameC) any day name as comment
arrow_forward
Complete this javascript file according to the individual instructions given in the comments. *** DO NOT CHANGE any of the code that you are not instructed to. */ //////////////////////// // NOTE: Use the API endpoints available at // https://jsonplaceholder.typicode.com/ // to get the data required in these exercises. // HINT: Read the documented Resources and Routes. // Also the guide: // https://jsonplaceholder.typicode.com/guide/ /////////////////////// // 1) Create a function named "getAllPosts". // Use Fetch with Async/Await to request // all the posts. The function should // return all the posts as JSON data. // 2) Create a function named "getAllUsers". // Use Fetch with Async/Await to request // all the posts. The function should // return all the posts as JSON data. // 3) Create a function named "getComments". // This function needs to accept a "postID" // parameter. // Use Fetch with Async/Await to request // all the comments for the postID that // is passed in as a…
arrow_forward
File extensions are important, so tell us why you think that. You can name three file extensions in a random folder on your computer. You can also find out what software packages were used to make them. Most file extensions should be visible when you right-click on a file and choose "Properties" from the pop-up menu (Microsoft Windows environment).
arrow_forward
C Programming:
Create a makefile to facilitate rebuilding the project and creating executables testpipe, testpipe-inst, testfork, testfork-inst, and stackviz by just typing make
arrow_forward
1. Code-Tracing
- Without running / testing the following code, predict what the following program would print on the screen if you printed freeze and then boil. Write your answer in the comment section when submitting your work. For help with code-tracing see the code tracing page in
this module.
ments
freeze - int(32)
boil - int(212)
freeze - 0
boil - 100
print(freeze, boil) # what would this print to the monitor?
Research
• Submit your answer in the comment section.
arrow_forward
You can execute commands by entering them in the command window after the MATLAB prompt (>>) and pressing the Enter key.
TASK
Multiply the numbers 3 and 5 together with the command 3*5
arrow_forward
Create a simple menu-like program that will act like a virtual classroom. The menu will act as a means for the user to interact with the program.
The required menu and sub-menu options are the following:
Class (add class, view classroom, delete class)
Calendar (view calendar, add an event, delete event)
To-do (view to-do list)
Settings (view account details)
The program should use at least one of the following:
singly-linked node class
doubly-linked node class
singly-linked circular node class
doubly-linked circular node class
arrow_forward
C++. Please do not change the existing code. The instructions are in the image that is provided. Please zoom in or you can download the png file. Can you please provide every section of code that is needed there is Time.cpp, Time.h, Date.cpp, Date.h, Event.cpp, Event.h, and main.cpp. Thank you!
Time.cpp
#include "Time.h"
//Default Constructor
//Constructor with parameters
int Time::getHour() const { return hour; }int Time::getMinute() const { return minute; }int Time::getSecond() const { return second; }void Time::setHour(int h) { hour = h; }void Time::setMinute(int m) { minute = m; }void Time::setSecond(int s) { second = s; }
int Time::timeToSeconds() const{ return (getSecond() + getMinute() * 60 + getHour() * 3600);}
const Time Time::secondsToTime(int s) const{ int resultS = s % 60; s /= 60; int resultM = s % 60; s /= 60; int resultH = s % 24; return Time(resultH, resultM, resultS);}
//toString
// +
// -
// <
// >
// ==
------
Time.h
#ifndef TIME#define…
arrow_forward
Lab activity: Driving costs
Code in main.py, attach output.
arrow_forward
<stdio.h>
arrow_forward
Assignment3A:
Diagnosis Checker: For years, patients have used websites like WebMD to pre-diagnosis
themselves with a variety of illnesses before meeting with a doctor. As you might imagine,
medical professionals believe this can lead to incorrect treatment. To combat this, a local
hospital has asked you to develop a program that will help patients check if their symptoms
match the online diagnosis.
You will prompt the user to enter their illness. Based on this input, you will ask them if they are
experiencing certain symptoms. Depending on their answer, your program will indicate if the
Internet diagnosis is likely to be correct or not. The decision chart is shown below:
•
●
●
HGPS
0
Do they have brittle bones?
If no, it is likely not HGPS
■ If yes, it is possibly HGPS
Bokter Syndrome
O
Do they have a Vitamin C deficiency?
If no, it is likely not Bokter Syndrome
If yes, are they a sailor?
.
.
Lupus
.
If no, it is likely not Bokter Syndrome
If yes, it is possibly Bokter Syndrome
arrow_forward
Software Requirements:
Latest version of NetBeans IDE
Java Development Kit (JDK) 8
Procedure:
1. Create a folder named LastName_FirstName (ex. Reyes_Mark) in your local drive.
2. Create a new project named LabExer6A. Set the project location to your own folder.
3. Create a simple guessing game (similar to Hangman or Hangaroo). In this game, the user guesses
a letter and then attempts to guess the word.
4. Create a Notepad file named words.txt which will store any number of words each written per line.
5. The Java program shall:
• randomly select a word from the list saved in words.txt;
• display a letter in which some of the letters are replaced by ?; for example, ED??A??ON
(for EDUCATION);
place the letter in the correct spot (or spots) in the word each time the user guesses a letter
correctly;
• inform the user if the guessed letter is not in the word; and
display a congratulatory message when the entire correct word has been deduced.
arrow_forward
Python Automation Script:
write a python automation script that scrape a website:
"https://www.goodreturns.in/gold-rates/delhi.html"
get the latest gold rate and change from previous day,
and print the result on the screen.
arrow_forward
# file name: w07_markus.py## Complete the following steps:# (1) Complete the following function according to its docstring.# (2) Save your file after you make changes, and then run the file by# clicking on the green Run button in Wing101. This will let you call your# modified function in the Python shell. An asterisk * on the Wing101# w07_markus.py tab indicates that modifications have NOT been saved.# (3) Test your function in the Wing101 shell by evaluating the examples from# the docstring and confirming that the correct result is displayed.# (4) Test your function using different function arguments.# (5) When you are convinced that your function is correct, submit your# modified file to MarkUs. You can find instructions on submitting a file# to MarkUs in Week *2* Perform -> Accessing Part 2 of the# Week 2 Perform (For Credit) on PCRS.# (6) Verify you have submitted the right file to MarkUs by downloading it# and checking that the…
arrow_forward
Open the simulator
Fill the 4-line header properly
Write a code that implements the task below
Test your code by running it on a random set of
arguments
Save the source, the *.X68 file, with your student
number as file name
Run the code, make a screenshot and save as an
image with your student number as file name
Upload the two files on Moodle (no .rra or .zip or ...
onlytst and image formats)
Task:
Given an array of 32 unsigned 8-bit integers at
address $1200 representing students' marks, find
the lowest mark, highest mark and the number of
students who passed the course, and store as
bytes at $1500, $1510 and $1520
arrow_forward
*Step1: Read the requirement of each part; write the pseudo-code in a word document by listing the step by step what you suppose to do in main() and then save it with the name as Lab3_pseudoCode_yourLastName.
*Step2:
-start editor (for example eClipse) create the project with the following project name:
Part 1: SU2022_LAB3PART1_yourLastName
-add data type class:
Part1: SU2022_Adult_yourLastName
-add a driver class that contains main()
Part 1: Class: SU2022_YourWeightManagement_yourLastName
*Step3: follow step by step in the pseudo-code (or the flowchart) to write the java code in main() or driver class.
FROM THIS LAB3, WE USE OBJECT ORIENTED PROGRAMMING TECHNIQUE TO WRITE THE CODE. IN ONE PROJECT (ONE PART) WE HAVE TWO TYPES OF CLASSES:
-DATATYPE CLASS (NEW FORMAT)
-DRIVER CLASS (CLASS…
arrow_forward
Just use this one only
#include<stdio.h>
arrow_forward
omputer Science
What is happening between the two comments labeled POINT A and POINT B? Write a brief description at the bottom of your lab3/lab3.txt file.
What happens if you compile the code and run it without any command line arguments? Explain what happens and why at the bottom of your lab3/lab3.txt file.
Update the code to include a check after the call to malloc to verify that memory was successfully allocated (and call exit(0) if it was not).
Rewrite the code between the two comments labeled POINT A and POINT B to use realloc. Include a check to verify that memory was successfully allocated as you did with malloc in the previous step.
#include <stdio.h>#include <stdlib.h>#include <ctype.h>
void print_int_array(int* a, unsigned size, char* name) {for (unsigned i=0; i<size; i++) {printf("%s[%d]=%d\n",name,i,a[i]);}}
int main(int argn, char *argv[]) {
// pretend initial_size came from user input (ie. not known ahead of time)int initial_size =…
arrow_forward
Just use this
#include<stdio.h>
arrow_forward
Instructions:
Create a C# MAUI application that allows the user to input a temperature value in either Fahrenheit, Celsius, or Kelvin, and converts that temperature value into the other two forms. For example, if the user enters 45.6 Celsius, the program should output 114.08 Fahrenheit and 280.7056 Kelvin.
Part 1: Front-End and Resources Setup:
To implement this program, you first set up your MAUI app.
NOTE that the front end will be provided for you. You will need to study the frontend controls before proceeding to the back-end. Additionally, images for temperature gauge will be provided to you as well.
PART 2: Back-End Implementation
For this part, you aare going to implement the functionality of the GUI. The program should function by first allowing the user to input a temperature value and unit. As the user types, and if a unit is set, the program should automatically update the temperature conversion values, as well as the temperature gauge image. Additionally, remember that 0…
arrow_forward
Discord Bot Python question
I am just working on a project to create a discord bot and I was wondering how to change the prefix to @botname
Right now, the prefix code is as below:
bot = commands.Bot(command_prefix="!", intents=intents)
Let's say the bot name is BOT.
I want to make it so that if I go
@BOT command
it would give me the result.
arrow_forward
Your application will demonstrate the use of both counter-controlled loops and condition-based loops. Incorporate the following requirements into your application:
The program will consist of one file - the main application class
Name the class appropriately and name the file Program.cs (the default when you create the application)
Include documentation at the top of the file that includes
Your name
Date of development
Assignment (e.g., CIS214 Performance Assessment - Loops & Calculations)
Description of the class
The main application class must meet the following requirements
Print a line that states "Your Name - Week 2 PA Loops & Calculations"
Demonstrate a counter-controlled loop
Calculate the sum of the integers from 1 to 10
Print the running total
Print the final total
Demonstrate a condition-based loop
Ask the user to enter an integer value (-1 to quit)
Keep a running sum of the values
Keep a count of how many values the user has entered
Print the running…
arrow_forward
Make a simple application in c# windows forms
Using the system calls, you must display on the screen:
*Operating system name*OS version*host name*Operating system date
*** Remember, you must get the information from the Windows OS using C# code, NO put manually the information
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- n this assignment, you are required to make an application using assembly code that takes two numbers from the user and returns the result of dividing the first number by the second number. Important notes: 1- You should allow the user to Enter to digits number "For the first number only" 2- You should allow two-digit results if necessary. Stretch goal "optional": Handle the remain of the division process and print it on the screen. Submission: Provide two files (.asm and screenshot). Use your university ID for files naming.arrow_forwardDescription Greetings! Task: Write a program that will ask for the user's name and output their name mixed with a command line argument given as the greeting. Command line args will be formally introduced next week, however, you're encouraged to do some of your own research for this challenge! Python docs: https://docs.python.org/3/library/sys.html#sys.argv PYTHON 1 import sys 2 3 # e.g. $ python main.py foo bar 4 # Arguments would contain: 5 6 sys.argv[0] # => main.py 7 sys.argv[1] % => foo 8 sys.argv[2] # => bar Your program should read the greeting from command line arguments, ask the user for their name, and then output a custom greeting, like so: Example 1 $ python greet.py Yo! What's your name? Jamal Yo! Jamal Example 2 $ python greet.py "G'day" What's your name? Summer G'day Summer Tip: For G'day, be sure to include in double quotes, so Bash treats it as one argument.arrow_forwardComplete this javascript file according to the individual instructionsgiven in the comments. *** DO NOT CHANGE any of the code that you are not instructed to. */ ////////////////////////// NOTE: Use the API endpoints available at// https://jsonplaceholder.typicode.com/// to get the data required in these exercises.// HINT: Read the documented Resources and Routes.// Also the guide:// https://jsonplaceholder.typicode.com/guide//////////////////////// Create a function named "getComments".// This function needs to accept a "postID"// parameter.// Use Fetch with Async/Await to request// all the comments for the postID that// is passed in as a parameter.// The function should return all the// comments for the requested postID// as JSON data.arrow_forward
- Using the IDLE development environment, create a Python script named tryme4.py. (Note: an alternative to IDLE is to use a free account on the pythonanywhere website: ) IDLE has both an interactive mode and a script mode. You must use the script mode to develop your script. Your script must use meaningful variable names and have comments that describe what is happening in your script. Comments may describe the assignment of a value to a variable, a computation and the assignment of the result to a variable, or the display of the result. Write a function in this file called nine_lines that uses the function three_lines (provided below) to print a total of nine lines. Now add a function named clear_screen that uses a combination of the functions nine_lines, three_lines, and new_line (provided below) to print a total of twenty-five lines. The last line of your program should call first nine_lines and then the clear_screen function. The function three_lines and new_line are defined below…arrow_forwardomplete this javascript file according to the individual instructionsgiven in the comments. *** DO NOT CHANGE any of the code that you are not instructed to. */ ////////////////////////// NOTE: Use the API endpoints available at// https://jsonplaceholder.typicode.com/// to get the data required in these exercises.// HINT: Read the documented Resources and Routes.// Also the guide:// https://jsonplaceholder.typicode.com/guide//////////////////////// Create a function named "getUser".// This function needs to accept a "userID"// parameter.// Use Fetch with Async/Await to request// the data for the requested user.// The function should return JSON data.arrow_forwardLinux OS and uses commands Create a group with Coworkers then create four different users as a members of the group but before that they must have the following parameters:A) user I'd must be 2023,2022,2021 etc...B) a month name as user nameC) any day name as commentarrow_forward
- Complete this javascript file according to the individual instructions given in the comments. *** DO NOT CHANGE any of the code that you are not instructed to. */ //////////////////////// // NOTE: Use the API endpoints available at // https://jsonplaceholder.typicode.com/ // to get the data required in these exercises. // HINT: Read the documented Resources and Routes. // Also the guide: // https://jsonplaceholder.typicode.com/guide/ /////////////////////// // 1) Create a function named "getAllPosts". // Use Fetch with Async/Await to request // all the posts. The function should // return all the posts as JSON data. // 2) Create a function named "getAllUsers". // Use Fetch with Async/Await to request // all the posts. The function should // return all the posts as JSON data. // 3) Create a function named "getComments". // This function needs to accept a "postID" // parameter. // Use Fetch with Async/Await to request // all the comments for the postID that // is passed in as a…arrow_forwardFile extensions are important, so tell us why you think that. You can name three file extensions in a random folder on your computer. You can also find out what software packages were used to make them. Most file extensions should be visible when you right-click on a file and choose "Properties" from the pop-up menu (Microsoft Windows environment).arrow_forwardC Programming: Create a makefile to facilitate rebuilding the project and creating executables testpipe, testpipe-inst, testfork, testfork-inst, and stackviz by just typing makearrow_forward
- 1. Code-Tracing - Without running / testing the following code, predict what the following program would print on the screen if you printed freeze and then boil. Write your answer in the comment section when submitting your work. For help with code-tracing see the code tracing page in this module. ments freeze - int(32) boil - int(212) freeze - 0 boil - 100 print(freeze, boil) # what would this print to the monitor? Research • Submit your answer in the comment section.arrow_forwardYou can execute commands by entering them in the command window after the MATLAB prompt (>>) and pressing the Enter key. TASK Multiply the numbers 3 and 5 together with the command 3*5arrow_forwardCreate a simple menu-like program that will act like a virtual classroom. The menu will act as a means for the user to interact with the program. The required menu and sub-menu options are the following: Class (add class, view classroom, delete class) Calendar (view calendar, add an event, delete event) To-do (view to-do list) Settings (view account details) The program should use at least one of the following: singly-linked node class doubly-linked node class singly-linked circular node class doubly-linked circular node classarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education