Friday, October 23, 2015

GITing it



It was not so long ago that I was at total noob to Git Hub and even after I’d gone through the motions of installing git hub and doing the exercises I still didn't quite understand what it was...


SO WHAT THE HUB IS GIT? 

GitHub is a site that stores files for free. That’s it. It doesn’t necessarily have to be files for computer programming. It can be image or text files or whatever you want.


WHY STORE FILES THERE?

  
The cool thing about Git Hub is that it has been designed in such a way that multiple people can work on files at once. This is done by storing a copy of the files on the computer of each person who is working on the file and then when their changes to the file are uploaded back to GitHub it will identify what is different in your version of the file than the original and any other versions other people have created and will allow everyone involved to look at the changes and compare them.

Even if you are the only one working on the file, it is still quite handy to save it to GitHub because you will be able to look back at every version of the file you have saved — and if you are working on a computer program and you get off track in such a way that your program no longer runs OR doesn’t do what you had expected, you can back track and go back to an earlier version of the file before you got onto the wrong track and you can branch off in a new direction.

This process of saving different versions of a file and branching off in new directions is called Version control. And there are a lot of programs and sites that do this (Google drive can be used in a similar way for example), but GitHub is one of the most popular free sites to do this. And also, GIT lends itself nicely to puns.

HOW DO YOU USE GIT HUB:


These sites can help you GIT started:


Code School's Free intro to git hub

http://gitimmersion.com/

Pro GIT book

Thursday, October 22, 2015

Using the command prompt/ terminal





A DOSile EXPERIENCE
(contains no useful information)


I faintly remember using DOS on a pre-windows computer. When I was in 7th grade, before my dad had bought our first family computer. I was required to take computer class for three months. I would love to tell you that class was life-changing and sparked an interest in technology that burned inside of me from that day on...

But to me, at the age of 11, the thing that was most exciting about computers was their capacity to print large shitty address labels that sported shamefully pixelated images of Garfield And Friends. I was one of those kids who loved to stickers. My dresser, my homework folders, the brown paper bag covers on my books were all covered in stickers. So I'm pretty sure the day we learned how to make our own sticky labels was raddest day of my life.

As soon as I got home from school, I hand-wrote a half a dozen letters to send out to friends and family. Then I marched out to the mailbox, tipped up the red flag and gave the almost indistinguishable pictures of Odie and Garfield one last loving glance as I sent them off to "wow my friends and family."

... so I guess that's why seeing the good ol' black and white > on my screen makes me feel cool...  or maybe its cool for the same reason overly-pixelated graphics of Garfield are cool. Terminal commands are the OGs of computer interfacing. But using the command prompt is more than just a kookie-retro thing, it can actually be quite handy.

**** useful stuff starts here****

WHAT IS THE COMMAND PROMPT/ TERMINAL? 


-The command prompt (>  on a windows computer or $ on a Mac) is a non-GUI (graphical user interface) way to can access files and programs without a mouse or touch screen).

WHY WOULD YOU USE THE COMMAND PROMPT/ TERMINAL? 

-If you are familiar with searching/ accessing files through the command prompt it can be an extremely efficient and precise way to search and access files. (ie instead of opening finder and scanning through to the folder you want and then selecting the file you are looking for in that folder, you can just type one line into the command prompt and BAM, you've opened the file you were looking for. )

-It is the fastest easiest way to use certain Interfaces eg (Git Hub)

HOW DO YOU LEARN TO USE IT? 

Here are a few sites that are helpful in getting started with using the terminal:

The Command Line Crash Course

LinuxCommand.org

Ryan's Linux Tutorial

WHAT ARE THE BASICS? 

ls: lists the files in a directory
(adding  -a  will show files with any extension (some of which are normally hidden like git repository info)

cp: Copy the contents of a file and move it to a different file
eg:
cp file1.txt newBlankfile.txt OR file1.txt file2.txt 

mv: rename a file or directory OR move a file or directory
eg:
mv file1.txt improvedFile1.txt ... will rename "file1.txt": "improvedFile1.txt"
or
mv file1.txt folder1 ... will move file1.txt into folder1
or
mv folder1 theAwesomeFolder ... will rename the directory "folder1": "theAwesomeFolder"

mkdir: make a new empty directory (folder).

cd: change directory. Change from one directory to another
eg 
cd ..   takes you one step backwards in your path
cd ~ takes you to your home directory
cd ../../.. takes you three back
cd ~/desktop/fileOnDesktop takes you from the home directory forward 2 steps from there

pwd: "print working directory" ie show the path to get to where you currently are

less: gives you a summary of what's in a file
syntax:  
less file-name
http://www.thegeekstuff.com/2010/02/unix-less-command-10-tips-for-effective-navigation/

cat: Displays text file, file concatenation, create new text file, modify file, read text file
syntax:  cat filename OR cat > filename OR cat [options] filename

man: displays a manual of linux commands
syntax: man [option(s)] keyword(s)
eg man ls OR man pstree | col -b pstree.txt

grep: seraches any given input file, selecting lines that match one or more pattern(s). By default, a pattern matches an input line if the regular expression (RE) in the pattern matches the input line. Each input line that matches at least one of hte patterns is written to the standard output.
syntax:  grep patternYoureLookingFor filename

find: finds stuff
syntax:  
find location comparison-criteria search-term
.    finds all the files in the current and subdirectories

The pipe: method to send data from one program to another. Output is fed from the program on the left side of the "|: to the program on the right

syntax: fileOne and/or LinuxCommand1 | file2 and/or LinuxCommand2 | etc etc

eg
ps auxwww | grep fred | more
ls -al |grep Aug| grep -v '200[456]'| more

echo: appends text to a file. 
syntax:  echo "some text" >> afile.fileType (.txt, .rb etc) 

touch: creates an empty file
syntax: touch newFileName.type