0% found this document useful (0 votes)
124 views

Linux & Computer Systems: CS553 Homework #1

This document provides instructions for Homework #1 in CS553, which involves setting up virtual machines (VMs) and Linux, learning Linux commands, writing Bash scripts to generate and sort data, answering questions about computer systems and processors, and submitting the assignment via a private Git repository. The homework is divided into 6 parts and is due on January 30th, 2020. Late submissions within 10 days of the deadline will be penalized 10% per day. Students should submit source code, documentation, and a readme file to their private Git repository to complete the assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views

Linux & Computer Systems: CS553 Homework #1

This document provides instructions for Homework #1 in CS553, which involves setting up virtual machines (VMs) and Linux, learning Linux commands, writing Bash scripts to generate and sort data, answering questions about computer systems and processors, and submitting the assignment via a private Git repository. The homework is divided into 6 parts and is due on January 30th, 2020. Late submissions within 10 days of the deadline will be penalized 10% per day. Students should submit source code, documentation, and a readme file to their private Git repository to complete the assignment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

CS553 Homework #1

Linux & Computer Systems


Instructions:
● Assigned date: Wednesday January 22nd, 2020
● Due date: 11:59PM on Thursday January 30th, 2020
● Maximum Points: 100%
● This homework can be done in groups up to 3 students
● Please post your questions to the Piazza forum
● Only a softcopy submission is required; it will automatically be collected through GIT
after the deadline; email confirmation will be sent to your HAWK email address
● Late submission will be penalized at 10% per day; an email to the TA with the subject
“[CS553-Spring2020] late homework submission” must be sent

1 Your Assignment
This project aims to teach you the basics of Linux and Virtual Machines, as well as some basic Q&A about
computer systems. Any programming you do in this assignment will be limited to BASH scripting and/or
Python. You can use any computer for this part of the assignment (e.g. your laptop running any OS).
Here is your assignment. Collect evidence of your work through screen shots and log files. You will write
a report at the end that outlines what you have done to complete this assignment.
1. (21 points) Setup VM, Linux, and basic testing – must take screen shots at each step to receive
points
a. Read Oracle VirtualBox White Paper
b. Download Oracle VirtualBox 6.1.2
c. Install VirtualBox
d. Download Ubuntu Desktop 18.04.3 LTS Linux ISO image
e. Create Virtual Machine (VM), to support Linux, Ubuntu, 64-bit, 4GB RAM, Virtual Disk
25GB, VDI image, dynamically allocated, 2-core, and a network interface (1GbE or WiFi)
with NAT support
f. Install Linux from the ISO image
g. Create a user id and password
h. Turn on Firewall and block all ports
i. Enable SSH access to your new Linux installation; open SSH port in firewall
j. Repeat steps 5 through 9, and create another VM with the same specifications as the
first one
k. Create private/public keys and install them properly in both of your new VMs
l. Test that you can connect remotely to your VMs with your keys, from one VM to the
other VM

1 CS553 Spring 2020 – HW1


