25-07-2021
This commit is contained in:
85
docs/Divers/bash/basename.md
Normal file
85
docs/Divers/bash/basename.md
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
|
||||
#### basename
|
||||
|
||||
Récupérer la dernière partie d'un chemin (nom du fichier):
|
||||
|
||||
```bash
|
||||
$ basename /usr/local/etc/php/8.0/conf.d/ext-apcu.ini
|
||||
ext-apcu.ini
|
||||
```
|
||||
Récupérer la dernière partie d'un chemin (dossier):
|
||||
|
||||
```bash
|
||||
$ basename /usr/local/etc/php/8.0/conf.d/
|
||||
conf.d
|
||||
```
|
||||
|
||||
Récupérer le nom de fichier sans l'extension
|
||||
|
||||
```bash
|
||||
$ basename -s .ini /usr/local/etc/php/8.0/conf.d/ext-apcu.ini
|
||||
ext-apcu
|
||||
```
|
||||
|
||||
Sur plusieurs chemins:
|
||||
|
||||
```bash
|
||||
$ basename -a -s .ini /usr/local/etc/php/8.0/conf.d/ext-apcu.ini /usr/local/etc/php/7.3/conf.d/ext-ssh2.ini
|
||||
ext-apcu
|
||||
ext-ssh2
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### dirname
|
||||
|
||||
Récupérer le chemin (sans le nom du fichier):
|
||||
|
||||
```bash
|
||||
$ dirname /usr/local/etc/php/8.0/conf.d/ext-apcu.ini
|
||||
/usr/local/etc/php/8.0/conf.d
|
||||
```
|
||||
|
||||
Si le chemin n'est pas indiqué:
|
||||
|
||||
```bash
|
||||
/usr/local/etc/php/7.3/conf.d
|
||||
$ dirname ext-apcu.ini
|
||||
.
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### $0
|
||||
|
||||
Récupérer le chemin du script courant:
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ nano chemins.sh
|
||||
|
||||
#!/usr/local/bin/bash
|
||||
|
||||
echo "Chemin du script: " $0
|
||||
echo "Le script exécuté a comme basename `basename "$0"`, dirname `dirname "$0"`"
|
||||
echo "Le répertoire courant est `pwd`"
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ ./chemins.sh
|
||||
Chemin du script: ./chemins.sh
|
||||
Le script exécuté a comme basename chemins.sh, dirname .
|
||||
Le répertoire courant est /Users/bruno/Documents/shell_scripts
|
||||
```
|
||||
|
||||
```bash
|
||||
$ /Users/bruno/Documents/shell_scripts/chemins.sh
|
||||
Chemin du script: /Users/bruno/Documents/shell_scripts/chemins.sh
|
||||
Le script exécuté a comme basename chemins.sh, dirname /Users/bruno/Documents/shell_scripts
|
||||
Le répertoire courant est /Users/bruno/Documents/shell_scripts
|
||||
```
|
||||
|
||||
@@ -34,6 +34,8 @@ $ history
|
||||
|
||||
|
||||
|
||||
#### Commandes:
|
||||
|
||||
```bash
|
||||
$ history | grep 'chmod'
|
||||
250 sudo chmod -R 755 gallery/
|
||||
@@ -49,6 +51,71 @@ $ history | grep 'chmod'
|
||||
526 history | grep 'chmod'
|
||||
```
|
||||
|
||||
Excécuter une commande de l'historique d'après son nombre (!#):
|
||||
|
||||
```bash
|
||||
$ !507
|
||||
cd .ssh/
|
||||
drwx------ 1 bruno users 124 Mar 15 19:23 .
|
||||
drwxr-xr-x 1 bruno users 812 Mar 16 09:31 ..
|
||||
-rw------- 1 bruno users 5325 Mar 31 2020 _authorized_keys.bak
|
||||
-rw------- 1 bruno users 8200 Mar 11 14:30 authorized_keys
|
||||
-rw------- 1 bruno users 3326 Nov 19 2019 id_rsa
|
||||
-rw-r--r-- 1 bruno users 734 Nov 19 2019 id_rsa.pub
|
||||
-rw-r--r-- 1 bruno users 550 Mar 15 11:00 known_hosts
|
||||
bruno@DS916:~/.ssh $
|
||||
```
|
||||
|
||||
Excécuter 2 commandes en arrière:
|
||||
|
||||
```bash
|
||||
$ !-2
|
||||
|
||||
# 10 commandes en arrière
|
||||
$ !-10
|
||||
```
|
||||
|
||||
Ré-excécuter la dernière commande (!!):
|
||||
|
||||
```bash
|
||||
$ cat .npmrc
|
||||
#prefix=/var/services/homes/bruno/.npm-packages
|
||||
tmp=/tmp
|
||||
|
||||
$ !!
|
||||
cat .npmrc
|
||||
#prefix=/var/services/homes/bruno/.npm-packages
|
||||
tmp=/tmp
|
||||
|
||||
# !! est équivalent à !-1
|
||||
```
|
||||
|
||||
Relancer la dernière commande avec sudo comme préfixe:
|
||||
|
||||
```bash
|
||||
$ nano /etc/fstab
|
||||
|
||||
$ sudo !!
|
||||
sudo nano /etc/fstab
|
||||
|
||||
```
|
||||
|
||||
Relancer la dernière commande avec 'keygen':
|
||||
|
||||
```bash
|
||||
$ !keygen
|
||||
ssh-keygen -t rsa -b 1024
|
||||
```
|
||||
|
||||
Rechercher la dernière commande avec 'keygen' sans l'exécuter:
|
||||
|
||||
```bash
|
||||
# on ajoute :p après
|
||||
|
||||
$ !keygen:p
|
||||
ssh-keygen -t rsa -b 1024
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
@@ -73,7 +140,7 @@ $ history
|
||||
5039* 916e
|
||||
```
|
||||
|
||||
|
||||
Grep:
|
||||
|
||||
```bash
|
||||
$ history | grep mas
|
||||
@@ -86,3 +153,7 @@ $ history | grep mas
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Arguments:
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ $ echo ${string:7}
|
||||
$ echo ${string:7:3}
|
||||
23A
|
||||
|
||||
# Obtenir les 2 premieres caractères:
|
||||
# Obtenir les 2 premiers caractères:
|
||||
$ echo ${string:0:2}
|
||||
ab
|
||||
echo "$string" | awk '{print substr($0,0,2)}'
|
||||
|
||||
@@ -395,8 +395,6 @@ drwxr-xr-x 1 root root 196 Mar 15 09:35 public
|
||||
|
||||
|
||||
|
||||
## emby
|
||||
|
||||
|
||||
|
||||
https://github.com/mickael-kerjean/filestash/wiki/Release-0.2:-Photo-Management
|
||||
|
||||
@@ -15,7 +15,7 @@ https://docs.docker.com/
|
||||
| hoobs | hoobs/hoobs:latest | | |
|
||||
| photonix | damianmoore/photonix:latest | | |
|
||||
| PiHole | pihole/pihole:latest | | |
|
||||
| f | linuxserver/photoshow:latest | | |
|
||||
| photoshow | linuxserver/photoshow:latest | | |
|
||||
|
||||
#### Portainer:
|
||||
|
||||
@@ -49,13 +49,13 @@ uid=1026(bruno) gid=100(users) groups=100(users),101(administrators)
|
||||
```
|
||||
|
||||
```bash
|
||||
❯ id
|
||||
$ id
|
||||
uid=501(bruno) gid=20(staff) groups=20(staff),12(everyone)...
|
||||
|
||||
❯ id -u
|
||||
$ id -u
|
||||
501
|
||||
|
||||
❯ id -g
|
||||
$ id -g
|
||||
20
|
||||
```
|
||||
|
||||
@@ -70,7 +70,7 @@ chown 1000:1000 /volume1/docker/personal/ghost/ghost
|
||||
Créer un fichier **docker-compose.yml** dans **/volume1/docker/personal/ghost**
|
||||
(pas de TAB)
|
||||
|
||||
```
|
||||
```bash
|
||||
/volume1/docker/personal/ghost $ sudo docker-compose up -d
|
||||
```
|
||||
|
||||
@@ -93,20 +93,22 @@ Stopping photoprism_photoprism_1 ... done
|
||||
|
||||
Pour mettre à jour le container, supprimer le container dans la GUI et relancer `docker-compose up -d`
|
||||
|
||||
```
|
||||
```bash
|
||||
/volume1/docker/personal/ghost $ sudo docker-compose pull
|
||||
/volume1/docker/personal/ghost $ sudo docker-compose up -d
|
||||
```
|
||||
|
||||
```
|
||||
docker-compose up --force-recreate --build -d
|
||||
```bash
|
||||
$ docker-compose up --force-recreate --build -d
|
||||
```
|
||||
|
||||
http://tonylawrence.com/posts/unix/synology/free-your-synology-ports/
|
||||
|
||||
|
||||
Arreter un container:
|
||||
docker-compose down
|
||||
|
||||
```bash
|
||||
$ docker-compose down
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -116,15 +118,15 @@ Arreter un container:
|
||||
**Liste des containers qui tournent:**
|
||||
|
||||
```bash
|
||||
❯ docker ps (Docker <1.13)
|
||||
❯ docker container ls
|
||||
$ docker ps (Docker <1.13)
|
||||
$ docker container ls
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
104f0c7e80a1 postgres:11.1-alpine "docker-entrypoint.s…" About an hour ago Up About an hour 5432/tcp photonix-postgres
|
||||
4c66e278fd6d gitlab/gitlab-ce:latest "/assets/wrapper" 9 months ago Up 2 hours (unhealthy) 0.0.0.0:922->22/tcp, 0.0.0.0:81->80/tcp, 0.0.0.0:444->443/tcp gitlab
|
||||
```
|
||||
|
||||
```bash
|
||||
❯ docker container ls --format 'table {{.Names}}\t{{.Status}}'
|
||||
$ docker container ls --format 'table {{.Names}}\t{{.Status}}'
|
||||
NAMES STATUS
|
||||
watchtower Up 38 minutes
|
||||
portainer Up 2 hours
|
||||
@@ -133,7 +135,7 @@ homebridge Up 2 days
|
||||
bizmodeller-mymediaforalexa-amd641 Up 13 days
|
||||
PiHole Up 3 weeks (healthy)
|
||||
|
||||
❯ docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}\t{{.Networks}}\t{{.Mounts}}"
|
||||
$ docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}\t{{.Networks}}\t{{.Mounts}}"
|
||||
CONTAINER ID IMAGE COMMAND CREATED AT STATUS PORTS NAMES NETWORKS MOUNTS
|
||||
18fba7e277be portainer/portainer-ce "/portainer" 2020-11-09 22:22:47 +0100 CET Up 15 hours 0.0.0.0:8000->8000/tcp, 0.0.0.0:9000->9000/tcp portainer bridge portainer_data,/run/host-serv…
|
||||
|
||||
@@ -142,8 +144,8 @@ CONTAINER ID IMAGE COMMAND CREATED AT
|
||||
**Liste des containers stoppés:**
|
||||
|
||||
```bash
|
||||
❯ docker ps --filter "status=exited"
|
||||
❯ docker container ls -f "status=exited"
|
||||
$ docker ps --filter "status=exited"
|
||||
$ docker container ls -f "status=exited"
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
842cbbada398 damianmoore/photonix:latest "/bin/sh -c ./system…" About an hour ago Exited (137) 50 minutes ago photonix
|
||||
23c90981855b redis:3.2.8 "docker-entrypoint.s…" About an hour ago Exited (0) 50 minutes ago photonix-redis
|
||||
@@ -154,8 +156,8 @@ d2b481b91f10 portainer/portainer "/portainer" 9 mon
|
||||
**Liste de tous les containers:**
|
||||
|
||||
```bash
|
||||
❯ docker ps --all
|
||||
❯ docker container ls --all
|
||||
$ docker ps --all
|
||||
$ docker container ls --all
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
842cbbada398 damianmoore/photonix:latest "/bin/sh -c ./system…" About an hour ago Exited (137) 54 minutes ago photonix
|
||||
104f0c7e80a1 postgres:11.1-alpine "docker-entrypoint.s…" About an hour ago Up About an hour 5432/tcp photonix-postgres
|
||||
@@ -168,43 +170,56 @@ d2b481b91f10 portainer/portainer "/portainer" 9 mon
|
||||
**Liste des ID des containers qui tournent:**
|
||||
|
||||
```bash
|
||||
❯ docker ps -q
|
||||
❯ docker container ls -q
|
||||
$ docker ps -q
|
||||
$ docker container ls -q
|
||||
104f0c7e80a1
|
||||
4c66e278fd6d
|
||||
```
|
||||
|
||||
**Démarrer un container:**
|
||||
|
||||
```bash
|
||||
# Démarre un container déjà crée mais arrêté.
|
||||
|
||||
$ docker start photoprism_photoprism_1
|
||||
photoprism_photoprism_1
|
||||
$ docker start 4beabb9fd090
|
||||
4beabb9fd090
|
||||
```
|
||||
|
||||
**Stopper un container:**
|
||||
|
||||
```bash
|
||||
❯ docker stop gitlab
|
||||
❯ docker stop 4c66e278fd6d
|
||||
$ docker stop gitlab
|
||||
gitlab
|
||||
$ docker stop 4c66e278fd6d
|
||||
4c66e278fd6d
|
||||
```
|
||||
|
||||
**Stopper tous les containers:**
|
||||
|
||||
```bash
|
||||
❯ docker container stop $(docker container ls -aq)
|
||||
$ docker container stop $(docker container ls -aq)
|
||||
```
|
||||
|
||||
|
||||
**Stopper tous les containers associés à une image:**
|
||||
|
||||
```bash
|
||||
❯ docker ps -q --filter ancestor=IMAGE_NAME | xargs docker stop
|
||||
$ docker ps -q --filter ancestor=IMAGE_NAME | xargs docker stop
|
||||
```
|
||||
|
||||
|
||||
**Supprimer un container:**
|
||||
|
||||
```bash
|
||||
❯ docker container rm d2b481b91f10 9763d849e8b1
|
||||
$ docker container rm d2b481b91f10 9763d849e8b1
|
||||
d2b481b91f10
|
||||
9763d849e8b1
|
||||
```
|
||||
|
||||
```bash
|
||||
❯ sudo docker rm b5576f445729
|
||||
$ sudo docker rm b5576f445729
|
||||
Error response from daemon: You cannot remove a running container b5576f44572913f1154e429b2bc84f84e696f4006adbaf8c2fb44f9dc1ff013a. Stop the container before attempting removal or force remove
|
||||
|
||||
$ sudo docker rm b5576f445729 --force
|
||||
@@ -214,21 +229,37 @@ b5576f445729
|
||||
**Supprimer tous les containers:**
|
||||
|
||||
```bash
|
||||
❯ docker container rm $(docker container ls -aq)
|
||||
$ docker container rm $(docker container ls -aq)
|
||||
```
|
||||
|
||||
**Exécuter une commande dans un container:**
|
||||
|
||||
```
|
||||
❯ sudo docker container ls --format 'table {{.ID}}\t{{.Names}}'
|
||||
```bash
|
||||
$ sudo docker container ls --format 'table {{.ID}}\t{{.Names}}'
|
||||
CONTAINER ID NAMES
|
||||
700a2cd00cba lychee
|
||||
❯ sudo docker container exec 700a2cd00cba hostname
|
||||
$ sudo docker container exec 700a2cd00cba hostname
|
||||
700a2cd00cba
|
||||
❯ sudo docker container exec 700a2cd00cba hostname -I
|
||||
$ sudo docker container exec 700a2cd00cba hostname -I
|
||||
172.18.0.3
|
||||
```
|
||||
|
||||
**Créer et démarrer un container:**
|
||||
|
||||
```bash
|
||||
$ docker container run
|
||||
```
|
||||
|
||||
```bash
|
||||
$ docker run
|
||||
```
|
||||
|
||||
**Renommer un container:**
|
||||
|
||||
```bash
|
||||
$ docker rename photoprism_photoprism_1 photoprism_1
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Images:
|
||||
@@ -236,7 +267,7 @@ CONTAINER ID NAMES
|
||||
**Liste des images:**
|
||||
|
||||
```bash
|
||||
❯ docker image ls
|
||||
$ docker image ls
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
oznu/homebridge latest 3fa073f20624 4 days ago 625MB
|
||||
hoobs/hoobs latest c35c2f7222f3 4 days ago 558MB
|
||||
@@ -251,7 +282,7 @@ v2tec/watchtower latest 3069a9fb302a 2 ye
|
||||
Changer le [format de la sortie](https://docs.docker.com/engine/reference/commandline/images/#format-the-output):
|
||||
|
||||
```
|
||||
❯ docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}"
|
||||
$ docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}"
|
||||
REPOSITORY TAG IMAGE ID CREATED AT SIZE
|
||||
oznu/homebridge latest 3fa073f20624 2020-11-06 07:05:24 +0100 CET 625MB
|
||||
hoobs/hoobs latest c35c2f7222f3 2020-11-05 15:17:26 +0100 CET 558MB
|
||||
@@ -272,19 +303,19 @@ Sur une connection ssh: `ssh foo@bar docker images --format "$(jq .imagesFormat
|
||||
**Supprimer une image:**
|
||||
|
||||
```bash
|
||||
❯ docker image rm 75835a67d134
|
||||
$ docker image rm 75835a67d134
|
||||
```
|
||||
|
||||
**Supprimer toutes les images non référencées par un container existant:**
|
||||
|
||||
```bash
|
||||
❯ docker image prune -a
|
||||
$ docker image prune -a
|
||||
```
|
||||
|
||||
Infos sur une image:
|
||||
|
||||
```bash
|
||||
❯ docker image inspect 79aeacedba12
|
||||
$ docker image inspect 79aeacedba12
|
||||
[
|
||||
{
|
||||
"Id": "sha256:79aeacedba12f180af279aa030c7a64a0b2a9dc428a1dc1c4c074caafa05426d",
|
||||
@@ -301,7 +332,7 @@ Infos sur une image:
|
||||
|
||||
# Date de création d'une image:
|
||||
|
||||
❯ docker image inspect 79aeacedba12 | grep 'Created'
|
||||
$ docker image inspect 79aeacedba12 | grep 'Created'
|
||||
"Created": "2020-10-24T08:06:20.266765865Z",
|
||||
|
||||
```
|
||||
@@ -313,7 +344,7 @@ Infos sur une image:
|
||||
**Liste des volumes:**
|
||||
|
||||
```bash
|
||||
❯ docker volume ls
|
||||
$ docker volume ls
|
||||
DRIVER VOLUME NAME
|
||||
local 4a0cb49ef186f5b6b920cb783e9c7a3d80065d13575dbe956a0875451490e009
|
||||
local 9d1fbf38c96c6474e159d512ff218c67ff7307c42f46cb01724358db854f3dd9
|
||||
@@ -324,15 +355,15 @@ local portainer_data
|
||||
|
||||
**Supprimer un volume:**
|
||||
|
||||
```
|
||||
❯ docker volume rm 4a0cb49ef186f5b6b920cb783e9c7a3d80065d13575dbe956a0875451490e009
|
||||
```bash
|
||||
$ docker volume rm 4a0cb49ef186f5b6b920cb783e9c7a3d80065d13575dbe956a0875451490e009
|
||||
4a0cb49ef186f5b6b920cb783e9c7a3d80065d13575dbe956a0875451490e009
|
||||
```
|
||||
|
||||
**Supprimer tous les volumes inutilisés:**
|
||||
|
||||
```
|
||||
❯ docker volume prune
|
||||
```bash
|
||||
$ docker volume prune
|
||||
WARNING! This will remove all local volumes not used by at least one container.
|
||||
Are you sure you want to continue? [y/N] y
|
||||
Total reclaimed space: 0B
|
||||
@@ -344,8 +375,8 @@ Total reclaimed space: 0B
|
||||
|
||||
**Liste des réseaux:**
|
||||
|
||||
```
|
||||
❯ docker network ls
|
||||
```bash
|
||||
$ docker network ls
|
||||
NETWORK ID NAME DRIVER SCOPE
|
||||
cb8db3bfdaa8 bridge bridge local
|
||||
5a1ec0a7d634 host host local
|
||||
@@ -356,14 +387,14 @@ a522745b92b7 pixapop_default bridge local
|
||||
|
||||
**Supprimer tous les réseaux inutilisés:**
|
||||
|
||||
```
|
||||
❯ docker network prune
|
||||
```bash
|
||||
$ docker network prune
|
||||
```
|
||||
|
||||
**Supprimer tous les réseaux crées il y a plus de 12h:**
|
||||
|
||||
```
|
||||
❯ docker network prune --filter "until=12h"
|
||||
```bash
|
||||
$ docker network prune --filter "until=12h"
|
||||
WARNING! This will remove all custom networks not used by at least one container.
|
||||
Are you sure you want to continue? [y/N] y
|
||||
```
|
||||
@@ -373,7 +404,7 @@ Are you sure you want to continue? [y/N] y
|
||||
## Stats:
|
||||
|
||||
```bash
|
||||
❯ docker stats
|
||||
$ docker stats
|
||||
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDSCONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
|
||||
18fba7e277be portainer 0.00% 11.86MiB / 1.941GiB 0.60% 773kB / 6.04MB 287kB / 3.53MB 12
|
||||
```
|
||||
@@ -383,7 +414,7 @@ CONTAINER ID NAME CPU % MEM USAGE / LIMIT
|
||||
## Prune:
|
||||
|
||||
```bash
|
||||
❯ sudo docker system prune
|
||||
$ sudo docker system prune
|
||||
Password:
|
||||
WARNING! This will remove:
|
||||
- all stopped containers
|
||||
@@ -513,11 +544,11 @@ b47b4299cc38 bizmodeller-mymediaforalexa-amd641 0.0.0.0:52050-52051->52
|
||||
|
||||
```bash
|
||||
~/Documents/docker master* ⇡
|
||||
❯ docker volume create portainer_data
|
||||
$ docker volume create portainer_data
|
||||
portainer_data
|
||||
|
||||
~/Documents/docker master* ⇡
|
||||
❯ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
|
||||
$ docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
|
||||
Unable to find image 'portainer/portainer-ce:latest' locally
|
||||
latest: Pulling from portainer/portainer-ce
|
||||
d1e017099d17: Already exists
|
||||
@@ -644,16 +675,16 @@ Entry | Description | Equivalent
|
||||
|
||||
|
||||
|
||||
```
|
||||
docker top
|
||||
```bash
|
||||
$ docker top
|
||||
|
||||
❯ docker service ls
|
||||
$ docker service ls
|
||||
Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
|
||||
|
||||
❯ docker node ls
|
||||
$ docker node ls
|
||||
Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
|
||||
|
||||
❯ docker config ls
|
||||
$ docker config ls
|
||||
Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
|
||||
|
||||
```
|
||||
|
||||
101
docs/Divers/joplin.md
Normal file
101
docs/Divers/joplin.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# Joplin
|
||||
|
||||
|
||||
|
||||
## Joplin server
|
||||
|
||||
#### Docker:
|
||||
|
||||
`docker-compose.yaml`
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:13.1
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /Users/bruno/Documents/docker/joplin-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- APP_PORT=22300
|
||||
- POSTGRES_PASSWORD=joplin
|
||||
- POSTGRES_USER=joplin
|
||||
- POSTGRES_DB=joplin
|
||||
app:
|
||||
image: joplin/server:latest
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "22300:22300"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- APP_BASE_URL=https://silverbook.local/joplin
|
||||
- DB_CLIENT=pg
|
||||
- POSTGRES_PASSWORD=joplin
|
||||
- POSTGRES_DATABASE=joplin
|
||||
- POSTGRES_USER=joplin
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_HOST=db
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Apache:
|
||||
|
||||
Activer les modules dans`httpd.conf`
|
||||
|
||||
```http
|
||||
LoadModule proxy_html_module lib/httpd/modules/mod_proxy_html.so
|
||||
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
|
||||
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
|
||||
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
|
||||
LoadModule vhost_alias_module lib/httpd/modules/mod_vhost_alias.so
|
||||
```
|
||||
|
||||
Editer le fichier`httpd-vhosts.conf`
|
||||
|
||||
```http
|
||||
<VirtualHost *:443>
|
||||
DocumentRoot "/Users/bruno/Sites"
|
||||
ServerName silverbook.local
|
||||
<Proxy *>
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Proxy>
|
||||
ProxyPass "/joplin" http://localhost:22300
|
||||
ProxyPassReverse "/joplin" http://localhost:22300
|
||||
ProxyPreserveHost On
|
||||
ProxyRequests off
|
||||
SSLEngine on
|
||||
SSLProxyEngine On
|
||||
SSLCertificateFile "/usr/local/etc/httpd/server.crt"
|
||||
SSLCertificateKeyFile "/usr/local/etc/httpd/server.key"
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
<u>Joplin server</u> sera accessible à https://silverbook.local/joplin
|
||||
|
||||
|
||||
|
||||
Pour rendre <u>Joplin server</u> disponible à https://joplin.silverbook.local, modifier le fichier`httpd-vhosts.conf`
|
||||
|
||||
```http
|
||||
<VirtualHost *:443>
|
||||
...
|
||||
ServerName joplin.silverbook.local
|
||||
ProxyPass "/" http://localhost:22300
|
||||
ProxyPassReverse "/" http://localhost:22300
|
||||
...
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
et le fichier `docker-compose.yaml`
|
||||
|
||||
```yaml
|
||||
- APP_BASE_URL=https://joplin.silverbook.local
|
||||
```
|
||||
|
||||
348
docs/Divers/wordpress.md
Normal file
348
docs/Divers/wordpress.md
Normal file
@@ -0,0 +1,348 @@
|
||||
# WordPress sur Debian / nginx
|
||||
|
||||
|
||||
|
||||
#### Installation nginx/php/mariadb
|
||||
|
||||
Ajouter le dépôt PPA pour PHP 7.4
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install apt-transport-https lsb-release ca-certificates
|
||||
$ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
||||
$ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" >> /etc/apt/sources.list.d/php.list
|
||||
apt-get update
|
||||
```
|
||||
|
||||
Installer nginx, mariadb, php7.4 et ses modules
|
||||
|
||||
```bash
|
||||
sudo apt-get install nginx mariadb-server mariadb-client unzip wget git -y
|
||||
|
||||
sudo apt-get install php7.4-fpm php7.4-cli
|
||||
sudo apt-get install php7.4-{bcmath,bz2,curl,imagick,intl,gd,mbstring,mcrypt,memcache,mysql,redis,xdebug,xml,zip}
|
||||
```
|
||||
|
||||
Démarrer nginx et mariadb
|
||||
|
||||
```bash
|
||||
sudo systemctl start nginx.service
|
||||
sudo systemctl enable nginx.service
|
||||
sudo systemctl start mariadb.service
|
||||
sudo systemctl enable mariadb.service
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### PHP
|
||||
|
||||
Voir les logs:
|
||||
|
||||
```bash
|
||||
sudo nano /etc/php/7.4/fpm/php.ini
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### mariadb
|
||||
|
||||
Sécuriser mariadb
|
||||
|
||||
```bash
|
||||
$ sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
Créer la base de donnée wordpress
|
||||
|
||||
```bash
|
||||
$ sudo mysql -u root -p
|
||||
```
|
||||
|
||||
```mysql
|
||||
# Supprimer une ancienne base:
|
||||
# DROP DATABASE wordpress;
|
||||
|
||||
CREATE DATABASE wordpress;
|
||||
GRANT ALL ON wordpress.* TO 'adm_wp'@'localhost' IDENTIFIED BY 'Kpm!65YU';
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Installation WordPress
|
||||
|
||||
Télécharger WordPress
|
||||
|
||||
```bash
|
||||
cd /var/www/html
|
||||
sudo wget https://wordpress.org/latest.tar.gz
|
||||
sudo tar -xzvf latest.tar.gz
|
||||
```
|
||||
|
||||
Corriger les autorisations
|
||||
|
||||
```bash
|
||||
#$ sudo chown -R $USER:$USER /var/www/html/wordpress/
|
||||
$ sudo chown -R www-data:www-data /var/www/html/wordpress/
|
||||
$ sudo chmod -R 755 /var/www/html/wordpress/
|
||||
$ find /var/www/html/wordpress/ -type d -exec chmod 755 {} \;
|
||||
$ find /var/www/html/wordpress/ -type f -exec chmod 644 {} \;
|
||||
```
|
||||
|
||||
Configurer WordPress
|
||||
|
||||
```bash
|
||||
$ curl -s https://api.wordpress.org/secret-key/1.1/salt/
|
||||
define('AUTH_KEY', 'nqx$&&2@.PlOv:R-@D5O@1J!fxBV).%}|4$E,<]3V6wK:>s;N*_qZgX1v%Clj.nY');
|
||||
define('SECURE_AUTH_KEY', 'k/iGx=P!Q,I=-f-_JhI-hNNlvL]036/W;h@,-a>l:DN#w}@.RdqehTDC>Da{$`v,');
|
||||
define('LOGGED_IN_KEY', 'e!2g+-jFty5(}j>Oxtdt1+krNu&[TIrP}|)G&0jt%Z+q#+?TTP1mM+MVTH-zD5#w');
|
||||
define('NONCE_KEY', '9 @VoZ.-OVd!wy5mT$?&-$RHIX%xImw]M2jKK+vUet+pImeiNYGx~Jm>shu}p0B7');
|
||||
define('AUTH_SALT', ':pyo`{Fk*YNww+V-]-8Oy|}daBoedBnlO?AWKw;Gj+X9n|qm#Ndk~?R-d`N!I21v');
|
||||
define('SECURE_AUTH_SALT', ' +dgn@u/e#rZ.4(t}#.3d<)Y2>d)3c)t$j>_C^}sEwSK&VZ+]C=b2/.gzyA#.$Kz');
|
||||
define('LOGGED_IN_SALT', 'q1},|Tm|kBb!?H*T`PkGt;}>JF/8fHRRzGaVPB[Et!#gjbm4rjG-}-J`jlzZ<I|E');
|
||||
define('NONCE_SALT', 'I}Sv1zA>I*rW/[3?d[@/jg$=95NqWDdBMf{N>o: G!R fp10Ynyoq-^Hw>-7|LEK');
|
||||
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cp wp-config-sample.php wp-config.php
|
||||
$ nano wp-config.php
|
||||
```
|
||||
|
||||
```php
|
||||
### Modifier les réglages de base de donnée ###
|
||||
|
||||
// ** MySQL settings - You can get this info from your web host ** //
|
||||
/** The name of the database for WordPress */
|
||||
define( 'DB_NAME', 'wordpress' );
|
||||
|
||||
/** MySQL database username */
|
||||
define( 'DB_USER', 'adm_wp' );
|
||||
|
||||
/** MySQL database password */
|
||||
define( 'DB_PASSWORD', 'Kpm!65YU' );
|
||||
|
||||
/** MySQL hostname */
|
||||
define( 'DB_HOST', 'localhost' );
|
||||
|
||||
/** Database Charset to use in creating database tables. */
|
||||
define( 'DB_CHARSET', 'utf8' );
|
||||
|
||||
/** The Database Collate type. Don't change this if in doubt. */
|
||||
define( 'DB_COLLATE', '' );
|
||||
|
||||
|
||||
### Remplacer la section Authentication Unique Keys and Salts. ###
|
||||
|
||||
define('AUTH_KEY', 'nqx$&&2@.PlOv:R-@D5O@1J!fxBV).%}|4$E,<]3V6wK:>s;N*_qZgX1v%Clj.nY');
|
||||
define('SECURE_AUTH_KEY', 'k/iGx=P!Q,I=-f-_JhI-hNNlvL]036/W;h@,-a>l:DN#w}@.RdqehTDC>Da{$`v,');
|
||||
define('LOGGED_IN_KEY', 'e!2g+-jFty5(}j>Oxtdt1+krNu&[TIrP}|)G&0jt%Z+q#+?TTP1mM+MVTH-zD5#w');
|
||||
define('NONCE_KEY', '9 @VoZ.-OVd!wy5mT$?&-$RHIX%xImw]M2jKK+vUet+pImeiNYGx~Jm>shu}p0B7');
|
||||
define('AUTH_SALT', ':pyo`{Fk*YNww+V-]-8Oy|}daBoedBnlO?AWKw;Gj+X9n|qm#Ndk~?R-d`N!I21v');
|
||||
define('SECURE_AUTH_SALT', ' +dgn@u/e#rZ.4(t}#.3d<)Y2>d)3c)t$j>_C^}sEwSK&VZ+]C=b2/.gzyA#.$Kz');
|
||||
define('LOGGED_IN_SALT', 'q1},|Tm|kBb!?H*T`PkGt;}>JF/8fHRRzGaVPB[Et!#gjbm4rjG-}-J`jlzZ<I|E');
|
||||
define('NONCE_SALT', 'I}Sv1zA>I*rW/[3?d[@/jg$=95NqWDdBMf{N>o: G!R fp10Ynyoq-^Hw>-7|LEK');
|
||||
|
||||
|
||||
### Activer les mises à jour ###
|
||||
|
||||
define( 'FS_METHOD', 'direct' );
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Configurer nginx
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ sudo nano /etc/nginx/sites-available/test.conf
|
||||
```
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
#return 302 https://$server_name$request_uri;
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html index.htm index.nginx-debian.html;
|
||||
|
||||
location / {
|
||||
if ($request_uri ~ ^/(.*)\.html$) {
|
||||
return 302 /$1;
|
||||
}
|
||||
}
|
||||
|
||||
location /wordpress {
|
||||
try_files $uri $uri/ /wordpress/index.php?$args;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
#include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo ln -s /etc/nginx/sites-available/test.conf /etc/nginx/sites-enabled/default
|
||||
```
|
||||
|
||||
Vérifier la configuration et redémarrer PHP/nginx.
|
||||
|
||||
```bash
|
||||
$ sudo /usr/sbin/nginx -t
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
|
||||
$ sudo systemctl restart nginx php7.4-fpm
|
||||
```
|
||||
|
||||
Aller à http://localhost/wordpress/ pour terminer l'installation de WordPress.
|
||||
|
||||
|
||||
|
||||
#### Échec d’installation : Impossible de créer le dossier » dans WordPress
|
||||
|
||||
Aller dans Outils -> Santé du site
|
||||
|
||||
```bash
|
||||
$ sudo chown -R www-data:www-data wordpress/
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### SSL
|
||||
|
||||
Générer clé et certificat auto-signés:
|
||||
|
||||
```bash
|
||||
$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
|
||||
```
|
||||
|
||||
Créer un groupe Diffie-Hellman:
|
||||
|
||||
```bash
|
||||
$ sudo openssl dhparam -out /etc/nginx/dhparam.pem 4096
|
||||
```
|
||||
|
||||
Créer un snippet contenant les fichiers des clés et certificats:
|
||||
|
||||
```bash
|
||||
$ sudo nano /etc/nginx/snippets/self-signed.conf
|
||||
```
|
||||
|
||||
```nginx
|
||||
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
|
||||
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
||||
```
|
||||
|
||||
Créer un snippet contenant les réglages SSL:
|
||||
|
||||
```bash
|
||||
$ sudo nano /etc/nginx/snippets/ssl-params.conf
|
||||
```
|
||||
|
||||
```nginx
|
||||
ssl_protocols TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_dhparam /etc/nginx/dhparam.pem;
|
||||
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
|
||||
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
|
||||
ssl_session_timeout 10m;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off; # Requires nginx >= 1.5.9
|
||||
ssl_stapling on; # Requires nginx >= 1.3.7
|
||||
ssl_stapling_verify on; # Requires nginx => 1.3.7
|
||||
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
# Disable strict transport security for now. You can uncomment the following
|
||||
# line if you understand the implications.
|
||||
# add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
|
||||
add_header X-Frame-Options DENY;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
```
|
||||
|
||||
Modifier la config nginx pour gérer SSL:
|
||||
|
||||
```bash
|
||||
$ sudo cp /etc/nginx/sites-available/test.conf /etc/nginx/sites-available/test.conf.bak
|
||||
|
||||
$ sudo cp /etc/nginx/sites-available/test.conf
|
||||
```
|
||||
|
||||
```nginx
|
||||
server {
|
||||
#listen 80;
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
include snippets/self-signed.conf;
|
||||
include snippets/ssl-params.conf;
|
||||
|
||||
server_name localhost;
|
||||
#return 302 https://$server_name$request_uri;
|
||||
|
||||
root /var/www/html;
|
||||
index index.php index.html index.htm index.nginx-debian.html;
|
||||
|
||||
location / {
|
||||
if ($request_uri ~ ^/(.*)\.html$) {
|
||||
return 302 /$1;
|
||||
}
|
||||
}
|
||||
|
||||
location /wordpress {
|
||||
try_files $uri $uri/ /wordpress/index.php?$args;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
#include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name localhost;
|
||||
|
||||
# redirection provisoire
|
||||
#return 302 https://$server_name$request_uri;
|
||||
|
||||
# redirection permanente
|
||||
return 301 https://$server_name$request_uri;
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
https://slacker.ro/2019/07/15/how-to-create-a-self-signed-ssl-certificate-for-nginx-on-debian-10/
|
||||
|
||||
|
||||
|
||||
```
|
||||
bruno / MHxhNZ2Ax*@@cvy6XM
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ snowleopard macOS
|
||||
|
||||
|
||||
|
||||
### Colonnes:
|
||||
|
||||
Afficher la 1ere colonne d'un fichier:
|
||||
|
||||
```bash
|
||||
@@ -186,6 +188,28 @@ snowleopard
|
||||
|
||||
|
||||
|
||||
### Lignes:
|
||||
|
||||
Afficher la 3eme ligne:
|
||||
|
||||
```bash
|
||||
$ awk 'NR==3' test.txt
|
||||
mint
|
||||
```
|
||||
|
||||
Afficher les ligne 2 à 4:
|
||||
|
||||
```bash
|
||||
$ awk 'NR>=2 && NR<=4' test.txt
|
||||
ubuntu
|
||||
mint
|
||||
debian
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Divers:
|
||||
|
||||
Passer un argument à awk:
|
||||
|
||||
```bash
|
||||
|
||||
63
docs/Linux/grep-options-fr.md
Normal file
63
docs/Linux/grep-options-fr.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# grep --options
|
||||
|
||||
|
||||
|
||||
| **grep (BSD)** | **grep (GNU)** |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| **-A** num, -**-after-context**=num<br />Affiche les lignes numériques du contexte de fin après chaque correspondance. Voir aussi les options **-B** et**-C**. | **-A** NUM, **--after-context**=NUM<br/>Affiche les lignes NUM du contexte de fin après avoir fait correspondre les lignes. Place une ligne contenant un séparateur de groupe (--) entre des groupes contigus de correspondances. Avec l'option **-o** ou **--only-matching**, cela n'a aucun effet et un avertissement est donné. |
|
||||
| **-a**, **--text**<br />Traitez tous les fichiers comme du texte ASCII. | **-a**, **--text**<br/>Traiter un fichier binaire comme s'il s'agissait de texte ; c'est équivalent à l'option **--binary-files**=text. |
|
||||
| **-B** num, **--before-context**=num<br />Affiche le nombre de lignes de contexte principal avant chaque correspondance. Voir aussi les options **-A** et **-C**. | **-B** NUM, **--before-context**=NUM<br/>Affiche les lignes NUM du contexte principal avant de faire correspondre les lignes. Place une ligne contenant un séparateur de groupe (--) entre des groupes contigus de correspondances. Avec l'option **-o** ou **--only-matching**, cela n'a aucun effet et un avertissement est donné. |
|
||||
| **-b**, **--byte-offset**<br />Le décalage en octets d'un motif correspondant est affiché devant la ligne correspondante respective. | **-b**, **--byte-offset**<br/>Affche le décalage d'octets basé sur 0 dans le fichier d'entrée avant chaque ligne de sortie. Si **-o** (**--only-matching**) est spécifié, imprimez le décalage de la pièce correspondante elle-même. |
|
||||
| **-C**[num, **--context**=num]<br />Imprimez des lignes numériques de contexte de début et de fin entourant chaque correspondance. La valeur par défaut est 2 et équivaut à **-A** 2 **-B** 2. | Affiche les lignes NUM du contexte de sortie. Place une ligne contenant un séparateur de groupe (--) entre des groupes contigus de correspondances.<br/>Avec l'option **-o** ou **--only-matching**, cela n'a aucun effet et un avertissement est donné. |
|
||||
| **-c**, **--count**<br />Seul un nombre de lignes sélectionnées est écrit sur la sortie standard. | **-c**, **--count**<br/>Supprimez la sortie normale ; imprimez plutôt un nombre de lignes correspondantes pour chaque fichier d'entrée. Avec l'option **-v**, **--invert-match** (voir ci-dessous), comptez les lignes non correspondantes. |
|
||||
| **--colour**=[when, **--color**=[when]]<br />Marquez le texte correspondant avec l'expression stockée dans la variable d'environnement GREP_COLOR. Les valeurs possibles de when peuvent être *never*, *always*, ou *auto*. | **--color**[=WHEN], **--colour**[=WHEN]<br/>Entourez les chaînes (non vides) correspondantes, les lignes de contexte, les noms de fichiers, les numéros de ligne, les décalages d'octets et les séparateurs correspondants (pour les champs et les groupes de lignes de contexte) de séquences d'échappement pour les a-cher en couleur sur le terminal. Les couleurs sont définies par la variable d'environnement GREP_COLORS. La variable d'environnement obsolète GREP_COLOR est toujours prise en charge, mais son paramètre n'a pas la priorité. WHEN est *never*, *always*, ou *auto*. |
|
||||
| **-D** action, **--devices**=action<br />Spécifiez l'action demandée pour les périphériques, les FIFO et les sockets. L'action par défaut est *'read',* ce qui signifie qu'ils sont lus comme s'il s'agissait de fichiers normaux. Si l'action est définie sur *'skip'*, les périphériques seront ignorés silencieusement. | **-D** ACTION, **--devices**=ACTION<br/>Si un fichier d'entrée est un périphérique, une FIFO ou un socket, utilisez ACTION pour le traiter. Par défaut, ACTION est *read*, ce qui signifie que les périphériques sont lus comme s'il s'agissait de fichiers ordinaires. Si ACTION est *skip*, les périphériques sont ignorés en silence. |
|
||||
| **-d** action, **--directories**=action<br />Spécifiez l'action demandée pour les répertoires. Il est *"read"* par défaut, ce qui signifie que les répertoires sont lus de la même manière que les fichiers normaux. Les autres valeurs possibles sont *'skip'* pour ignorer silencieusement les répertoires, et *'récurse'* pour les lire récursivement, ce qui a le même effet que l'option **-R** et **-r**. | **-d** ACTION, **--directories**=ACTION<br/>Si un fichier d'entrée est un répertoire, utilisez ACTION pour le traiter. Par défaut, ACTION est *read*, c'est-à-dire lire les répertoires comme s'il s'agissait de fichiers ordinaires. Si ACTION est *skip*, ignorez silencieusement les répertoires. Si ACTION est *récurse*, lisez tous les fichiers sous chaque répertoire, récursivement, en suivant des liens symboliques uniquement s'ils se trouvent sur la ligne de commande. C'est l'équivalent de l'option **-r**. |
|
||||
| **-E**, **--extended-regexp**<br />Interpréter le motif comme une expression régulière étendue | **-E**, **--extended-regexp**<br/>Interpréter les MODÈLES en tant qu'expressions régulières étendues (ERE, voir ci- dessous). |
|
||||
| **-e** pattern, **--regexp**=pattern<br />Spécifiez un motif utilisé lors de la recherche de l'entrée : une ligne d'entrée est sélectionnée si elle correspond à l'un des motifs spécifiés. Cette option est plus utile lorsque plusieurs options **-e** sont utilisées pour spécifier plusieurs motifs, ou lorsqu'un motif commence par un tiret (-'). | **-e** PATTERNS, **--regexp**=PATTERNS<br/>Utilisez des PATTERNS comme motifs. Si cette option est utilisée plusieurs fois ou est combinée avec l'option **-f** (**--file**), recherchez tous les modèles donnés. Cette option peut être utilisée pour protéger un motif commençant par "-". |
|
||||
| **--exclude**<br />Si spécifié, il exclut les fichiers correspondant au modèle de nom de fichier donné de la recherche. Notez que les modèles **--exclude** ont priorité sur les modèles **--include**, et si aucun motif **--include n'est** spécifié, tous les fichiers qui ne sont pas exclus sont recherchés. Les motifs correspondent au chemin d'accès complet spécifié, pas seulement au composant nom de fichier. | **--exclude**=GLOB<br/>Ignorez tout fichier en ligne de commande avec un suffixe de nom qui correspond au motif GLOB, en utilisant la correspondance de caractères génériques ; un suffixe de nom est soit le nom entier, soit une partie arrière qui commence par un caractère non-slash immédiatement après une barre oblique (/) dans le nom. Lors de la recherche récursive, sautez tout sous-fichier dont le nom de base correspond à GLOB ; le nom de base est la partie après la dernière barre oblique. Un motif peut utiliser *, ? et [...] comme caractères génériques, et \ pour citer littéralement un caractère générique ou antislash. |
|
||||
| | **--exclude-from**=FILE<br/>Skip files whose base name matches any of the file-name globs read from FILE (using wildcard matching as described under --exclude).<br />Ignorer les fichiers dont le nom de base correspond à l'un des globes de nom de fichier lus à partir de FILE (en utilisant la correspondance de caractères génériques comme décrit sous --exclude). |
|
||||
| **--exclude-dir**<br />Si -R est spécifié, il exclut les répertoires correspondants au modèle de nom de fichier donné de la recherche. Notez que les modèles **--exclude- dir** ont priorité sur les modèles **--include-dir**, et si aucun modèle **--include-dir n'est** spécifié, tous les répertoires qui ne sont pas exclus sont recherchés. | **--exclude-dir**=GLOB<br/>Ignorez tout répertoire en ligne de commande avec un suffixe de nom qui correspond au motif GLOB. Lors de la recherche récursive, sautez tout sous-répertoire dont le nom de base correspond à GLOB. Ignorez toute barre oblique redondante dans GLOB. |
|
||||
| **-F**, **--fixed-strings**<br />Interpréter le motif comme un ensemble de chaînes fixes | **I-F**, **--fixed-strings**<br/>Interprétez les PATTERNS comme des chaînes fixes, pas comme des expressions régulières. |
|
||||
| **-f** file, **--file**=file<br />Lisez un ou plusieurs modèles séparés de saut de ligne du fichier. Les lignes de motif vides correspondent à chaque ligne d'entrée. Les sauts de ligne ne sont pas considérés comme faisant partie d'un modèle. Si le fichier est vide, rien n'est trouvé. | **-f** FILE, **--file**=FILE<br/>Obtenez des modèles à partir de FILE, un par ligne. Si cette option est utilisée plusieurs fois ou est combinée avec l'option **-e** (**--regexp**), recherchez tous les modèles donnés. Le fichier vide ne contient aucun motif et ne correspond donc à rien. |
|
||||
| **-G**, **--basic-regexp**<br />Interpréter le motif comme une expression régulière de base. | **-G**, **--basic-regexp**<br/>Interpréter les MODÈLES comme des expressions régulières de base (BRE, voir ci- dessous). C'est la valeur par défaut. |
|
||||
| **-H**<br />Affchez toujours les en-têtes de nom de fichier avec des lignes de sortie. | **-H**, **--with-filename**<br/>Affchez le nom du fichier pour chaque correspondance. C'est la valeur par défaut lorsqu'il y a plus d'un fichier à rechercher. |
|
||||
| **-h**, **--no-filename**<br/>N'affchez jamais d'en-têtes de nom de fichier (c'est-à-dire des noms de fichier) avec des lignes de sortie. | **-h**, **--no-filename**<br/>Supprimez le préfixe des noms de fichiers sur la sortie. C'est la valeur par défaut lorsqu'il n'y a qu'un seul fichier (ou une seule entrée standard) à rechercher. |
|
||||
| **--help**<br />Imprimez un bref message d'aide. | **--help**<br />Affchez un message d'utilisation et quittez. |
|
||||
| **-I**<br />Ignorez les fichiers binaires. Cette option est équivalente à l'option **--binary-file=without-match**. | **-I**<br />Traiter un fichier binaire comme s'il ne contenait pas de données correspondantes ; c'est équivalent à l'option **--binary-files=without-match**. |
|
||||
| **--include**<br />Si spécifié, seuls les fichiers correspondant au modèle de nom de fichier donné sont recherchés. Notez que les modèles **--exclude** ont priorité sur **-- include** patterns. Les motifs correspondent au chemin d'accès complet spécifié, pas seulement au composant nom de fichier. | **--include**=GLOB<br/>Recherchez uniquement les fichiers dont le nom de base correspond à GLOB (en utilisant la correspondance de caractères génériques comme décrit sous **-- exclude**).<br/> Si des options contradictoires **--include** et **--exclude** sont données, la dernière correspondante gagne.<br/> Si aucune option **--include** ou **--exclude ne** correspond, un fichier est inclus à moins que la première de ces options ne soit **--include**. |
|
||||
| **--include-dir**<br/>Si -R est spécifié, seuls les répertoires correspondant au modèle de nom de fichier donné sont recherchés. Notez que les modèles **--exclude- dir** ont priorité sur les modèles **--include-dir**. | |
|
||||
| **-J**, **--bz2decompress**<br/>Décompressez le fichier compressé bzip2(1) avant de rechercher le texte. | |
|
||||
| **-L**, **--files-without-match**<br/>Seuls les noms des fichiers ne contenant pas de lignes sélectionnées sont écrits sur la sortie standard. Les chemins d'accès sont répertoriés une fois par fichier recherché. Si l'entrée standard est recherchée, la chaîne "(entrée standard)'' est écrite. | **-L**, **--files-without-match**<br/>Supprimez la sortie normale ; imprimez plutôt le nom de chaque fichier d'entrée à partir duquel aucune sortie n'aurait normalement été imprimée. Le balayage s'arrêtera lors de la première correspondance. |
|
||||
| **-l**, **--files-with-matches**<br/>Seuls les noms des fichiers contenant des lignes sélectionnées sont écrits en sortie standard. grep ne recherchera un fichier que jusqu'à ce qu'une correspondance ait été trouvée, ce qui rend les recherches potentiellement moins coûteuses. Les chemins d'accès sont répertoriés une fois par fichier recherché. Si l'entrée standard est recherchée, la chaîne "(entrée standard)'' est écrite. | **-l**, **--files-with-matches**<br/>Supprimez la sortie normale ; imprimez plutôt le nom de chaque fichier d'entrée à partir duquel la sortie aurait normalement été imprimée. Le balayage s'arrêtera lors de la première correspondance. |
|
||||
| **--mmap**<br />Utilisez mmap(2) au lieu de read(2) pour lire l'entrée, ce qui peut entraîner de meilleures performances dans certaines circonstances, mais peut entraîner un comportement indéfini. | |
|
||||
| **-m** num, **--max-count**=num<br/>Arrêtez de lire le fichier après *num* correspondances. | **-m** NUM, **--max-count**=NUM<br/>Arrêtez de lire un fichier après NUM lignes correspondantes . Si l'entrée est une entrée standard d'un fichier régulier et que NUM lignes de correspondance sont sorties, grep s'assure que l'entrée standard est positionnée juste après la dernière ligne correspondante avant de quitter, indépendamment de la présence de lignes de contexte. Cela permet à un processus d'appel de reprendre une recherche. <br />Lorsque grep s'arrête après NUM lignes de correspondance, il affiche toutes les lignes de contexte.<br/> Lorsque l'option **-c** ou **--count** est également utilisée, grep n'affiche pas un compte supérieur à NUM.<br/> Lorsque l'option **-v** ou **--invert-match** est également utilisée, grep s'arrête après avoir affiché NUM lignes non correspondantes. |
|
||||
| **-n**, **--line-number**<br/>Chaque ligne de sortie est précédée de son numéro de ligne relatif dans le fichier, à partir de la ligne 1. Le compteur de numéros de ligne est réinitialisé pour chaque fichier traité. Cette option est ignorée si **-c**, **-L**, **-l** ou **-q** est spécifié. | **-n**, **--line-number**<br/>Préfixez chaque ligne de sortie avec le numéro de ligne basé sur 1 dans son fichier d'entrée. |
|
||||
| **--null**<br />Affiche un octet zéro après le nom du fichier. | **-Z**, **--null**<br/>Affiche un octet zéro (le caractère ASCII NUL) au lieu du caractère qui suit normalement un nom de fichier. Par exemple, grep -lZ affiche un octet zéro après chaque nom de fichier au lieu du saut de ligne habituel. Cette option rend la sortie sans ambiguïté, même en présence de noms de fichiers contenant des caractères inhabituels comme les sauts de ligne. Cette option peut être utilisée avec des commandes comme find -print0, perl -0, sort -z et xargs -0 pour traiter les noms de fichiers arbitraires, même ceux qui contiennent des caractères de saut de ligne. |
|
||||
| **-O**<br />Si **-R** est spécifié, suivez les liens symboliques uniquement s'ils ont été explicitement répertoriés sur la ligne de commande. La valeur par défaut est de ne pas suivre les liens symboliques. | |
|
||||
| **-o**, **--only-matching**<br />Imprime uniquement la partie correspondante des lignes. | **-o**, **--only-matching**<br />Imprimez uniquement les parties correspondantes (non vides) d'une ligne correspondante, chacune de ces parties sur une ligne de sortie distincte. |
|
||||
| **-p**<br />Si **-R** est spécifié, aucun lien symbolique n'est suivi. C'est la valeur par défaut. | |
|
||||
| **-q**, **--quiet**, **--silent**<br/>Mode silencieux : supprimez la sortie normale. grep ne recherchera un fichier que jusqu'à ce qu'une correspondance ait été trouvée, ce qui rend les recherches potentiellement moins coûteuses. | **-q**, **--quiet**, **--silent**<br/>Silence ; n'écrivez rien sur la sortie standard. Quittez immédiatement avec un statut zéro si une correspondance est trouvée, même si une erreur a été détectée. Voir également l'option **-s** ou **--no-messages**. |
|
||||
| **-R**, **-r**, **--recursive**<br/>Recherchez récursivement les sous-répertoires répertoriés. | **-r**, **--recursive**<br/>Read all files under each directory, recursively, following symbolic links only if they are on the command line. Note that if no file operand is given, grep searches the working directory. This is equivalent to the **-d** recurse option.<br />Lisez tous les fichiers sous chaque répertoire, récursivement, en suivant des liens symboliques uniquement s'ils sont sur la ligne de commande. Notez que si aucun opérande de fichier n'est donné, grep recherche dans le répertoire de travail. C'est l'équivalent de l'option récurse **-d** . |
|
||||
| | **-R**, **--dereference-recursive**<br/>Lisez tous les fichiers sous chaque répertoire, récursivement. Suivez tous les liens symboliques, contrairement à **-r**. |
|
||||
| **-S**<br />Si **-R** est spécifié, tous les liens symboliques sont suivis. La valeur par défaut est de ne pas suivre les liens symboliques. | |
|
||||
| **-s**, **--no-messages**<br/>Mode silencieux. Les fichiers inexistants et illisibles sont ignorés (c'est-à-dire que leurs messages d'erreur sont supprimés). | **-s**, **--no-messages**<br/>Supprimez les messages d'erreur concernant les fichiers inexistants ou illisibles. |
|
||||
| **-U**, **--binary**<br/>Recherchez des fichiers binaires, mais n'essayez pas de les imprimer. | **-U**, **--binary**<br/>Traitez le(s) fichier(s) comme binaire(s). Par défaut, sous MS-DOS et MS-Windows, grep devine si un fichier est texte ou binaire comme décrit pour l'option **--binary-files**. Si grep décide que le fichier est un fichier texte, il supprime les caractères CR du contenu du fichier d'origine (pour que les expressions régulières avec ^ et $ fonctionnent correctement).<br/> Spécifier **-U** annule cette conjecture, ce qui fait que tous les fichiers sont lus et transmis mot pour mot au mécanisme de correspondance ; si le fichier est un fichier texte avec des paires CR/LF à la fin de chaque ligne, cela entraînera l'échec de certaines expressions régulières. Cette option n'a aucun effet sur les plates- formes autres que MS-DOS et MS-Windows. |
|
||||
| **-V**, **--version**<br/>Afficher les informations de version et quitter. | **-V**, **--version**<br/> Affiche le numéro de version de grep et quitte. |
|
||||
| **-v**, **--invert-match**<br/>Les lignes sélectionnées sont celles qui ne correspondent à aucun des motifs spécifiés. | **-v**, **--invert-match**<br/>Inverser le sens de correspondance, pour sélectionner des lignes non correspondantes. |
|
||||
| **-w**, **--word-regexp**<br/>The expression is searched for as a word (as if surrounded by `[[:<:]]` and `[[:>:]]`; voir re_format(7)). | **-w**, **--word-regexp**<br/>Sélectionnez uniquement les lignes contenant des correspondances qui forment des mots entiers. Le test est que la sous-chaîne correspondante doit être soit au début de la ligne, soit précédée d'un caractère constitutif non-mot. De même, il doit être soit à la fin de la ligne, soit suivi d'un caractère constitutif non-mot. Les caractères constitutifs du mot sont les lettres, les chiffres et le soulignement. Cette option n'a aucun effet si **-x** est également spécifié. |
|
||||
| **-x**, **--line-regexp**<br/>Seules les lignes d'entrée sélectionnées par rapport à une chaîne fixe entière ou à une expression régulière sont considérées comme des lignes correspondantes. | **-x**, **--line-regexp**<br/>Sélectionnez uniquement les correspondances qui correspondent exactement à l'ensemble de la ligne. Pour un motif d'expression régulière, c'est comme mettre entre parenthèses le motif puis l'entourer de ^ et $.<br /> |
|
||||
| **-y**<br />Équivalent à **-i**. Obsolète. | **-y**<br />Synonyme obsolète de **-i.** |
|
||||
| **-Z**, **-z**, **--decompress**<br/>Forcer grep à se comporter comme zgrep. | |
|
||||
| | **-z**, **--null-data**<br/>Traitez les données d'entrée et de sortie comme des séquences de lignes, chacune terminée par un octet zéro (le caractère ASCII NUL) au lieu d'un saut de ligne. Comme l'option **-Z** ou -**-null**, cette option peut être utilisée avec des commandes comme sort **-z** pour traiter des noms de fichiers arbitraires. |
|
||||
| **--binary-files**=value<br/>Contrôle la recherche et l'impression de fichiers binaires. Les options sont *binary*, la valeur par défaut : rechercher des fichiers binaires mais ne par les imprimer ; *without-match* : ne recherchez pas de fichiers binaires ; et *text* : traitez tous les fichiers comme du texte. | **--binary-files**=TYPE<br/>If a file's data or metadata indicate that the file contains binary data, assume that the file is of type TYPE. Non-text bytes indicate binary data; these are either output bytes that are improperly encoded for the current locale, or null input bytes when the **-z** option is not given.<br/><br/>By default, TYPE is *binary*, and grep suppresses output after null input binary data is discovered, and suppresses output lines that contain improperly encoded data. When some output is suppressed, grep follows any output with a one-line message saying that a binary file matches.<br/><br/>If TYPE is *without-match*, when grep discovers null input binary data it assumes that the rest of the file does not match; this is equivalent to the -I option.<br/><br/>If TYPE is *text*, grep processes a binary file as if it were text; this is equivalent to the **-a** option.<br/><br/>When type is *binary*, grep may treat non-text bytes as line terminators even without the **-z** option. This means choosing binary versus text can affect whether a pattern matches a file. For example, when type is *binary* the pattern q$ might match q immediately followed by a null byte, even though this is not matched when type is *text*. Conversely, when type is *binary* the pattern . (period) might not match a null byte.<br/><br/><u>Warning:</u> The **-a** option might output binary garbage, which can have nasty side effects if the output is a terminal and if the terminal driver interprets some of it as commands. On the other hand, when reading files whose text encodings are unknown, it can be helpful to use **-a** or to set **LC_ALL='C'** in the environment, in order to find more matches even if the matches are unsafe for direct display. |
|
||||
| **--binary-files**=value<br/>Contrôle la recherche et l'impression de fichiers binaires. Les options sont *binary*, la valeur par défaut : rechercher des fichiers binaires mais ne par les imprimer ; *without-match* : ne recherchez pas de fichiers binaires ; et *text* : traitez tous les fichiers comme du texte. | Si les données ou métadonnées d'un fichier indiquent que le fichier contient des données binaires, considère que le fichier est de type TYPE. Les octets non textuels indiquent des données binaires ; il s'agit soit d'octets de sortie mal encodés pour la locale actuelle, soit d'octets d'entrée NULL lorsque l'option **-z** n'est pas donnée.<br /><br />Par défaut, TYPE est *binar*y, et grep supprime la sortie après la découverte de données binaires d'entrée nulles, et supprime les lignes de sortie qui contiennent des données mal encodées. Lorsqu'une sortie est supprimée, grep suit n'importe quelle sortie avec un message d'une ligne indiquant qu'un fichier binaire correspond.<br />Si TYPE est *without-match*, lorsque grep découvre des données binaires d'entrée nulles, il suppose que le reste du fichier ne correspond pas ; c'est équivalent à l'option **-I**.<br />Si TYPE est *text*, grep traite un fichier binaire comme s'il s'agissait de texte ; c'est l'équivalent de l'option **-a**.<br />Lorsque type est *binary*, grep peut traiter les octets non textuels comme des terminaisons de ligne, même sans l'option **-z**. Cela signifie que le choix du binaire par rapport au texte peut influer sur la correspondance d'un modèle avec un fichier. Par exemple, lorsque type est *binary*, le motif q$ peut correspondre à q immédiatement suivi d'un octet nul, même si cela n'est pas égalé lorsque type is *text*. Inversement, lorsque type est *binary*, le motif . (point) peut ne pas correspondre à un octet nul.<br /><u>Avertissement :</u> L'option **-a** peut a-cher des ordures binaires, qui peuvent avoir des effets secondaires désagréables si la sortie est un terminal et si le pilote de terminal en interprète une partie comme des commandes. D'autre part, lors de la lecture de fichiers dont les encodages de texte sont inconnus, il peut être utile d'utiliser **-a** ou de définir **LC_ALL='C'** dans l'environnement, afin de trouver plus de correspondances même si les correspondances ne sont pas sûres pour l'affichage direct. |
|
||||
| **--context**[=num]<br/>Imprimez les lignes numériques du contexte de début et de fin. La valeur par défaut est 2. | |
|
||||
| **--line-buffered**<br/>Force la sortie à mettre en mémoire tampon par ligne. Par défaut, la sortie est mise en mémoire tampon en ligne lorsque la sortie standard est un terminal et le bloc est mis en mémoire tampon dans le cas contraire. | **--line-buffered**<br/>Utilisez la mise en mémoire tampon de ligne sur la sortie. Cela peut entraîner une pénalité de performance. |
|
||||
| | **-i**, **--ignore-case**<br/>Ignorez les distinctions de casse dans les modèles et les données d'entrée, de sorte que les caractères qui ne diffèrent que dans la casse correspondent les uns aux autres. |
|
||||
| | **--no-ignore-case**<br/>N'ignorez pas les distinctions de cas dans les modèles et les données d'entrée. C'est la valeur par défaut. Cette option est utile pour passer aux scripts shell qui utilisent déjà **-i**, pour annuler ses effets car les deux options se remplacent. |
|
||||
| | **--label=LABEL**<br />Afficher l'entrée provenant réellement de l'entrée standard comme l'entrée provenant du fichier LABEL. Cela peut être utile pour les commandes qui transforment le contenu d'un fichier avant la recherche, par exemple, gzip -cd foo.gz \|grep --label=foo -H 'some pattern'. Voir aussi le **-H** |
|
||||
| | **--perl-regexp**<br/>Interpréter les MODÈLES en tant qu'expressions régulières compatibles Perl (PCRE). Cette option est expérimentale lorsqu'elle est combinée avec l'option **-z** (**-- null-data**), et grep **-P** peut avertir des fonctionnalités non implémentées. |
|
||||
| | **-T**, **--initial-tab**<br/>Assurez-vous que le premier caractère du contenu réel de la ligne se trouve sur un arrêt d'onglet, de sorte que l'alignement des onglets semble normal.<br/> C'est utile avec les options qui préfixent leur sortie au contenu réel : **-H**,**-n** et **-b**. Afin d'améliorer la probabilité que les lignes d'un seul fichier commencent toutes à la même colonne, cela entraîne également l'impression du numéro de ligne et du décalage d'octet (le cas échéant) dans une largeur de champ de taille minimale. |
|
||||
| | **-u**, **--unix-byte-offsets**<br/>Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to running grep on a Unix machine. This option has no effect unless -b option is also used; it has no effect on platforms other than MS-DOS and MS-Windows.<br />Signaler les décalages d'octets de style Unix. Ce commutateur fait que grep signale les décalages d'octets comme si le fichier était un fichier texte de style Unix, c'est-à-dire avec des caractères CR supprimés. Cela produira des résultats identiques à ceux de l'exécution de grep sur une machine Unix. Cette option n'a aucun effet à moins que l'option **-b** ne soit également utilisée ; elle n'a aucun effet sur les plates-formes autres que MS-DOS et MS-Windows. |
|
||||
|
||||
62
docs/Linux/grep-options.txt
Normal file
62
docs/Linux/grep-options.txt
Normal file
@@ -0,0 +1,62 @@
|
||||
# grep --options
|
||||
|
||||
|
||||
|
||||
| **grep (BSD)** | **grep (GNU)** |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| **-A** num, -**-after-context**=num<br />Print num lines of trailing context after each match. See also the **-B** and **-C** options. | **-A** NUM, **--after-context**=NUM<br/>Print NUM lines of trailing context after matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the **-o** or **--only-matching** option, this has no effect and a warning is given. |
|
||||
| **-a**, **--text**<br />Treat all files as ASCII text. | **-a**, **--text**<br/>Process a binary file as if it were text; this is equivalent to the **--binary-files**=text option. |
|
||||
| **-B** num, **--before-context**=num<br />Print num lines of leading context before each match. See also the **-A** and **-C** options. | **-B** NUM, **--before-context**=NUM<br/>Print NUM lines of leading context before matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the **-o** or **--only-matching** option, this has no effect and a warning is given. |
|
||||
| **-b**, **--byte-offset**<br />The offset in bytes of a matched pattern is displayed in front of the respective matched line. | **-b**, **--byte-offset**<br/>Print the 0-based byte offset within the input file before each line of output. If **-o** (**--only-matching**) is specified, print the offset of the matching part itself. |
|
||||
| **-C**[num, **--context**=num]<br />Print num lines of leading and trailing context surrounding each match. The default is 2 and is equivalent to **-A** 2 **-B** 2. | **-C** NUM, -NUM, **--context**=NUM<br/>Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches.<br/>With the **-o** or **--only-matching** option, this has no effect and a warning is given. |
|
||||
| **-c**, **--count**<br />Only a count of selected lines is written to standard output. | **-c**, **--count**<br/>Suppress normal output; instead print a count of matching lines for each input file. With the **-v**, **--invert-match** option (see below), count non-matching lines. |
|
||||
| **--colour**=[when, **--color**=[when]]<br />Mark up the matching text with the expression stored in GREP_COLOR environment variable. The possible values of when can be *'never'*, *'always'* or *'auto'*. | **--color**[=WHEN], **--colour**[=WHEN]<br/>Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to display them in color on the terminal. The colors are defined by the environment variable GREP_COLORS. The deprecated environment variable GREP_COLOR is still supported, but its setting does not have priority. WHEN is *never*, *always*, or *auto*. |
|
||||
| **-D** action, **--devices**=action<br />Specify the demanded action for devices, FIFOs and sockets. The default action is *'read',* which means, that they are read as if they were normal files. If the action is set to *'skip'*, devices will be silently skipped. | **-D** ACTION, **--devices**=ACTION<br/>If an input file is a device, FIFO or socket, use ACTION to process it. By default, ACTION is *read*, which means that devices are read just as if they were ordinary files. If ACTION is *skip*, devices are silently skipped. |
|
||||
| **-d** action, **--directories**=action<br />Specify the demanded action for directories. It is *'read'* by default, which means that the directories are read in the same manner as normal files. Other possible values are *'skip'* to silently ignore the directories, and *'recurse'* to read them recursively, which has the same effect as the **-R** and **-r** option. | **-d** ACTION, **--directories**=ACTION<br/>If an input file is a directory, use ACTION to process it. By default, ACTION is *read*, i.e., read directories just as if they were ordinary files. If ACTION is *skip*, silently skip directories. If ACTION is *recurse*, read all files under each directory, recursively, following symbolic links only if they are on the command line. This is equivalent to the **-r** option. |
|
||||
| **-E**, **--extended-regexp**<br />Interpret pattern as an extended regular expression | **-E**, **--extended-regexp**<br/>Interpret PATTERNS as extended regular expressions (EREs, see below). |
|
||||
| **-e** pattern, **--regexp**=pattern<br />Specify a pattern used during the search of the input: an input line is selected if it matches any of the specified patterns. This option is most useful when multiple **-e** options are used to specify multiple patterns, or when a pattern begins with a dash (`-'). | **-e** PATTERNS, **--regexp**=PATTERNS<br/>Use PATTERNS as the patterns. If this option is used multiple times or is combined with the **-f** (**--file**) option, search for all patterns given. This option can be used to protect a pattern beginning with "-". |
|
||||
| **--exclude**<br />If specified, it excludes files matching the given filename pattern from the search. Note that **--exclude** patterns take priority over **--include** patterns, and if no **--include** pattern is specified, all files are searched that are not excluded. Patterns are matched to the full path specified, not only to the filename component. | **--exclude**=GLOB<br/>Skip any command-line file with a name suffix that matches the pattern GLOB, using wildcard matching; a name suffix is either the whole name, or a trailing part that starts with a non-slash character immediately after a slash (/) in the name. When searching recursively, skip any subfile whose base name matches GLOB; the base name is the part after the last slash. A pattern can use *, ?, and [...] as wildcards, and \ to quote a wildcard or backslash character literally. |
|
||||
| | **--exclude-from**=FILE<br/>Skip files whose base name matches any of the file-name globs read from FILE (using wildcard matching as described under --exclude). |
|
||||
| **--exclude-dir**<br />If -R is specified, it excludes directories matching the given filename pattern from the search. Note that **--exclude-dir** patterns take priority over **--include-dir** patterns, and if no **--include-dir** pattern is specified, all directories are searched that are not excluded. | **--exclude-dir**=GLOB<br/>Skip any command-line directory with a name suffix that matches the pattern GLOB. When searching recursively, skip any subdirectory whose base name matches GLOB. Ignore any redundant trailing slashes in GLOB. |
|
||||
| **-F**, **--fixed-strings**<br />Interpret pattern as a set of fixed strings | **-F**, **--fixed-strings**<br/>Interpret PATTERNS as fixed strings, not regular expressions. |
|
||||
| **-f** file, **--file**=file<br />Read one or more newline separated patterns from file. Empty pattern lines match every input line. Newlines are not considered part of a pattern. If file is empty, nothing is matched. | **-f** FILE, **--file**=FILE<br/>Obtain patterns from FILE, one per line. If this option is used multiple times or is combined with the **-e** (**--regexp**) option, search for all patterns given. The empty file contains zero patterns, and therefore matches nothing. |
|
||||
| **-G**, **--basic-regexp**<br /> Interpret pattern as a basic regular expression. | **-G**, **--basic-regexp**<br/>Interpret PATTERNS as basic regular expressions (BREs, see below). This is the default. |
|
||||
| **-H**<br />Always print filename headers with output lines. | **-H**, **--with-filename**<br/>Print the file name for each match. This is the default when there is more than one file to search. |
|
||||
| **-h**, **--no-filename**<br/>Never print filename headers (i.e. filenames) with output lines. | **-h**, **--no-filename**<br/>Suppress the prefixing of file names on output. This is the default when there is only one file (or only standard input) to search. |
|
||||
| **--help**<br />Print a brief help message. | **--help**<br />Output a usage message and exit. |
|
||||
| **-I**<br />Ignore binary files. This option is equivalent to **--binary-file=without-match option**. | **-I**<br />Process a binary file as if it did not contain matching data; this is equivalent to the **--binary-files=without-match option**. |
|
||||
| **--include**<br />If specified, only files matching the given filename pattern are searched. Note that **--exclude** patterns take priority over **--include** patterns. Patterns are matched to the full path specified, not only to the filename component. | **--include**=GLOB<br/> Search only files whose base name matches GLOB (using wildcard matching as described under **--exclude**). <br />If contradictory **--include** and **--exclude** options are given, the last matching one wins. <br />If no **--include** or **--exclude** options match, a file is included unless the first such option is **--include**. |
|
||||
| **--include-dir**<br/>If -R is specified, only directories matching the given filename pattern are searched. Note that **--exclude-dir** patterns take priority over **--include-dir** patterns. | |
|
||||
| **-J**, **--bz2decompress**<br/>Decompress the bzip2(1) compressed file before looking for the text. | |
|
||||
| **-L**, **--files-without-match**<br/>Only the names of files not containing selected lines are written to standard output. Pathnames are listed once per file searched. If the standard input is searched, the string "(standard input)'' is written. | -L, --files-without-match<br/>Suppress normal output; instead print the name of each input file from which no output would normally have been printed. The scanning will stop on the first match. |
|
||||
| **-l**, **--files-with-matches**<br/>Only the names of files containing selected lines are written to standard output. grep will only search a file until a match has been found, making searches potentially less expensive. Pathnames are listed once per file searched. If the standard input is searched, the string "(standard input)'' is written. | -l, --files-with-matches<br/>Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match. |
|
||||
| **--mmap**<br />Use mmap(2) instead of read(2) to read input, which can result in better performance under some circumstances but can cause undefined behaviour. | |
|
||||
| **-m** num, **--max-count**=num<br/>Stop reading the file after num matches. | **-m** NUM, **--max-count**=NUM<br/>Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines. This enables a calling process to resume a search. <br />When grep stops after NUM matching lines, it outputs any trailing context lines. <br />When the **-c** or **--count** option is also used, grep does not output a count greater than NUM. <br />When the **-v** or **--invert-match** option is also used, grep stops after outputting NUM non-matching lines. |
|
||||
| **-n**, **--line-number**<br/>Each output line is preceded by its relative line number in the file, starting at line 1. The line number counter is reset for each file processed. This option is ignored if **-c**, **-L**, **-l**, or **-q** is specified. | **-n**, **--line-number**<br/>Prefix each line of output with the 1-based line number within its input file. |
|
||||
| **--null**<br />Prints a zero-byte after the file name. | **-Z**, **--null**<br/>Output a zero byte (the ASCII NUL character) instead of the character that normally follows a file name. For example, grep -lZ outputs a zero byte after each file name instead of the usual newline. This option makes the output unambiguous, even in the presence of file names containing unusual characters like newlines. This option can be used with commands like find -print0, perl -0, sort -z, and xargs -0 to process arbitrary file names, even those that contain newline characters. |
|
||||
| **-O**<br />If -R is specified, follow symbolic links only if they were explicitly listed on the command line. The default is not to follow symbolic links. | |
|
||||
| **-o**, **--only-matching**<br />Prints only the matching part of the lines. | **-o**, **--only-matching**<br />Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line. |
|
||||
| **-p**<br />If **-R** is specified, no symbolic links are followed. This is the default. | |
|
||||
| **-q**, **--quiet**, **--silent**<br/>Quiet mode: suppress normal output. grep will only search a file until a match has been found, making searches potentially less expensive. | **-q**, **--quiet**, **--silent**<br/>Quiet; do not write anything to standard output. Exit immediately with zero status if any match is found, even if an error was detected. Also see the **-s** or **--no-messages** option. |
|
||||
| **-R**, **-r**, **--recursive**<br/>Recursively search subdirectories listed. | **-r**, **--recursive**<br/>Read all files under each directory, recursively, following symbolic links only if they are on the command line. Note that if no file operand is given, grep searches the working directory. This is equivalent to the **-d** recurse option. |
|
||||
| | **-R**, **--dereference-recursive**<br/>Read all files under each directory, recursively. Follow all symbolic links, unlike **-r**. |
|
||||
| **-S**<br />If **-R** is specified, all symbolic links are followed. The default is not to follow symbolic links. | |
|
||||
| **-s**, **--no-messages**<br/>Silent mode. Nonexistent and unreadable files are ignored (i.e. their error messages are suppressed). | **-s**, **--no-messages**<br/>Suppress error messages about nonexistent or unreadable files. |
|
||||
| **-U**, **--binary**<br/>Search binary files, but do not attempt to print them. | **-U**, **--binary**<br/>Treat the file(s) as binary. By default, under MS-DOS and MS-Windows, grep guesses whether a file is text or binary as described for the **--binary-files** option. If grep decides the file is a text file, it strips the CR characters from the original file contents (to make regular expressions with ^ and $ work correctly). <br />Specifying **-U** overrules this guesswork, causing all files to be read and passed to the matching mechanism verbatim; if the file is a text file with CR/LF pairs at the end of each line, this will cause some regular expressions to fail. This option has no effect on platforms other than MS-DOS and MS-Windows. |
|
||||
| **-V**, **--version**<br/>Display version information and exit. | **-V**, **--version**<br/> Output the version number of grep and exit. |
|
||||
| **-v**, **--invert-match**<br/>Selected lines are those not matching any of the specified patterns. | **-v**, **--invert-match**<br/>Invert the sense of matching, to select non-matching lines. |
|
||||
| **-w**, **--word-regexp**<br/>The expression is searched for as a word (as if surrounded by `[[:<:]]` and `[[:>:]]`; see re_format(7)). | **-w**, **--word-regexp**<br/>Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.This option has no effect if -x is also specified. |
|
||||
| **-x**, **--line-regexp**<br/>Only input lines selected against an entire fixed string or regular expression are considered to be matching lines. | **-x**, **--line-regexp**<br/>Select only those matches that exactly match the whole line. For a regular expression pattern, this is like parenthesizing the pattern and then surrounding it with ^ and $. |
|
||||
| **-y**<br />Equivalent to **-i**. Obsoleted. | **-y**<br />Obsolete synonym for **-i.** |
|
||||
| **-Z**, **-z**, **--decompress**<br/>Force grep to behave as zgrep. | |
|
||||
| | **-z**, **--null-data**<br/>Treat input and output data as sequences of lines, each terminated by a zero byte (the ASCII NUL character) instead of a newline. Like the **-Z** or --null option, this option can be used with commands like sort **-z** to process arbitrary file names. |
|
||||
| **--binary-files**=value<br/>Controls searching and printing of binary files. Options are *binary*, the default: search binary files but do not print them; *without-match*: do not search binary files; and *text*: treat all files as text. | **--binary-files**=TYPE<br/>If a file's data or metadata indicate that the file contains binary data, assume that the file is of type TYPE. Non-text bytes indicate binary data; these are either output bytes that are improperly encoded for the current locale, or null input bytes when the **-z** option is not given.<br/><br/>By default, TYPE is *binary*, and grep suppresses output after null input binary data is discovered, and suppresses output lines that contain improperly encoded data. When some output is suppressed, grep follows any output with a one-line message saying that a binary file matches.<br/><br/>If TYPE is *without-match*, when grep discovers null input binary data it assumes that the rest of the file does not match; this is equivalent to the -I option.<br/><br/>If TYPE is *text*, grep processes a binary file as if it were text; this is equivalent to the **-a** option.<br/><br/>When type is *binary*, grep may treat non-text bytes as line terminators even without the **-z** option. This means choosing binary versus text can affect whether a pattern matches a file. For example, when type is *binary* the pattern q$ might match q immediately followed by a null byte, even though this is not matched when type is *text*. Conversely, when type is *binary* the pattern . (period) might not match a null byte.<br/><br/><u>Warning:</u> The **-a** option might output binary garbage, which can have nasty side effects if the output is a terminal and if the terminal driver interprets some of it as commands. On the other hand, when reading files whose text encodings are unknown, it can be helpful to use **-a** or to set **LC_ALL='C'** in the environment, in order to find more matches even if the matches are unsafe for direct display. |
|
||||
| **--context**[=num]<br/>Print num lines of leading and trailing context. The default is 2. | |
|
||||
| **--line-buffered**<br/>Force output to be line buffered. By default, output is line buffered when standard output is a terminal and block buffered otherwise. | **--line-buffered**<br/>Use line buffering on output. This can cause a performance penalty. |
|
||||
| | **-i**, **--ignore-case**<br/>Ignore case distinctions in patterns and input data, so that characters that differ only in case match each other. |
|
||||
| | **--no-ignore-case**<br/>Do not ignore case distinctions in patterns and input data. This is the default. This option is useful for passing to shell scripts that already use **-i**, to cancel its effects because the two options override each other. |
|
||||
| | **--label=LABEL**<br />Display input actually coming from standard input as input coming from file LABEL. This can be useful for commands that transform a file's contents before searching, e.g., gzip -cd foo.gz \|grep --label=foo -H 'some pattern'. See also the **-H** |
|
||||
| | **--perl-regexp**<br/>Interpret PATTERNS as Perl-compatible regular expressions (PCREs). This option is experimental when combined with the **-z** (**--null-data**) option, and grep **-P** may warn of unimplemented features. |
|
||||
| | **-T**, **--initial-tab**<br/>Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal.<br/>This is useful with options that prefix their output to the actual content: **-H**,**-n**, and **-b**. In order to improve the probability that lines from a single file will all start at the same column, this also causes the line number and byte offset (if present) to be printed in a minimum size field width. |
|
||||
| | **-u**, **--unix-byte-offsets**<br/>Report Unix-style byte offsets. This switch causes grep to report byte offsets as if the file were a Unix-style text file, i.e., with CR characters stripped off. This will produce results identical to running grep on a Unix machine. This option has no effect unless -b option is also used; it has no effect on platforms other than MS-DOS and MS-Windows. |
|
||||
|
||||
@@ -1,10 +1,25 @@
|
||||
# interpègrep
|
||||
# grep
|
||||
|
||||
|
||||
|
||||
La commande **grep** permet de rechercher une chaîne de caractères dans un fichier.
|
||||
|
||||
Options:
|
||||
macOS intègre la version BSD de grep
|
||||
|
||||
```bash
|
||||
$ grep -V
|
||||
grep (BSD grep) 2.5.1-FreeBSD
|
||||
```
|
||||
mais peut aussi utiliser la version GNU grâce à Homebrew (rebaptiser ggrep)
|
||||
```bash
|
||||
$ ggrep -V
|
||||
ggrep (GNU grep) 3.6
|
||||
Packaged by Homebrew
|
||||
```
|
||||
|
||||
|
||||
|
||||
Options ([toutes les options](grep-options-fr.md))([US](grep-options.md)):
|
||||
|
||||
```bash
|
||||
-E, --extended-regexp interprète la PATTERN comme Expression Régulière Etendue
|
||||
@@ -111,7 +126,11 @@ grep ^[a-d] fichier.txt
|
||||
Rechercher plusieurs chaines:
|
||||
|
||||
```bash
|
||||
grep -E 'tata|toto' fichier.txt
|
||||
grep -E 'alias|function' ~/.zshrc
|
||||
```
|
||||
|
||||
```bash
|
||||
grep -e alias -e function ~/.zshrc
|
||||
```
|
||||
|
||||
ou passer un fichier de motifs à grep:
|
||||
|
||||
@@ -264,6 +264,13 @@ $ sed -n '1p' test.txt
|
||||
red hat
|
||||
```
|
||||
|
||||
Afficher uniquement la <u>3eme ligne</u>:
|
||||
|
||||
```bash
|
||||
$ sed -n '3p' test.txt
|
||||
mint
|
||||
```
|
||||
|
||||
Afficher la <u>dernière ligne</u>:
|
||||
|
||||
```bash
|
||||
@@ -312,6 +319,15 @@ mint
|
||||
raspbian
|
||||
```
|
||||
|
||||
Afficher les <u>lignes 3 à 5</u>:
|
||||
|
||||
```bash
|
||||
$ sed -n '3,5p' test.txt
|
||||
mint
|
||||
debian
|
||||
raspbian
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Supression de caractères:
|
||||
|
||||
@@ -36,13 +36,13 @@ mysql> UPDATE USER.master SET PASSWORD = AES_ENCRYPT('a_password','a_passkey') W
|
||||
- Backup du nouveau dossier data:
|
||||
|
||||
```bash
|
||||
sudo mv /usr/local/mysql-5.6.14-osx10.7-x86_64/data /usr/local/mysql-5.6.14-osx10.7-x86_64/dataold
|
||||
$ sudo mv /usr/local/mysql-5.6.14-osx10.7-x86_64/data /usr/local/mysql-5.6.14-osx10.7-x86_64/dataold
|
||||
```
|
||||
|
||||
- Copie des anciennes bases à leur nouveau emplacement:
|
||||
|
||||
```bash
|
||||
sudo cp -rf /usr/local/mysql-5.5.13-osx10.6-x86_64/data /usr/local/mysql-5.6.10-osx10.7-x86_64/
|
||||
$ sudo cp -rf /usr/local/mysql-5.5.13-osx10.6-x86_64/data /usr/local/mysql-5.6.10-osx10.7-x86_64/
|
||||
```
|
||||
|
||||
- Redémarrer MySQL
|
||||
@@ -103,7 +103,7 @@ adduser \
|
||||
#### Télécharger Gitea:
|
||||
|
||||
```bash
|
||||
VERSION=1.11.4
|
||||
VERSION=1.14.4
|
||||
sudo wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64
|
||||
```
|
||||
|
||||
|
||||
@@ -62,6 +62,16 @@ Starting scan for user 1 out of 1 (bruno)
|
||||
|
||||
|
||||
|
||||
#### Le module php-imagick n’a aucun support SVG dans cette instance (Nextcloud 21.0.1)
|
||||
|
||||
Il faut installer `libmagickcore`:
|
||||
|
||||
```bash
|
||||
$ sudo apt install libmagickcore-6.q16-3-extra
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Joplin:
|
||||
|
||||
```bash
|
||||
@@ -103,7 +113,7 @@ Configuration:
|
||||
|
||||
|
||||
|
||||
Problèemes de synchro
|
||||
Problèmes de synchro
|
||||
|
||||
Plesk -> Wordpress -> maboiteverte.fr -> Vérifier la sécurité:
|
||||
|
||||
|
||||
119
docs/Synology/Docker/joplin.md
Normal file
119
docs/Synology/Docker/joplin.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# Joplin
|
||||
|
||||
|
||||
|
||||
### Serveur Joplin:
|
||||
|
||||
https://github.com/laurent22/joplin/blob/dev/packages/server/README.md
|
||||
|
||||
#### Créer les dossiers:
|
||||
|
||||
```bash
|
||||
$ mkdir /volume1/docker/joplin
|
||||
$ mkdir /volume1/docker/joplin/data
|
||||
```
|
||||
|
||||
#### Créer le fichier `docker-compose.yml` dans `/volume1/docker/joplin`:
|
||||
|
||||
```bash
|
||||
$ nano docker-compose.yml
|
||||
```
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:13.1
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /volume1/docker/joplin/data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- APP_PORT=22300
|
||||
- POSTGRES_PASSWORD=joplin
|
||||
- POSTGRES_USER=joplin
|
||||
- POSTGRES_DB=joplin
|
||||
app:
|
||||
image: joplin/server:latest
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "22300:22300"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- APP_BASE_URL=https://clicclac.synology.me:22301
|
||||
- DB_CLIENT=pg
|
||||
- POSTGRES_PASSWORD=joplin
|
||||
- POSTGRES_DATABASE=joplin
|
||||
- POSTGRES_USER=joplin
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_HOST=db
|
||||
|
||||
```
|
||||
|
||||
#### Créer le container:
|
||||
|
||||
```bash
|
||||
$ sudo docker-compose up -d
|
||||
Creating network "joplin_default" with the default driver
|
||||
Pulling app (joplin/server:latest)...
|
||||
latest: Pulling from joplin/server
|
||||
...
|
||||
Digest: sha256:5c4cd651d4dae4ce85e252efc9262856d07dd8e0cf9a9a2c077a36c9631883cb
|
||||
Status: Downloaded newer image for joplin/server:latest
|
||||
Creating joplin_db_1 ... done
|
||||
Creating joplin_app_1 ... done
|
||||
```
|
||||
|
||||
Le serveur est disponible en local sur: http://dsm916.local:22300
|
||||
|
||||
#### Créer une règle de proxy-inverse:
|
||||
|
||||
Panneau de configuration -> Portail des applications -> Proxy inversé -> Créer:
|
||||
|
||||
Source:
|
||||
|
||||
- Protocole: HTTPS
|
||||
- Nom d'hôte: clicclac.synology.me
|
||||
- Port: 22301
|
||||
- Activer HTTP/2
|
||||
|
||||
Destination:
|
||||
|
||||
- Protocole: HTTP
|
||||
- Nom d'hôte: localhost
|
||||
- Port: 22300
|
||||
|
||||
Le serveur est disponible depuis l'extérieur sur: https://clicclac.synology.me:22301
|
||||
|
||||
On se connecte à https://clicclac.synology.me:22301/login en administrateur avec l'utilisateur **admin@localhost** et le mot-de-passe **admin**, puis on change l'émail et la password. On peut un utilisateur non-admin juste pour la synchro avec les clients Joplin.
|
||||
|
||||
#### Voir les logs:
|
||||
|
||||
```bash
|
||||
$ sudo docker-compose --file docker-compose.yml logs
|
||||
Password:
|
||||
Attaching to joplin_app_1, joplin_db_1
|
||||
app_1 | WARNING: no logs are available with the 'db' log driver
|
||||
db_1 | WARNING: no logs are available with the 'db' log driver
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Application Joplin
|
||||
|
||||
Préférences -> Synchronisation:
|
||||
|
||||
Cible de la synchronisation: Joplin Server
|
||||
|
||||
Serveur Joplin:
|
||||
|
||||
- URL: https://clicclac.synology.me:22301
|
||||
- Dossier: home
|
||||
- Utilisateur: bruno@xxx.info
|
||||
- Mot de passe: xxxxx
|
||||
|
||||
|
||||
|
||||
136
docs/Synology/ImageMagick.md
Normal file
136
docs/Synology/ImageMagick.md
Normal file
@@ -0,0 +1,136 @@
|
||||
|
||||
|
||||
#### Paquet opkg
|
||||
|
||||
Formats supportés:
|
||||
|
||||
```bash
|
||||
$ magick --version
|
||||
$ identify --version
|
||||
Version: ImageMagick 7.0.9-5 Q8 x86_64 2021-04-19 https://imagemagick.org
|
||||
Copyright: © 1999-2019 ImageMagick Studio LLC
|
||||
License: https://imagemagick.org/script/license.php
|
||||
Features: DPC Modules
|
||||
Delegates (built-in): freetype jng jpeg ltdl png tiff zlib
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ identify /volume1/web/IMG_0636.HEIC
|
||||
identify: NoDecodeDelegateForThisImageFormat `HEIC' @ error/constitute.c/ReadImage/562.
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Paquet SynoCommunity
|
||||
|
||||
Formats supportés:
|
||||
|
||||
```bash
|
||||
$ /usr/local/bin/magick --version
|
||||
Version: ImageMagick 7.0.11-6 Q16 x86_64 2021-03-28 https://imagemagick.org
|
||||
Copyright: (C) 1999-2021 ImageMagick Studio LLC
|
||||
License: https://imagemagick.org/script/license.php
|
||||
Features: Cipher DPC HDRI Modules OpenMP(4.5)
|
||||
Delegates (built-in): bzlib fontconfig freetype heic jng jp2 jpeg lcms ltdl lzma png tiff webp wmf xml zlib
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ /usr/local/bin/identify /volume1/web/IMG_0636.HEIC
|
||||
identify: UnableToOpenModuleFile '/var/services/homes/bruno/.config/ImageMagick/heic.la': No such file or directory @ warning/module.c/GetMagickModulePath/823.
|
||||
identify: NoDecodeDelegateForThisImageFormat `HEIC' @ error/constitute.c/ReadImage/572.
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ identify /volume1/web/IMG_0636.HEIC
|
||||
identify: DecoderNotActivated `/volume1/web/IMG_0636.HEIC' @ error/heic.c/ReadHEICImage/186.
|
||||
```
|
||||
|
||||
https://unix.stackexchange.com/questions/96004/imagemagick-on-open-wrt-router-unabletoopenconfigurefile
|
||||
|
||||
```bash
|
||||
$ /usr/local/bin/identify -list format
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Debug
|
||||
|
||||
$ identify -debug configure -list configure
|
||||
|
||||
```bash
|
||||
$ /usr/local/bin/identify -debug configure -list configure
|
||||
2021-07-10T09:22:23+00:00 0:00.001 0.000u 7.0.11 Configure identify[6366]: utility.c/ExpandFilenames/971/Configure
|
||||
Command line: /usr/local/bin/identify {-debug} {configure} {-list} {configure}
|
||||
2021-07-10T09:22:23+00:00 0:00.001 0.000u 7.0.11 Configure identify[6366]: configure.c/GetConfigureOptions/675/Configure
|
||||
Searching for configure file: "/usr/local/etc/ImageMagick-7/configure.xml"
|
||||
2021-07-10T09:22:23+00:00 0:00.001 0.000u 7.0.11 Configure identify[6366]: configure.c/GetConfigureOptions/675/Configure
|
||||
Searching for configure file: "/usr/local/share/ImageMagick-7/configure.xml"
|
||||
2021-07-10T09:22:23+00:00 0:00.001 0.000u 7.0.11 Configure identify[6366]: configure.c/GetConfigureOptions/675/Configure
|
||||
Searching for configure file: "/var/packages/imagemagick/target/lib/ImageMagick-7.0.11//config-Q16HDRI/configure.xml"
|
||||
2021-07-10T09:22:23+00:00 0:00.001 0.000u 7.0.11 Configure identify[6366]: configure.c/GetConfigureOptions/675/Configure
|
||||
Searching for configure file: "configure.xml"
|
||||
2021-07-10T09:22:23+00:00 0:00.001 0.000u 7.0.11 Configure identify[6366]: configure.c/GetConfigureOptions/675/Configure
|
||||
Searching for configure file: "/var/services/homes/bruno/.config/ImageMagick/configure.xml"
|
||||
|
||||
Path: [built-in]
|
||||
|
||||
Name Value
|
||||
-------------------------------------------------------------------------------
|
||||
DELEGATES bzlib fontconfig freetype heic jng jp2 jpeg lcms ltdl lzma png tiff webp wmf xml zlib
|
||||
FEATURES Cipher DPC HDRI Modules OpenMP(4.5)
|
||||
MAGICK_TEMPORARY_PATH /var/services/homes/bruno/tmp
|
||||
NAME ImageMagick
|
||||
QuantumDepth Q16
|
||||
identify: UnableToOpenConfigureFile `configure.xml' @ warning/configure.c/GetConfigureOptions/702.
|
||||
```
|
||||
|
||||
|
||||
|
||||
Fichiers xml
|
||||
|
||||
```bash
|
||||
/var/packages/imagemagick/target/etc/ImageMagick-7
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Homebrew
|
||||
|
||||
```
|
||||
#/var/packages/imagemagick/target/lib/ImageMagick-7.0.11/modules-Q16HDRI/coders
|
||||
/usr/local/Cellar/imagemagick/7.1.0-2_1/lib/ImageMagick/modules-Q16HDRI
|
||||
-rwxr-xr-x 1 bruno staff 1352 Jul 7 07:26 heic.la
|
||||
-r--r--r-- 1 bruno staff 73432 Jul 7 07:26 heic.so
|
||||
|
||||
#
|
||||
/usr/local/Cellar/imagemagick/7.1.0-2_1/lib/ImageMagick/config-Q16HDRI
|
||||
-r--r--r-- 1 bruno staff 6557 Jul 7 07:26 configure.xml
|
||||
|
||||
# /var/packages/imagemagick/target/etc/ImageMagick-7
|
||||
/usr/local/Cellar/imagemagick/7.1.0-2_1/etc/ImageMagick-7
|
||||
-rw-r--r-- 1 bruno staff 1383 Jun 25 13:22 colors.xml
|
||||
-rw-r--r-- 1 bruno staff 13804 Jun 25 13:22 delegates.xml
|
||||
-rw-r--r-- 1 bruno staff 1642 Jun 25 13:22 log.xml
|
||||
-rw-r--r-- 1 bruno staff 134319 Jul 7 07:26 mime.xml
|
||||
-rw-r--r-- 1 bruno staff 3773 Jun 25 13:22 policy.xml
|
||||
-rw-r--r-- 1 bruno staff 2369 Jun 25 13:22 quantization-table.xml
|
||||
-rw-r--r-- 1 bruno staff 11453 Jun 25 13:22 thresholds.xml
|
||||
-rw-r--r-- 1 bruno staff 29218 Jun 25 13:22 type-apple.xml
|
||||
-rw-r--r-- 1 bruno staff 8490 Jun 25 13:22 type-dejavu.xml
|
||||
-rw-r--r-- 1 bruno staff 9952 Jul 7 07:26 type-ghostscript.xml
|
||||
-rw-r--r-- 1 bruno staff 8162 Jun 25 13:22 type-urw-base35.xml
|
||||
-rw-r--r-- 1 bruno staff 13706 Jun 25 13:22 type-windows.xml
|
||||
-rw-r--r-- 1 bruno staff 612 Jun 25 13:22 type.xml
|
||||
|
||||
```
|
||||
|
||||
@@ -319,6 +319,8 @@ root@DS916:/volume1/@appstore/PHP7.0/misc# nano extension_list.json
|
||||
/usr/local/bin/php56
|
||||
- PHP 7.3 (Package PHP 7)
|
||||
/usr/local/bin/php73
|
||||
- PHP 7.4 (Package PHP 7)
|
||||
/usr/local/bin/php74
|
||||
|
||||
Pour Apache, c'est la version choisie dans WebStation qui est active.
|
||||
|
||||
@@ -328,51 +330,86 @@ Pour Apache, c'est la version choisie dans WebStation qui est active.
|
||||
$ which php
|
||||
/bin/php
|
||||
|
||||
$ php -v
|
||||
PHP 5.6.11 (cli) (built: Jun 8 2018 15:13:30)
|
||||
Copyright (c) 1997-2015 The PHP Group
|
||||
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
|
||||
$ /bin/php -v
|
||||
PHP 7.3.16 (cli) (built: Sep 14 2020 18:32:16) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
|
||||
|
||||
$ php --ini
|
||||
Configuration File (php.ini) Path: /etc/php
|
||||
Loaded Configuration File: /etc/php/php.ini
|
||||
Scan for additional .ini files in: (none)
|
||||
Additional .ini files parsed: (none)
|
||||
$ /bin/php --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php73/cli
|
||||
Loaded Configuration File: /usr/local/etc/php73/cli/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php73/cli/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php73/cli/conf.d/extension.ini,
|
||||
/usr/local/etc/php73/cli/conf.d/timezone.ini
|
||||
```
|
||||
|
||||
Les 2 autres versions sont néanmoins disponibles:
|
||||
|
||||
```bash
|
||||
$ which php56
|
||||
/usr/local/bin/php56
|
||||
|
||||
$ php56 -v
|
||||
PHP 5.6.36 (cli) (built: May 2 2018 16:13:10)
|
||||
Copyright (c) 1997-2016 The PHP Group
|
||||
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
|
||||
|
||||
$ php56 --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php56
|
||||
Loaded Configuration File: /usr/local/etc/php56/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php56/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php56/conf.d/phpMyAdmin.ini,
|
||||
/usr/local/etc/php56/conf.d/webstation-extensions.ini
|
||||
|
||||
|
||||
$ which php70
|
||||
/usr/local/bin/php70
|
||||
|
||||
$ php70 -v
|
||||
PHP 7.0.30 (cli) (built: May 2 2018 16:29:25) ( NTS )
|
||||
PHP 7.0.33 (cli) (built: Dec 13 2018 12:30:20) ( NTS )
|
||||
Copyright (c) 1997-2017 The PHP Group
|
||||
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
|
||||
with Zend OPcache v7.0.30, Copyright (c) 1999-2017, by Zend Technologies
|
||||
with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
|
||||
|
||||
$ php70 --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php70
|
||||
Loaded Configuration File: /usr/local/etc/php70/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php70/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php70/conf.d/SYNO.SDS.PhotoStation.ini
|
||||
|
||||
|
||||
$ which php72
|
||||
/usr/local/bin/php72
|
||||
|
||||
$ php72 -v
|
||||
PHP 7.2.29 (cli) (built: Jun 5 2020 14:21:39) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
|
||||
|
||||
$ php72 --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php72/cli
|
||||
Loaded Configuration File: /usr/local/etc/php72/cli/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php72/cli/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php72/cli/conf.d/extension.ini,
|
||||
/usr/local/etc/php72/cli/conf.d/phpMyAdmin.ini,
|
||||
/usr/local/etc/php72/cli/conf.d/timezone.ini
|
||||
|
||||
|
||||
$ which php73
|
||||
/usr/local/bin/php73
|
||||
|
||||
$ php73 -v
|
||||
PHP 7.3.16 (cli) (built: Sep 14 2020 18:32:16) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
|
||||
|
||||
$ php73 --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php73/cli
|
||||
Loaded Configuration File: /usr/local/etc/php73/cli/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php73/cli/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php73/cli/conf.d/extension.ini,
|
||||
/usr/local/etc/php73/cli/conf.d/timezone.ini
|
||||
|
||||
|
||||
$ which php74
|
||||
/usr/local/bin/php74
|
||||
|
||||
$ php74 -v
|
||||
PHP 7.4.9 (cli) (built: Oct 14 2020 15:15:33) ( NTS )
|
||||
Copyright (c) The PHP Group
|
||||
Zend Engine v3.4.0, Copyright (c) Zend Technologies
|
||||
|
||||
$ php74 --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php74/cli
|
||||
Loaded Configuration File: /usr/local/etc/php74/cli/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php74/cli/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php74/cli/conf.d/extension.ini,
|
||||
/usr/local/etc/php74/cli/conf.d/timezone.ini
|
||||
|
||||
```
|
||||
|
||||
Mettre PHP70 par défaut en CLI:
|
||||
@@ -421,6 +458,8 @@ PHP 7.3.16 (cli) (built: Jun 2 2020 11:39:19) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
|
||||
|
||||
lrwxrwxrwx 1 root root 45 Sep 17 10:26 php -> /volume1/@appstore/PHP7.3/usr/local/bin/php73
|
||||
|
||||
```
|
||||
|
||||
|
||||
238
docs/Synology/dsm7/dsm7.md
Normal file
238
docs/Synology/dsm7/dsm7.md
Normal file
@@ -0,0 +1,238 @@
|
||||
|
||||
|
||||
# DSM 7
|
||||
|
||||
|
||||
|
||||
Status paquets SynoCommunity:
|
||||
|
||||
https://github.com/SynoCommunity/spksrc/issues/4524
|
||||
|
||||
|
||||
|
||||
#### ffmpeg (SynoCommunity)
|
||||
|
||||
```bash
|
||||
$ /var/packages/ffmpeg/target/bin/ffmpeg -version
|
||||
ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers
|
||||
built with gcc 7.3.0 (crosstool-NG crosstool-ng-1.23.0-306-g04d910b)
|
||||
configuration: --target-os=linux --cross-prefix=/home/spksrc/all-supported-fix/spksrc/toolchain/syno-x64-7.0/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/var/packages/ffmpeg/target --extra-cflags=-I/home/spksrc/all-supported-fix/spksrc/spk/ffmpeg/work-x64-7.0/install/var/packages/ffmpeg/target/include --extra-ldflags=-L/home/spksrc/all-supported-fix/spksrc/spk/ffmpeg/work-x64-7.0/install/var/packages/ffmpeg/target/lib --extra-libs='-lxml2 -ldl' --pkg-config=/usr/bin/pkg-config --ranlib=/home/spksrc/all-supported-fix/spksrc/toolchain/syno-x64-7.0/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ranlib --enable-cross-compile --enable-rpath --enable-pic --enable-shared --enable-gpl --enable-version3 --enable-fontconfig --enable-avresample --disable-debug --disable-doc --disable-static --enable-debug=1 --extra-cflags=-DSYNO_VIDEOSTATION --extra-cflags=-fno-if-conversion --extra-cflags=-O3 --extra-cflags=-Wno-deprecated-declarations --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libbluray --enable-libspeex --enable-libtheora --enable-libvorbis --enable-gnutls --enable-libopus --enable-libsoxr --enable-libx264 --enable-libx265 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libzmq --enable-libshine --enable-libfdk-aac --enable-nonfree --enable-libaom --enable-libsvtav1 --enable-libsvthevc --arch=x86_64 --enable-vaapi --enable-libmfx
|
||||
libavutil 56. 51.100 / 56. 51.100
|
||||
libavcodec 58. 91.100 / 58. 91.100
|
||||
libavformat 58. 45.100 / 58. 45.100
|
||||
libavdevice 58. 10.100 / 58. 10.100
|
||||
libavfilter 7. 85.100 / 7. 85.100
|
||||
libavresample 4. 0. 0 / 4. 0. 0
|
||||
libswscale 5. 7.100 / 5. 7.100
|
||||
libswresample 3. 7.100 / 3. 7.100
|
||||
libpostproc 55. 7.100 / 55. 7.100
|
||||
```
|
||||
|
||||
#### ffmpeg (dsm7)
|
||||
|
||||
```bash
|
||||
$ which ffmpeg
|
||||
/bin/ffmpeg
|
||||
|
||||
$ ffmpeg -version
|
||||
ffmpeg version 4.1.6 Copyright (c) 2000-2020 the FFmpeg developers
|
||||
built with gcc 7.5.0 (GCC)
|
||||
configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264
|
||||
libavutil 56. 22.100 / 56. 22.100
|
||||
libavcodec 58. 35.100 / 58. 35.100
|
||||
libavformat 58. 20.100 / 58. 20.100
|
||||
libavdevice 58. 5.100 / 58. 5.100
|
||||
libavfilter 7. 40.101 / 7. 40.101
|
||||
libswscale 5. 3.100 / 5. 3.100
|
||||
libswresample 3. 3.100 / 3. 3.100
|
||||
libpostproc 55. 3.100 / 55. 3.100
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Web Station
|
||||
|
||||
#### php
|
||||
|
||||
```bash
|
||||
$ which php
|
||||
/bin/php
|
||||
|
||||
$ php -v
|
||||
PHP 7.3.3 (cli) (built: Dec 18 2020 10:30:19) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies
|
||||
```
|
||||
|
||||
```bash
|
||||
$ which php74
|
||||
/usr/local/bin/php74
|
||||
$ php74 -v
|
||||
PHP 7.4.9 (cli) (built: Apr 22 2021 16:12:43) ( NTS )
|
||||
Copyright (c) The PHP Group
|
||||
Zend Engine v3.4.0, Copyright (c) Zend Technologies
|
||||
```
|
||||
|
||||
Paramètres:
|
||||
|
||||
```bash
|
||||
extension_dir = /usr/local/lib/php74/modules
|
||||
```
|
||||
|
||||
```bash
|
||||
$ php74 --ini
|
||||
Configuration File (php.ini) Path: /usr/local/etc/php74/cli
|
||||
Loaded Configuration File: /usr/local/etc/php74/cli/php.ini
|
||||
Scan for additional .ini files in: /usr/local/etc/php74/cli/conf.d
|
||||
Additional .ini files parsed: /usr/local/etc/php74/cli/conf.d/extension.ini,
|
||||
/usr/local/etc/php74/cli/conf.d/timezone.ini
|
||||
```
|
||||
|
||||
```bash
|
||||
# PHP info
|
||||
|
||||
$ php74 -i
|
||||
phpinfo()
|
||||
PHP Version => 7.4.9
|
||||
|
||||
System => Linux DS916 3.10.108 #41890 SMP Fri Jun 25 02:39:26 CST 2021 x86_64
|
||||
Build Date => Apr 22 2021 16:12:31
|
||||
Server API => Command Line Interface
|
||||
Virtual Directory Support => disabled
|
||||
Configuration File (php.ini) Path => /usr/local/etc/php74/cli
|
||||
Loaded Configuration File => /usr/local/etc/php74/cli/php.ini
|
||||
Scan this dir for additional .ini files => /usr/local/etc/php74/cli/conf.d
|
||||
Additional .ini files parsed => /usr/local/etc/php74/cli/conf.d/extension.ini,
|
||||
/usr/local/etc/php74/cli/conf.d/timezone.ini
|
||||
|
||||
PHP API => 20190902
|
||||
PHP Extension => 20190902
|
||||
Zend Extension => 320190902
|
||||
Zend Extension Build => API320190902,NTS
|
||||
PHP Extension Build => API20190902,NTS
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
/usr/local/etc/php74/cli $ ls
|
||||
drwxr-xr-x 2 root root 4096 Jun 30 14:43 conf.d
|
||||
# Paramètres PHP (Web Station -> Paramètres du language de script -> Modifier un profil PHP -> Coeur)
|
||||
-rw-r--r-- 1 root root 8275 Jun 30 14:43 php.ini
|
||||
|
||||
/usr/local/etc/php74/cli/conf.d $ ls
|
||||
# Liste des extensions disponibles (Web Station -> Paramètres du language de script)
|
||||
-rw-r--r-- 1 root root 795 Jun 30 14:43 extension.ini
|
||||
-rw-r--r-- 1 root root 33 Jun 30 14:43 timezone.ini
|
||||
```
|
||||
|
||||
Logs:
|
||||
|
||||
```bash
|
||||
sudo tail -f /var/log/php73-fpm.log
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### nginx
|
||||
|
||||
Version:
|
||||
|
||||
```bash
|
||||
$ nginx -V
|
||||
nginx version: nginx/1.17.10
|
||||
TLS SNI support enabled
|
||||
```
|
||||
|
||||
Fichiers html:
|
||||
|
||||
```bash
|
||||
/usr/share/nginx/html $ ls
|
||||
-rw-r--r-- 1 root root 494 Jan 28 10:59 50x.html
|
||||
-rw-r--r-- 1 root root 612 Jan 28 10:59 index.html
|
||||
```
|
||||
|
||||
Paramètres:
|
||||
|
||||
```bash
|
||||
/etc/nginx $ ls
|
||||
rw-r--r-- 1 root root 16863 Jul 11 16:45 nginx.conf
|
||||
lrwxrwxrwx 1 root root 34 Jun 30 14:06 sites-enabled -> /usr/local/etc/nginx/sites-enabled
|
||||
|
||||
/etc/nginx/sites-enabled $ ls
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 12:41 server.ReverseProxy.conf -> /usr/local/etc/nginx/sites-available/65fb5bd7-8b91-4bd5-a1bf-ef37a0ff48ca.w3conf
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 13:46 server.webstation.conf -> /usr/local/etc/nginx/sites-available/869ece58-e587-47ca-acf4-39c0e870f53f.w3conf
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 13:46 server.webstation-vhost.conf -> /usr/local/etc/nginx/sites-available/155c718b-0ebe-47dc-81d0-8c22baace8e5.w3conf
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 13:45 synowstransfer-nginx.conf -> /usr/local/etc/nginx/sites-available/6e75aa1e-afa3-475c-8391-d980fd3c7a1f.w3conf
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
/usr/local/etc/nginx $ ls
|
||||
drwxr-xr-x 2 root root 4096 Jul 10 20:45 conf.d
|
||||
drwxr-xr-x 2 root root 4096 Jul 10 20:45 conf.d-available
|
||||
drwxr-xr-x 2 root root 4096 Jul 7 13:45 sites-available
|
||||
drwxr-xr-x 2 root root 4096 Jul 7 13:46 sites-enabled
|
||||
|
||||
/usr/local/etc/nginx/sites-enabled $ l
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 12:41 server.ReverseProxy.conf -> /usr/local/etc/nginx/sites-available/65fb5bd7-8b91-4bd5-a1bf-ef37a0ff48ca.w3conf
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 13:46 server.webstation.conf -> /usr/local/etc/nginx/sites-available/869ece58-e587-47ca-acf4-39c0e870f53f.w3conf
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 13:46 server.webstation-vhost.conf -> /usr/local/etc/nginx/sites-available/155c718b-0ebe-47dc-81d0-8c22baace8e5.w3conf
|
||||
lrwxrwxrwx 1 root root 80 Jul 7 13:45 synowstransfer-nginx.conf -> /usr/local/etc/nginx/sites-available/6e75aa1e-afa3-475c-8391-d980fd3c7a1f.w3conf
|
||||
```
|
||||
|
||||
Logs:
|
||||
|
||||
```bash
|
||||
$ sudo -i
|
||||
bash-5.1# cd /var/log/nginx
|
||||
bash-5.1# ls -la
|
||||
-rw-r--r-- 1 root root 5433 Jul 10 20:47 error_default.log
|
||||
-rw-rw---- 1 system log 642376 Jul 11 08:12 error.log
|
||||
-rw-rw---- 1 system log 70396 Jul 9 23:47 error.log.1.xz
|
||||
-rw-rw---- 1 system log 70440 Jul 7 09:00 error.log.2.xz
|
||||
-rw-rw---- 1 system log 70268 Jul 4 19:35 error.log.3.xz
|
||||
|
||||
```
|
||||
|
||||
Tester la configuration:
|
||||
|
||||
```bash
|
||||
$ sudo nginx -t
|
||||
Password:
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
```
|
||||
|
||||
Recharger le serveur nginx (après un changement de configuration:
|
||||
|
||||
```bash
|
||||
$ sudo nginx -s reload
|
||||
```
|
||||
|
||||
Autres commandes:
|
||||
|
||||
```bash
|
||||
# quitter nginx immédiatement.
|
||||
$ sudo nginx -s stop
|
||||
|
||||
# quitter nginx après que toutes les requêtes actives ont obtenu une réponse.
|
||||
$ sudo nginx -s quit
|
||||
|
||||
# les Log-Files sont relancés.
|
||||
$ sudo nginx -s reopen
|
||||
|
||||
# lancer nginx
|
||||
$ sudo service nginx start
|
||||
|
||||
# Redémarrer le serveur nginx:
|
||||
$ synosystemctl restart nginx
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Liens
|
||||
|
||||
[nginx.md](../nginx.md)
|
||||
40
docs/Synology/dsm7/node.md
Normal file
40
docs/Synology/dsm7/node.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Node.js
|
||||
|
||||
|
||||
|
||||
Installer nvm
|
||||
|
||||
```bash
|
||||
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
|
||||
```
|
||||
|
||||
Installer node=lts/fermium (ou mettre-à-jour)
|
||||
|
||||
```bash
|
||||
$ nvm install --lts=fermium
|
||||
```
|
||||
|
||||
Mettre-à-jour npm
|
||||
|
||||
```bash
|
||||
$ npm -g install npm
|
||||
```
|
||||
|
||||
Réinstaller les paquets d'une ancienne version après une mise-à jour:
|
||||
|
||||
```bash
|
||||
# update 14.17.3 depuis 14.17.0
|
||||
$ nvm reinstall-packages 14.17.0
|
||||
```
|
||||
|
||||
|
||||
|
||||
Installer thumbsup
|
||||
|
||||
```bash
|
||||
$ npm -g install thumbsup
|
||||
|
||||
$ which thumbsup
|
||||
/var/services/homes/bruno/.nvm/versions/node/v14.17.3/bin/thumbsup
|
||||
```
|
||||
|
||||
70
docs/Synology/dsm7/python.md
Normal file
70
docs/Synology/dsm7/python.md
Normal file
@@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
# Python
|
||||
|
||||
|
||||
|
||||
Python 3 est installé par défaut:
|
||||
|
||||
```bash
|
||||
$ python -V
|
||||
Python 3.8.8
|
||||
|
||||
$ which python
|
||||
/bin/python
|
||||
```
|
||||
|
||||
|
||||
|
||||
<u>pip n'est pas installé par défaut</u>
|
||||
|
||||
```bash
|
||||
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
||||
|
||||
$ $ python3 get-pip.py
|
||||
Defaulting to user installation because normal site-packages is not writeable
|
||||
Collecting pip
|
||||
Using cached pip-21.1.3-py3-none-any.whl (1.5 MB)
|
||||
Installing collected packages: pip
|
||||
WARNING: The scripts pip, pip3 and pip3.8 are installed in '/var/services/homes/bruno/.local/bin' which is not on PATH.
|
||||
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
|
||||
Successfully installed pip-21.1.3
|
||||
|
||||
# Ajouter /volume1/homes/bruno/.local/bin au $PATH
|
||||
|
||||
# Utiliser sudo pour une install globale
|
||||
```
|
||||
|
||||
|
||||
|
||||
Local installation:
|
||||
|
||||
```bash
|
||||
$ which pip3
|
||||
/var/services/homes/bruno/.local/bin/pip3
|
||||
```
|
||||
|
||||
|
||||
|
||||
Mieux vaut créer un environnement virtuel:
|
||||
|
||||
```bash
|
||||
# Création de l'environnement virtuel
|
||||
bruno@DS916:~/venv $ python3 -m venv mkdocs
|
||||
|
||||
# Activation
|
||||
bruno@DS916:~/venv $ source mkdocs/bin/activate
|
||||
|
||||
# Mise-à-jour de pip et setuptools
|
||||
(mkdocs) bruno@DS916:~/venv $ pip3 install -U pip setuptools
|
||||
|
||||
# Installation de mkdocs
|
||||
(mkdocs) bruno@DS916:~/venv $ pip3 install -U mkdocs
|
||||
|
||||
# Dé-activation
|
||||
(mkdocs) bruno@DS916:~/venv $ deactivate
|
||||
|
||||
$ /var/services/homes/bruno/venv/mkdocs/bin/mkdocs --version
|
||||
mkdocs, version 1.2.1 from /volume1/homes/bruno/venv/mkdocs/lib/python3.8/site-packages/mkdocs (Python 3.8)
|
||||
```
|
||||
|
||||
181
docs/Synology/dsm7/wordpress.md
Normal file
181
docs/Synology/dsm7/wordpress.md
Normal file
@@ -0,0 +1,181 @@
|
||||
# WordPress
|
||||
|
||||
|
||||
|
||||
#### Installer WordPress:
|
||||
|
||||
Téléchargement:
|
||||
|
||||
```bash
|
||||
$ cd /volume1/web
|
||||
$ wget https://wordpress.org/latest.tar.gz
|
||||
$ tar -xzvf latest.tar.gz
|
||||
```
|
||||
|
||||
Régler les permissions:
|
||||
|
||||
```bash
|
||||
$ sudo chown -R http:http wordpress
|
||||
$ sudo chmod -R 755 /volume1/web/wordpress/
|
||||
$ sudo find /volume1/web/wordpress/ -type d -exec chmod 755 {} \;
|
||||
$ sudo find /volume1/web/wordpress/ -type f -exec chmod 644 {} \;
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Créer un Virtual Host:
|
||||
|
||||
- Aller dans **Web Station** -> **Portail de services Web** -> Créer -> **Créer un portail de service**
|
||||
- Sélectionner **Virtual Host**
|
||||
- Configurer un **hôte virtuel**:
|
||||
-Nom d'hôte:
|
||||
-Port: cocher 80/443
|
||||
-Racine du document: web/wordpress
|
||||
-Paramètres HTTPS: cocher HSTS
|
||||
-Serveur principal HTTP: Nginx
|
||||
-PHP: PHP 7.4
|
||||
|
||||
DSM ajustera les permissions pour les fichiers WordPress.
|
||||
|
||||
|
||||
|
||||
#### Créer une base MariaDB:
|
||||
|
||||
```bash
|
||||
$ sudo mysql -u root -p
|
||||
```
|
||||
|
||||
```mariadb
|
||||
# Supprimer une ancienne base:
|
||||
# DROP DATABASE wordpress;
|
||||
|
||||
MariaDB > CREATE DATABASE wordpress;
|
||||
|
||||
# Créer un utilisateur autorisé à se connecter uniquement depuis le NAS
|
||||
MariaDB > CREATE USER 'adm_wp'@'localhost' IDENTIFIED BY 'DB_password';
|
||||
|
||||
# Créer un utilisateur autorisé à se connecter uniquement depuis une IP fixe (interne/externe)
|
||||
# CREATE USER 'adm_wp'@'192.168.1.123' IDENTIFIED BY 'DB_password';
|
||||
# Créer un utilisateur autorisé à se connecter uniquement depuis le réseau local
|
||||
# CREATE USER 'adm_wp'@'192.168.1.%' IDENTIFIED BY 'DB_password';
|
||||
# Créer un utilisateur autorisé à se connecter uniquement depuis ln'importe où
|
||||
# CREATE USER 'adm_wp'@'%' IDENTIFIED BY 'DB_password';
|
||||
|
||||
# Donner tousles droits à l'utilisateur admin_wp sur la base wordpress depuis le NAS
|
||||
MariaDB > GRANT ALL PRIVILEGES ON wordpress . * TO 'adm_wp'@'localhost';
|
||||
|
||||
# On peut regrouper les 2 dernières commandes
|
||||
# GRANT ALL ON wordpress.* TO 'adm_wp'@'localhost' IDENTIFIED BY 'Kpm!65YU$q';
|
||||
|
||||
MariaDB > FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
Vérifier la base créee:
|
||||
|
||||
```mariadb
|
||||
MariaDB > SHOW DATABASES;
|
||||
+--------------------+
|
||||
| Database |
|
||||
+--------------------+
|
||||
| admin_gitea |
|
||||
| information_schema |
|
||||
| mysql |
|
||||
| nextcloud |
|
||||
| performance_schema |
|
||||
| wordpress |
|
||||
+--------------------+
|
||||
|
||||
MariaDB > SELECT User, Host FROM mysql.user;
|
||||
+-----------------+-----------+
|
||||
| User | Host |
|
||||
+-----------------+-----------+
|
||||
| adm_gitea | % |
|
||||
| admin_nextcloud | % |
|
||||
| root | 127.0.0.1 |
|
||||
| root | ::1 |
|
||||
| adm_wp | localhost |
|
||||
| root | localhost |
|
||||
+-----------------+-----------+
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Finaliser l'installation:
|
||||
|
||||
Aller à https://clicclac.synology.me/wordpress dans Firefox.
|
||||
|
||||
|
||||
|
||||
#### Permaliens:
|
||||
|
||||
|
||||
|
||||
```php
|
||||
# Note : avec DSM7, le chemin d'accès du fichier server.ReverseProxy.conf a changé
|
||||
# DSM6.2 = /etc/nginx/app.d/server.ReverseProxy.conf
|
||||
# DSM7 = /etc/nginx/sites-enabled/server.ReverseProxy.conf
|
||||
```
|
||||
|
||||
|
||||
|
||||
Identification du dossier *réceptacle*:
|
||||
|
||||
```bash
|
||||
$ sudo nano /usr/local/etc/nginx/sites-enabled/server.webstation-vhost.conf
|
||||
```
|
||||
|
||||
```nginx
|
||||
...
|
||||
|
||||
include /usr/local/etc/nginx/conf.d/2bbf5ec3-353e-48c2-8564-f5ad432bb05e/user.conf*;
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
Création du fichier:
|
||||
|
||||
```bash
|
||||
cd /usr/local/etc/nginx/conf.d/2bbf5ec3-353e-48c2-8564-f5ad432bb05e/
|
||||
|
||||
# Créer un fichier de configuration nginx pour gérer les permaliens
|
||||
$ sudo nano user.conf.wordpress-permalink
|
||||
```
|
||||
|
||||
```nginx
|
||||
location /{
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
```
|
||||
|
||||
Tester la configuration et recharger nginx:
|
||||
|
||||
```bash
|
||||
$ sudo nginx -t
|
||||
|
||||
$ sudo systemctl reload nginx
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Mises-à-jour
|
||||
|
||||
Configurer le fichier <u>config.php</u> comme suit:
|
||||
|
||||
```php
|
||||
define( 'FS_METHOD', 'ftpext' );
|
||||
define( 'FTP_PASS', 'nas_password' );
|
||||
define( 'FTP_USER', 'bruno' );
|
||||
define( 'FTP_HOST', 'clicclac.synology.me:21' );
|
||||
```
|
||||
|
||||
ou plus simplement:
|
||||
|
||||
```php
|
||||
define( 'FS_METHOD', 'direct' );
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Liens:
|
||||
|
||||
[Installer WordPress sur Debian / nginx](../../Divers/wordpress.md)
|
||||
@@ -1,28 +1,48 @@
|
||||
# Synology
|
||||
|
||||
|
||||
|
||||
### Packages manager:
|
||||
|
||||
[Installer ipkg et ses packages (DSM5)](opkg/iPKG5.md)
|
||||
|
||||
[Installer ipkg et ses packages (DSM6)](opkg/iPKG6.md)
|
||||
|
||||
[Installer oPKG](opkg/oPKG.md) (Entware)
|
||||
|
||||
[Installer le shell bash](bash.md)
|
||||
|
||||
[Installer Gitea](gitea.md)
|
||||
|
||||
Installer ownCloud (depuis paquet)
|
||||
### DSM
|
||||
|
||||
[Installer ownCloud (depuis archive) (DSM6)](owncloud.md)
|
||||
|
||||
[Dossiers @eaDir](eadir.md)
|
||||
|
||||
[DSM 6](dsm6.md)
|
||||
|
||||
[Scripts](scripts.md)
|
||||
- [crontab](crontab.md)
|
||||
- [Installer le shell bash](bash.md)
|
||||
- [Dossiers @eaDir](eadir.md)
|
||||
- [Scripts](scripts.md)
|
||||
- [WordPress](wordpress.md)
|
||||
|
||||
|
||||
|
||||
#### Liens:
|
||||
### DSM7
|
||||
|
||||
- [DSM 7](dsm7/dsm7.md)
|
||||
- [Node.js](dsm7/node.md)
|
||||
- [Python](dsm7/python.md)
|
||||
|
||||
|
||||
|
||||
### DSM6
|
||||
|
||||
- [DSM 6](dsm6/dsm6.md)
|
||||
- [Installer Gitea](dsm6/gitea.md)
|
||||
- [Installer ownCloud (depuis archive)](dsm6/owncloud.md)
|
||||
- [Installer Nextcloud](dsm6/nextcloud.md)
|
||||
- [PHP](dsm6/php.md)
|
||||
- [Python](dsm6/python)
|
||||
- [Services](dsm6/services.md)
|
||||
|
||||
|
||||
|
||||
### Liens:
|
||||
|
||||
[DS916+ Guide d'installation rapide](syno_qig_ds916_fra.pdf)
|
||||
|
||||
|
||||
460
docs/Synology/nginx.md
Normal file
460
docs/Synology/nginx.md
Normal file
@@ -0,0 +1,460 @@
|
||||
# nginx
|
||||
|
||||
|
||||
|
||||
#### SSL
|
||||
|
||||
Création d'un certificat ssl self-signed:
|
||||
|
||||
```bash
|
||||
$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
|
||||
# => /etc/ssl/certs/nginx-selfsigned.crt
|
||||
|
||||
$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
|
||||
# => /etc/ssl/certs/dhparam.pem
|
||||
|
||||
$ sudo nano /etc/nginx/snippets/self-signed.conf
|
||||
# ajouter:
|
||||
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
|
||||
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
||||
|
||||
$ sudo nano /etc/nginx/snippets/ssl-params.conf
|
||||
# ajouter:
|
||||
# from https://cipherli.st/
|
||||
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
|
||||
ssl_ecdh_curve secp384r1;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_tickets off;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
resolver 8.8.8.8 8.8.4.4 valid=300s;
|
||||
resolver_timeout 5s;
|
||||
# Disable preloading HSTS for now. You can use the commented out header line that includes
|
||||
# the "preload" directive if you understand the implications.
|
||||
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
|
||||
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
|
||||
add_header X-Frame-Options DENY;
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
|
||||
ssl_dhparam /etc/ssl/certs/dhparam.pem;
|
||||
```
|
||||
|
||||
Configurer nginx pour qu'il utilise SSL:
|
||||
|
||||
```bash
|
||||
$ sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak
|
||||
$ sudo nano /etc/nginx/sites-available/default
|
||||
```
|
||||
|
||||
```nginx
|
||||
# 1. Redirection http vers https
|
||||
# /etc/nginx/sites-available/default
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
root /var/www/debian/html;
|
||||
|
||||
index index.html index.htm index.php index.nginx-debian.html;
|
||||
|
||||
server_name localhost;
|
||||
# redirection temporaire (302), permanente (301)
|
||||
return 302 https://$server_name$request_uri;
|
||||
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
# SSL configuration
|
||||
|
||||
listen 443 ssl http2 default_server;
|
||||
listen [::]:443 ssl http2 default_server;
|
||||
include snippets/self-signed.conf;
|
||||
include snippets/ssl-params.conf;
|
||||
}
|
||||
```
|
||||
|
||||
```nginx
|
||||
# 2. Autoriser http et https
|
||||
# /etc/nginx/sites-available/default
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
listen 443 ssl http2 default_server;
|
||||
listen [::]:443 ssl http2 default_server;
|
||||
|
||||
root /var/www/debian/html;
|
||||
|
||||
index index.html index.htm index.php index.nginx-debian.html;
|
||||
|
||||
server_name localhost;
|
||||
return 302 https://$server_name$request_uri;
|
||||
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
include snippets/self-signed.conf;
|
||||
include snippets/ssl-params.conf;
|
||||
}
|
||||
```
|
||||
|
||||
Tester la configuration et redémarrer nginx:
|
||||
|
||||
```bash
|
||||
# message normal pour certificat auto-signé
|
||||
|
||||
$ sudo /usr/sbin/nginx -t
|
||||
nginx: [warn] "ssl_stapling" ignored, issuer certificate not found for certificate "/etc/ssl/certs/nginx-selfsigned.crt"
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
|
||||
$ sudo systemctl restart nginx
|
||||
```
|
||||
|
||||
Vérifier le status de nginx:
|
||||
|
||||
```bash
|
||||
$ systemctl status nginx
|
||||
● nginx.service - A high performance web server and a reverse proxy server
|
||||
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
|
||||
Active: active (running) since Tue 2021-07-13 09:30:48 CEST; 2min 58s ago
|
||||
Docs: man:nginx(8)
|
||||
Process: 14769 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, sta
|
||||
Process: 14770 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUC
|
||||
Main PID: 14771 (nginx)
|
||||
Tasks: 5 (limit: 4682)
|
||||
Memory: 5.7M
|
||||
CGroup: /system.slice/nginx.service
|
||||
├─14771 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
|
||||
├─14772 nginx: worker process
|
||||
├─14773 nginx: worker process
|
||||
├─14774 nginx: worker process
|
||||
└─14775 nginx: worker process
|
||||
|
||||
```
|
||||
|
||||
#### Logs
|
||||
|
||||
```bash
|
||||
/var/log/nginx$ ls -la
|
||||
-rw-r----- 1 www-data adm 2812 juil. 13 12:00 access.log
|
||||
-rw-r----- 1 www-data adm 3252 juil. 13 11:51 error.log
|
||||
```
|
||||
```bash
|
||||
$ nano /etc/nginx/nginx.conf
|
||||
```
|
||||
|
||||
```nginx
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Utilisation
|
||||
|
||||
On commande nginx avec SystemD (Debian 8+, ubuntu 16+, CentOS):
|
||||
|
||||
```bash
|
||||
$ systemctl stop nginx.service
|
||||
|
||||
$ systemctl start nginx.service
|
||||
|
||||
$ systemctl restart nginx
|
||||
|
||||
$ systemctl reload nginx
|
||||
|
||||
$ systemctl disable nginx
|
||||
|
||||
$ systemctl enable nginx
|
||||
|
||||
```
|
||||
|
||||
On peut controller directement nginx avec les signals:
|
||||
|
||||
```bash
|
||||
# Relancer nginx
|
||||
|
||||
$ sudo /usr/sbin/nginx -s reload
|
||||
```
|
||||
|
||||
Aide:
|
||||
|
||||
```bash
|
||||
$ sudo /usr/sbin/nginx -h
|
||||
nginx version: nginx/1.14.2
|
||||
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
|
||||
|
||||
Options:
|
||||
-?,-h : this help
|
||||
-v : show version and exit
|
||||
-V : show version and configure options then exit
|
||||
-t : test configuration and exit
|
||||
-T : test configuration, dump it and exit
|
||||
-q : suppress non-error messages during configuration testing
|
||||
-s signal : send signal to a master process: stop, quit, reopen, reload
|
||||
-p prefix : set prefix path (default: /usr/share/nginx/)
|
||||
-c filename : set configuration file (default: /etc/nginx/nginx.conf)
|
||||
-g directives : set global directives out of configuration file
|
||||
```
|
||||
|
||||
Tester la configuration:
|
||||
|
||||
```bash
|
||||
$ sudo /usr/sbin/nginx -t
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
```
|
||||
|
||||
Tester la configuration et l'afficher:
|
||||
|
||||
```nginx
|
||||
$ sudo /usr/sbin/nginx -T
|
||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||
# configuration file /etc/nginx/nginx.conf:
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
# server_tokens off;
|
||||
|
||||
.../...
|
||||
}
|
||||
|
||||
# configuration file /etc/nginx/modules-enabled/50-mod-http-auth-pam.conf:
|
||||
load_module modules/ngx_http_auth_pam_module.so;
|
||||
|
||||
# configuration file /etc/nginx/modules-enabled/50-mod-http-dav-ext.conf:
|
||||
load_module modules/ngx_http_dav_ext_module.so;
|
||||
|
||||
.../...
|
||||
|
||||
# configuration file /etc/nginx/mime.types:
|
||||
|
||||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
.../...
|
||||
}
|
||||
|
||||
# configuration file /etc/nginx/sites-enabled/default:
|
||||
##
|
||||
# You should look at the following URL's in order to grasp a solid understanding
|
||||
# of Nginx configuration files in order to fully unleash the power of Nginx.
|
||||
# https://www.nginx.com/resources/wiki/start/
|
||||
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
||||
# https://wiki.debian.org/Nginx/DirectoryStructure
|
||||
#
|
||||
# In most cases, administrators will remove this file from sites-enabled/ and
|
||||
# leave it as reference inside of sites-available where it will continue to be
|
||||
# updated by the nginx packaging team.
|
||||
#
|
||||
# This file will automatically load configuration files provided by other
|
||||
# applications, such as Drupal or Wordpress. These applications will be made
|
||||
# available underneath a path with that package name, such as /drupal8.
|
||||
#
|
||||
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
||||
##
|
||||
|
||||
# Default server configuration
|
||||
#
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
.../...
|
||||
|
||||
root /var/www/html;
|
||||
|
||||
# Add index.php to the list if you are using PHP
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
# First attempt to serve request as file, then
|
||||
# as directory, then fall back to displaying a 404.
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# pass PHP scripts to FastCGI server
|
||||
#
|
||||
#location ~ \.php$ {
|
||||
# include snippets/fastcgi-php.conf;
|
||||
#
|
||||
# # With php-fpm (or other unix sockets):
|
||||
# fastcgi_pass unix:/run/php/php7.3-fpm.sock;
|
||||
# # With php-cgi (or other tcp sockets):
|
||||
# fastcgi_pass 127.0.0.1:9000;
|
||||
#}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Virtual Host configuration for example.com
|
||||
#
|
||||
# You can move that to a different file under sites-available/ and symlink that
|
||||
# to sites-enabled/ to enable it.
|
||||
#
|
||||
#server {
|
||||
# listen 80;
|
||||
# listen [::]:80;
|
||||
#
|
||||
# server_name example.com;
|
||||
#
|
||||
# root /var/www/example.com;
|
||||
# index index.html;
|
||||
#
|
||||
# location / {
|
||||
# try_files $uri $uri/ =404;
|
||||
# }
|
||||
#}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```nginx
|
||||
http {
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /var/service/web;
|
||||
index index.html index.htm index.php;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/myexample.access.http.log;
|
||||
error_log /var/log/nginx/myexample.error.http.log;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /var/service/web;
|
||||
index index.html index.htm index.php;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/myexample.access.https.log;
|
||||
error_log /var/log/nginx/myexample.error.https.log;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/nginx/ssl/server.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
Site accessible via HTTP et HTTPS:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
root /var/www/html;
|
||||
index index.html index.htm index.php;
|
||||
server_name example.com example;
|
||||
access_log /var/log/nginx/myexample.access.http.log;
|
||||
error_log /var/log/nginx/myexample.error.http.log;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
root /var/www/html;
|
||||
index index.html index.htm index.php;
|
||||
server_name example.com example;
|
||||
access_log /var/log/nginx/myexample.access.https.log;
|
||||
error_log /var/log/nginx/myexample.error.https.log;
|
||||
ssl on;
|
||||
ssl_certificate /etc/nginx/ssl/server.crt;
|
||||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
||||
}
|
||||
```
|
||||
|
||||
Reverse proxy:
|
||||
|
||||
```nginx
|
||||
upstream mysite {
|
||||
server localhost:8080;
|
||||
}
|
||||
server {
|
||||
server_name mysite.local;
|
||||
location / {
|
||||
proxy_pass http://mysite.local;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
PHP:
|
||||
|
||||
```nginx
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
```
|
||||
|
||||
Redirige les www. vers la version sans www
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.monsupersite.fr;
|
||||
return 301 http://monsupersite.fr$request_uri;
|
||||
}
|
||||
```
|
||||
|
||||
@@ -275,11 +275,75 @@ bruno@silverbook:~$ ssh dsm916 ./kymsu/kymsu2.sh
|
||||
|
||||
|
||||
|
||||
#### Paquets opkg
|
||||
|
||||
```bash
|
||||
$ sudo opkg find '*lsof*'
|
||||
lsof - 4.94.0-1 - LiSt Open Files - a diagnostic tool
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Compiler dcraw.
|
||||
|
||||
Télécharger les [sources](https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/24922branch/evansport-source/), puis:
|
||||
|
||||
```bash
|
||||
$ gcc -o dcraw -O4 dcraw.c -lm -DNO_JPEG -DNODEP
|
||||
$ gcc -o dcraw -O4 dcraw.c -lm -DNO_JPEG -DNODEPS
|
||||
|
||||
$ gcc -o dcraw -O4 dcraw.c -lm -DNODEPS
|
||||
```
|
||||
Identifier sans décoder (-i)
|
||||
|
||||
```bash
|
||||
$ dcraw -i 2006-08-25_Brocard_0370.CR2
|
||||
2006-08-25_Brocard_0370.CR2 is a Canon EOS 20D image.
|
||||
```
|
||||
Identifier sans décoder (+mode verbose) (-i -v)
|
||||
|
||||
```bash
|
||||
$ dcraw -i -v 2020-10-16_Brocard_3606.CR3
|
||||
|
||||
Filename: 2020-10-16_Brocard_3606.CR3
|
||||
Timestamp: Fri Oct 16 18:38:17 2020
|
||||
Camera make: Canon
|
||||
Camera model: EOS 90D
|
||||
Owner: @Bruno Pesenti
|
||||
ISO speed: 1600
|
||||
Shutter: 1/49.4 sec
|
||||
Aperture: f/4.0
|
||||
Focal length: 500.0 mm
|
||||
Embedded ICC profile: no
|
||||
Number of raw images: 1
|
||||
Thumb size: 6960 x 4640
|
||||
Full size: 7128 x 4732
|
||||
Image size: 7128 x 4732
|
||||
Output size: 7128 x 4732
|
||||
Raw colors: 3
|
||||
Filter pattern: RG/GB
|
||||
Daylight multipliers: 1.000000 1.000000 1.000000
|
||||
```
|
||||
|
||||
Convertir dans l'espace sRGB (-o 1)
|
||||
|
||||
```bash
|
||||
$ dcraw -o 1 -v 2020-10-16_Brocard_3606.CR3
|
||||
Loading Canon EOS 90D image from 2020-10-16_Brocard_3606.CR3 ...
|
||||
Scaling with darkness 0, saturation 255, and
|
||||
multipliers 1.000000 1.000000 1.000000 1.000000
|
||||
AHD interpolation...
|
||||
Building histograms...
|
||||
Writing data to 2020-10-16_Brocard_3606.ppm ...
|
||||
```
|
||||
|
||||
Use the cameras White Balance (WB) (-w) et crér un fichier TIFF (-t)
|
||||
|
||||
```bash
|
||||
$ dcraw -o 1 -w -T 2016-09-28_Brocard_7953.CR2
|
||||
```
|
||||
|
||||
|
||||
|
||||
https://gist.github.com/darencard/500eca3d09e32283d5fe6377270fd9e8
|
||||
|
||||
41
docs/macos/Divers/parallels.md
Normal file
41
docs/macos/Divers/parallels.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Parallels Desktop
|
||||
|
||||
|
||||
|
||||
#### Accéder à une VM depuis macOS:
|
||||
|
||||
```bash
|
||||
$ prlctl enter "Debian GNU Linux"
|
||||
root@silverbook:/# ls
|
||||
bin boot dev etc home initrd.img initrd.img.old lib lib32 lib64 libx32 lost+found media mnt opt proc root run sbin srv sys tmp usr var vmlinuz vmlinuz.old
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Exécuter une commande dans une VM:
|
||||
|
||||
```bash
|
||||
$ prlctl exec "Debian GNU Linux" ifconfig
|
||||
enp0s5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
||||
inet 10.211.55.4 netmask 255.255.255.0 broadcast 10.211.55.255
|
||||
inet6 fdb2:2c26:f4e4:0:21c:42ff:fee9:7e1c prefixlen 64 scopeid 0x0<global>
|
||||
inet6 fe80::21c:42ff:fee9:7e1c prefixlen 64 scopeid 0x20<link>
|
||||
inet6 fdb2:2c26:f4e4:0:a1de:bde4:b68:5d63 prefixlen 64 scopeid 0x0<global>
|
||||
ether 00:1c:42:e9:7e:1c txqueuelen 1000 (Ethernet)
|
||||
RX packets 315106 bytes 338679740 (322.9 MiB)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 202399 bytes 24815933 (23.6 MiB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
|
||||
inet 127.0.0.1 netmask 255.0.0.0
|
||||
inet6 ::1 prefixlen 128 scopeid 0x10<host>
|
||||
loop txqueuelen 1000 (Local Loopback)
|
||||
RX packets 4488 bytes 5545309 (5.2 MiB)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 4488 bytes 5545309 (5.2 MiB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
```
|
||||
|
||||
42
docs/macos/Divers/vuepress.md
Normal file
42
docs/macos/Divers/vuepress.md
Normal file
@@ -0,0 +1,42 @@
|
||||
vuepress
|
||||
|
||||
|
||||
|
||||
Installation:
|
||||
|
||||
```bash
|
||||
npm i -g vuepress
|
||||
```
|
||||
|
||||
|
||||
|
||||
Crée du contenu:
|
||||
|
||||
```bash
|
||||
$ mkdir VuePress && cd VuePress
|
||||
|
||||
$ nano README.md
|
||||
|
||||
# Outreach shame
|
||||
Outreach Shame is the place to expose every lousy outreach emails. It’s every online marketer’s worst nightmares. These emails are everything you shouldn’t do to promote your business & content. Everything’s kept anonymous for good fun above all.
|
||||
|
||||
## How can you contribute?
|
||||
Simple, forward us the shameful email to *outreachshame@snipcart.com* where it’ll be up for moderation. We kindly ask you to censor any personal information from the email before forwarding it to us. Once your submission is accepted by our team it’ll be published on the site outreachshame.com.
|
||||
|
||||
## How it does work?
|
||||
Once a submission is approved, a commit is pushed in this [GitHub repository](https://github.com/snipcart/outreachshame). We then use [Forestry](https://forestry.io/#/) to make content editing and publishing easier for our dumb marketing folks. Once the entry is published, the site is built and deployed automatically on Netlify.
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
Démarrer le serveur de développement:
|
||||
|
||||
```bash
|
||||
$ vuepress dev
|
||||
```
|
||||
|
||||
|
||||
|
||||
Customiser:
|
||||
|
||||
16
docs/macos/Latex.md
Normal file
16
docs/macos/Latex.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Latex
|
||||
|
||||
|
||||
|
||||
### Erreurs:
|
||||
|
||||
```bash
|
||||
$ echo -e "$list" | pandoc --pdf-engine=lualatex -o brew.pdf
|
||||
|
||||
Error producing PDF.
|
||||
! LaTeX Error: File `lualatex-math.sty' not found.
|
||||
|
||||
```
|
||||
|
||||
https://tex.stackexchange.com/questions/160253/latex-cannot-find-sty-files/#280684
|
||||
|
||||
@@ -400,3 +400,5 @@ Info (version) sur le paquet 'fzf':
|
||||
$ brew info --installed --json=v2 | jq -r '{formulae} | .[] | .[] | select(.name == "fzf") | (.installed)' | jq -r '.[].version'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# WebServer
|
||||
# node.js
|
||||
|
||||
|
||||
|
||||
@@ -6,5 +6,7 @@
|
||||
|
||||
[node-js](node-js.md)
|
||||
|
||||
[nodeenv](nodeenv.md)
|
||||
|
||||
[nvm](nvm.md)
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ livephotoskit 1.4.11 1.5.2 1.5.2
|
||||
|
||||
1. Current: la version actuelle du module.
|
||||
2. Wanted: la dernière version qui satisfait le semver ranges decrit dans le package.json
|
||||
3. Latest: la toutedernière version du module disponible sur npm.
|
||||
3. Latest: la toute dernière version du module disponible sur npm.
|
||||
|
||||
<u>Mettre-à-jour:</u>
|
||||
|
||||
@@ -153,6 +153,139 @@ puis
|
||||
|
||||
|
||||
|
||||
#### Voir toutes les versions disponibles d'un module:
|
||||
|
||||
```bash
|
||||
# Option: --json
|
||||
|
||||
$ npm show @popperjs/core versions
|
||||
[
|
||||
'2.0.0-alpha.1', '2.0.0-alpha.2', '2.0.0-alpha.3',
|
||||
'2.0.0-alpha.4', '2.0.0-next.5', '2.0.0-next.6',
|
||||
'2.0.0-next.7', '2.0.0-next.8', '2.0.0-next.9',
|
||||
'2.0.0-next.10', '2.0.0-next.11', '2.0.0-next.12',
|
||||
'2.0.0-next.13', '2.0.0-next.14', '2.0.0-next.15',
|
||||
'2.0.0-next.16', '2.0.0-next.17', '2.0.0-rc.1',
|
||||
'2.0.0-rc.2', '2.0.0-rc.3', '2.0.0',
|
||||
'2.0.1', '2.0.2', '2.0.3',
|
||||
'2.0.4', '2.0.5', '2.0.6',
|
||||
'2.1.0', '2.1.1', '2.2.0-bundlephobia.1',
|
||||
'2.2.0', '2.2.1', '2.2.2',
|
||||
'2.2.3', '2.3.0', '2.3.1',
|
||||
'2.3.2', '2.3.3', '2.4.0',
|
||||
'2.4.1', '2.4.2', '2.4.3',
|
||||
'2.4.4', '2.5.0', '2.5.1',
|
||||
'2.5.2', '2.5.3', '2.5.4',
|
||||
'2.6.0', '2.7.0', '2.7.1',
|
||||
'2.7.2', '2.8.0', '2.8.1',
|
||||
'2.8.2', '2.8.3', '2.8.4',
|
||||
'2.8.5', '2.8.6', '2.9.0',
|
||||
'2.9.1', '2.9.2'
|
||||
]
|
||||
```
|
||||
|
||||
```bash
|
||||
# Sans les versions alpha et beta
|
||||
|
||||
$ npm show bootstrap@* version # bash OK, zsh NOK
|
||||
```
|
||||
|
||||
|
||||
|
||||
`"dependencies": { "express": "2.9.1" }` (major.minor.patch)
|
||||
|
||||
- major version: 2
|
||||
- minor version: 9
|
||||
- patch version: 1
|
||||
|
||||
|
||||
|
||||
#### Installer un module:
|
||||
|
||||
Installer une <u>version spécifique</u>:
|
||||
|
||||
```bash
|
||||
$ npm info @popperjs/core
|
||||
|
||||
@popperjs/core@2.9.2 | MIT | deps: none | versions: 62
|
||||
Tooltip and Popover Positioning Engine
|
||||
https://github.com/popperjs/popper-core#readme
|
||||
|
||||
dist-tags:
|
||||
latest: 2.9.2
|
||||
|
||||
# Version spécifique (@x.y.z)
|
||||
$ npm install @popperjs/core@2.8.0
|
||||
|
||||
$ npm ls
|
||||
Downloads@ /Users/bruno/Downloads
|
||||
└── @popperjs/core@2.8.0
|
||||
```
|
||||
|
||||
Installer <u>latest minor version</u>:
|
||||
|
||||
```bash
|
||||
$ npm info @popperjs/core
|
||||
|
||||
@popperjs/core@2.9.2 | MIT | deps: none | versions: 62
|
||||
Tooltip and Popover Positioning Engine
|
||||
https://github.com/popperjs/popper-core#readme
|
||||
|
||||
dist-tags:
|
||||
latest: 2.9.2
|
||||
|
||||
# Latest minor version (^)
|
||||
# Update to 2.*.*
|
||||
$ npm install @popperjs/core@^2.8.0
|
||||
|
||||
$ npm ls
|
||||
Downloads@ /Users/bruno/Downloads
|
||||
└── @popperjs/core@2.9.2
|
||||
```
|
||||
|
||||
Installer <u>latest patch version</u>:
|
||||
|
||||
```bash
|
||||
$ npm info @popperjs/core
|
||||
|
||||
@popperjs/core@2.9.2 | MIT | deps: none | versions: 62
|
||||
Tooltip and Popover Positioning Engine
|
||||
https://github.com/popperjs/popper-core#readme
|
||||
|
||||
dist-tags:
|
||||
latest: 2.9.2
|
||||
|
||||
# Latest patch version (~)
|
||||
# Update to 2.8.*
|
||||
$ npm install @popperjs/core@~2.8.0
|
||||
|
||||
$ npm ls
|
||||
Downloads@ /Users/bruno/Downloads
|
||||
└── @popperjs/core@2.8.6
|
||||
```
|
||||
|
||||
Installer la <u>dernière version</u>:
|
||||
|
||||
```bash
|
||||
$ npm info @popperjs/core
|
||||
|
||||
@popperjs/core@2.9.2 | MIT | deps: none | versions: 62
|
||||
Tooltip and Popover Positioning Engine
|
||||
https://github.com/popperjs/popper-core#readme
|
||||
|
||||
dist-tags:
|
||||
latest: 2.9.2
|
||||
|
||||
# Dernière version (@latest)
|
||||
$ npm install @popperjs/core@latest
|
||||
|
||||
$npm ls
|
||||
Downloads@ /Users/bruno/Downloads
|
||||
└── @popperjs/core@2.9.2
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Supprimer tous les modules:
|
||||
|
||||
```bash
|
||||
@@ -214,6 +347,42 @@ published over a year ago by cohara87 <cohara87@gmail.com>
|
||||
|
||||
|
||||
|
||||
#### Version d'un package installé:
|
||||
|
||||
```bash
|
||||
$ npm list bootstrap
|
||||
silverbook.local@1.0.0 /Users/bruno/Sites
|
||||
└── bootstrap@5.0.1
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Dernière version d'un package:
|
||||
|
||||
```bash
|
||||
$ npm view bootstrap version
|
||||
5.0.1
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Rechercher un package:
|
||||
|
||||
[npms.io](https://npms.io)
|
||||
|
||||
[Libraries.io](https://libraries.io/search?platforms=NPM)
|
||||
|
||||
```bash
|
||||
$ npm search tar
|
||||
NAME | DESCRIPTION | AUTHOR | DATE | VERSION | KEYWORDS
|
||||
tar | tar for node | =nlf… | 2020-08-14 | 6.0.5 |
|
||||
tar-fs | filesystem bindings… | =mafintosh… | 2020-11-06 | 2.1.1 | tar fs file tarball directory stream
|
||||
tar-stream | tar-stream is a… | =mafintosh… | 2020-09-10 | 2.1.4 | tar tarball parse parser generate generator stream stream2 streams streams2 str
|
||||
archiver | a streaming… | =ctalkington | 2020-09-11 | 5.0.2 | archive archiver stream zip tar
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Funding:
|
||||
|
||||
```bash
|
||||
@@ -300,23 +469,16 @@ $ npm install -g --unsafe-perm homebridge-config-ui-x
|
||||
added 362 packages, and audited 362 packages in 45s
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Packages:
|
||||
|
||||
[Rechercher un package](https://npms.io)
|
||||
Autre solution:
|
||||
|
||||
```bash
|
||||
$ npm search tar
|
||||
NAME | DESCRIPTION | AUTHOR | DATE | VERSION | KEYWORDS
|
||||
tar | tar for node | =nlf… | 2020-08-14 | 6.0.5 |
|
||||
tar-fs | filesystem bindings… | =mafintosh… | 2020-11-06 | 2.1.1 | tar fs file tarball directory stream
|
||||
tar-stream | tar-stream is a… | =mafintosh… | 2020-09-10 | 2.1.4 | tar tarball parse parser generate generator stream stream2 streams streams2 str
|
||||
archiver | a streaming… | =ctalkington | 2020-09-11 | 5.0.2 | archive archiver stream zip tar
|
||||
$ npm cache clean --force
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Packages:
|
||||
|
||||
##### uninstall-all-modules
|
||||
|
||||
Desinstaller tous les modules=
|
||||
|
||||
@@ -64,3 +64,9 @@ Coller les texte supprimer: `CTRL+Y`
|
||||
Supprimer le mot précédent: `CTRL+W`
|
||||
|
||||
Rechercher dans l'historique: `CTRL+R`
|
||||
|
||||
|
||||
|
||||
#### Date:
|
||||
|
||||
[How to format Date and Time in Linuxn macOS and Bash ?](https://www.shell-tips.com/linux/how-to-format-date-and-time-in-linux-macos-and-bash/)
|
||||
@@ -37,6 +37,7 @@ nav:
|
||||
- find: Linux/find.md
|
||||
- for: Linux/for.md
|
||||
- grep: Linux/grep.md
|
||||
- grep --options: Linux/grep-options-fr.md
|
||||
- Lire un fichier: Linux/read.md
|
||||
- MàJ sans internet: Linux/maj.md
|
||||
- Permissions: Linux/permissions.md
|
||||
@@ -198,7 +199,9 @@ nav:
|
||||
- Synology:
|
||||
- Index: Synology/index.md
|
||||
- bash: Synology/bash.md
|
||||
- crontab: Synology/crontab.md
|
||||
- Docker:
|
||||
- Joplin: Synology/Docker/joplin.md
|
||||
- Ports: Synology/Docker/ports.md
|
||||
- DSM 6: Synology/dsm6.md
|
||||
- eadir: Synology/eadir.md
|
||||
@@ -213,6 +216,7 @@ nav:
|
||||
- Python 3: Synology/python.md
|
||||
- Scripts: Synology/scripts.md
|
||||
- Services: Synology/services.md
|
||||
- WordPress: Synology/wordpress.md
|
||||
- Windows:
|
||||
- Index: Windows/index.md
|
||||
- Astuces: Windows/trucs.md
|
||||
@@ -236,6 +240,7 @@ nav:
|
||||
- Index: Divers/index.md
|
||||
- Adobe: Divers/adobe.md
|
||||
- bash:
|
||||
- Commandes: Divers/bash/commandes.md
|
||||
- direnv: Divers/bash/direnv.md
|
||||
- Exemples: Divers/bash/bash_exemples.md
|
||||
- Programmation: Divers/bash/programmation.md
|
||||
@@ -258,6 +263,7 @@ nav:
|
||||
- Synchroniser 2 dépôts: Divers/git/sync-repo.md
|
||||
- go: Divers/go.md
|
||||
- Homebridge: Divers/homebridge.md
|
||||
- Joplin: Divers/joplin.md
|
||||
- Markdown: Divers/markdown.md
|
||||
- Nextcloud: Divers/nextcloud.md
|
||||
- Plex: Divers/plex.md
|
||||
|
||||
Reference in New Issue
Block a user