CS 31: Lab 0

Due: before Lab on Wednesday


Everybody do the following

  1. If you have not yet taken CS21, skip to the next section first.
  2. Read the class webpage
  3. Try out (and setup) your Swarthmore GitHub account. Read the Git Overview and Setup and Configuration sections of the git Help page, and then try cloning your copy of the Lab0 repository from the CS31-S18 github organization.
  4. If this is your first time using the college’s GitHub server for CS, follow the instruction in the First Time Set-up and Generating ssh keys section of the above git help page to generate ssh keys and upload your public ssh key (generated from your CS account) that is necessary to clone repos on our system.

    We will go over these steps in lab on Wednesday, but please try this on your own before lab.


    NOTE: You need a CS account to do this. If you don’t have one, Rich will hand out new accounts at the end of class on Tuesday, or see Jeff Knerr outside of class to get your account.
  5. Try out the class Piazza page. You should have received an email with information about how to connect to Piazza. Let us know if you encounter problems using Piazza.

Students who have not taken CS21 do this first

Get an account and learn Unix

  1. Go to a CS lab and login with your new account. It will ask you to reset your password. Read and sign the user agreement form and return to Rich, David, or Jeff Knerr. Read the lab rules and user rules off of the CS help pages. To logout, click the logout icon logout icon and choose “log out”.
  2. Attend one of the Using Unix sessions
    • Monday Jan 22 at 7-8pm in SC 256
    • Tuesday Jan 23 at 7-8pm in SC 256
  3. After going through the Using Unix material, create a cs31 subdirectory in your home directory. Start a terminal and at the unix prompt ($) enter the following sequence of commands (the lines with #’s are explanations of each command and not meant to be typed):
# change current working directory to your home directory
$ cd

# print current working directory
$ pwd

# create a new subdirectory named cs31
$ mkdir cs31

# list contents of current working directory (your home directory)
$ ls

# change current working directory to cs31
$ cd cs31

# print current working directory
$ pwd

If you unfamiliar with the Unix file system, read the help on the Unix directory structure.

Learn an editor

You can use emacs, vim or atom as an editor for this class. If you don’t know where to start, try one of these links:

  1. Learn the vim editor

  2. Learn the emacs editor
  3. Learn the atom editor

The atom editor is the easiest to learn and will serve you well in most CS courses. Some upper-level systems (Group 2) courses may require you to be familiar with vim, but the choice of editor in CS31 is up to you.

Locking your screen

As you work in a CS lab, if you plan to leave the lab for just a few minutes and then come right back to work, you do not need to log out, but it is a good idea to lock your machine while you are gone. You can lock your screen by clicking on the lock icon lock icon. You should not lock a machine if you plan to be gone for more than about 10 minutes, and you should not lock main lab machines during times when classes are held in the lab.