From e49aadd556e93059c699762e56a84c0df144cccb Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Thu, 2 Aug 2018 15:39:05 +0200 Subject: [PATCH] Regenerate all files accordingly --- module2/ressources/emacs_orgmode.html | 166 +++++++-------- module2/ressources/gitlab.html | 277 ++++++++++++++++++-------- module2/ressources/rstudio.html | 173 ++++++++++++++-- 3 files changed, 425 insertions(+), 191 deletions(-) diff --git a/module2/ressources/emacs_orgmode.html b/module2/ressources/emacs_orgmode.html index 02d8d0c..dcf0e4c 100644 --- a/module2/ressources/emacs_orgmode.html +++ b/module2/ressources/emacs_orgmode.html @@ -4,39 +4,39 @@

Table of Contents

@@ -57,13 +57,13 @@ the -

Installing emacs, org-mode, ess, and auctex.

-
+
+

Installing emacs, org-mode, ess, and auctex.

+
-
-

Linux (Debian, Ubuntu)

-
+
+

Linux (Debian, Ubuntu)

+

We provide here only instructions for debian-based distributions. Feel free to contribute to this document to provide up-to-date information @@ -125,9 +125,9 @@ which is now deprecated.

-
-

Mac OS X

-
+ -
-

Windows

-
-
-

A simple "reproducible research" emacs configuration

-
+
+

A simple "reproducible research" emacs configuration

+

This section is illustrated in a video tutorial ("Mise en place Emacs/Orgmode" in French). Watching it before following the @@ -197,9 +197,9 @@ adding a few org-mode specific configurations.

-
-

Step 0: Backup and download our configuration

-
+
+

Step 0: Backup and download our configuration

+

The procedure we propose will wipe your already existing custom emacs configuration if you already have one. You should thus beforehand make @@ -220,9 +220,9 @@ rr_org/journal.org

-
-

Step 1: Prepare your journal

-
+
+

Step 1: Prepare your journal

+

Create an org/ directory in the top of your home:

@@ -239,9 +239,9 @@ should give a try.

-
-

Step 2: Set up Emacs configuration

-
+
+

Step 2: Set up Emacs configuration

+

Copy rr_org/init.el in your ~/.emacs.d/ directory.

@@ -253,9 +253,9 @@ configuration with the following command: emacs -q -l rr_org/init.el
-
-

Step 3: Check whether the installation is working or not

-
+
+

Step 3: Check whether the installation is working or not

+

Open a new instance of Emacs and open a foo.org file. Copy the following lines in this file: @@ -286,9 +286,9 @@ is demonstrated in the -

Step 4: Open and play with your journal:

-
+
+

Step 4: Open and play with your journal:

+

In step 1, you were told to create an journal in ~org/journal.org. First you probably want to make sure this file is @@ -299,9 +299,9 @@ forums.

-
-

A stub of replicable article

-
+
+

A stub of replicable article

+

This section is illustrated in a video tutorial ("Écrire un article réplicable avec Emacs/Orgmode" in French). Watching it before @@ -318,13 +318,13 @@ source (archive, uncompress it and simply make to generate the +Download the following archive, uncompress it and simply make to generate the article. You should then be able to open the resulting article. This is summarized in the following command:

-
wget --no-check-certificate -O replicable.tgz https://github.com/alegrand/RR_webinars/raw/master/1_replicable_article_laboratory_notebook/replicable/replicable.tgz ### Fix the broken URL
-tar zxf replicable.tgz; cd replicable; make ; evince article.pdf
+
wget --no-check-certificate -O replicable_article.tgz https://app-learninglab.inria.fr/gitlab/learning-lab/mooc-rr-ressources/raw/master/module2/ressources/replicable_article.tgz
+tar zxf replicable_article.tgz; cd replicable_article; make ; evince article.pdf
 
@@ -365,22 +365,22 @@ chunk of code when exporting.
-
-

Emacs Tips and tricks

-
+
+

Emacs Tips and tricks

+
-
-

Cheat-sheets

-
+
+

Cheat-sheets

+

Learning emacs and org-mode can be difficult as there is an inordinate amount of shortcuts. Many people have thus come up with cheat-sheats. Here is a selection in case it helps:

-
-

Emacs

-
+
+

Emacs

+
-
-

Org-mode

-
+
+

Org-mode

+
-
-

Video tutorials

-
+
+

Video tutorials

+

For those of you who prefer video explanations, here is a Youtube channel with many step by step emacs tutorials.

-
-

Additional useful emacs packages

-
+
+

Additional useful emacs packages

+
-
-

Company-mode

-
+
+

Company-mode

+

Company-mode is a text completion framework for Emacs. It allows to have smart completion in emacs for the most common languages. If you @@ -424,9 +424,9 @@ official Web page: http://company-mode.

-
-

Magit

-
+
+

Magit

+

Magit is an emacs interface for Git. Its usage is briefly illustrated in the context of this MOOC in a video tutorial ("Utilisation @@ -444,9 +444,9 @@ invoke magit by using C-x g.

-
-

Other resources

-
+
+

Other resources

+ +

+This document is particularly important if you follow the Rstudio or +the Org-Mode course. If you follow the Jupyter course, it can be +ignored in a first step as we have closely integrated Jupyter and +GitLab in the context of this MOOC. +

+

So far, you only used git via the web interface from the GitLab we deployed for the MOOC. @@ -47,22 +52,27 @@ is very convenient but in most cases, you will want to have your own local copy of the repository and you will have to synchronize your local copy with the remote GitLab one. To propagate your modifications, you will obviously have to authenticate yourself on -GitLab. How to do this is illustrated in a video tutorial (in French). +GitLab. +

+ +

+This document describes the software you need to have installed on +your machine and how to handle authentication. The "Configuring Git" +section is illustrated in a video tutorial (in French).

-This document describes the software you need to have -installed on your machine and how to handle authentication. Please -read these instructions carefully. +Please read all these instructions carefully, in particular the one on +"Configuring your password on GitLab".

-
-

Installing Git

-
+
+

Installing Git

+
-
-

Linux (debian, ubuntu)

-
+
+

Linux (debian, ubuntu)

+

We provide here only instructions for debian-based distributions. Feel free to contribute to this document to provide up-to-date information @@ -78,9 +88,9 @@ Run (as root):

-
-

Mac OSX and Windows

-
+
+

Mac OSX and Windows

+
  • Download and install Git from the Git website.
  • Optional Git clients (should not be needed if you work within @@ -100,61 +110,146 @@ Rstudio):
-
-

Authenticating on GitLab

-
-

-There are two ways of authenticating and synchronizing your local -repository with GitLab: through HTTPS or through SSH. The first one -does not require any particular software installation on your machine -so this is what I recommend for this MOOC. Yet, I also describe the -second one as it is the one I prefer (once it is well configured, it -never asks me for any password anymore and I don't have to remember -anything). +

+

Configuring Git

+
+
+
+

Telling Git who you are: Name and Email

+
+
    +
  1. Open Terminal.
  2. +
  3. +Set a Git username and email: +

    +
    +
    git config --global user.name "Mona Lisa"
    +git config --global user.email "email@example.com"
    +
    +
  4. + +
  5. +Confirm that you have set the Git username correctly:

    +
    +
    git config --global user.name
    +git config --global user.email
    +
    -
    -

    Option 1: HTTPS

    -
    + +
    +Mona Lisa
    +email@example.com
    +
    +
  6. +
-
-

Configuring your GitLab password

-
+
+
+

Dealing with proxies

+

-In this video tutorial (in French), I explain how to change your -password on our GitLab. +You may be behind a proxy, in which case you may have trouble cloning +or fetching from a remote repository or you may get an error like +unable to access '...' Couldn't resolve host '...'.

-
-
-
-

Making sure git remembers your password

-
+

-My GitLab id is 3211ac4f2fb71deaeff9252764c368e7. Say I've configured -my password to be tototutu (what a weak password…) and I want to -clone my mooc-rr repository. If you clone your repos by simply pasting -the GitLab url (e.g., with the following command line) you will be -prompted for your login and your password every time you want to -propagate your local modifications. +In such case, consider something like this:

-
git clone https://app-learninglab.inria.fr/gitlab/3211ac4f2fb71deaeff9252764c368e7/mooc-rr
+
git config --global http.proxy http://proxyUsername:proxyPassword@proxy.server.com:port
 
+

-This can be quite painful, which is why you can also provide them once -and for all when cloning, as follows: +The proxyPassword will be stored unencrypted in your .gitconfig file, +which you may not want. In that case, remove it from the URL and you +will be prompted for it every time it is needed.

-
-
git clone https://3211ac4f2fb71deaeff9252764c368e7:tototutu@app-learninglab.inria.fr/gitlab/3211ac4f2fb71deaeff9252764c368e7/mooc-rr
-
+
+
+
+

Configuring your password on GitLab

+
+
    +
  1. +Access GitLab. Note: You have to access Gitlab from the FUN +platform otherwise you may get a 405 error when trying to direcly +open https://app-learninglab.inria.fr/gitlab/users/sign_in. +

    +
    + +
    +

    erreur405.png

    +
    +
  2. +
  3. +Click on Sign in: +

    +
    + +
    +

    projects.png

    +
    +
    +

    +The long and uggly character sequence, which is here replaced by xxx +is your GitLab login/id. You'll need to use it when trying to +propagate some modifications from your computer to GitLab. +

  4. +
  5. +To defind your password, you should go in settings: +

    +
    + +
    +

    settings.png

    +
    +
  6. +
  7. +Then, go to the profile tab to define a valid email address: +

    +
    + +
    +

    profile.png

    +

    -This is very convenient but there is one drawback to understand. This -means your password is stored, unencrypted on your hard drive. If -anyone ever gets an access to your machine, he will gain access rights -to all your repos, which can be problematic. This is why the really -good way to do this is to follow these instructions: +You will then receive a email with a link to open to confirm your +email address is correct. Just open it. +

  8. +
  9. +Once your email address is validated, it will appear as verified and +as your main address in the Emails tab: +

    +
    + +
    +

    mail.png

    +
    +
  10. +
  11. +You will then finally be able to click on the I forgot my password +button from the password tab: +password.png

    + +

    +You will then receive an email allowing you to reset your GitLab +password. +

  12. +
+
+
+
+

Remembering your password locally

+
+

+If you clone your repos by simply pasting the GitLab URL, you will be +prompted for your login and your password every time you want to +propagate your local modifications, which is tedious. This is why you +should ask git to remember your login and password as follows

git config --global credential.helper cache                  # remember my password
@@ -163,28 +258,34 @@ git config --global credential.helper "cache -
 

With this setup, you will be prompted for your password but it will be -cached in memory and they will not be asked again before an hour. +cached in memory and they will not be asked again before an hour. You +may want to read these instructions to better understand how all this +works.

-
-
-

Option 2: SSH

-
+
+

Optional: authenticating through SSH

+

-My preferred (although more technical) solution is to install SSH, to -create a pair or private/public keys, and to upload your SSH public -key on GitLab. This section provides with information on how to do -this. +There are two ways of authenticating and synchronizing your local +repository with GitLab: through HTTPS or through SSH. The first one is +what was just described and does not require any particular software +installation on your machine so this is what I recommend for this +MOOC. Yet, I like the second one better (although is may seem a bit +more technical), which is why I describe it here. It consists in +installing SSH, creating a pair or private/public keys, and uploading +your SSH public key on GitLab. This section provides with information +on how to do this.

-
-

Installing SSH

-
+
+

Installing SSH

+
    -
  • Linux (debian, ubuntu)
    -
    +
  • Linux (debian, ubuntu)
    +

    We provide here only instructions for debian-based distributions. Feel free to contribute to this document to provide up-to-date information @@ -200,15 +301,15 @@ Run (as root):

-
  • Mac OSX
    -
    +
  • Mac OSX
    +

    You do not have anything to do as it is installed by default.

  • -
  • Windows
    -
    +
  • Windows
    +

    You should install the Putty client. Once it is installed, look for the section on generating an SSH key. @@ -217,9 +318,9 @@ the section on generati

  • -
    -

    Setting up SSH on GitLab

    -
    +
    +

    Setting up SSH on GitLab

    +

    Here are all the official explanations on how to set up your SSH key on GitLab. Alternatively, you may also want to have a look at this diff --git a/module2/ressources/rstudio.html b/module2/ressources/rstudio.html index 4a178ba..c68386e 100644 --- a/module2/ressources/rstudio.html +++ b/module2/ressources/rstudio.html @@ -4,15 +4,21 @@

    Table of Contents

    @@ -60,13 +66,13 @@ of these documents:
  • Un court document sur R Markdown
  • -
    -

    Installing Rstudio

    -
    +
    +

    Installing Rstudio

    +
    -
    -

    Linux (debian, ubuntu)

    -
    +
    +

    Linux (debian, ubuntu)

    +

    We provide here only instructions for debian-based distributions. Feel free to contribute to this document to provide up-to-date information @@ -88,9 +94,9 @@ for upgrading…

    -
    -

    Installing R

    -
    +
    +

    Installing R

    +

    Beforehand, you need to install the R language and convenient packages by running (as root): @@ -123,9 +129,9 @@ to run (as root):

    -
    -

    Installing rstudio

    -
    +
    +

    Installing rstudio

    +

    Rstudio is unfortunately not packaged within debian so the easiest is to download the corresponding debian package on the Rstudio webpage @@ -143,9 +149,9 @@ sudo apt-get update ; sudo apt-get -f install -

    Mac OSX and Windows

    -
    +
    +

    Mac OSX and Windows

    +

    Some instructions on installing R and knitr must be missing. This @@ -169,4 +175,131 @@ install.packages("ggplot2")

    +
    +

    Using Git from Rstudio

    +
    +
    +
    +

    Cloning a repository

    +
    +

    +Open RStudio and do the following steps: +

    +
      +
    • +Create a new version controled project: File / New Project / Version + Control +

      +
      + +
      +

      new_project.png

      +
      + + +
      +

      git.png

      +
      +
    • +
    • +Get the url from your gitlab repository: +

      +
      + +
      +

      adresse_depot.png

      +
      +
    • +
    • +Indicate this URL in the "Repository URL" field (you may want to +prefix this URL with xxx@ where xxx is your Gitlab id to avoid +repeatedly giving it later on). +

      +
      + +
      +

      clone.png

      +
      +
    • +
    • If you're behind a proxy, git should be configured +accordingly. Check the "Dealing with proxies" section.
    • +
    • Git will then connect to Gitlab and fetch a whole copy of the +repository.
    • +
    • +RStudio should restart in a mode related to Git: +

      +
      + +
      +

      rstudio.png

      +
      +
    • +
    • The file manager on the right, allows you to browse the version +controled repository.
    • +
    +
    +
    +
    +

    Modifying a file

    +
    +
      +
    • Open Module2/exo1/toy_document.Rmd and perform a simple +modification.
    • +
    • Save
    • +
    • +Go to the Git menu to commit +

      +
      + +
      +

      commit.png

      +
      + + +
      +

      commit2.png

      +
      +
    • +
    • +Select the lines to commit and then click on commit +

      +
      + +
      +

      commit5.png

      +
      +
      +

      +Your modifications have now been commited on your local +machine. They haven't been propagated to GitLab yet. +

    • +
    • +Click on push to propagate them on GitLab +

      +
      + +
      +

      push.png

      +
      + + +
      +

      push2.png

      +
      + + +
      +

      push3.png

      +
      +
      +

      +NB: You won't be able to propagate your modifications on GitLab if +some modifications have been done on GitLab in the meantime. +push4.png

    • +
    • You should first merge these remote modifications locally. Click on +pull to get these modifications on your machine.
    • +
    +
    +
    +
    -- 2.18.1