Browse Source

Merge branch 'master' into cat-readme

pull/179/head
Christopher Fremond 5 years ago committed by GitHub
parent
commit
bfd606ac4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      scripts/common_packages.txt
  2. 12
      scripts/dconfig.txt
  3. 1
      scripts/go.sh
  4. 6
      scripts/install_client.sh
  5. 8
      scripts/ubuntu_tweaks.sh
  6. 11
      subjects/boolean.en.md
  7. 23
      subjects/boolean.fr.md
  8. 20
      subjects/cat.en.md
  9. 22
      subjects/cat.fr.md
  10. 10
      subjects/displayfile.en.md
  11. 10
      subjects/displayfile.fr.md
  12. 11
      subjects/point.en.md
  13. 18
      subjects/point.fr.md
  14. 10
      subjects/ztail.en.md
  15. 10
      subjects/ztail.fr.md

2
scripts/common_packages.txt

@ -46,6 +46,7 @@ pciutils
psmisc psmisc
python python
python3 python3
rar
rsync rsync
rsyslog rsyslog
ssh ssh
@ -57,6 +58,7 @@ tig
traceroute traceroute
tree tree
tzdata tzdata
unrar
unzip unzip
usbutils usbutils
wget wget

12
scripts/dconfig.txt

@ -11,9 +11,16 @@ delay=uint32 350
unicode-hotkey=@as [] unicode-hotkey=@as []
hotkey=@as [] hotkey=@as []
[apps/update-manager]
launch-time=int64 1557136088
launch-count=1
first-run=false
[org/gnome/desktop/peripherals/touchpad] [org/gnome/desktop/peripherals/touchpad]
natural-scroll=false
two-finger-scrolling-enabled=true two-finger-scrolling-enabled=true
disable-while-typing=false disable-while-typing=false
click-method='none'
[org/gnome/login-screen] [org/gnome/login-screen]
enable-smartcard-authentication=false enable-smartcard-authentication=false
@ -31,6 +38,7 @@ disable-external=true
[org/gnome/desktop/interface] [org/gnome/desktop/interface]
gtk-im-module='gtk-im-context-simple' gtk-im-module='gtk-im-context-simple'
show-battery-percentage=true
clock-show-seconds=true clock-show-seconds=true
enable-animations=false enable-animations=false
cursor-blink=false cursor-blink=false
@ -98,8 +106,12 @@ active=false
active=false active=false
[org/gnome/settings-daemon/plugins/power] [org/gnome/settings-daemon/plugins/power]
sleep-inactive-battery-type='nothing'
sleep-inactive-ac-type='nothing' sleep-inactive-ac-type='nothing'
idle-dim=false
sleep-inactive-battery-timeout=0
sleep-inactive-ac-timeout=0 sleep-inactive-ac-timeout=0
ambient-enabled=false
[org/gnome/shell] [org/gnome/shell]
enable-hot-corners=true enable-hot-corners=true

1
scripts/go.sh

@ -17,6 +17,7 @@ do
PATH=$PATH:$GOPATH/bin PATH=$PATH:$GOPATH/bin
alias gobuild='CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w"' alias gobuild='CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w"'
EOF EOF
echo 'GOPATH=$HOME/go' >> $DIR/.profile
# Fix rights # Fix rights
USR=$(echo "$DIR" | rev | cut -d/ -f1 | rev) USR=$(echo "$DIR" | rev | cut -d/ -f1 | rev)

6
scripts/install_client.sh

@ -3,8 +3,7 @@
# Configure Z01 client # Configure Z01 client
# Log stdout & stderr # Log stdout & stderr
exec > >(tee -i /tmp/install_client.log) exec > >(tee -i /tmp/install_client.log) 2>&1
exec 2>&1
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)" SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR cd $SCRIPT_DIR
@ -51,6 +50,9 @@ xfsprogs
apt-get -y install $PKGS apt-get -y install $PKGS
# Install additional drivers
ubuntu-drivers install
# Remove fsck because the system partition will be read-only (overlayroot) # Remove fsck because the system partition will be read-only (overlayroot)
rm /usr/share/initramfs-tools/hooks/fsck rm /usr/share/initramfs-tools/hooks/fsck

8
scripts/ubuntu_tweaks.sh

