Homework #0 - Getting Setup

In this course we will be using the Linux operating system. While we will specifically be using Ubuntu, the main thing that all Linux distributions have in common is that they use the Linux kernel. The kernel is the core software of the operating system which interacts with and provides an abstraction layer for the hardware to users and developers.

To complete this assignment, you will need to setup and configure a remote VM that you will use throughout the semester and provide some verification information to show that you have everything ready to begin work for the course.

Setup the VM

The first thing you will need to do is read and follow the setup guide to:

Create a course folder on the server

We will want a convenient way to store all of our work for the class, so first we will create a cs212 directory. It will be best to keep this directory name lowercase as the Linux operating system has a case sensitive filesystem (e.g “foobar.txt” != “Foobar.txt”). Run the change directory command on your terminal:

$ cd

This will return your terminal to the root of your home directory on the file system (also referenced with the tilda symbol ~). You already have some folders present in this directory. Let’s see those folders with the list command:

$ ls

After running this command your should see several names listed below your command. These are all folders or files you have in your home directory. We want to create a new folder inside the Documents folder in our home directory to hold our classwork. Navigate to the Documents folder using the change directory command, but supply the name of the directory you want to enter:

$ cd Documents

Take notice how your terminal now shows ~/Documents. This part of the terminal prompt tells you where in the filesystem you are currently located. If you run the list command again (ls) you’ll notice that it no longer outputs the same names it did previously. This is because you are no longer in your home directory root, you are in the Documents folder in your home directory. Let’s create a folder named cs212 in this directory to hold our assignments and examples. We can create a new directory with the make directory command:

$ mkdir  cs212

After we run this command, there isn’t any output to let us know what happened. That’s okay, you can always us the list command (ls) to verify that the new directory was created successfully.

Task 1

Using what you have just learned, create two more folders called assignments and examples inside the cs212 folder.

Clone an Assignment from GitHub classroom

We will regularly have to acquire code repositories from git in order to look at and run example code or work on and submit assignments. All assignments will be distributed by GitHub Classroom. Each homework assignment will have a link that you will use to accept and get access to the assignment. Once you have accepted the assignment, you can clone the repository from GitHub. It is important to note that the first time you use GitHub Classroom you will need to associate your GitHub account with your name in the class roster. BE CAREFUL WHEN YOU DO THIS AND PICK THE CORRECT NAME! You will only need to associate your GitHub account with your name once for the first assignment (which conveniently will be this one). The only exception to this would be for group assignments where you will have to associate yourself with the correct group name for a given assignment (but we’ll worry about that at a later time). When you accept the repository, you’ll get an email from GitHub with a link to the repo (you can also find your accepted assignments here).

Task 2

Go to the class Moodle and locate the GitHub Classroom link for Hw0 to accept the assignment.

Once you have accepted the assignment, you will have a repository that you can clone like a normal GitHub project.

Navigate to your assignments directory in the cs212 folder, copy the assignment repostiory url from GitHub and use git to clone the repository into the assignments folder:

$ git clone <assignment-url>

Editing Files and Committing Your Work

Navigate to the git assignment repository that you cloned previously and run the list command. You should see that the directory has a few files in it already. One of them is named README.md. Currently this file doesn’t have much information in it, but we can display the contents of the file with the cat command:

$ cat README.md

The README.md file is a format called Markdown. If you are unfamilar with these files you can get a quick introduction to their fomatting using this guide and if you need a quick reference there is a cheat sheet as well.

Task 3

Using an editor of your choice, edit README.md to add your name to the bottom of this file as heading level 2 (H2) in markdown annotation.

Once you have that complete use git to stage the file for a commit (add), create a commit, and push the changes.

$ git add README.md
$ git commit -m "Update README.md with my name"
$ git push

You have just completed the basic Git workflow. Add new or modified files, create a commit to save your changes, and push the changes up to the server for safe keeping or sharing with collaborators. Do not be afraid to commit and push your work if you aren’t completely “done”. This is a way to save and backup your work. The only thing you shouldn’t do is commit broken code if you are working with other developers. Even when we have autograded assignments that will grade you each time you push, do not hesitate to commit and push your work. I only consider your last submission before an assignment deadline when grading.

Task 4

This last task I’d like you to try on your own. You can get the version of the Linux kernel that you are running by running this command in a terminal:

$ uname -r

Inside your repository for this assignment, I’d like you to create a new file named kernel-version.txt and add the output of the previous command to this file. When you are done with that, make sure to properly add that work to your repostory using git and submit your changes to GitHub.

Grading (4 Points)