Computer Systems Organization

CSCI-UA.0201-030, Fall 2026

Lab-0: Basic Lab Setup

Background: Working with UNIX for program development

This course assumes familiarity of the UNIX environment as course pre-requisite. If you are new to UNIX, you should take some time to read on your own to master the required knowledge.
Good sources to help you learn UNIX:
  • A short course from MIT called ``The missing semester of your CS education''. Note that this course has a lecture on Agent coding. However, you should not use agent coding to do the labs for this course. Learn it for your other non-course-related projects.
  • A useful guide: The art of commandline.
  • A very short UNIX command cheat sheet.
  • Ask AI. It is a good use of AI to help you get familiar with UNIX programming environment.

Lab Setup Preliminary

We use Docker for doing labs so everyone has the same Linux (Unix) enviroment, whether you are on a Mac, Windows or other kind of laptops.

Docker gives you a pre-built lab environment that includes:

Install Docker Desktop
Creating and Running CSO Docker image

Reminder: if your laptop is Windows, type all the commands within WSL.

Do the following:

Setting up Git and Github

Learn to use git

Git is a version control system. It allows you to save versions of your work over time. It's like a time machine plus a teamwork system for your program files, where you track changes and safely experiment and collaborate without chaos.

Eddie Kohler has an excellent guide on Git. You should read it.

You can find other comprehensive sources to study here.

This course uses Github to distribute and collect labs. Github is a cloud storage plus other useful project management tools for code using git.

Create a Github account if you do not already have one. The Free plan is perfectly fine.

Set up ssh-based logins to Github.

Cloning lab0 repository locally

  • On your laptop, clone your lab0 repo by typing the following.
    $ cd cso-labs
    $ git clone git@github.com:nyu-cso-fa26/lab0-<netid>.git lab0
    

    You will see that a directory named lab0-<netid> has been created under the cso-labs directory. This is the git repo for your Lab0 assignment. Other labs can be created similarly by cloning respective repositories.

    If you encounter a warning/error saying "Repository Access Issues", you should check your email (the email your github account is registered under), find an email from Github classroom inviting you to join the nyu-cso-fa26/lab0-netid repository and accept the invite.

  • Lab0's README.md file instructs you what to do. In particular, you are to add your NetID to file netid.txt, commit and push this change to Github.

    Using a command line editor to modify files for your lab assignments.

    We recommend using nano. For example, for Lab0, you want to change file netid.txt, type the following:

    $ cd cso-labs/lab0
    $ nano netid.txt
    

    Saving changes to Github while you are working on Labs

    As you modify the skeleton files to complete the labs, you should frequently save your work to protect against laptop failures and other unforeseen troubles. You save the changes by first "committing" them to your local lab repo and then "pushing" those changes to the repo stored on github.com

    $ git commit -am "saving my changes"
    $ git push origin master
    
    You do not need to create any new files in Lab 0. In the future, if you want to add a new file to the git repo, you need to explicitly tell git so. Otherwise, the file will not be committed by git commit. Make git track a new file by typing:
    $ git add <my-new-file>
    

    After you've pushed your changes by typing git push origin master, they are safely stored on github.com. Even if your laptop catches on fire in the future, those pushed changes can still be retrieved. However, you must remember that doing git commit by itself does not save your changes on github.com (it only saves your changes locally). So, don't forget to type git push origin master.

    To see if your local repo is up-to-date with your origin repo on github.com and vice versa, type git status

    FAQs on Git repository
    • What message should I fill in for git commit -am "message"

      The "message" can be any string. But we ask you to leave something descriptive as message. In the future, when you check your git logs, this message helps you recall what you did for this commit. We (CSO staff) will never read your commit message. It's not going to affect grading.

    • How can I change a message if it's already pushed to GitHub?

      You don't need to change a message. There are ways to change messages but for CSO you never need them. Don't do it. It's going to cause conflict. Super dangerous.

    • I got an error message Fatal: Not a git repository (or any of the parent directories).

      This means you are typing git commands outside the directory containing your git repository. You need to type cd recitations-XXX, where XXX is your GitHub username. Remember to always type most git commands inside git repository. Commands like git clone, git config --global can be issued anywhere.

    • Can I edit files through GitHub.com?

      No. You should never do that. That's very likely to cause conflicts. Super dangerous. Please only use GitHub.com for read-only access, i.e. checking if all your changes have been pushed to your remote repository.

    • When I do git pull, I got an error Repository not found. Check the repository address, there should be no quotes (") or angle brackets (< >). The lab instructions use quotes or angle brackets to mark a placeholder for your GitHub username. If git pull upstream master fails, then check upstream address by typing git remote -v To edit your upstream address, remove it first by typing git remote remove upstream, and then add it back with git remote add

    Handin Procedure

    You must do both of the following steps:

    Acknowledgements

    Some part of this material is based on the lab setup instructions in Prof. Michael Walfish's CS202.