Using Your Own Machine

Using the CS lab machines remains the recommended, preferred and best supported option. But we also do provide some support for working from your own machine, and given the size of the class (and the number of students taking CS courses in general), there may be times when there are no free lab machines and using your own may be advantageous.

Even if you do use your own machine, if you have a laptop it may be helpful to bring it to the labs (or somewhere nearby) rather than working in your dorm room. For one thing, your partner might prefer not to be close to your dorm room detritus, but more importantly, if you work in the labs, you benefit because you will likely be surrounded by sources of help, including other students in the class and course grutors. In addition, our systems administrator, Tim Buchheim will often be close by if there are any system problems to resolve.

This page explains the best ways to use your own computer.

Connecting to the CS Servers (Recommended Approach)

The easiest way to work on your own machine is just to connect to the CS servers. That way, all your files are on the CS file servers (and thus backed up) and all the software you need is readily available. In essence, your machine becomes a graphical terminal connecting to the remote system.

Connecting to knuth

You will need to connect to the CS server called knuth, to run programs there.

Console, with Linux and OS X

Open a terminal and run

     ssh ‹your-id›@knuth.cs.hmc.edu

where ‹your-id› is your id (e.g., if your id is mabel, use ssh -X mabel@knuth.cs.hmc.edu).

Console, with Windows

If you have Windows 10, it’s possible to download a bash terminal (for example, see here). Once you have this terminal, you can follow the instructions above and ssh into knuth.

Editing files

Clone your repository to knuth

If you are running your programs on knuth, you should clone your repository there. Be sure to keep it up to date with any other clones you might have on other machines.

This method is probably the preferred, default method for editing files on knuth. Follow these instructions (written by Prof. Chris Stone) for installing the Visual Studio editor with the Remote SSH plugin.

To work with Haskell files, you may also want to install the haskell-linter and Haskell Syntax Highlighting plugins.

A more advanced approach is to use sshfs to mount your knuth home directory directly on your machine (e.g., on a Mac using OS X Fuse and MacFusion), although this approach requires some Googling and has been buggy in the past.

Console, with Linux and OS X

Open a terminal and run

     ssh -X ‹your-id›@knuth.cs.hmc.edu

where ‹your-id› is your id (e.g., if your id is mabel, use ssh -X mabel@knuth.cs.hmc.edu).

The -X option causes ssh to also forward X11 traffic, allowing you to run graphical programs (e.g., editors, viewers, etc.) on knuth and see them shown on your screen. For example, run xterm after logging in to bring up a terminal window for the remote machine.

Some programs are not written to correctly take advantage of the X11 SECURITY extensions and will not work properly when logging in with ssh -X, in which case you might want to try forwarding X11 traffic using ssh -Y instead, which enables trusted X11 forwarding and will work better for some applications. Be warned that connections using trusted X11 forwarding will not be subject to X11 SECURITY controls and should not be used when logging in to untrusted machines.

Note: if you are running a recent version of OS X, X11 is no longer installed by default. You can find it on the XQuartz Project page.

To test if X11 is already supported on your machine, try to run xterm on a local terminal window. See this article for information about X11 support on Macs.

Editing on Your Machine, Running on knuth

A variant on the above schemes is to edit your files locally on your own machine (using your favorite editor), push them to GitHub, then pull them to knuth to be run.

Running Code Locally (More Steps, More Complex)

If you wish to work on CS 131 assignments directly on your own machine, you’ll need to have a software setup that is essentially identical to the one we provide. Creating such a setup is possible, but you should only attempt to do so if you’re already fairly comfortable with the basics of Unix systems (e.g., editing your PATH).

To run code locally, you should be running a 64-bit Unix-like operating system. OS X or Linux (for x86_64, not i386) should work fine.

Install Developer Tools

Although we’ll not be working much with C and C++, these tools are needed implicitly by some of the software we use, so be sure to have installed a C++ compiler, etc. On a Mac, installing the developer tools means installing Xcode from the app store.

Installing Git (git)

See the git webpage for instructions on downloading / installing git.

Use lc on knuth only, don’t install your own copy.

We use a slightly custom version of lc, so we recommend that you just log into knuth and run it there. We’ll only use it briefly, so it isn’t worth the effort to perform your own installation with our customizations.

The Haskell Platform

The easiest way to use Haskell is to log onto knuth, but you can try installing your own copy of The Haskell Platform. Unfortunately, installing it on a Mac is a bit of a pain at present because Mavericks broke some things, but it is possible. (Note that currently we’re running a slightly older version of the Haskell Platform on knuth, but the differences should be minor.)

Troubleshooting

Generally speaking, it’s not practical or desirable for the course staff to troubleshoot technical problems students may have with their own computers, but here are a few common issues.

Network Problems

If you are on campus and using wireless, make sure you are using Claremont WPA. If you have problems connecting to machines like knuth and are on the Wireless network CINE, it’s possible that your machine is not properly authorized. Unknown machines are allowed to access the global web, but not other Internet services, such as ssh.