<commit_before><commit_msg>18th class notes<commit_after>---
layout: post
author: elliott
title: Eighteenth Class Notes
---

## Announcements

* Hard-coded links in Jekyll:
 - `{{'{{ site.baseurl '}}}}` generates `{{ site.baseurl}}` 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 <EMAIL>
```

(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: https://github.com/eah13/deployafs

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](http://interlockroc.org/2012/12/06/raspberry-pi-macgyver/).  The process on PCs may be easy but documentation is [spotty](http://superuser.com/questions/476450/enable-networking-on-raspberry-pi-internet-sharing-with-win7).  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.
{'fraction_non_alphanumeric': 0.08593526210254941, 'fraction_numerical': 0.00916642795760527, 'mean_word_length': 3.8298755186721993, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7574790', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1021, 'n_words': 527}