Lab 0: Remote Access to CS Lab Machines
Welcome
The purpose of this first lab is to familiarize you with the environment you will be using in this course--some at the beginning, some at the end. In particular, this lab will introduce you to remotely accessing the Linux operating system, using GitHub, and course resources.
Goals for Lab Zero
After the lab, you should know how to
- access the lab machines remotely
- use GitHub through GitHub classrooms
- use the interactive textbook
Introduction to Lab Assignments
Links are bolded, and when you hover over them, you'll see a gold background to them. (I don't know if it's necessary to mention that in this class; it is an issue in the intro class.)
Objective: Linux
- Log into a lab machine.
- Review common Unix commands, since I will assume your knowledge of using them in the terminal.
- Open a terminal.
- Type labhelp to start an application that
helps me keep track of who needs help next.
- When you need help, press "I have a question".
- When your question has been answered, press "Question answered"
- Before exiting the help client (not now but at the end of the lab), always click "Question answered"
Objective: Remotely Accessing the Lab Machines
You may access your Computer Science account from any computer connected to the Internet, provided you have appropriate access software, e.g., a secure shell client program. Having an X server installed too means that you'll be able to run graphical programs and have them display on your machine.
You may be planning to do most of your work on the lab machines, BUT you must set up your personal machine to remotely access the lab machines.
- Follow the instructions to download and install the ssh client and X server and ssh into the lab machine of your neighbor (to your left or right). For future reference, this document contains the names of all the lab machines.
- Type emacs & in the terminal to open a text
editor. A text editor is a simple editor (like Notepad for
Windows or TextEdit for Mac) for plain-text documents (like
program source code and HTML files). You may get
errors/warnings in the terminal, but as long as you get the
window, you're probably good.
The
&
means "run in the background" so you can keep using the terminal. - Type who in the terminal to see who else is
logged on to the machine, e.g.,
sprenkle@python:~$ who sprenkle pts/0 2024-04-18 13:19 (137.113.118.65) tmarcais tty2 2024-04-15 15:50 (tty2)
From the output, I see myself and tmarcais (our technical support person) are logged into the machine named python. - Save the output in a file named
who.txt
by running who > who.txtTo view the contents of the file, you can use the
cat
command, e.g., run cat who.txt - View the contents of the directory to show
that
who.txt
is in your directory. This file is now saved on the CS department's file system. When you log onto any lab machine, you will see this file.
Objective: Setting up Aliases
You'll run some commands frequently, e.g., sshing into the web server. Instead of remembering what to type, it's often helpful to have an alias to run a shorter command as a shortcut for the longer command. If you don't want to try this now, you can come back to it later.
Some options:
- Creating aliases in zsh, the default shell on MacOS
- Creating aliases in bash, the default shell on Ubuntu and most Linux distributions
Objective: Reviewing and Setting Up Git
This can get tricky because I don't know if you already have git set up, but I want to make sure everyone is at the same starting point. Do the parts that you need to do.
Git Resources:
Reference these resources to help you use Git
- GitHub Guides: Git Handbook
- An interactive
resource: Learn Git
Branching may help -- you probably just need
Main: Introduction Sequence
andRemote: Push & Pull -- Git Remotes
Install and Set Up Git
- If you only plan to use the lab machines, you can skip this
step. On Mac or Linux, Git may already be installed. Follow the
instructions
here: Download
and install Git
on Windows, there are some settings you should set to work well with other platforms and it comes with a program called Git Shell that you can use to enter the commands below (you can also install a full version of Ubuntu Linux!) - Within Terminal/Shell, configure Git for your computer
(note, these commands only need to be done once for each
computer you want to use git on)-- make sure to replace the information as appropriate
git config --global user.name "YOUR NAME" git config --global user.email "YOURUSERID@mail.wlu.edu"
- Commit messages automatically open an editor to write/save the
messages. It seems that most systems are defaulting to
using
vim
for the editor, which many of you probably don't know, and it has a learning curve. If you want to change the editor that is used for git, see these examples.
Get a GitHub Account
If you don't already, you should get a GitHub account.
Set up Your GitHub Account: Personal Access Token
If you don't have a personal access token or your token expired, create a personal access token in the GitHub web interface.
- Select the Classic token, which are less secure but easier to use for our purposes.
- You can set the expiration to be the end of the term or to never expire (or something else).
- Set the scopes to all of
repo
. - Save your token somewhere! You can't get it again after it has been generated. You can create a new one, though, if needed.
If you had a different personal access token (i.e., if your old personal access token expired), you may need to reset your stored credentials on your Mac.
GitHub Classroom
- Accept the Git assignment. This will create your own private repository for the assignment that you and I can access.
- Clone the repository for this assignment.
- Complete the assignment--the directions are
in
README.md
in the git repository.
Objective: Using the Interactive Textbook
If you haven't used Runestone before, register for the site,
creating a username/password for the
course WLU_CSCI335_S24
. Please make the email, first
name, and last name be what you use for W&L so that I can
recognize your account.
If you have used Runestone before, login, click the person icon and
press "Enroll in a Course" and enter the code for the
course, WLU_CSCI335_S24
.
While the book and registration is free, please consider donating $10 to help with their costs of hosting and development.
Read the first chaper, marking the sections as completed by 11:59 p.m. tonight. Check the assignments page to make sure you have completed the assignment.
Grading (30 pts)
Due by 11:59 p.m. tonight.
- Interactive textbook: 4 pts
- GitHub assignment: 26 pts