From a5adc906b1fa07a2f3b478d2efdf8c2307c1637d Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Mon, 17 Jun 2019 19:13:53 +0100 Subject: [PATCH 01/17] update et fix de boolean --- subjects/boolean.en.md | 9 +++++++-- subjects/boolean.fr.md | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/subjects/boolean.en.md b/subjects/boolean.en.md index ff2a3e489..eab52ae02 100644 --- a/subjects/boolean.en.md +++ b/subjects/boolean.en.md @@ -2,11 +2,16 @@ ### Instructions -Create a `.go` file and copy the code below into that file -and add the code necessary so the program works. +Create a `.go` file. + +- The code below has to be copied in that file. + +- The necessary changes have to be applied so that the program works. - The program must be submitted inside a folder with the name `boolean`. +### Code to be copied + ```go func printStr(str string) { arrayStr := []rune(str) diff --git a/subjects/boolean.fr.md b/subjects/boolean.fr.md index 2c23b376a..3fc00c7af 100644 --- a/subjects/boolean.fr.md +++ b/subjects/boolean.fr.md @@ -2,9 +2,16 @@ ### Instructions -Create a `.go` file and copy the code below into our file +Créer un fichier `.go`. -- The main task is to return a working program. +- Le code ci-dessous doit être copié dans ce fichier. + +- Les changements nécéssaires doivent être appliquer et the code below into that file + and do the necessary changes so that the program works. + +- Le programme doit être rendu dans un dossier nommé `boolean`. + +### Code à copier ```go func printStr(str string) { @@ -33,14 +40,12 @@ func main() { } ``` -### Expected output +### Usage ```console +student@ubuntu:~/student/boolean$ go build +student@ubuntu:~/student/boolean$ ./boolean "not" "odd" I have an even number of arguments -``` - -### Or - -```console +student@ubuntu:~/student/boolean$ ./boolean "not even" I have an odd number of arguments ``` From 2cc619787e15225731ef214eec3079db132981b4 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Mon, 17 Jun 2019 19:25:26 +0100 Subject: [PATCH 02/17] fix of subjects --- subjects/boolean.en.md | 2 +- subjects/boolean.fr.md | 2 +- subjects/point.en.md | 11 ++++++++--- subjects/point.fr.md | 18 ++++++++++++------ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/subjects/boolean.en.md b/subjects/boolean.en.md index eab52ae02..b6dce5574 100644 --- a/subjects/boolean.en.md +++ b/subjects/boolean.en.md @@ -1,4 +1,4 @@ -## Boolean +## boolean ### Instructions diff --git a/subjects/boolean.fr.md b/subjects/boolean.fr.md index 3fc00c7af..67b64856a 100644 --- a/subjects/boolean.fr.md +++ b/subjects/boolean.fr.md @@ -1,4 +1,4 @@ -## Boolean +## boolean ### Instructions diff --git a/subjects/point.en.md b/subjects/point.en.md index d74ce5d5d..f91b29bad 100644 --- a/subjects/point.en.md +++ b/subjects/point.en.md @@ -1,12 +1,17 @@ -## Point +## point ### Instructions -Create a `.go` file and copy the code below into our file -and add the code necessary so the program works. +Create a `.go` file. + +- The code below has to be copied in that file. + +- The necessary changes have to be applied so that the program works. - The program must be submitted inside a folder with the name `point`. +### Code to be copied + ```go func setPoint(ptr *point) { ptr.x = 42 diff --git a/subjects/point.fr.md b/subjects/point.fr.md index ba6b426e1..326af58ba 100644 --- a/subjects/point.fr.md +++ b/subjects/point.fr.md @@ -1,10 +1,17 @@ -## Point +## point ### Instructions -Create a `.go` file and copy the code below into our file +Créer un fichier `.go`. -- The main task is to return a working program. +- Le code ci-dessous doit être copié dans ce fichier. + +- Les changements nécéssaires doivent être appliquer et the code below into that file + and do the necessary changes so that the program works. + +- Le programme doit être rendu dans un dossier nommé `boolean`. + +### Code à copier ```go func setPoint(ptr *point) { @@ -17,12 +24,11 @@ func main() { setPoint(points) - fmt.Printf("x = %d, y = %d",points.x, points.y) - fmt.Println() + fmt.Printf("x = %d, y = %d\n",points.x, points.y) } ``` -### Expected output +### Usage ```console student@ubuntu:~/piscine/test$ go build From b0f2494923ba7bd8a10400a1ea4460698db74380 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Mon, 17 Jun 2019 19:53:55 +0100 Subject: [PATCH 03/17] traduction de la quete 8 --- subjects/displayfile.en.md | 6 +++--- subjects/displayfile.fr.md | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/subjects/displayfile.en.md b/subjects/displayfile.en.md index f72987fff..eeaf506a3 100644 --- a/subjects/displayfile.en.md +++ b/subjects/displayfile.en.md @@ -2,17 +2,17 @@ ### Instructions -Write a program that displays, on the standard output, only the content of the file given as argument. +Write a program that displays, on the standard output, the content of a file given as argument. - Create a file `quest8.txt` and write into the file `Almost there!!` - The argument of the program should be the name of the file, in this case, `quest8.txt`. -- In case of error it should print: +- In case of error it should print one the below messages accordingly: - `File name missing`. - `Too many arguments`. -### Output: +### Usage: ```console student@ubuntu:~/student/displayfile$ go build diff --git a/subjects/displayfile.fr.md b/subjects/displayfile.fr.md index 1f1bce848..b117240c3 100644 --- a/subjects/displayfile.fr.md +++ b/subjects/displayfile.fr.md @@ -2,17 +2,17 @@ ### Instructions -Write a program that displays, on the standard output, only the content of the file given as argument. +Écrire un programme qui affiche, sur la sortie standard, le contenu d'un fichier donné en argument. -- Create a file `quest8.txt` and write into the file `Almost there!!` +- Créer un fichier `quest8.txt` et écrire dedans la phrase `Almost there!!` -- The argument of the program should be the name of the file, in this case, `quest8.txt`. +- L'argument pour ce programme sera, dans ce cas, `quest8.txt`. -- In case of error it should print: +- En cas d'erreur le programme doit afficher un des deux messages suivants de manière approprié: - `File name missing`. - `Too many arguments`. -### Output: +### Utilisation: ```console student@ubuntu:~/student/test$ go build From c2c78060247a880a54193234118a63bf4f85a246 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Tue, 18 Jun 2019 03:03:59 +0100 Subject: [PATCH 04/17] translation of cat --- subjects/cat.en.md | 18 +++++++++--------- subjects/cat.fr.md | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/subjects/cat.en.md b/subjects/cat.en.md index e285e01be..624d7b703 100644 --- a/subjects/cat.en.md +++ b/subjects/cat.en.md @@ -2,25 +2,25 @@ ### Instructions -Write a program that does the same thing as the system's `cat` command-line. +Write a program that has the same behaviour as the system's `cat` command-line. -- You don't have to handle options. +- The `options` do not have to be handled. -- But if just call the program with out arguments it should take a input and print it back +- If the program is called without arguments it should take the `input` and print it back. - In the program folder create two files named `quest8.txt` and `quest8T.txt`. -- Copy to the `quest8.txt` file this : +- Copy to the `quest8.txt` file the following sentence : - - "Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing +`"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing` -- Copy to the `quest8T.txt` file this : +- Copy to the `quest8T.txt` file the following sentence : - - "Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence." +`"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."` -- In case of error it should print the error. +- In case of error the program should print the error. -### Output: +### Usage: ```console student@ubuntu:~/student/test$ go build diff --git a/subjects/cat.fr.md b/subjects/cat.fr.md index e285e01be..1da4d1d7f 100644 --- a/subjects/cat.fr.md +++ b/subjects/cat.fr.md @@ -2,25 +2,25 @@ ### Instructions -Write a program that does the same thing as the system's `cat` command-line. +Écrire un programme qui a le même comportement que la ligne de commande `cat`. -- You don't have to handle options. +- Les `options` ne doivent pas être gérés. -- But if just call the program with out arguments it should take a input and print it back +- Si le programme est éxécuté sans arguments il doit prendre l'`input` et l'afficher. -- In the program folder create two files named `quest8.txt` and `quest8T.txt`. +- Dans le dossier du programme créer deux fichiers nommés `quest8.txt` et `quest8T.txt`. -- Copy to the `quest8.txt` file this : +- Copier dans le fichier `quest8.txt` la phrase suivante : - - "Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing +`"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing` -- Copy to the `quest8T.txt` file this : +- Copier dans le fichier `quest8T.txt` la phrase suivante : - - "Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence." +`"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."` -- In case of error it should print the error. +- En cas d'erreur le programme doit imprimer l'erreur. -### Output: +### Utilisation: ```console student@ubuntu:~/student/test$ go build From 538c8afc92f08fb73470274c6dd367138e8865dc Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Tue, 18 Jun 2019 03:14:42 +0100 Subject: [PATCH 05/17] translation of ztail --- subjects/displayfile.en.md | 6 +++--- subjects/ztail.en.md | 10 +++++----- subjects/ztail.fr.md | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/subjects/displayfile.en.md b/subjects/displayfile.en.md index eeaf506a3..97153fc1f 100644 --- a/subjects/displayfile.en.md +++ b/subjects/displayfile.en.md @@ -4,11 +4,11 @@ Write a program that displays, on the standard output, the content of a file given as argument. -- Create a file `quest8.txt` and write into the file `Almost there!!` +- Create a file `quest8.txt` and write nito it the sentence `Almost there!!` -- The argument of the program should be the name of the file, in this case, `quest8.txt`. +- The argument of the program in this case should be, `quest8.txt`. -- In case of error it should print one the below messages accordingly: +- In case of error the program should print one the below messages accordingly: - `File name missing`. - `Too many arguments`. diff --git a/subjects/ztail.en.md b/subjects/ztail.en.md index 015a9c5d5..231235c57 100644 --- a/subjects/ztail.en.md +++ b/subjects/ztail.en.md @@ -2,12 +2,12 @@ ### Instructions -Write a program called ztail that does the same thing as the system command tail, but witch takes at least one file as argument. +Write a program called `ztail` that has the same behaviour as the system command `tail`, but which takes at least one file as argument. -The only option you have to handle is -c. This option will be used in all tests. +- The only option to be handled is `-c`. This option will be used in all tests. -For this program you can use the "os" package. +- For this program the "os" package can be used. -For the program to pass the test you should follow the convention for the return code of program in Unix sistems (see os.Exit) +- For the program to pass the tests the convention for the return code of program in Unix systems should be followed (see os.Exit). -For more information consult the man page for tail. +- For more information consult the man page for `tail`. diff --git a/subjects/ztail.fr.md b/subjects/ztail.fr.md index 015a9c5d5..8166d2875 100644 --- a/subjects/ztail.fr.md +++ b/subjects/ztail.fr.md @@ -2,12 +2,12 @@ ### Instructions -Write a program called ztail that does the same thing as the system command tail, but witch takes at least one file as argument. +Écrire un programme `ztail` qui a le même comportement que la ligne de commande `tail`, mais qui prend au moins 1 fichier comme argument. -The only option you have to handle is -c. This option will be used in all tests. +- La seule option qui doit être géré est `-c`. Cette option sera utilisé dans tous les tests. -For this program you can use the "os" package. +- Pour ce programme le package "os" peut être utilisé. -For the program to pass the test you should follow the convention for the return code of program in Unix sistems (see os.Exit) +- Pour que le programme passe les tests la convention pour le retour code de programme en systémes Unix devra être suivi(voir os.Exit). -For more information consult the man page for tail. +- Pour plus d'informtations consulter la page du man de `tail`. From 0a7efc9a6087b1841dcace8300da32379150fb01 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Tue, 18 Jun 2019 03:16:45 +0100 Subject: [PATCH 06/17] Update cat.en.md --- subjects/cat.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/cat.en.md b/subjects/cat.en.md index 624d7b703..1221da71d 100644 --- a/subjects/cat.en.md +++ b/subjects/cat.en.md @@ -1,4 +1,4 @@ -## Cat +## cat ### Instructions From 1b55e74d733ae9c8712d8b5fd114411c1d6b1263 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Tue, 18 Jun 2019 03:17:10 +0100 Subject: [PATCH 07/17] Update cat.fr.md --- subjects/cat.fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/cat.fr.md b/subjects/cat.fr.md index 1da4d1d7f..b234565c8 100644 --- a/subjects/cat.fr.md +++ b/subjects/cat.fr.md @@ -1,4 +1,4 @@ -## Cat +## cat ### Instructions From a9efb5652d2c8779e4806853d7ad91dcfc38ccc0 Mon Sep 17 00:00:00 2001 From: xpetit Date: Mon, 17 Jun 2019 19:20:43 +0100 Subject: [PATCH 08/17] Add (un)rar command --- scripts/common_packages.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/common_packages.txt b/scripts/common_packages.txt index 2048b8239..63a6f1dd3 100644 --- a/scripts/common_packages.txt +++ b/scripts/common_packages.txt @@ -46,6 +46,7 @@ pciutils psmisc python python3 +rar rsync rsyslog ssh @@ -57,6 +58,7 @@ tig traceroute tree tzdata +unrar unzip usbutils wget From 1b44372cd02802b3380c286f296ae7566ba14e76 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Sat, 4 May 2019 02:24:59 +0100 Subject: [PATCH 09/17] Install additional drivers --- scripts/install_client.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install_client.sh b/scripts/install_client.sh index f91b40220..0d0e76dd8 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -51,6 +51,9 @@ xfsprogs apt-get -y install $PKGS +# Install additional drivers +ubuntu-drivers install + # Remove fsck because the system partition will be read-only (overlayroot) rm /usr/share/initramfs-tools/hooks/fsck From 574099c91ae60da4d471799be4f074792f9e083f Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Mon, 6 May 2019 11:35:13 +0100 Subject: [PATCH 10/17] One-line log --- scripts/install_client.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install_client.sh b/scripts/install_client.sh index 0d0e76dd8..a5d2db866 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -3,8 +3,7 @@ # Configure Z01 client # Log stdout & stderr -exec > >(tee -i /tmp/install_client.log) -exec 2>&1 +exec > >(tee -i /tmp/install_client.log) 2>&1 SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" cd $SCRIPT_DIR From e076a28586e11a6000f6c35b6cc92a911b879c55 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Mon, 6 May 2019 11:35:38 +0100 Subject: [PATCH 11/17] Remove first-time Ubuntu screen --- scripts/dconfig.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/dconfig.txt b/scripts/dconfig.txt index 3057624f1..1c2132acf 100644 --- a/scripts/dconfig.txt +++ b/scripts/dconfig.txt @@ -11,6 +11,11 @@ delay=uint32 350 unicode-hotkey=@as [] hotkey=@as [] +[apps/update-manager] +launch-time=int64 1557136088 +launch-count=1 +first-run=false + [org/gnome/desktop/peripherals/touchpad] two-finger-scrolling-enabled=true disable-while-typing=false From f09a85b198acf961dc88a9b05f2e5c8d6123c0f0 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Mon, 6 May 2019 11:36:48 +0100 Subject: [PATCH 12/17] Disable smart touchpad --- scripts/dconfig.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/dconfig.txt b/scripts/dconfig.txt index 1c2132acf..92ff10d83 100644 --- a/scripts/dconfig.txt +++ b/scripts/dconfig.txt @@ -17,8 +17,10 @@ launch-count=1 first-run=false [org/gnome/desktop/peripherals/touchpad] +natural-scroll=false two-finger-scrolling-enabled=true disable-while-typing=false +click-method='none' [org/gnome/login-screen] enable-smartcard-authentication=false From 1b1e78d4a282320bbf4fb930f380a2dbf3528e9b Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Mon, 6 May 2019 12:20:06 +0100 Subject: [PATCH 13/17] Better default settings for laptop --- scripts/dconfig.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/dconfig.txt b/scripts/dconfig.txt index 92ff10d83..fb66080cc 100644 --- a/scripts/dconfig.txt +++ b/scripts/dconfig.txt @@ -38,6 +38,7 @@ disable-external=true [org/gnome/desktop/interface] gtk-im-module='gtk-im-context-simple' +show-battery-percentage=true clock-show-seconds=true enable-animations=false cursor-blink=false @@ -105,8 +106,12 @@ active=false active=false [org/gnome/settings-daemon/plugins/power] +sleep-inactive-battery-type='nothing' sleep-inactive-ac-type='nothing' +idle-dim=false +sleep-inactive-battery-timeout=0 sleep-inactive-ac-timeout=0 +ambient-enabled=false [org/gnome/shell] enable-hot-corners=true From debe17edc853ee2128690d52fed03da3a13d3389 Mon Sep 17 00:00:00 2001 From: Xavier Petit Date: Mon, 6 May 2019 14:39:33 +0100 Subject: [PATCH 14/17] The gnome-shell segfault seems to be a feature... Prevents double Xorg --- scripts/ubuntu_tweaks.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/ubuntu_tweaks.sh b/scripts/ubuntu_tweaks.sh index a1d4e139f..d70cc8dac 100755 --- a/scripts/ubuntu_tweaks.sh +++ b/scripts/ubuntu_tweaks.sh @@ -39,9 +39,6 @@ swapoff /swapfile || true rm -f /swapfile sed -i '/swapfile/d' /etc/fstab -# Prevent gnome-shell segfault from happening -sed -i 's/#WaylandEnable=false/WaylandEnable=false/g' /etc/gdm3/custom.conf - # Purge unused Ubuntu packages PKGS=" apport From e7157aa9eb5a262defc7be8c44de75080a3a6473 Mon Sep 17 00:00:00 2001 From: Xavier Date: Thu, 9 May 2019 15:16:07 +0100 Subject: [PATCH 15/17] Remove speech synth, fixes idle pulseaudio high CPU usage --- scripts/ubuntu_tweaks.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ubuntu_tweaks.sh b/scripts/ubuntu_tweaks.sh index d70cc8dac..93fa281ae 100755 --- a/scripts/ubuntu_tweaks.sh +++ b/scripts/ubuntu_tweaks.sh @@ -59,6 +59,7 @@ popularity-contest python3-update-manager secureboot-db snapd +speech-dispatcher* spice-vdagent ubuntu-report ubuntu-software From cb35404aadef1dbc401a572c9a5899689163d75f Mon Sep 17 00:00:00 2001 From: Xavier Date: Sun, 12 May 2019 11:26:51 +0100 Subject: [PATCH 16/17] Hiding kernel output makes boot seconds slower, so remove it. --- scripts/ubuntu_tweaks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ubuntu_tweaks.sh b/scripts/ubuntu_tweaks.sh index 93fa281ae..48f5d1a7b 100755 --- a/scripts/ubuntu_tweaks.sh +++ b/scripts/ubuntu_tweaks.sh @@ -28,8 +28,8 @@ sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop # Remove password complexity constraints sed -i 's/ obscure / minlen=1 /g' /etc/pam.d/common-password -# Remove splash screen (plymouth) and hide kernel output -sed -i 's/quiet splash/quiet vt.global_cursor_default=0 console=ttyS0/g' /etc/default/grub +# Remove splash screen (plymouth) +sed -i 's/quiet splash/quiet/g' /etc/default/grub update-initramfs -u update-grub From ad244a272cc79cafb5f889d487c8d75eec4b0aed Mon Sep 17 00:00:00 2001 From: Xavier Date: Mon, 13 May 2019 09:36:41 +0100 Subject: [PATCH 17/17] Make the GOPATH work visible for sublime-text plug-ins --- scripts/go.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/go.sh b/scripts/go.sh index c3a27a4ae..0fafed829 100755 --- a/scripts/go.sh +++ b/scripts/go.sh @@ -17,6 +17,7 @@ do PATH=$PATH:$GOPATH/bin alias gobuild='CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w"' EOF + echo 'GOPATH=$HOME/go' >> $DIR/.profile # Fix rights USR=$(echo "$DIR" | rev | cut -d/ -f1 | rev)