Project 0: Linux basics
-
This project is due at 11:59.59pm on Friday, January 29, 2021.
-
Pre-requisite: Setup your gradescope account.
Goals
- Install a linux environment on your computer and become comfortable with manipulating files. Alternatively, you can use a GCP environment.
- Create a Github account to store your course projects and submit them to our grading system.
Description and Deliverables
This class has projects that require the use of the command line. Since different OS’s have different command line environments, we will use Ubuntu 20.04 LTS as a concrete example for the whole class. When we provide examples in the future, or when students ask us to help debug problems, we will assume that everything is being done on Ubuntu 20.04. See Basic VM setup for how to set this up.
Even if you already have a bash command line (e.g. you use Linux, own a Mac, or have installed WSL on Windows 10) for this project we ask that everyone complete the following steps in full. Later on, if you want to use your own command line, so be it.
Steps to Complete The Project
To receive full credit for this project, complete the following steps. Ultimately, you will create a git project for your course files, and submit three files that you produce during these steps as a commit to your repository.
-
If you don’t already have an account on Github, you will need to get one. You can sign-up for one at Github.
-
We will now create a git repository in your Github account that will hold all of your cy2550 Project files.
- Click on
Create a Repository
in your Github account, in Repository Name, usecy2550
, select Visibility levelPrivate
and select “Initialize repository with README.” Click “Create project”. You should see a Github repository page now.
- Click on
- Install VirtualBox (or VMWare if you want) on your own computer and create an Ubuntu <20 class=“04s”></20> machine; you can follow the instructions on Basic VM setup. Make sure to allocate at least 2GB of RAM (preferably 4GB) and 10–20GB of disk space to the new VM. Another useful tutorial can be found here. It is useful to install the “Virtualbox Extensions” in your operating system as well.
Note: for those of you using a Mac M1 computer, virtual box will not work. You will need to work on either GCP, or use the M1 docker preview, or compile your own simple virtualization wrapper using vftool. Please reach out separately on Piazza if you are having troubles here.
-
Once Ubuntu is installed, reboot the VM, wait for Ubuntu to load, and log-in to your new Ubuntu installation using the credentials you provided during setup.
-
Open a command line (also known as a terminal) and install the
git
and thescreenfetch
program using theapt
tool. You can think of “apt” as the app store for Ubuntu: it lets you install new programs from the command line. Of course, to do this you need administrator privileges, so you also need to use thesudo
command. Putting it all together, execute the following command:$ sudo apt install screenfetch git
-
Now
checkout
your newly created git repository. To do this, go back to the Github repository page, and click the “Clone” button. UnderClone with HTTPS
, copy the URL and then run these commands:$ git clone <copied url, e.g. https://github.com/<your username>/cy2550.git>
The prompt will ask you for your Github credentials.
-
Make a new directory for
project0
, and then enter this directory$ mkdir -p ~/cy2550/project0 $ cd ~/cy2550/project0
mkdir
is a program that makes directories (i.e. folders) on the hard drive. The tilde character is a shortcut that always refers to your home directory (typically/home/your_username/
). -
If you run the
screenfetch
program, it will print out useful information about Ubuntu and your system. Runscreenfetch
again, but redirect the output (using the > operator) to a file on disk namedsf-output.txt
. Make sure you remember where you saved this file, you will need it again! -
Run the
ps -ef
program, and redirect the output to a file namedps-output.txt
. -
Create a file named
~/cy2550/project0/hello.txt
on your Linux machine (using a text editor of your choosing, such as Emacs, VIM, or Nano). This file must contain your full name Github username exactly in this format:Hi, my name is abhi shelat and my Github user name is abhvious.
-
At this point, your
~/cy2550/project0
directory should contain three files. You can use thels
program to list the files in this directory to make sure. -
You are now ready to
commit
andpush
your files to your Github repository.
Throughout these steps, you will be using various Linux command line programs. Most programs have built-in help messages if you run them with “–help” or “-?” as the command line argument. Furthermore, all programs have helpful Manual Pages that you can access by running:
$ man <program_name>
These various sources of help text may be useful if you get stuck during the project.
Learning the Linux Command Line
TA Martin Petrauskas has put together a helpful guide that explains how to setup VirtualBox (including how to change several important settings). This guide also has several chapters on basic Linux command line usage that may prove useful throughout this course if you are unfamiliar with the Linux command line. The guide is a work-in-progress, and the latest version is: Learning the Linux Command Line
Submit Your Project
-
We first need to do some setup to tell git who we are:
$ git config --global user.name "abhi" $ git config --global user.email "abhi@neu.edu"
-
Then we can prepare our commit. If you are already in the
~/cy2550/project0
directory, then you can do the following$ git add sf-output.txt ps-output.txt hello.txt $ git commit -m "Initial commit to project 0"
The first command tells
git
that the three files listed should be part of a “commit.” A commit represents a change to the state of the repository. It can include new files, modified files, or deleting of files from the state of the repository. In this case, we are adding 3 new files to the repository.The second command formalizes the change of the state your local git repository. The
-m
flag gives a short informative message that describes this commit.You can make as many changes as you like to your local repository in this way. When you edit larger pieces of software, it is important to make incremental commits as you develop a solution. For example, if you decide to edit the
hello.txt
file, and want to not reflect the new state:$ git add hello.txt $ git commit -m "Edit to hello.txt"
-
Finally, when you are ready, you need to
push
this local commit to Github:$ git push
This command will ask for your Github credentials. Pushing the local commit shares it with us. We can now see this change. This is how some large software projects manage collaboration across thousands of developers working on different parts of the system, while keeping a consistent view of the “latest” changes.
-
You can now return to your Github repository webpage to check that your files are now there.
To turn-in your project, you must submit exactly three files in a commit:
sf-output.txt
ps-output.txt
hello.txt
the format and specification of which are described above. All files should be placed in the directory cy2550/project0
.
- Go to gradescope and submit your assignment.
-
Select the appropriate assignment and then choose Github as the submission method.
-
The first time you submit your repository, you will need to authorize Gradescope to access your git repository. Select the appropriate repository and master branch.
-
You can submit multiple times before the deadline. Your last submission will determine your grade.
-
Once assignments are completely graded, you will be able to see your grade and assignment feedback on Gradescope. Grades will also be synched with Canvas.
Grading
This project is worth 5% of your final grade, broken down as follows (out of 50):
- 33 points - producing a sf-output.txt file that gives your OS as Ubuntu 20.xx or Debian 10 Buster.
- 33 points - producing a correct ps-output.txt file.
- 34 points - submitting a hello.txt file that contains your name and Github username.
Note, we use an automated script to perform grading. If you do not create files and directories with exactly the stated names, our scripts will not find your work, and will not be able to grade it.