2. (13 points) Show an example of using the following commands (hint: you can use man to find
more information about each one); take screen shots of your commands; make sure to clear the
screen between each command; explain in your own words what these commands do:
a. ssh n. watch aa. chmod nn. mount
b. ssh-keygen o. ps bb. chown oo. passwd
c. scp p. top cc. useradd pp. uname
d. history q. htop dd. man qq. whereis
e. sudo r. gcc ee. locate rr. whatis
f. ip s. tail ff. find ss. su
g. dd t. grep gg. sed tt. ping
h. fdisk u. kill hh. awk uu. traceroute
i. apt v. killall ii. diff vv. date
j. vi w. du jj. sort ww. time
k. time x. df kk. export xx. wget
l. tar y. screen ll. pwd yy. wc
m. cat z. vim mm. crontab zz. pwgen
3. (21 points) Write bash scripts to do the following:
a. Write a script called “generate-dataset.sh <filename> <num_records>” with two
command line arguments specifying the file name to output and the number of records,
where each record is separated by new line character, and each has the following
format: <integer> <integer> <ASCII_string>. The integer should be any random number
up to a 32-bit integer. The ASCII_string should be any string using ASCII of exactly 100
bytes long. Use the “time” command to show how long the benchmark took to
complete. The benchmark should run for at least 10 seconds, and it should complete
even if the ssh (or bash) session is terminated. How many records does your file contain
after running it? You must write this script entirely with existing Linux commands (which
you can install if they don’t exist on your system), without using any other programming
languages like C, C++, Java, or Python.
b. Write a script called “sort-data.sh” that takes input a file from part (a) above and sorts
the file based on the first column data (make sure to only sort based on the first column
data, and not on the entire line of data; also make sure you are treating the data in
column 1 as numbers and not text). Use the “time” command to show how long the sort
script took to complete.
c. Use the script in part (a) and generate 3 data files with different number of records
(1000, 100000, 10000000); measure time taken to generate these records. Sort the data
with your script from part (b) and measure the time. Write a Python matplotlib script to
generate a graph for the time taken to generate the data and the time taken to sort the
data at the 3 different scales. The graph should automatically adjust to the number of
entries, and the scale of the data.
4. (15 points) Answer the following questions about VMs:
a. In the system configuration of the VM, explain how changing the number of processors
changes the behavior of your VM. Explain a scenario where you want to set this to the
minimum, and a scenario where you want to set it to the maximum. Why is setting it to
the maximum potentially a bad idea?
b. In the system configuration of the VM, under the Acceleration Tab, explain the
difference between the paravirtualization options: None, Legacy, Minimal, Hyper-V, and
KVM. Explain which one would be best to use with Ubuntu Linux, and why.

2 CS553 Spring 2020 – HW1


c. In storage devices when configuring the VM, there are multiple types of storage
controllers: explain the difference between the IDE, SATA, and NVMe controller. Give an
example for each type of storage controller of a scenario where you may want to use
this type of controller.
d. In the network configuration of the VM, there are multiple types of network adapters:
explain the difference between NAT, Bridged Adapter, Internal Network, and Host-only
Network. Give an example for each type of network of a scenario where you may want
to use this type of network.
e. For the USB configuration of the VM, explain the difference between USB 1.1, 2.0, and
3.0 controllers.
5. (20 points) Answer the following questions about computer processors:
a. Describe what a core and hardware thread is on a modern processor, and the difference
between them?
b. How many cores do the fastest processors from each manufacturer have? Give an
example (specific model, specs, and price).
(a) Intel CPU (x86)
(b) AMD CPU (x86)
(c) IBM CPU (Power9)
(d) ThunderX CPU (ARM)
(e) NVIDIA GPU
c. Why do we not have processors running at 1THz today (as might have been predicted in
the year 2000)?
d. Describe Moore’s Law. Is it going to go on forever? If not, when will it end? Justify your
answer to why it will end and when.
6. (10 points) Answer the following questions about threading:
a. Why is threading useful on a single-core processor?
b. Do more threads always mean better performance?
c. Is super-linear speedup possible? Explain why or why not.
d. Why are locks needed in a multi-threaded program?
e. Would it make sense to limit the number of threads in a server process?

2 Where you will submit


You will have to submit your solution to a private git repository created for you at
git@gitlab.com:cs553-spring2020/team-<id>.git. A directory structure for all the repositories will be
created that looks like this: hw1/, hw2/, ... You will have to firstly clone the repository. Then you will
have to add or update your source code, documentation and report. Your solution will be collected
automatically after the deadline. If you want to submit your homework later, you will have to push your
final version to your GIT repository and you will have let the TA know of it through email. There is no
need to submit anything on BB for this assignment. If you cannot access your repository contact the TAs.
You can find a git cheat sheet here: https://www.git-tower.com/blog/git-cheat-sheet/

3 What you will submit


When you have finished implementing the complete assignment as described above, you should submit
your solution to your private git repository. Each program must work correctly and be detailed in-line
documented. You should hand in:
1. Source code: All of the source code, including proper documentation and formatting.

3 CS553 Spring 2020 – HW1


2. Readme: A detailed manual describing the structure of your files and directory organization. The
manual should be able to instruct users how to run the program step by step. The manual should
contain example commands. This should be included as readme.txt in the source code folder.
3. Report: A written document (typed, named hw1-report.pdf) describing the overall assignment
completion, along with screen shots and text answering the key questions. Make sure to label
answers with the appropriate question number from the homework writeup.

Submit code/report through GIT.


Grades for late programs will be lowered 10% per day late.

4 CS553 Spring 2020 – HW1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy