Apr 10: Exam #2
First 20 minutes¶
Windows Terminal
On Windows, be sure to use Git Bash as your terminal in VS Code. See the last paragraph of Git Bash on Windows to change the default terminal.
SSH Configuration
- Open a terminal in your project repository.
- Run this command (on your laptop):
ssh stu
- Are you able to log in without a password?
- If not, see the instructions from Tuesday.
- Run this command (on the stu server):
ls -l
- Do you see a
www
pointing to/cs/www/stu/username
? - If not, run this command:
ln -s /cs/www/stu/$USER www
- Do you see a
- Press Ctrl+D to log out of stu.
- That's the shortcut for EOF, which closes the connection.
rsync
on Windows
If you are running Windows, rsync
is likely not installed.
Follow these steps to get rsync
working in Git Bash (without having to install and configure a bunch of other tools):
- Download and open the latest rsync package from MSYS2.
- Copy the
usr
folder (fromrsync...tar.zst
) intoC:\Program Files\Git
.- This should merge the files into the existing
C:\Program Files\Git\usr
folder.
- This should merge the files into the existing
- Download the latest libxxhash package from MSYS2.
- Copy the
usr
folder (fromlibxxhash...tar.zst
) intoC:\Program Files\Git
.- This should merge the files into the existing
C:\Program Files\Git\usr
folder.
- This should merge the files into the existing
- You should now be able to type
rsync
in Git Bash and see the usage message.
Deployment Script
- Open a terminal in your project repository.
- Type
git pull
to update your local copy. - Run this command:
./deploy.sh
- The
.
refers to the current directory. - You should see a list of files being copied.
- The
- Run the deploy script again.
- The list of files being copied should now be empty.
- The
rsync
command copies only files that changed.
Reminder
Set up a Mock API for your project for testing/debugging, and in case the API changes this month. You'll need to fetch and add sample json files to your repository for this to work. Let me know if you have any questions. You can post questions on Piazza, or come to office hours on Friday, Monday, or Tuesday.