dlab-berkeley / Computational-Social-Science-Training-Program

This course is a rigorous, year-long introduction to computational social science. We cover topics spanning reproducibility and collaboration, machine learning, natural language processing, and causal inference. This course has a strong applied focus with emphasis placed on doing computational social science.
221 stars 96 forks source link

BashGit Lab #3

Open Akesari12 opened 4 years ago

Akesari12 commented 4 years ago

In-Class Lab for working with git and bash tools.

Akesari12 commented 4 years ago

@EastBayEv , @aculich, getting your eyes on these first two labs would be great! A lot of this is based on D-Lab's BashGit. Any comments/suggestions/corrections welcome. Here's the link: https://github.com/dlab-berkeley/Computational-Social-Science-Training-Program/tree/master/Reproducible%20Data%20Science

Also, if we could follow up about getting the students onboarded to benten or another remote server for the ssh part of the command line, that would be awesome.

aculich commented 4 years ago

@Akesari12 @EastBayEv continuing the conversation for now in Slack in #curriculum-development

We can use this github issue to document the final answer that we come to in the Slack conversation.

For now, try running the notebooks using this link for the campus datahub:

https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fdlab-berkeley%2FComputational-Social-Science-Training-Program&urlpath=tree%2FComputational-Social-Science-Training-Program%2F&branch=master

jaeyk commented 4 years ago

@Akesari12 I strongly recommend teaching using SSH protocol for git push and pull. It's quicker and safer way to use GitHub.

No longer needs to type id and pw to push and pull.

jaeyk commented 4 years ago

@Akesari12 For the bash part, consider teaching writing and executing a sh file.

an example

#!/bin/sh

#! part called shebang

blah blah

let's say you name the file test.sh

you can make it executable by

$ chmod +x test.sh

chmod = change mode

+x is a file permission parameter and means executable

then you can execute the file by

$ ./test.sh
jaeyk commented 4 years ago

@Akesari12 For the bash, also consider teaching cat, less, and head.

In the following examples, text means any kind of flat file like CSV, TXT, etc.

cat: print a small text file (print everything) less: print a large text file (you need to enter to scroll down lines) head: print first n lines in a text file. head -n 1 print first 5 lines in a text file. Note that -n does not mean negative n - indicates a parameter will be followed.

I also use awk, grep, find, and echo a lot.