Nothing to hand in
You'll need to work on your own for this, since it involves setting up your own computer. But absolutely take advantage of our class Slack workspace to ask questions if you get stuck.
Here's the quick summary of your tasks. Much more detailed instructions are in the numbered sections below.
Communication for this class is going to take multiple forms:
Slack is a chat tool that has become extremely widely used in businesses and other organizations. Carleton CS majors started using it for comps team communication about five years ago, and we've gradually increased our use of it in classes since then. The CS faculty and staff have a very active Slack workspace. I would have been lost without this easy access to my colleagues while preparing to teach online in 2020.
Here are your Slack-related tasks for this assignment.
Unix is a family of operating systems whose shared heritage goes back to a project begun in 1969 by Ken Thompson and Dennis Ritchie. Linux is a Unix-based system. macOS is a Unix-based system. Holy cow, are there a whole lotta Unix-based systems.
There are three reasons I want you to have access to a Unix command-line interface on your working computer:
Boot up macOS and you're good to go. Mike Tie has installed all the Unix tools you'll need. Masks and distancing required, of course.
This depends on your computer's operating system.
For macOS, the Terminal app (installed on all macOS systems in /Applications/Utilities) gives you a Unix command line. Apple's variant of Unix is a descendant of Berkeley Unix from the early 80s, with occasional small Apple-specific adjustments.
Linux systems all have at least one terminal app, with various names, depending on which Linux distribution you're running. In my experience, a terminal app is easily available via the desktop or default menus on Linux distributions.
On Windows 10, you don't get a Unix terminal by default. Instead, you'll need to install the Windows Subsystem for Linux (WSL), which will give you a Unix terminal app. To do the installation, follow these WSL installation instructions, with the following clarifications:
This is a lot more work for Windows users than for macOS or Linux users, but that just means you get to learn more than they do.
Open your Unix terminal app. Type the following command. (NOTE: you always hit Enter at the end of a command to execute it.)
The answer you will get will almost assuredly be:
The "which" command is saying that the "vi" command in your system is located at the path /usr/bin/vi.
Do it again for two more commands:
If you get nothing after either of those, you'll need to install the missing command with a package manager. Which brings us to...
Package managers make it (relatively) easy to install, update, and uninstall software. That will be very handy as we add new tools to our toolkits later in the term.
On Windows 10, once you have installed WSL, you should have the command "apt" installed. You can run "which apt" in your Unix terminal to make sure. If you don't have "apt", then you surely have "apt-get".
On Linux, same thing as on Windows—apt or apt-get.
On macOS, I strongly recommend that you use the Homebrew package manager. Go to that link and follow the brief installation instructions at the top of the page.
As an example, let's install the package "imagemagick", which is a collection of tools that help you manipulate image files. I picked this example because it's an interesting tool that is not installed by default on any operating system I know of. Here are the commands that you could use to do the installation:
Note that "sudo" (from "super-user do") allows you to execute commands with the Unix version of "administrator privileges". Sometimes, you can try to execute a command and you'll be told you don't have permission to do so. For example, when I try "apt install imagemagick" on my WSL terminal, I get told "Could not open lock file" and "Permission denied", which is a slightly perplexing way to say "only administrators are allowed to do that". But if I do "sudo apt install imagemagick" and enter my administrator password when prompted, everything works fine.
Once you have imagemagick installed, you can try any of its zillions of options. For example, suppose I want to take a JPG file of my dog (maisie.jpg) and scale it to half width and half height (thus cutting the file size by approximately a factor of 4), and also convert it to PNG format. This command will do the job:
Remember executing the commands "which python3" and "which git"? If either one of those "which" commands returned nothing—that is, the command in question isn't available on your system—then it's time to install whichever command is missing.
On macOS, that would be "brew install git" and/or "brew install python3".
On Linux or WSL, "sudo apt install git" and/or "sudo apt install python3".
One of the most important tools in a programmer's toolkit is version control software. Version control gives you a convenient way to: back up your documents (code, documentation, data, images, etc.); track document changes over time; roll back a document to an earlier version; share the editing of documents with your collaborators; etc. Version control systems are powerful, complicated, and indispensible for both individual programmers and teams.
This term, we will use the version control system git. We will also use GitHub, a website and company that provide hosting and other services for people using git. The central copies of your work will live on GitHub, and you will transfer the changes that you and your collaborators make to your code and other documents back and forth between your individual machines and GitHub via git commands.
To do this, you will need a GitHub account. So:
Create a Personal Access Token (PAT) to enable you to "push" (i.e. save) changes to GitHub repositories from the command line. GitHub will not allow you to push changes using your password, so you're going to need this PAT right away.
Follow GitHub's instructions for creating a PAT. These instructions are pretty straight-forward, with a couple things to watch out for:
Create a repository to use for this class. Click on the green "New" button (near the upper left of github.com when you're logged in), and then make these choices:
A couple notes about these selections:
No need to do anything further with your GitHub account for this exercise. We'll start using it for your next lab.
That's all for now. You have a Unix terminal on your computer, including vi, python3, and git, and you have a git repository ready on GitHub. Next up: we'll start learning how to use all this stuff.