Homework 1 had you create a CCOM wiki page. Much of the homework for the rest of the class will be in emacs org-mode. You will submit your homework as an emacs org-mode file and an exported HTML file as a tar with the proper file name. Make sure to mark all TODO items as DONE. Make sure to fill in all sections. Mark all check boxes when you complete them.
Put your answers in the appropriate “#+BEGIN\_SRC” or “#+VERSE” sections when they are in the homework.
Some questions may start with a “- [ ]”. Fill in the line and use C-c
C-c to mark the check box as done.
NOTE: You should complete this assignment on your own first. But it is okay to check over each other’s completed assignments. I strongly recommend that you have another classmate check your work.
This assignment depends on attention to detail.
- [ ] Log in to your virtual machine
- [ ] Open a terminal
- [ ]
mkdir -p hw/2 - [ ]
cd hw/2 - [ ]
wget http://tinyurl.com/hw-2-shell-and-org-mode-dotorg - [ ]
mv hw-2-shell-and-org-mode-dotorg hw-2-shell-and-org-mode.org - [ ] start emacs and open the homework
Or if you want to do less typing, you can replace the wget and mv command with this:
wget --output-file=hw-2-shell-and-org-mode.org http://tinyurl.com/3fjdphv This is what inline questions look like. The first question is answered for you and marked as complete.
- [X] What is the CCOM website? http://ccom.unh.edu
- [ ] What is the website for the operating system we are using in this class inside of the virtual machine?
- [ ] What is the URL for the Wikipedia Entry on Multibeam Sonars?
If you don’t put your name on your homework, even if sending it to me and naming the files approriately, I will deduct points.
Go to the top of this file and do the following:
- [ ] Replace “FIX: your name” with your name
- [ ] Replace “FIX: your email” with your email address. This must be UNH or NOAA address, or no points.
- [ ] Replace the date line just under those two with the current date.
Download this file using wget: http://vislab-ccom.unh.edu/~schwehr/Classes/2011/esci895-researchtools/examples/2007-boston-construction.csv.bz2
Place the command inside the “SRC” and the results inside of the example. I will do the first one for you.
wget http://vislab-ccom.unh.edu/~schwehr/Classes/2011/esci895-researchtools/examples/2007-boston-construction.csv.bz2Results:
--2011-09-16 03:47:58-- http://vislab-ccom.unh.edu/~schwehr/Classes/2011/esci895-researchtools/examples/2007-boston-construction.csv.bz2 Resolving vislab-ccom.unh.edu... 132.177.103.235 Connecting to vislab-ccom.unh.edu|132.177.103.235|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1030480 (1006K) [application/x-bzip2] Saving to: `2007-boston-construction.csv.bz2' 100%[========================================================>] 1,030,480 51.4K/s in 27s 2011-09-16 03:48:25 (37.9 KB/s) - `2007-boston-construction.csv.bz2' saved [1030480/1030480]
Use the correct command to uncompress 2007-boston-construction.csv.bz2
# FIX: put command hereUse the file command to find out what type of file this is.
FIX: put answer hereResults:
FIX: put results here
How many lines are in this file?
# FIX: put command hereResults:
FIX: put results here
- [ ] Read the man page for
head
What is the command to display the first 5 lines of the file?
# FIX: put command hereResults:
FIX: put results here
Output the last 15 lines of the file. Hint: you can use “man –apropos” to try to find the command to use.
# FIX: put command hereResults:
FIX: put results here
You can use the “GMT minmax” command from GMT to get the bounding box of this data. What is it?
# FIX: put command hereResults:
FIX: put results here
If you do not save the org-mode file you are working on before creating the submission, the HTML will be fine, but your org-mode file will not show your completed home. Save your file with:
C-x C-s
Follow this section very carefully. You should be creating a submission that is layed out exactly as I have done.
Use the emacs search command for the string “FIX:”. The only place where this string should be in your org-mode homework 2 file is in this section and the two list check boxes that talk about filling in your name, email, and the date. I use that string to mark sections where you need to be replacing it with something.
Searching starts by holding Control and pressing s (written C-s).
Then type what you want to search for. In this case, type “FIX:”
(without the quotes). To search for the next instance of the string,
press C-s again. When you get to the end of the file, press C-s
again and it will jump to the top of the document.
WARNING: If you properly follow this section, the “TODO” above and any TODO or [ ] markers below will be left unflagged inside of the tar. They are included to help you work through the process.
First create an HTML export of your assignment. In emacs you can
type C-c C-e. Remember to hold down the control key and press the
letter that follows the dash. You should now see the list of org
export formats. Press the letter b and you should see Firefox open
up and show you your homework. The full command:
C-c C-e b
Switch back to the terminal. You should be in ~/hw/2. You will now create your submission. Replace YOURNAME with your user name. NOTE: If you don’t remember your username, it is what you used to log into researchtools.
First, build the directory tree:
mkdir hw2-YOURNAME
cp hw-2-shell-and-org-mode.org hw2-YOURNAME/hw2-YOURNAME.org
cp hw-2-shell-and-org-mode.html hw2-YOURNAME/hw2-YOURNAME.htmlVerify that your homework submission looks correct. It should look something like this:
ls -l hw2-YOURNAME/
total 20
-rw-r--r-- 1 researchtools researchtools 11904 2011-09-16 05:57 hw2-YOURNAME.html
-rw-r--r-- 1 researchtools researchtools 4740 2011-09-16 05:57 hw2-YOURNAME.orgNow we need to create a “tar” archive of your homework:
tar cf hw2-YOURNAME.tar hw2-YOURNAMEVerify the contents of your tar:
tar tfvv hw2-YOURNAME.tar
drwxr-xr-x researchtools/researchtools 0 2011-09-16 05:57 hw2-YOURNAME/
-rw-r--r-- researchtools/researchtools 4740 2011-09-16 05:57 hw2-YOURNAME/hw2-YOURNAME.org
-rw-r--r-- researchtools/researchtools 11904 2011-09-16 05:57 hw2-YOURNAME/hw2-YOURNAME.htmlCompress your tar archive using bzip2 with maximum compression
bzip2 -9 hw2-YOURNAME.tarCompute the md5 checksum.
md5sum hw2-YOURNAME.tar.bz2
57e88b90db260511eee305108d0b2d91 hw2-YOURNAME.tar.bz2NOTE: Your checksum will be different!!!!
57e88b90db260511eee305108d0b2d91 hw2-YOURNAME.tar.bz2
The “>” character redirects the output from the screen to a file. Save that md5 sum to a file. Put the checksum in a file:
md5sum hw2-YOURNAME.tar.bz2 > hw2-YOURNAME.tar.bz2.md5Use the secure copy command to copy your files from the virtual machine to the researchtools server
scp hw2-YOURNAME.tar.bz2* YOURNAME@researchtools.ccom.nh:You will see this the first time that you ssh or scp to a computer from a new computer or account. Each computer has a unique signature that should not change. When you say yes here, the computer will record the host signature. If the host key changes, ssh or scp will warn you loudly about it.
The authenticity of host 'researchtools.ccom.nh (192.168.2.28)' can't be established. ECDSA key fingerprint is 16:c1:64:32:da:23:b9:58:0a:87:06:5b:05:1a:c5:35. Are you sure you want to continue connecting (yes/no)? yes YOURNAME@researchtools.ccom.nh's password: hw2-YOURNAME.tar.bz2 100% 4705 4.6KB/s 00:00 hw2-YOURNAME.tar.bz2.md5 100% 55 0.1KB/s 00:00
Use ssh to log into the researchtools server.
ssh YOURNAME@researchtools.ccom.nh The authenticity of host 'researchtools.ccom.nh (192.168.2.28)' can't be established. ECDSA key fingerprint is 16:c1:64:32:da:23:b9:58:0a:87:06:5b:05:1a:c5:35. Are you sure you want to continue connecting (yes/no)? yes
Make sure you are actually logged in to researchtools.
echo $HOSTNAME
researchtoolsSetup your homework area, unpack your homework, and move the tar to the “hw” directory.
mkdir hw
cd hw
tar xf ~/hw2-YOURNAME.tar.bz2
mv ../hw2-YOURNAME.tar.bz2 .Verify that your homework is in place.
ls -la hw2-YOURNAME/
total 28
drwxr-xr-x 2 schwehr domain users 4096 2011-09-16 05:57 .
drwxr-xr-x 3 schwehr domain users 4096 2011-09-20 09:42 ..
-rw-r--r-- 1 schwehr domain users 11904 2011-09-16 05:57 hw2-YOURNAME.html
-rw-r--r-- 1 schwehr domain users 4740 2011-09-16 05:57 hw2-YOURNAME.orgEmail me from your UNH email account (no hotmail/gmail/yahoo/etc email) with the subject line “research tools homework 2”.
My email address is kurt@ccom.unh.edu
In the email, include the md5 sum of your .tar.bz2 archive. I will then log into researchtools to check on your homework. I will compute the md5 sum of your tar.
DO NOT put the tar or .md5 file in the email. Only copy the md5 sum and filename in the email.
Include these in the email:
- [ ] your tar file name
- [ ] the text of the md5 checksum