Skip to content
Snippets Groups Projects
Unverified Commit abc8b29d authored by Laurent Modolo's avatar Laurent Modolo
Browse files

fix link between the 3 first parts of the course

parent 13d281d9
No related branches found
No related tags found
No related merge requests found
--- ---
theme: default title: First step in a terminal
paginate: true
title: Understanding a computer
--- ---
# Understanding a computer # Understanding a computer
...@@ -15,13 +14,6 @@ Objective: understand the relations between the different components of a comput ...@@ -15,13 +14,6 @@ Objective: understand the relations between the different components of a comput
# Which parts are necessary to define a computer ? # Which parts are necessary to define a computer ?
---
# Computer model: universal Turing machine
![width:20% height:20%](./img/lego_turing_machine.jpg)
--- ---
# Computer components # Computer components
...@@ -32,11 +24,11 @@ Objective: understand the relations between the different components of a comput ...@@ -32,11 +24,11 @@ Objective: understand the relations between the different components of a comput
## Memory ## Memory
### RAM (Random Access Memory) ### RAM (Random Access Memory)
![RAM](./img/220px-Swissbit_2GB_PC2-5300U-555.jpg) <img src="./img/220px-Swissbit_2GB_PC2-5300U-555.jpg" alt="RAM" style="zoom:150%;" />
### HDD (Hard Disk Drive) / SSD (Solid-State Drive) ### HDD (Hard Disk Drive) / SSD (Solid-State Drive)
![HDD](./img/220px-Laptop-hard-drive-exposed.jpg) <img src="./img/220px-Laptop-hard-drive-exposed.jpg" alt="HDD" style="zoom:150%;" />
![SSD](./img/220px-SSD_Samsung_960_PRO_512GB_-_front_and_back_-_2018-05-27.jpg) <img src="./img/220px-SSD_Samsung_960_PRO_512GB_-_front_and_back_-_2018-05-27.jpg" alt="SSD" style="zoom:150%;" />
## Motherboard ## Motherboard
![motherboard](./img/motherboard.jpg) ![motherboard](./img/motherboard.jpg)
...@@ -49,6 +41,13 @@ Objective: understand the relations between the different components of a comput ...@@ -49,6 +41,13 @@ Objective: understand the relations between the different components of a comput
--- ---
# Computer model: universal Turing machine
![width:20% height:20%](./img/lego_turing_machine.jpg)
---
# As simple as a Turing machine ? # As simple as a Turing machine ?
![universal_truing_machine](./img/universal_truing_machine.png) ![universal_truing_machine](./img/universal_truing_machine.png)
...@@ -128,20 +127,9 @@ The GNU with Richard Stallman introduced the notion of Free Software: ...@@ -128,20 +127,9 @@ The GNU with Richard Stallman introduced the notion of Free Software:
You can find a [list of software licenses](https://www.gnu.org/licenses/license-list.html) You can find a [list of software licenses](https://www.gnu.org/licenses/license-list.html)
# (First) step with GNU/Linux
You first need to connect to [https://biosphere.france-bioinformatique.fr/](https://biosphere.france-bioinformatique.fr/).
Go to [RAINBio the catalogue of appliances](https://biosphere.france-bioinformatique.fr/catalogue/) and start the [UNIX Biocomputing](https://biosphere.france-bioinformatique.fr/catalogue/appliance/173/) appliance. An appliance is a virtual machine with preinstalled software.
Then go to the [myVM tab](https://biosphere.france-bioinformatique.fr/cloud/) and wait for your appliance to start.
Then click on the link **Params** to get your login and password.
![Params](ifb_params.png)
You can then open the **https** link.
And go to the next session [2 first steps in a terminal.](2_first_steps_in_a_terminal.html) [Instead of installing GNU/Linux on your computer you are going to learn to use the IFB Cloud](http://perso.ens-lyon.fr/laurent.modolo/unix/2_using_the_ifb_cloud.html)
---
title: IFB (Institu Français de bioinformatique) Cloud
---
# IFB (Institu Français de bioinformatique) Cloud
[![cc_by_sa](./img/cc_by_sa.png)](http://creativecommons.org/licenses/by-sa/4.0/)
Objective: Start and connect to an appliance on the IFB cloud
Instead of working on your computer where you don't have an Unix-like OS or have limited right, we are going to use the [IFB (Institu Français de bioinformatique) Cloud]( https://biosphere.france-bioinformatique.fr/).
## Creating an IFB account
1. Access the [**https://biosphere.france-bioinformatique.fr/**](**https://biosphere.france-bioinformatique.fr/**) website
2. On the top righ(First) step with GNU/Linux
Instead of working on your computer where you don't have an Unix-like OS or have limited right, we are going to use the [IFB (Institu Français de bioinformatique) Cloud]( https://biosphere.france-bioinformatique.fr/). For this you will need:
1. Access the [**https://biosphere.france-bioinformatique.fr/**](**https://biosphere.france-bioinformatique.fr/**) website
2. On the top right of the screen click on <img src="/Users/laurent/Documents/formations/2020_08_UNIX/img/signin_ifb.png" alt="sign in" style="zoom:150%;" />
3. Then click on ![login](/Users/laurent/Documents/formations/2020_08_UNIX/img/login_ifb.png)
4. Use the **Incremental search field** to select your identity provider (CNRS / ENS de Lyon / etc.)
5. Login
6. Complete the form with your **Name**, **First Name**, **Town** and **Zip Code**. You can ignore the other field and click on **accept**.
7. Go to your **Groups** parameters on the top right ![group_selection_ifb](/Users/laurent/Documents/formations/2020_08_UNIX/img/group_selection_ifb.png)
8. Click on ![join_a_group](/Users/laurent/Documents/formations/2020_08_UNIX/img/join_a_group.png) and type **LBMC Unix 2020**
9. You can click on the **+** sign to candidate and wait to be accepted in the group
## Starting the LBMC Unix 2020 appliance
To follow this practical you will need to start the **[LBMC Unix 2020](https://biosphere.france-bioinformatique.fr/catalogue/appliance/177/) ** appliance from the [IFB Cloud](https://biosphere.france-bioinformatique.fr/) and click on the ![start](/Users/laurent/Documents/formations/2020_08_UNIX/img/start_VM.png) button after login with your account.
In the IFB jargon, appliance means **virtual machine** (VM). Remember how an universal Turing machine can run any programs ? A virtual machine, is a simulation program, simulating a physical computer. VM's have the following advantages:
- Copies of the VM will be identical (there will be no differences between your running *LBMC Unix 2020 appliance* and mine )
- Upon start the VM is reset to the *LBMC Unix 2020 appliance* state
- You can break everything in your VM, terminate it and start a new one
To access to your appliance you can go to the [**myVM** tab](https://biosphere.france-bioinformatique.fr/cloud/)
![myVM tab](/Users/laurent/Documents/formations/2020_08_UNIX/img/my_VM_ifb.png)
You will see the list of your running or starting appliances
![my appliances](/Users/laurent/Documents/formations/2020_08_UNIX/img/my_appliances_ifb.png)
**Don't forget to terminate your appliances at the end of the session by clicking on** ![rm my appliances ifb](/Users/laurent/Documents/formations/2020_08_UNIX/img/rm_my_appliances_ifb.png)
You will need to start this appliance at the start of each session of this course and terminate it afterward.
The ![hourlass](/Users/laurent/Documents/formations/2020_08_UNIX/img/wait_my_appliances_ifb.png) symbol indicate that your appliance is starting.
## Accessing the LBMC Unix 2020
You can open the **https** link next to the termination button of your appliance in a new tab. You will have the following message
![ssl warning](/Users/laurent/Documents/formations/2020_08_UNIX/img/ssl_warning.png)
This mean that the https connection is encrypted with a certificate unknown to your browser. As this certificate is going to be destroyed when you terminate your appliance, we don't want to pay a certification authority to validate it. Therefore you can safely add an exception for this certificate.
![ssl exception](/Users/laurent/Documents/formations/2020_08_UNIX/img/ssl_exception.png)
The webpage you will load will display only the following line:
```sh
achinea3e18205-1f8c-4ee1-995e-d33ef57afa3c login:
```
To get your identifiant you can click on the **Params** next to the **https** link.
**The password and the https links are one of the only things that going to change when you start a new appliance.**
```sh
Password:
```
To copy / paste your password, you will need to perform a right click and select **past from browser**
![past from browser](/Users/laurent/Documents/formations/2020_08_UNIX/img/shellinabox_past_from_browser.png)
Then paste your password in the dialog box.
Don't worry the password will not be displayed (not even in the form of `*****`, so someone looking at your screen will not be able to guess it's length), you can press **enter** to log on your VM.
[first steps in a terminal.](http://perso.ens-lyon.fr/laurent.modolo/unix/3_first_steps_in_a_terminal.html)
\ No newline at end of file
--- ---
theme: default
paginate: true
title: First step in a terminal title: First step in a terminal
--- ---
# First step in a terminal # First step in a terminal
[![cc_by_sa](./img/cc_by_sa.png)](http://creativecommons.org/licenses/by-sa/4.0/)
Objective: learn to use basic terminal command
Congratulation you are now connected on your VM !
The first thing that you can see is a welcome message (yes GNU/Linux users are polite and friendly), and information on your distribution.
> A **Linux distribution** (often abbreviated as **distro**) is an [operating system](https://en.wikipedia.org/wiki/Operating_system) made from a software collection that is based upon the [Linux kernel](https://en.wikipedia.org/wiki/Linux_kernel)
What is the distribution installed on your VM ?
You can go to this distribution website and have a look at the liste of firm using it.
## Shell
A command-line interpreter (or shell), is a software designed to read lines of text entered by a user to interact with an OS.
To simplify the shell execute the following infinite loop:
1. read a line
2. translate this line as a program execution with it's parameters
3. launch the corresponding program with the parameters
3. wait for the program to finish
4. Go back to 1.
When you open a terminal on an Unix like OS, you will have a **prompt** displayed: it can end with a **$** or a **%** caracter depending on your configuration. As long as you see your prompt, it means that you are in step **1.**, if no prompt is visible, you are in step **4.** or you have set up a very minimalist configuration for your shell.
<img src="./img/prompt.png" alt="prompt" style="zoom:150%;" />
The blinking square or vertical bar represent your **cursor**. Shell predate graphical interfaces, so most of the time you won't be able to move this cursor with your mouse, but with the directional arrows (left and right).
On the IFB, your prompt is a **$**
```sh
etudiant@VM:~$
```
You can identify the following information form your prompt: **etudiant** is your login and **VM** is the name of your VM (**~** is where you are on the computer, but we will come back to that later).
On Ubuntu 20.04, the default shell is [Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) while on recent version of macOS it's [zsh](https://en.wikipedia.org/wiki/Z_shell). There are [many different shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters), for example, Ubuntu 20.04 also have [sh](https://en.wikipedia.org/wiki/Bourne_shell) installed.
## Launching programs
You can launch every program present on your computer from the shell. The syntax will always be the following:
```sh
etudiant@VM:~$ program_name option_a option_b option_c [...] option_n
```
And pressing **enter** to execute your command.
For example we can launch the `cal` software by typing the following command and pressing **enter**:
```sh
cal
```
When you launch a command, various things can happen:
- Information can be diplayed in the shell
- Computation can be made
- Files can we read or written
- etc.
We can pass argument to the `cal` software the following way
```sh
cal -N
```
What is the effect of the `-N` parameter ?
You can add as many parameters as you want to your command, try `-N -C` what is the meaning of the `-C` parameter ?
The `-H` option display the month of a given date in a `yyyy-mm-dd` format. Try to display your month of birth in vertical format.
Traditionally, parameters are *named* which mean that they are in the form of:
* `-X` for an on/off option (like `cal -N`)
* `-X something` for an input option (like `cal -H yyyy-mm-dd`)
Here the name of the paremeter is `X`, but software can also accept list of unamed parameter. Try the following:
```sh
cal 2
cal 1999
cal 2 1999
```
What is the difference for the parameter value `2` in the first and third command ?
## Moving around
For the `cal` program, the position in the file system is not important (it's not going to change the calendar). However, for most tools that are able to read or write files, it's important to know where you are. This is the first real difficulty with command line interface: you need to remember where you are.
If you are lost you can **p**rint your **w**orking **d**irectory (i.e. where you are now, working) with the command
```sh
pwd
```
Like `cal`, the `pwd` command return textual information
By default when you log on an Unix system you are in your **HOME** directory. Every user (except one) should have it's home directory in the `/home/`folder.
To **c**hange **d**irectory you can type the command `cd`, `cd` take one argument: the path of the directory where you want to go. go to the `/home` directory.
```sh
cd /home
```
The `cd` command don't return any textual information, but change the environement of the shell (you can confirm it with ` pwd`) ! You can also see this change in your prompt:
```sh
`etudiant@VM:/home$`
```
What happend when you type `cd` without any argument ?
What is the location shown in your prompt ? Is it coerent with the `pwd` information ? Can you `cd` to the `pwd` path ?
When we move around a file system, we often want to see what is in a given folde. We want to **l**i**s**t the directory content. Go back to the `/home` directory and use to the `ls` command see how many have a home directory there.
We will see various option of the `ls` command, throughout this course. Try the `-a` option.
```sh
ls -a
```
What changed commpared to the `ls` command without this option ?
Go to your home folder with the bare `cd` command and run the `ls -a` command again. The `-a` option make the `ls` command list hidden files and folders. On Unix systems, hidden files and folders are every files and folders whose name start with a "**.**".
Can you `cd` to "**.*" ?
```sh
cd .
```
What happend ?
Can you cd to "**..**" ?
```sh
cd ..
```
What appended ?
Repeat 3 times the previous command (you can use the upper directionnal arrow to repeat the last command).
What append ?
You can use the `-l` option in combinaison with the `-a` option to know more about those folder.
## Unix file system structure
> On a UNIX system, everything is a file ; if something is not a file, it is a process.
>
> Machtelt Garrels
The followings are files:
- a text file
- an executable file
- a folder
- a keyboard
- a disk
- an usb key
- ...
This mean that your keyboard is represented as a file within the OS.
This file system is organized as a tree. As you have seen every folder has a parent folder exept the `/` folder whose parent is itself.
Every file can be accessed by an **absolute path** starting at the root. Your user home folder can be accessed with the path `/home/etudiant/`. Go to your user home folder.
We can also access file with a **relative path**, using the special folder "**..**". From your home folder, go to the *ubuntu* user home folder without passing by the root (we will see use of the "**.**" folder later).
all: index.html 1_understanding_a_computer.html 2_first_steps_in_a_terminal.html all: index.html 1_understanding_a_computer.html 2_using_the_ifb_cloud.html 3_first_steps_in_a_terminal.html
index.html: index.md github-pandoc.css index.html: index.md github-pandoc.css
pandoc -s -c github-pandoc.css index.md -o index.html pandoc -s -c github-pandoc.css index.md -o index.html
...@@ -6,5 +6,8 @@ index.html: index.md github-pandoc.css ...@@ -6,5 +6,8 @@ index.html: index.md github-pandoc.css
1_understanding_a_computer.html: 1_understanding_a_computer.md github-pandoc.css 1_understanding_a_computer.html: 1_understanding_a_computer.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 1_understanding_a_computer.md -o 1_understanding_a_computer.html pandoc -s --toc -c github-pandoc.css 1_understanding_a_computer.md -o 1_understanding_a_computer.html
2_first_steps_in_a_terminal.html: 2_first_steps_in_a_terminal.md github-pandoc.css 2_using_the_ifb_cloud.html: 2_using_the_ifb_cloud.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 2_first_steps_in_a_terminal.md -o 2_first_steps_in_a_terminal.html pandoc -s --toc -c github-pandoc.css 2_using_the_ifb_cloud.md -o 2_using_the_ifb_cloud.html
3_first_steps_in_a_terminal.html: 3_first_steps_in_a_terminal.md github-pandoc.css
pandoc -s --toc -c github-pandoc.css 3_first_steps_in_a_terminal.md -o 3_first_steps_in_a_terminal.html
1. [Understanding a computer](1_understanding_a_computer.html) ---
2. [First step in a terminal](2_first_steps_in_a_terminal.html) title: # Unix / command line training course
---
# Unix / command line training course
1. [Understanding a computer](http://perso.ens-lyon.fr/laurent.modolo/unix/1_understanding_a_computer.html)
2. [Using the IFB cloud](http://perso.ens-lyon.fr/laurent.modolo/unix/2_using_the_ifb_cloud.html)
3. [First step in a terminal](http://perso.ens-lyon.fr/laurent.modolo/unix/3_first_steps_in_a_terminal.html)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment