Fork me on GitHub

Eighteenth Class Notes

by Elliott Hauser

28 Oct 2013

Announcements

  • Hard-coded links in Jekyll:
    • {{ site.baseurl }} generates /fall2013 but can be easily changed in the future. Hard-coded links will never change

SSH

Secure SHell is a way of 'logging in' to another computer remotely and controlling it via the command line. It's used often in programming, for instance to log in to and update servers that run a website. Today we're going to SSH into the University's web space they provide everyone with an ONYEN. You'll then have the ability to put things on the internet easily!

To access your AFS space, use the following command:

ssh onyen@isis.unc.edu

(Where onyen is your ONYEN)

You'll be asked for a password, then get a blinking prompt. This looks like a normal prompt but it's actually your way to tell UNC's servers what to do.

As always, type ls to see what's around you. You shuld see something like this:

$ ls
bin/  documents/  ms@  OldFiles/  private/  public/  public_cgi/  public_html/

You can also type pwd to see where you are.

We want to go to the public_html directory: this is where the server looks to serve files in your public webspace.

cd public_html

Now ls to see what's in there. You may have existing files in there. If you do, and want to save them, change the file names below to something else so you won't overwrite them.

Let's make an index.html file. By default, most web servers will serve this file when you go to a location, so by changing this we can change what someone sees when they go to http://www.unc.edu/~onyen/.

Let's change it with nano:

nano index.html

# here's what I see:

<html>
<head>
<title>eah13's homepage</title>
</head>
<body>
<center>eah13's homepage</center>
</body>
</html>

Change the text in the body and or title, then save with Ctrl-O and exit with Ctrl-X. Go to http://www.unc.edu/~onyen/ and see if your changes are reflected. (if not, make sure you've saved)

Exercise: Deploy to AFS

I've written a script to help you sync an entire folder up to the webspace: deployafs on GitHub

Use this script to deploy your mysite Jekyll site up to your public AFS space. This should make it visible at http://www.unc.edu/~youronyen/mysite.

By tonight, open a Github issue with a link to your working site.

Extra Credit: Raspberry Pi VNC Post

We're not going to have time to dive into Raspberry Pi in class as I'd hoped. The Library has these bad boys available for checkout. Once you know how to ssh, which we do now, you can set up remote access to your Pi by sharing your ethernet connection. The process on Macs is easy and well-documented. The process on PCs may be easy but documentation is spotty. On Linux I imagine the process is easy but no promises.

Those of you who are planning to use the Raspberry Pi for a project will want to pay attention to this in particular. You'll likely have to set up a (NOOBS image on an SD card](http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf), which is easy, but an additional step you'd have to take anyways..

The due date on this is negotiable, but Friday Nov 1 is a reasonable target.

Elliott Hauser is a PhD Student in information science at UNC Chapel Hill. He's hacking education as one of the cofounders of Coursefork.org. Find Elliott Hauser on Twitter, Github, and on the web.
comments powered by Disqus