Useful Commands

simple navigation commands: ls, cd, pwd paths: ../relative/folder, /absolute/path shortcuts: ~, -, ~username showing stuff: less, cat, more, sort, grep, wc, head, tail, tee stream manipulation: >, >>, | help: man, help manipulating files and dirs: cp, mv, mkdir, rm, ln utility: alias, clear, history cursor: ctrl-a, ctrl-e, ctrl-c, tab process manipuation: bg, fg, ps, kill environment: printenv, set, alias text editors: vi vi command mode: :wq!, i, esc, y, p, linenumber vi search: /searchstring enter. n for next servers: ssh user@server networking: ping, traceroute, netstat, wget, ssh, scp looking: locate, find, grep, diff compression: gzip, tar java: javac java

Assignment

You SHOULD read through the problems before you begin You MAY use the internet or any notes. You MAY NOT use your peers. You MUST submit by 3:15pm on 9/22. You WILL NOT have time to work in class on 9/22. UPDATE: because level 2 was down, you may submit by 3:15 on 9/24. Note we will be moving on in class on 9/22.

Level 1:

  1. Use ssh to log on to compsci.dalton.org.
  2. make a new folder in your home directory called homer.
  3. Inside that folder, make 3 new files in that directory called agamemnon, achilles, and nestor.
  4. Put the line “King of Mycenae, leader of the Greeks” in the agamemnon file.
  5. use curl to download the file http://compsci.dalton.org/~cforster/pg6130.txt.
  6. use grep to find out who needs to accept a “mean sacrifice”. Make a file with that name
  7. use grep to find out why Juno and Minerva descend. Put the answer in a file called juno.
  8. I’m interested in what Great Jove beheld. Put about ten lines surrounding this quote in a new file called jove.
  9. rename the nestor file to greatnestor.
  10. Add the contents of the file blue-eyed from my home folder to the end your agamemnon file. Hint, use cat and a redirect.
  11. add the current system uptime to the agamemnon file.
  12. store your history in a file called “myhistory”. Hint, use history and a redirect.
  13. Using vim, In ALL CAPS, annotate “myhistory” to reference the numbers on this sheet.
  14. use tar to make a tarball called “MYNAME.tar” of all of the files in your directory—replace MYNAME with your name (for example, mine would be cforster.tar)
  15. copy your tarball to /home/cforster/submissions

Level 2:

Somebody who doesn’t work at Dalton anymore has become a secret spy!

  1. Figure out who the spy is by checking login times for inactive users
  2. Look in that user’s folder to figure out what server you need access to.
  3. Run the java program in that folder to get a password for that server
  4. Log on to the hacker server
  5. Write a shell script that creates a log of any system information you can.
  6. Make cron job to generate that file

Level 3:

A good project to take your new linux knowledge further is to spin up your own virtual machine instance and build a small server. Amazon web services (aws) is the most popular server platform on the internet today, it is used by many large companies including netflix, dropbox, etc. Make a free-tier aws linux-based instance (I recommend ubuntu) then use it to make a simple chatterbot program. The interaction can be as simple as you like, and you should be able to find many example programs and tutorials on the internet. This is a hard challenge, but would be an excellent demonstration of a mastery of both linux and java networking.

Grading

Base: 70 points Level 1: 1.33 points each Level 2: 1 point each Level 3: graded as appropriate