mirror of
https://codeberg.org/Mo8it/How_To_Linux.git
synced 2024-12-05 01:40:32 +00:00
Compare commits
2 commits
dba742033a
...
17b5900871
Author | SHA1 | Date | |
---|---|---|---|
17b5900871 | |||
36e7527c38 |
4 changed files with 9 additions and 9 deletions
|
@ -67,7 +67,7 @@ After that I add you public key, connect to the server using the host name that
|
|||
|
||||
`-aG` stands for _append to group(s)_.
|
||||
|
||||
(On debian based distros, the user should be added to the `sudo` group instead of `wheel`.)
|
||||
(On Debian based distros, the user should be added to the `sudo` group instead of `wheel`.)
|
||||
|
||||
1. Now, change your user to the new user:
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ We want to practice compilation and containers, so lets compile in a container!
|
|||
In this task, we want to compile the program `tmate`.
|
||||
|
||||
1. Start an Ubuntu container with `podman run -it --rm --name tmate-compiler ubuntu:latest bash`.
|
||||
1. Go to the [website of `tmate`](https://tmate.io/) and find out how to compile from source (there are intructions for compiling on Ubuntu).
|
||||
1. Go to the [website of `tmate`](https://tmate.io/) and find out how to compile from source (there are instructions for compiling on Ubuntu).
|
||||
1. Follow the compilation instructions in the container.
|
||||
1. After compilation, you will find the binary `tmate` in the directory of the git repository.
|
||||
1. Don't exit the container yet, otherwise you will lose what you have done in it. Now open a new terminal (tab) and copy the binary `tmate` from the container to the directory `bin` in your home directory. Use the command `podman cp CONTAINERNAME:SRC_PATH DESTINATION_PATH`.
|
||||
|
@ -43,7 +43,7 @@ Do the following in the second script:
|
|||
|
||||
The `scripts` directory is mounted to be able to give the container access to the script `compile_tmate.sh`. The directory is mounted as _read only_ (`ro`) because it will not be modified.
|
||||
|
||||
The `bin` directory is mounted to be able to trasfer the binary into it before the container exits.
|
||||
The `bin` directory is mounted to be able to transfer the binary into it before the container exits.
|
||||
|
||||
After running the second script, you should see the container compiling and then exiting. At the end, you should find the binary `tmate` in the `bin` directory.
|
||||
|
||||
|
@ -51,7 +51,7 @@ Now that you have the program `tmate`, find out what it does! Try it with a seco
|
|||
|
||||
##### Tipps:
|
||||
|
||||
- On debain based distributions like Ubuntu, the package manager is `apt`. Before that you can install any packages with `apt`, you have to run `apt update`. This does not run system updates like `dnf upgrade`. `apt update` does only synchronize the repositories which is needed before installations.
|
||||
- On Debian based distributions like Ubuntu, the package manager is `apt`. Before that you can install any packages with `apt`, you have to run `apt update`. This does not run system updates like `dnf upgrade`. `apt update` does only synchronize the repositories which is needed before installations.
|
||||
- Test if a file exists in bash:
|
||||
|
||||
```bash
|
||||
|
|
|
@ -67,12 +67,12 @@ Can be used for example with `grep`, `rg`, `find`, `fd`, `nvim`, etc.
|
|||
- `.`: Any character
|
||||
- `.*`: 0 or more characters
|
||||
- `.+`: 1 or more characters
|
||||
- `\w`: Word
|
||||
- `\w`: Not word
|
||||
- `\w`: Letter or number
|
||||
- `\W`: Not letter nor number
|
||||
- `\d`: Digit
|
||||
- `\d`: Not digit
|
||||
- `\D`: Not digit
|
||||
- `\s`: Whitespace
|
||||
- `\s`: Not whitespace
|
||||
- `\S`: Not whitespace
|
||||
|
||||
## More tools
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Congratulations, you did just convert the names into a form that could be direct
|
|||
## Task: Parsing a CSV file
|
||||
|
||||
1. Use `curl` to take a look at the file with the following link: [https://gitlab.rlp.net/mobitar/julia\_course/-/raw/main/Day\_3/resources/fitting\_task\_data.csv](https://gitlab.rlp.net/mobitar/julia_course/-/raw/main/Day_3/resources/fitting_task_data.csv). The file contains measurement of a (fake) free fall experiment.
|
||||
1. Now that you know what the file contains, pipe the output to tools that let you remove the first 6 and last 2 lines. Afterwards, extract the first (measured hight) and third column (measured time).
|
||||
1. Now that you know what the file contains, pipe the output to tools that let you remove the first 6 and last 2 lines. Afterwards, extract the first (measured height) and third column (measured time).
|
||||
1. Write a small Python that processes the output of the command from the last step. Since this book is not about programming in Python or plotting, the simple code to process the output of the variable `h_t` is given below:
|
||||
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue