Before We Start
You will get an email on 3 or 4 January, which will refer you to this page. Here is what you need to do before we begin so we can hit the ground running. Save this email until the first day of class; you will need the information it contains.
You will need three important items.
- If you use Windoze, download and install
puTTy Get the
.msi
file for your system. Just about all of you should have 64 bit systems. The install is very straighforward. Mac and Linux users do not need to complete this step. - Download and install the FileZilla Client. This will allow you to transfer files easily between your machine and the server.
- Go to The Python Site and install the latest version of Python 3 (Macs have 2.7 installed by default). Corey Schaeffer's video has complete instructions for Mac and then for Windoze at 5:50. Windoze users: Do not forget to check the update path box! The video will remind you to do this.
You will receive an account on cs.ncssm.edu
on the first day
of JTerm. This will afford us a uniform UNIX computing environment. This server
has all of your favorite compilers, inclding headlless Java, C, and Python.
The server is not visible off of campus.
Windoze Login
You need to be on campus to do this.
- Start PuTTy
- Port: 22
- hostname: cs.ncssm.edu
- You will be asked for your login and password, which has been sent to you. You will see a black terminal window asking for your login name. Enter it and hit ENTER.
- You will be asked for your pasword. YOU WILL NOT SEE CHARACTERS AS YOU TYPE. Hit ENTER when you have typed it in.
- If you log in successfuly you will see a system prompt looking like this:
~>
- Type
passwd
at this prompt and you can change your password. - To end your session, type
exit
at the prompt.
This brief video shows how to customize your PuTTY session. You can create different profiles for different purposes.
This video has some really nice tips to make PuTTy easier to use and make you more productive.
Mac/UNIX Login
- Open a terminal window.
- At the prompt, type ssh (your user name)@cs.ncssm.edu.
You will see this.
- Type your password. YOU WILL NOT SEE CHARACTERS AS YOU TYPE.
Hit ENTER when you have typed it in. You will get a system prompt
which will likely just be
~>
. - Type
passwd
at this prompt and you can change your password. Just follow the directions and choose a strong password. - To end your session, type
exit
at the prompt.
Handy Resources
Cast of Characters
- chen23e
- etin22a
- fawcett22a
- fetkovich23j
- gomatam23v
- goyal23a
- krasinski23r
- mohanraj22d
- patel23pratham
- ravichandran22c
- workukebede22m
- zhang22b
Meeting Times There will be two sessions.
- AM Session: 9:00A-11:30A
- PM Session: 1:00P-3:30P
Central Theme This is about data acquisition and visualization. You will learn a toolset that is freely available and amazingly powerful. It allows you to do some heavy lifting without writing a ton of code.
What you will Learn
- How to manage files in a command-line interface
- How to use the UNIX text editor VIM
- How to use the
sed
stream editor - Regular Expressions
- How to use
awk
to extract data from files - How to use pipes and redirection to process files
- How to use
wget
to slurp things off of the web efficiently - A little python so you can visualize data using MatPlotLib
What you will Create Start thinking about things that interest you and which produce scads of data. This can encompass economics, politics, science, sports, and a panoply of other areas of interest.
You will build an apparatus that allows you to acquire and process data and use that apparatus to look at a "real-world" problem.
The Anatomy of a UNIX Command
The three parts
- name: The name of the command
- options: these are preceded by - or --
- arguments: these are things being acted upon.
Commands we learned this AM
ls
list stuffecho
put something tostdout
mv
renames or moves filestouch
creates an empty file(e) if the files don't exist and moves modified date to present.cp
copycd
change directory. Wiht no argument, you go home.whoami
tells user namehostname
tells machine namepwd
prints your cwd.rmdir
discard empty directoyrm
unlink file from FS.
- command mode: search replace mobility save save as This is the default mode
- insert mode: type
Getting INTO insert moe
i insert before the cursor I inserts at beginning of line A appends to end of line a appends after the cursor o opens a new line after the cursor O opens a new line before the cursor
ESC goes from ANY mode into command mode.
oCommand mode mobility arrow keys: go in inidicated direction one spaceo :number go to line numbero ^ go to start of line $ go to end of line gg go to top. :1 also works G go to bottom u undo
/string to search for string forward ?string to search for string backwards n to find next N to fine previous :set ignorecase - editor now searches case-insenitive :set noignorecase = turn off ignoring case
:set number :set nonumber :set ignorecase - editor now searches case-insenitive :set noignorecase = turn off ignoring case
Saving graces
:w writes file to disk :q quits a saved file :wq save adn quit :qw ERROR :w filename saves a copy to the named file. :a, b w filename saves a copy to the named file of lines a to b, inclusive. :w! filename overwrites an exsiting file with a copy of the one you are editing. :r filename reads the file in at the cursor's location.
yy yanks cursor's line to Mabel p pastes Mabel's contents dd cuts cursor's line to Mabel :a, b d
% matches any delimiter.:s/old/new substitute first instance of old to new on cursor's line :a,b s/old/new substitutes first insance of old to new on lines a through b. :a,b s/old/new/g substitutes all insances of old to new on lines a through b. flagst end: ^ can be beginning of line $ can be end of line g global (do all) i case-insensitive c check each onereplace mode r then characgter repalces cursor's character with character specified. R mows down characters as you tupeThe File System: HFS!