@ -28,8 +28,8 @@ sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop
# Remove password complexity constraints # Remove password complexity constraints
sed -i 's/ obscure / minlen=1 /g' /etc/pam.d/common-password sed -i 's/ obscure / minlen=1 /g' /etc/pam.d/common-password
# Remove splash screen (plymouth) and hide kernel output # Remove splash screen (plymouth)
sed -i 's/quiet splash/quiet vt.global_cursor_default=0 console=ttyS0/g' /etc/default/grub sed -i 's/quiet splash/quiet/g' /etc/default/grub
update-initramfs -u update-initramfs -u
update-grub update-grub
@ -39,9 +39,6 @@ swapoff /swapfile || true
rm -f /swapfile rm -f /swapfile
sed -i '/swapfile/d' /etc/fstab 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 # Purge unused Ubuntu packages
PKGS=" PKGS="
apport apport
@ -62,6 +59,7 @@ popularity-contest
python3-update-manager python3-update-manager
secureboot-db secureboot-db
snapd snapd
speech-dispatcher*
spice-vdagent spice-vdagent
ubuntu-report ubuntu-report
ubuntu-software ubuntu-software

11
subjects/boolean.en.md

@ -1,12 +1,17 @@
## Boolean ## boolean
### Instructions ### Instructions
Create a `.go` file and copy the code below into that file Create a `.go` file.
and add the code necessary so the program works.
- 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`. - The program must be submitted inside a folder with the name `boolean`.
### Code to be copied
```go ```go
func printStr(str string) { func printStr(str string) {
arrayStr := []rune(str) arrayStr := []rune(str)

23
subjects/boolean.fr.md

@ -1,10 +1,17 @@
## Boolean ## boolean
### Instructions ### 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 ```go
func printStr(str string) { func printStr(str string) {
@ -33,14 +40,12 @@ func main() {
} }
``` ```
### Expected output ### Usage
```console ```console
student@ubuntu:~/student/boolean$ go build
student@ubuntu:~/student/boolean$ ./boolean "not" "odd"
I have an even number of arguments I have an even number of arguments
``` student@ubuntu:~/student/boolean$ ./boolean "not even"
### Or
```console
I have an odd number of arguments I have an odd number of arguments
``` ```

20
subjects/cat.en.md

@ -1,29 +1,27 @@
## Cat ## cat
### Instructions ### 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`. - 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.
- The program must be submitted inside a folder with the name `cat`. - The program must be submitted inside a folder with the name `cat`.
### Output:
```console ```console
student@ubuntu:~/student/cat$ go build student@ubuntu:~/student/cat$ go build
student@ubuntu:~/student/cat$ ./cat student@ubuntu:~/student/cat$ ./cat

22
subjects/cat.fr.md

@ -1,26 +1,26 @@
## Cat ## cat
### Instructions ### 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 ```console
student@ubuntu:~/student/test$ go build student@ubuntu:~/student/test$ go build

10
subjects/displayfile.en.md

@ -2,17 +2,17 @@
### Instructions ### 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!!` - 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: - In case of error the program should print one the below messages accordingly:
- `File name missing`. - `File name missing`.
- `Too many arguments`. - `Too many arguments`.
### Output: ### Usage:
```console ```console
student@ubuntu:~/student/displayfile$ go build student@ubuntu:~/student/displayfile$ go build

10
subjects/displayfile.fr.md

@ -2,17 +2,17 @@
### Instructions ### 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`. - `File name missing`.
- `Too many arguments`. - `Too many arguments`.
### Output: ### Utilisation:
```console ```console
student@ubuntu:~/student/test$ go build student@ubuntu:~/student/test$ go build

11
subjects/point.en.md

@ -1,12 +1,17 @@
## Point ## point
### Instructions ### Instructions
Create a `.go` file and copy the code below into our file Create a `.go` file.
and add the code necessary so the program works.
- 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`. - The program must be submitted inside a folder with the name `point`.
### Code to be copied
```go ```go
func setPoint(ptr *point) { func setPoint(ptr *point) {
ptr.x = 42 ptr.x = 42

18
subjects/point.fr.md

@ -1,10 +1,17 @@
## Point ## point
### Instructions ### 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 ```go
func setPoint(ptr *point) { func setPoint(ptr *point) {
@ -17,12 +24,11 @@ func main() {
setPoint(points) setPoint(points)
fmt.Printf("x = %d, y = %d",points.x, points.y) fmt.Printf("x = %d, y = %d\n",points.x, points.y)
fmt.Println()
} }
``` ```
### Expected output ### Usage
```console ```console
student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/test$ go build

10
subjects/ztail.en.md

@ -2,12 +2,12 @@
### Instructions ### 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`.

10
subjects/ztail.fr.md

@ -2,12 +2,12 @@
### Instructions ### 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`.

Loading…
Cancel
Save