Mike and Chris's Deep Conversation

so my questoin was about git push and pull

I understand you push stuff from your local copy into the global one

but what does pull do?
Mike Mintz 4:39 PM
pulls from the global one into the local one
Chris Beachy 4:39 PM
what if you didn't have a local one?

would you make a new on
Mike Mintz 4:39 PM
you always have a local one

you either have to "git init" to make a blank one, or "git clone" to copy an existing one
Chris Beachy 4:39 PM
oh ok

and i did that for deme and sym sys earlier huh

i see
Mike Mintz 4:39 PM
have you used svn?
Chris Beachy 4:40 PM
yes
Mike Mintz 4:40 PM
yeah you did git clone
Chris Beachy 4:40 PM
a lil bit
Mike Mintz 4:40 PM
okay, so it's like SVN, except with some intermediate steps

in SVN, you have "local files (tracked and untracked)" and "remote repository"

in Git, you have "local files", "staged updates", "local repository" and "remote repository"
Chris Beachy 4:41 PM
and you will only push from your local

and pull from the remote repository?
Mike Mintz 4:41 PM
yes, push is from local repo to remote repo

pull is from remote repo to local repo

add is from local files to staged updates

commit is from staged updates to local repo
Chris Beachy 4:42 PM
so does it matter which directory you're in when you issue the git command?
Mike Mintz 4:42 PM
only if you specify a filename (like for git add)

otherwise as long as you're in the base dir or a subdir, you're fine i believe
Chris Beachy 4:42 PM
ok cool. thanks!

my other question was just about ssh ing and what exactly is going on there

because I do it all the time but never fully understood it
Mike Mintz 4:44 PM
ssh stands for "secure shell", it's a secure connection from a client (you) to a remote machine (deme.stanford.edu) and gives you shell access

there used to be telnet, which was the same thing, but not secure (unencrypted)

you can also use the same protocol to copy files from one machien to another, with the scp command

(vs rcp which was unencrypted)

git can run over many different protocols, including ssh, and https

or were you more curious about what the shell is in general?
Chris Beachy 4:45 PM
kinda more in general
Mike Mintz 4:45 PM
okay, so let me know if anything i'm saying is too basic or advanced

you start out in a "terminal emulator". it used to be all computers were terminals with a 80x20 character screen and a keyboard and that's it

or something like that

you open Terminal on your mac, or xterm on a linux machine, or cmd.exe on windows, and it emulates a terminal

it can run any program, and take keyboard input and display a monospace text output

but it always has to choose a program to start with

in the vast majority of cases, it will start with a "shell" such as "bash" (which I think mac uses now)
Chris Beachy 4:47 PM
same
Mike Mintz 4:48 PM
the shell is basically just a launcher, but it also has a built-in programming language

if you type a command, it'll just run, and when the command exits, it goes back to the shell

for example, ls is a command

if you type "which ls" you'll see it's located in /bin/ls

if you open /bin/ls in a decompiler, you'll see it's just a bunch of assembly

actually ls is a program, not a command

when you tyupe something in, it might be a "shell command" like "exit" or "cd"

but it might be a program, and it looks for programs in /bin and /usr/bin

if you type echo $PATH

you'll see a list of places it searches for programs

echo is a shell command

$PATH is a shell variable

you can write entire programs in bash scripting

in fact, there are probably some .sh files in the deme repository

like reset_db.sh

if you run ./manage.py, it's executing the program manage.py (you gave it the full path to it)

. is the current directory

at the top of manage.py, it has some text about how to interpret the code

since it's not in assembly, it says it's a python program
Chris Beachy 4:51 PM
ok thats very enlightening!
Mike Mintz 4:51 PM
here's an official explanation: http://en.wikipedia.org/wiki/Shell_(computing)

i guess technically we're talking about a CLI shell (command line interface)

windows is really a GUI shell

in fact, windows 3.1 was merely a shell that ran on top of DOS
Chris Beachy 4:52 PM
i guess my original question was more about how we are able to inhabit some other systems memory so easily with ssh
Mike Mintz 4:52 PM
ooo

well, do you know anything about sockets?
Chris Beachy 4:52 PM
haha nope
Mike Mintz 4:53 PM
so the internet is like a stack

on the bottom is Ethernet or whatever transmitting 0s and 1s

but on top of that are a few layers that define those 0s and 1s and what they mean

in TCP/IP layer, you can open a virtual connection from one machine to another

that just means it's an isolated stream of 0s and 1s from one computer to another, in a specific program

the SSH daemon runs on the host machine, and the SSH client runs on your machine

they open a connection, and can just talk in 0s and 1s

all it really takes is for everything your keyboard types to get sent from you to it

and SSH daemon launches a "shell" underneath, pipes your input to the shell, and pipes the output of the shell back over the connection to you
Chris Beachy 4:54 PM
ok i see
Mike Mintz 4:54 PM
think of it like VNC or screen sharing for the shell

but much simpler of course, since it's just letters
Chris Beachy 4:55 PM
and you couldn't establish that kind of connection without ssh?
Mike Mintz 4:55 PM
and it has advanced cryptography

telnet is the way to do it without cryptography

anyone could write a new program to do it

ssh is just standard practice

if you're curious, i can show you how to write sonmething like that in python

it's literally like 10 lines of code on each side to establish that connection
Chris Beachy 4:56 PM
yeah that 'd be cool to know
Mike Mintz 4:56 PM
http://ilab.cs.byu.edu/python/socket/echoserver.html

that's a server that anything you type to it, it sends back to you

you could modify it so it reverses it and sends it back or whatever
Chris Beachy 4:56 PM
i was more curious about just how easy it would be to hack from just one side
Mike Mintz 4:56 PM
well you'd need the password and/or private key

in your case, probably just the password

it's pretty much impossible to hack without that, and brute forcing would take far too long

especially since it throttles invalid password attempts
Chris Beachy 4:57 PM
yeah definitely

ok cool tahnks man!
Mike Mintz 4:58 PM
no problem
Chris Beachy 4:58 PM
these are just questions that are cropping up

i'm sure i will have a lot throughout the summa
Mike Mintz 4:58 PM
yeah you can ask anytime

or email me if i'm not online
Chris Beachy 4:59 PM
awesome
Mike Mintz 4:59 PM
okay i have to go make some calls

i'll stay in the room and be back periodically if you have more questions
Chris Beachy 4:59 PM
ok cool

cya later, going to watch some python lectures
Mike Mintz 4:59 PM
see ya chris
trbdavies 5:05 PM
I think my version of Skype doesn't have the history option. I can't turn it on in preferences. Can someone save and post this as a file doc on Deme Team folio?
Chris Beachy 5:05 PM
yeah sure.

how far back should i go? it extends quite a while
trbdavies 5:08 PM
Also I posted an email about the trip to CMU tomorrow at moffat field. I'm giving a talk on Deme. It's also streaming and has guest access. http://www.cmu.edu/silicon-valley/news-events/seminars/index.html. Chris and Jimmy if you want to come with me we need to leave at 11:30 so we can meet them for lunch with Ted Selker (big HCI dude). We'll be back by 3:30 I think.

Chris - the beginning I guess.

or whatever you think is a useful starting point.
Chris Beachy 5:10 PM
ok, they were all pretty basic questions but i found ity all very interesting

well maybe not basic, but not entirely related to deme
trbdavies 5:10 PM
okay, it's all good.

For Internet Explorer users: Click on the Tools menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.

For Chrome users:Click on the Chrome "wrench" icon, located in the upper right hand corner of your browser window. When the drop-down menu appears, select the choice labeled Full Screen.

For Firefox user:Click on the View menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.

For Safari users: Safari currently does not support the ability to go fullscreen.