From e6fc2251ec16d87d6569231c0373a0a23ee3df9c Mon Sep 17 00:00:00 2001 From: Bruno21 Date: Thu, 11 Nov 2021 10:53:38 +0100 Subject: [PATCH] 11-11-2021 --- docs/Divers/zsh/Untitled.md | 61 ++++ docs/Linux/find.md | 3 + docs/Linux/kill.md | 83 +++++ docs/Plesk/index.md | 36 ++ docs/Plesk/joplin.md | 16 + docs/Sonos/support.md | 10 + docs/Sonos/voyants.md | 45 +++ docs/Synology/dsm7/gitea.md | 332 ++++++++++++++++++ docs/Synology/dsm7/nextcloud.md | 34 ++ docs/Synology/dsm7/python.md | 25 ++ docs/Synology/dsm7/redis.md | 58 +++ docs/Windows/Chocolatey.md | 2 +- docs/Windows/wsl_2.md | 21 +- docs/macos/perl/homebrew.md | 233 ++++++++++++ docs/macos/perl/index.md | 24 ++ docs/macos/perl/{installer.md => perlbrew.md} | 250 +------------ docs/macos/python/pipx.md | 15 + mkdocs.yml | 4 +- 18 files changed, 1001 insertions(+), 251 deletions(-) create mode 100644 docs/Divers/zsh/Untitled.md create mode 100644 docs/Linux/kill.md create mode 100644 docs/Sonos/support.md create mode 100644 docs/Sonos/voyants.md create mode 100644 docs/Synology/dsm7/gitea.md create mode 100644 docs/Synology/dsm7/nextcloud.md create mode 100644 docs/Synology/dsm7/redis.md create mode 100644 docs/macos/perl/homebrew.md create mode 100644 docs/macos/perl/index.md rename docs/macos/perl/{installer.md => perlbrew.md} (51%) diff --git a/docs/Divers/zsh/Untitled.md b/docs/Divers/zsh/Untitled.md new file mode 100644 index 0000000..1541926 --- /dev/null +++ b/docs/Divers/zsh/Untitled.md @@ -0,0 +1,61 @@ +exa +https://the.exa.website/ +https://github.com/ogham/exa +ubuntu 20.10+ : apt install exa +debian : unstable repo +https://github.com/ogham/exa/releases/download/v0.10.0/exa-linux-armv7-v0.10.0.zip +http://ftp.br.debian.org/debian/pool/main/r/rust-exa/exa_0.10.1-1_arm64.deb +sudo dpkg -i exa_0.10.1-1_arm64.deb + + +fzf +https://github.com/junegunn/fzf +Debian 9+ : sudo apt-get install fzf +Ubuntu 19.10+ : sudo apt-get install fzf + +dotbare + + + +zoxide +https://github.com/ajeetdsouza/zoxide +ubuntu 21.04+ : apt install zoxide +debian11+ : apt install zoxide +curl -sS https://webinstall.dev/zoxide | bash + + + +rg + + + +rga + + + +dircolors +partie de coreutils +http://www.gnu.org/software/coreutils/ +ubuntu : sudo apt install coreutils + +mstsc.exe + + +zinit + + +rust +https://www.rust-lang.org/ +wsl : curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + + + +nanorc + +```bash +curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh +``` + + + +sudo apt install cabextract p7zip-full unzip \ No newline at end of file diff --git a/docs/Linux/find.md b/docs/Linux/find.md index 14cf230..fc5cf42 100644 --- a/docs/Linux/find.md +++ b/docs/Linux/find.md @@ -318,6 +318,9 @@ find: ‘/volume1/@appstore/Gitea/gitea/.ssh’: Permission denied ``` Tous les messages d'erreurs sont redirigés avec `2>/dev/null` vers la poubelle. ```bash +$ find / -name site-packages -type d -print 2>/dev/null + + $ find /volume1/@appstore/ -name "*php*.ini" 2>/dev/null /volume1/@appstore/PHP7.0/usr/local/etc/php70/php.ini /volume1/@appstore/PHP7.2/misc/php-fpm.ini diff --git a/docs/Linux/kill.md b/docs/Linux/kill.md new file mode 100644 index 0000000..f340c05 --- /dev/null +++ b/docs/Linux/kill.md @@ -0,0 +1,83 @@ +# kill + + + +La commande **kill** permet d’**envoyer un signal à un processus**. + +Elle est couramment utilisée pour fermer (**tuer**) un programme en cours d’exécution. + + + +Pour utiliser la commande **kill**, il est nécessaire de connaître le **PID** du processus à fermer. + +On utilise pour cela la commande **pidof**: + +```bash +bruno@DS916:~ $ pidof gitea +7189 +``` + + + +```bash +bruno@DS916:~ $ ps auxw | grep gitea +bruno 18268 0.0 0.0 5856 964 pts/0 S+ 12:57 0:00 grep gitea +``` + +On peut ensuite fermer (tuer) proprement le processus: + +```bash +bruno@DS916:~ $ kill 7189 +``` + + + +Si on n’arrivez pas à fermer un programme qui a par exemple planter, il est interressant d’utiliser **kill** avec une option particulière permettant de **forcer la fermeture du processus** + +La **commande kill** permet d’envoyer des signaux à des processus, le signal utilisé pour forcer la fermeture d’un programme est **SIGKILL.** Sachez également que les signaux sont numérotés, le signal SIGKILL a le numéro 9. + +Pour forcer la fermeture d’un processus, utilisez la commande **kill** avec l’**option -s**, cette option permet de spécifier le signal à envoyer. + +```bash +bruno@DS916:~ $ kill -s 9 7189 +``` + +```bash +bruno@DS916:~ $ kill -s SIGKILL 7189 +``` + +One-line: + +```bash +bruno@DS916:~ kill $(pidof firefox) +``` + + + +On peut aussi utiliser la commande **pkill**: + +```bash +$ pkill gitea +``` + +et en forçant la fermeture: + +```bash +$ pkill -KILL gitea +``` + + + +##### Lister les signaux disponibles + +```bash +$ kill -l + 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP + 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 +11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM +16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP +21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ +26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR +31) SIGSYS +``` + diff --git a/docs/Plesk/index.md b/docs/Plesk/index.md index ea04fca..f339da9 100644 --- a/docs/Plesk/index.md +++ b/docs/Plesk/index.md @@ -181,3 +181,39 @@ Ne marche pas !! [nextcloud](nextcloud.md) +https://support.plesk.com/hc/en-us/articles/360003876473-How-to-clean-temporary-Plesk-files-on-a-Linux-server + +```bash +root@localhost:~# df -h /tmp +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/vg00-lv01 47G 44G 1,2G 98% / +root@localhost:~# df -h / +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/vg00-lv01 47G 44G 1,2G 98% / + +``` + +Allocate additional disk space or remove unnecessary files in `/var/lib/psa/dumps`. + +```bash +# find / -type f -size +200M -exec du -h {} + 2>/dev/null | sort -r -h +5,0G /var/lib/psa/dumps/domains/sur-le-sentier.fr/backup_user-data_2108080143.tgz +2,5G /var/www/vhosts/sur-le-sentier.fr/.wp-toolkit/snapshots/instance_files_2_52x7sld.zip +1,3G /var/lib/psa/dumps/domains/maboiteverte.fr/backup_user-data_2110310443.tgz +445M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-08-28_00-30-sql-d1408.tar +445M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-08-21_01-02-sql-30d72.tar +445M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-08-13_21-16-sql-4a9e7.tar +444M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-08-06_21-55-sql-e4946.tar +444M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-07-31_00-58-sql-55db0.tar +444M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-07-23_19-09-sql-f389e.tar +443M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-09-18_00-06-sql-a7089.tar +443M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-09-11_01-02-sql-43a2f.tar +442M /var/www/vhosts/sur-le-sentier.fr/httpdocs/blog/wp-content/backups-hsmHO/backup_sur-le-sentier.fr-2021-09-03_16-27-sql-24b6a.tar +357M /var/lib/fail2ban/fail2ban.sqlite3.20210913-061953 +357M /var/lib/fail2ban/fail2ban.sqlite3.20210802-061844 +357M /var/lib/fail2ban/fail2ban.sqlite3 +272M /var/lib/psa/dumps/domains/sur-le-sentier.fr/backup_user-data_2108080143_2108150143.tgz +251M /var/lib/psa/dumps/domains/sur-le-sentier.fr/backup_user-data_2108080143_2108290143.tgz +251M /var/lib/psa/dumps/domains/sur-le-sentier.fr/backup_user-data_2108080143_2108220143.tgz +``` + diff --git a/docs/Plesk/joplin.md b/docs/Plesk/joplin.md index 9d914de..a82489c 100644 --- a/docs/Plesk/joplin.md +++ b/docs/Plesk/joplin.md @@ -138,6 +138,22 @@ COMPOSE_HTTP_TIMEOUT=200 +## Backup / restore Joplin database + +### Backup: + +```bash +$ docker exec -it joplin-server_db_1 pg_dumpall -U joplin > db.sql +``` + +### Restore: + +```bash +$ docker exec -i joplin-server_db_1 psql -U joplin < db.sql +``` + + + ### Application Joplin Préférences -> Synchronisation: diff --git a/docs/Sonos/support.md b/docs/Sonos/support.md new file mode 100644 index 0000000..5ca361d --- /dev/null +++ b/docs/Sonos/support.md @@ -0,0 +1,10 @@ +# Support + + + +https://support.sonos.com/s/?language=fr + + + +[Forum](https://en.community.sonos.com) + diff --git a/docs/Sonos/voyants.md b/docs/Sonos/voyants.md new file mode 100644 index 0000000..83c5b3c --- /dev/null +++ b/docs/Sonos/voyants.md @@ -0,0 +1,45 @@ +# Voyants + + + +https://support.sonos.com/s/article/226?language=fr&utm_source=doc-care&utm_medium=led&utm_campaign=fr-doc-care-led + + + +### Voyant d'état + +| Voyant | Etat | +| ----------------------------------------- | ------------------------------------------------------------ | +| Blanc fixe | Le produit Sonos est alimenté et fonctionne correctement. | +| Aucun voyant allumé | Le produit Sonos n'est pas sous tension. Vérifiez que le câble d’alimentation est parfaitement inséré dans le produit Sonos et branché à une prise électrique. Si vous possédez une enceinte nomade Sonos, remettez-la en marche à l'aide du bouton d'alimentation ou en la plaçant sur son socle de charge.
Le voyant d'état peut également être désactivé à l'aide de l'application Sonos. Si votre produit Sonos fonctionne correctement et apparaît dans l'application Sonos, vous pouvez [activer ou désactiver le voyant d'état](https://support.sonos.com/s/article/5040) depuis l'onglet Paramètres. Le voyant est éteint par défaut sur la Sonos Arc. | +| Blanc clignotant | Le produit Sonos est en cours de redémarrage après avoir été branché au secteur. Le voyant d'état clignote également en blanc lorsqu'une connexion au réseau est en attente. | +| Vert fixe | Le son est coupé sur le produit Sonos. Vous pouvez augmenter le volume en utilisant l'application Sonos ou les commandes de volume présentes sur le produit. | +| Vert clignotant | Le produit Sonos est allumé et prêt à être [configuré](https://support.sonos.com/s/article/2627). Le produit n'a pas encore été configuré ou connecté à un système Sonos. | +| Orange fixe | Durant la configuration, un voyant orange fixe signifie que le produit Sonos n'a pas pu terminer le processus de configuration. Vous pouvez corriger cet état en [redémarrant votre produit Sonos](https://support.sonos.com/s/article/3636).
Un voyant orange fixe peut également indiquer que le produit Sonos est en surchauffe. Éteignez votre produit Sonos et laissez-le refroidir avant de le rallumer. | +| Orange clignotant | Durant la configuration, le voyant d'état clignote en orange pendant que le produit Sonos établit une connexion.
Le voyant d'état peut clignoter rapidement en orange après que vous ayez appuyé sur le bouton Lecture/Pause d'un produit Sonos. Cela signifie qu'il n'y a rien dans la liste d'attente de lecture ou qu'aucun titre n'a été joué récemment. Si cela se produit, utilisez l'application Sonos pour commencer à lire quelque chose. | +| Orange et blanc clignotant | Le voyant d'état clignote en orange et en blanc pendant que votre produit est en cours de mise à jour.
Si vous êtes en train de [réinitialiser votre produit Sonos](https://support.sonos.com/s/article/1096), le voyant d'état clignote en orange et en blanc pendant que la réinitialisation est en cours. | +| Rouge clignotant | Un produit Sonos neuf (ou réinitialisé) affichera un voyant rouge clignotant s'il n'est pas configuré dans les 30 minutes suivant sa mise en marche. Vous pouvez corriger cet état en [redémarrant votre produit Sonos](https://support.sonos.com/s/article/3636). | +| Rouge et blanc clignotant | La mise à jour du produit Sonos a échoué. [Redémarrez votre produit Sonos](https://support.sonos.com/s/article/3636) et réessayez de mettre à jour le produit. Si le problème persiste, [contactez l'assistance Sonos](https://support.sonos.com/s/contact). | +| Bleu clignotant | Le produit nomade Sonos est en [mode d'appairage Bluetooth](https://support.sonos.com/s/article/4982) et peut se connecter à un appareil en Bluetooth. | +| Bleu fixe | Le produit nomade Sonos est connecté à un appareil en mode Bluetooth. Notez que le voyant restera bleu fixe si le produit Sonos perd la connexion avec l'appareil. | +| Clignotement rouge, blanc, orange et vert | Le produit Sonos est en mode de diagnostic matériel. Vous pouvez corriger cela en appuyant sur le bouton d'association du produit. Si votre produit n'a pas de bouton d'association, vous pouvez à la place appuyer sur le bouton Lecture/Pause ou Muet . | + + + +### Voyant du micro + +| | | +| ------------------- | ------------------------------------------------------------ | +| Aucun voyant allumé | Le microphone du produit Sonos est désactivé. Les assistants vocaux et Trueplay™ automatique ne sont pas disponibles. | +| Blanc fixe | Le microphone est activé. | + + + +### Voyant de la batterie + +| | | +| ----------------- | ------------------------------------------------------------ | +| Orange fixe | Le produit nomade Sonos est en cours de charge. Le voyant s'affiche pendant dix secondes une fois le produit nomade Sonos branché sur une prise secteur. Le produit continuera sa recharge lorsque le voyant s'éteindra. | +| Orange clignotant | Le niveau de la batterie du produit nomade Sonos est faible (<15%). | +| Rouge clignotant | Le produit nomade Sonos présente une défaillance. Si vous voyez un voyant d'état de batterie rouge clignotant, [contactez l'assistance Sonos](https://support.sonos.com/s/contact). | + diff --git a/docs/Synology/dsm7/gitea.md b/docs/Synology/dsm7/gitea.md new file mode 100644 index 0000000..a24db11 --- /dev/null +++ b/docs/Synology/dsm7/gitea.md @@ -0,0 +1,332 @@ +# Gitea + + + +Le paquet [gitea-spk](https://github.com/flipswitchingmonkey/gitea-spk) n'a pas été mis à jour pour DSM7. Il faut donc installer Gitea d'après les [binaires](https://docs.gitea.io/en-us/install-from-binary/). + + + +### Installation: + +Déclarer le répertoire d'installation dans `.bashrc`: + +``` +export GITEA_WORK_DIR=/var/services/homes/bruno/gitea +``` + +Préparer les répertoires: + +```bash +# dossier d'installation +mkdir -p $GITEA_WORK_DIR/{custom,data,log} +#chown -R git:git $GITEA_WORK_DIR/ +chown -R bruno:users $GITEA_WORK_DIR/ +chmod -R 750 $GITEA_WORK_DIR/ + +# dossier de configuration +mkdir /etc/gitea +#chown root:git /etc/gitea +chown bruno:users /etc/gitea +chmod 770 /etc/gitea +``` + +Télécharger Gitea + +```bash +wget -O gitea https://dl.gitea.io/gitea/1.15.4/gitea-1.15.4-linux-amd64 +chmod +x gitea +mv gitea /usr/local/bin/ +``` + +Lancer Gitea + +```bash +gitea web + +GITEA_WORK_DIR=/var/lib/gitea/ /usr/local/bin/gitea web -c /etc/gitea/app.ini +``` + + + +### Configuration: + +#### Accéder au site: + + http://localhost:3000 . Si Safari ne peut y accéder parce que la connexion n'est pas sécurisée (*HSTS Policy*): + +1. `command + ,` +2. **Confidentialité** -> **Gérer les données de sites web**... +3. Chercher *localhost* +4. Clic **Supprimer** + + + +DSM -> Portail des applications -> Proxy inversé + +| | Source | Destination | +| ---------- | -------------------- | ----------- | +| Protocole | HTTPS | HTTP | +| Nom d'hôte | clicclac.synology.me | localhost | +| Port | 3001 | 3000 | + +Apache: + +```bash + + ProxyPreserveHost On + ProxyRequests off + ProxyPass / http://localhost:3000/ + ProxyPassReverse / http://localhost:3000/ + +``` + +Nginx: + +```bash +server { + listen 80; + server_name git.example.com; + + location / { + proxy_pass http://localhost:3000; + } +} +``` + + + +#### Configuration: + +Base: sqlite3 (impossible de se connecter à mariadb) + +PATH: = /var/services/homes/bruno/gitea/data/gitea.db + + + +Une fois Gitea installé et configuré, on peut sécuriser le fichier de configuration: + +```bash +chmod 750 /etc/gitea +chmod 640 /etc/gitea/app.ini +``` + + + +Les repos sont stockés ici: + +```bash +ROOT = /var/services/homes/bruno/gitea/data/gitea-repositories +``` + +et les logs là: + +```bash +ROOT_PATH = /var/services/homes/bruno/gitea/log +``` + + + +On peut lancer gitea depuis un script: + +```bash +$ /usr/local/bin/gitea web -c /etc/gitea/app.ini +``` + +ou depuis un service. + + + +### Service + +A installer dans `/etc/systemd/system`: + +```ini +[Unit] +Description=Gitea (Git with a cup of tea) +After=syslog.target +After=network.target +### +# Don't forget to add the database service dependencies +### +# +#Wants=mysql.service +#After=mysql.service +# +#Wants=mariadb.service +#After=mariadb.service +# +#Wants=postgresql.service +#After=postgresql.service +# +#Wants=memcached.service +#After=memcached.service +# +#Wants=redis.service +#After=redis.service +# +### +# If using socket activation for main http/s +### +# +#After=gitea.main.socket +#Requires=gitea.main.socket +# +### +# (You can also provide gitea an http fallback and/or ssh socket too) +# +# An example of /etc/systemd/system/gitea.main.socket +### +## +## [Unit] +## Description=Gitea Web Socket +## PartOf=gitea.service +## +## [Socket] +## Service=gitea.service +## ListenStream= +## NoDelay=true +## +## [Install] +## WantedBy=sockets.target +## +### + +[Service] +# Modify these two values and uncomment them if you have +# repos with lots of files and get an HTTP error 500 because +# of that +### +#LimitMEMLOCK=infinity +#LimitNOFILE=65535 +RestartSec=2s +Type=simple +User=bruno +Group=users +WorkingDirectory=/var/services/homes/bruno/gitea/ +# If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file +# (manually creating /run/gitea doesn't work, because it would not persist across reboots) +#RuntimeDirectory=gitea +ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini +Restart=always +Environment=USER=bruno HOME=/var/services/homes/bruno GITEA_WORK_DIR=/var/services/homes/bruno/gitea +# If you install Git to directory prefix other than default PATH (which happens +# for example if you install other versions of Git side-to-side with +# distribution version), uncomment below line and add that prefix to PATH +# Don't forget to place git-lfs binary on the PATH below if you want to enable +# Git LFS support +#Environment=PATH=/path/to/git/bin:/bin:/sbin:/usr/bin:/usr/sbin +# If you want to bind Gitea to a port below 1024, uncomment +# the two values below, or use socket activation to pass Gitea its ports as above +### +#CapabilityBoundingSet=CAP_NET_BIND_SERVICE +#AmbientCapabilities=CAP_NET_BIND_SERVICE +### + +[Install] +WantedBy=multi-user.target + +``` + + + +Activer le service gitea au démarrage: + +```bash +$ sudo systemctl enable gitea +``` + + + +Démarrer le service gitea: + +```bash +$ sudo systemctl start gitea +``` + + + +Vérifier le status de gitea: + +```bash +$ sudo systemctl status -l gitea +``` + +```bash +$ ps auxw | grep gitea +bruno 8220 0.8 6.2 2038820 122672 ? Ssl 20:26 0:02 /usr/local/bin/gitea web --config /etc/gitea/app.ini +bruno 9790 0.0 0.0 2860 184 pts/1 D+ 20:32 0:00 grep gitea +``` + + + +### Mise-à-jour + +Depuis un script `dsm7-gitea-update.sh`: + +```bash +#!/bin/bash + +GITEA_BIN=`which gitea` +if [ "$GITEA_BIN" == "*gitea*" ]; then + echo "Gitea is not installed..." + exit 0 +fi +GITEA_INSTALLED=`$GITEA_BIN --version | cut -d \ -f 3` + +LATEST_URL=`curl -Ls -o /dev/null -w %{url_effective} https://github.com/go-gitea/gitea/releases/latest` +#https://github.com/go-gitea/gitea/releases/tag/v1.11.3 + +#echo LATEST_URL = ${LATEST_URL} +GITEA_VERSION=${LATEST_URL##*/v} + +if [ "${GITEA_INSTALLED}" != "${GITEA_VERSION}" ]; then + echo "No Gitea update available..." + exit 0 + +else + echo "Installed: "${GITEA_INSTALLED} + echo "Latest: "${GITEA_VERSION} + + + a=$(echo -e "Do you wanna update Gitea to ${GITEA_VERSION} ? (y/n)") + read -p "$a" choice + + if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then + + rm -rf /tmp/gitea + mkdir /tmp/gitea + cd /tmp/gitea + + sudo systemctl stop gitea + + echo "Download latest Gitea..." + GITEA_ARCHIVE=gitea-${GITEA_VERSION}-linux-amd64.xz + #DOWNLOAD_URL=https://github.com/go-gitea/gitea/releases/download/v${GITEA_VERSION}/gitea-${GITEA_VERSION}-linux-amd64.xz + DOWNLOAD_URL=https://github.com/go-gitea/gitea/releases/download/v${GITEA_VERSION}/${GITEA_ARCHIVE} + echo ${DOWNLOAD_URL} + + wget -P /tmp/gitea ${DOWNLOAD_URL} + # sudo opkg install xz + # sudo opkg install tar (sinon tar: unrecognized option '--exclude=INFO.in') + xz --decompress ${GITEA_ARCHIVE} + + echo "Installing Gitea ${GITEA_VERSION}..." + filename="${GITEA_ARCHIVE%.*}" + + if [[ "$filename" =~ gitea ]]; then + mv $filename gitea + sudo mv gitea `dirname "$GITEA_BIN"` + fi + sudo chmod +x ${GITEA_BIN} + sudo chown root:root ${GITEA_BIN} + + sudo systemctl start gitea + + sudo systemctl status gitea + + fi +fi + +exit 1 +``` + diff --git a/docs/Synology/dsm7/nextcloud.md b/docs/Synology/dsm7/nextcloud.md new file mode 100644 index 0000000..bf14def --- /dev/null +++ b/docs/Synology/dsm7/nextcloud.md @@ -0,0 +1,34 @@ +# Nextcloud + + + +https://blog.viking-studios.net/en/nextcloud-hub-optimization-on-a-synology-diskstation-with-dsm-6/ + + + + + +config.php + +``` + 'memcache.local' => '\OC\Memcache\APCu', + 'memcache.distributed' => '\\OC\\Memcache\\Redis', + 'redis' => + array ( + 'host' => '127.0.0.1', + 'port' => '6379', + 'timeout' => '0', + 'dbindex' => '0', + ), + 'memcache.locking' => '\OC\Memcache\Redis', +``` + + + + + +``` +[apc] +apc.enable_cli=1 +``` + diff --git a/docs/Synology/dsm7/python.md b/docs/Synology/dsm7/python.md index 52df701..3a5d597 100644 --- a/docs/Synology/dsm7/python.md +++ b/docs/Synology/dsm7/python.md @@ -12,6 +12,27 @@ Python 3.8.8 $ which python /bin/python + +# Les modules sont installés là: +# /usr/lib/python3.8/site-packages +# /volume1/homes/bruno/.local/lib/python3.8/site-packages + +$ find / -iname "site-packages" -type d -print 2>/dev/null +``` + + + +Python 2 est aussi installé: + +```bash +$ python2 -V +Python 2.7.18 + +$ which python2 +/usr/local/bin/python2 + +# Les modules sont installés là: +# /usr/local/lib/python2.7/site-packages ``` @@ -42,6 +63,10 @@ Local installation: ```bash $ which pip3 /var/services/homes/bruno/.local/bin/pip3 + +bruno@DS916:~/.local/bin $ pip --version +bruno@DS916:~/.local/bin $ pip3 --version +pip 21.1.3 from /var/services/homes/bruno/.local/lib/python3.8/site-packages/pip (python 3.8) ``` diff --git a/docs/Synology/dsm7/redis.md b/docs/Synology/dsm7/redis.md new file mode 100644 index 0000000..5a8f9d0 --- /dev/null +++ b/docs/Synology/dsm7/redis.md @@ -0,0 +1,58 @@ +# Redis + + + +https://digitalboxweb.wordpress.com/2020/02/01/redis-sur-nas-synology/ + + + +1. Ajouter le repo DigitalBox comme source de paquets (http://digital.box.free.fr/sspks) + +2. Depuis le Centre de paquets, installer le paquet Redis. + +3. Vérifier que Redis est correctement installé: + + ```bash + $ cd /var/packages/redis/target/bin + total 3676 + drwxr-xr-x 1 sc-redis sc-redis 160 Jul 26 09:43 . + drwxr-xr-x 1 sc-redis sc-redis 18 Nov 10 09:21 .. + -rwxr-xr-x 1 sc-redis sc-redis 892760 Jul 26 09:43 redis-benchmark + lrwxrwxrwx 1 sc-redis sc-redis 12 Jul 26 09:43 redis-check-aof -> redis-server + lrwxrwxrwx 1 sc-redis sc-redis 12 Jul 26 09:43 redis-check-rdb -> redis-server + -rwxr-xr-x 1 sc-redis sc-redis 835832 Jul 26 09:43 redis-cli + lrwxrwxrwx 1 sc-redis sc-redis 12 Jul 26 09:43 redis-sentinel -> redis-server + -rwxr-xr-x 1 sc-redis sc-redis 2018008 Jul 26 09:43 redis-server + + $ ./redis-cli + 127.0.0.1:6379> ping + PONG + ``` + +4. Activer Redis dans PHP: + + Redis n'est pas proposé dans les extensions, bien que le module soit présent.. + + ```bash + $ ls /volume1/@appstore/PHP7.3/usr/local/lib/php73/modules/redis.so + /volume1/@appstore/PHP7.3/usr/local/lib/php73/modules/redis.so + ``` + + ```bash + sudo nano /usr/local/etc/php73/cli/conf.d/extension.ini + + # Ajouter la ligne extension = redis.so juste après posix.po + ``` + + ```bash + sudo nano /volume1/@appstore/PHP7.3/misc/extension_list.json + + # Ajouter le bloc suivant après le bloc posix + "redis": { + "enable_default": true, + "desc": "The phpredis extension provides an API for communicating with the Redis key-value store." + }, + ``` + +5. Redis est maintenant disponible dans les extensions PHP. On l'active. + diff --git a/docs/Windows/Chocolatey.md b/docs/Windows/Chocolatey.md index e2c4582..f699701 100644 --- a/docs/Windows/Chocolatey.md +++ b/docs/Windows/Chocolatey.md @@ -13,7 +13,7 @@ RemoteSigned ``` Si la réponse est `Restricted`, lancez: ```powershell -PS Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process. +PS Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process ``` Puis lancez la commande suivante: diff --git a/docs/Windows/wsl_2.md b/docs/Windows/wsl_2.md index e763923..1413bd5 100644 --- a/docs/Windows/wsl_2.md +++ b/docs/Windows/wsl_2.md @@ -42,7 +42,7 @@ Exécuter "notepad $PROFILE" et ajouter à la fin: ```powershell Import-Module posh-git Import-Module oh-my-posh -Set-Theme Paradox +Set-PoshPrompt -Theme cert ``` @@ -133,6 +133,18 @@ Ajouter la ligne suivante au .zshrc +#### Installer zoxide + +Ubuntu + +```bash +wget http://archive.ubuntu.com/ubuntu/pool/universe/r/rust-zoxide/zoxide_0.4.3-2_amd64.deb + +wget http://ports.ubuntu.com/pool/universe/r/rust-zoxide/zoxide_0.4.3-2_arm64.deb +``` + + + ### SSH #### Générer une paire de clé ssh sous Windows: @@ -144,6 +156,13 @@ Enter file in which to save the key (C:\Users\bruno/.ssh/id_rsa): Created directory 'C:\Users\bruno/.ssh'. ``` +```powershell +d---- 06/10/2021 17:23 .ssh + +-a--- 06/10/2021 17:23 2602 id_rsa +-a--- 06/10/2021 17:23 571 id_rsa.pub +``` + #### Copier les clés dans wsl: diff --git a/docs/macos/perl/homebrew.md b/docs/macos/perl/homebrew.md new file mode 100644 index 0000000..72ad4b8 --- /dev/null +++ b/docs/macos/perl/homebrew.md @@ -0,0 +1,233 @@ +# Perl (Homebrew) + + + +On peut installer une version plus récente de Perl avec **Homebrew**: + +```bash +$ brew install perl +``` + +```bash +$ brew info perl +zsh: correct 'perl' to 'perl5' [nyae]? n + +perl: stable 5.30.0 (bottled), HEAD +Highly capable, feature-rich programming language +https://www.perl.org/ +/usr/local/Cellar/perl/5.30.0 (2,440 files, 61.8MB) * + Poured from bottle on 2019-08-04 at 13:32:46 +From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/perl.rb +==> Options +--HEAD + Install HEAD version +==> Caveats +By default non-brewed cpan modules are installed to the Cellar. If you wish +for your modules to persist across updates we recommend using `local::lib`. + +You can set that up like this: + PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib + echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.zshrc +``` + +```bash +$ which perl +/usr/local/bin/perl + +$ perl -v + +This is perl 5, version 30, subversion 0 (v5.30.0) built for darwin-thread-multi-2level + +Copyright 1987-2019, Larry Wall + +Perl may be copied only under the terms of either the Artistic License or the +GNU General Public License, which may be found in the Perl 5 source kit. + +Complete documentation for Perl, including FAQ lists, should be found on +this system using "man perl" or "perldoc perl". If you have access to the +Internet, point your browser at http://www.perl.org/, the Perl Home Page. +``` + +#### cpan: + +**cpan** gère les modules Perl. + +```bash +$ cpan +Loading internal logger. Log::Log4perl recommended for better logging + +CPAN.pm requires configuration, but most of it can be done automatically. +If you answer 'no' below, you will enter an interactive dialog for each +configuration option instead. + +Would you like to configure as much as possible automatically? [yes] yes + + +Autoconfiguration complete. + +commit: wrote '/Users/bruno/.cpan/CPAN/MyConfig.pm' + +You can re-run configuration any time with 'o conf init' in the CPAN shell +Terminal does not support AddHistory. + +To fix enter> install Term::ReadLine::Perl + + +cpan shell -- CPAN exploration and modules installation (v2.22) +Enter 'h' for help. +``` + +Sans argument, la commande **cpan** ouvre un shell: + +```bash +$ cpan +Loading internal logger. Log::Log4perl recommended for better logging + +cpan shell -- CPAN exploration and modules installation (v2.27) +Enter 'h' for help. + +cpan[1]> h +``` + +```bash +cpan[1]> h + +Display Information (ver 2.27) + command argument description + a,b,d,m WORD or /REGEXP/ about authors, bundles, distributions, modules + i WORD or /REGEXP/ about any of the above + ls AUTHOR or GLOB about files in the author's directory + (with WORD being a module, bundle or author name or a distribution + name of the form AUTHOR/DISTRIBUTION) + +Download, Test, Make, Install... + get download clean make clean + make make (implies get) look open subshell in dist directory + test make test (implies make) readme display these README files + install make install (implies test) perldoc display POD documentation + +Upgrade installed modules + r WORDs or /REGEXP/ or NONE report updates for some/matching/all + upgrade WORDs or /REGEXP/ or NONE upgrade some/matching/all modules + +Pragmas + force CMD try hard to do command fforce CMD try harder + notest CMD skip testing + +Other + h,? display this menu ! perl-code eval a perl command + o conf [opt] set and query options q quit the cpan shell + reload cpan load CPAN.pm again reload index load newer indices + autobundle Snapshot recent latest CPAN uploads +``` + +La commande **cpan** peut aussi s'utiliser avec arguments: + + + +Avec Perl installé via homebrew, les modules sont installés dans Cellar (`Installing /usr/local/Cellar/perl/5.30.0/lib/perl5/site_perl/5.30.0/CPAN/DistnameInfo.pm`). Ils sont donc perdu à chaque mise-à-jour de Perl. + +Il est donc conseillé d'utiliser `local::lib` + +```bash +PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib +echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.zshrc + +# les dossiers suivants sont crées: +# $HOME/perl5/bin/ +# $HOME/perl5/lib/ +# +# à côté de $HOME/perl5/perlbrew/ +``` + +Les modules sont alors installés ici `Installing /Users/bruno/perl5/lib/perl5/Log/Log4perl.pm` + + + +##### Info sur un module: `cpan -D ` + +```bash +$ cpan -D CPAN::DistnameInfo +Reading '/Users/bruno/.cpan/Metadata' + Database was generated on Tue, 17 Dec 2019 07:29:02 GMT +CPAN::DistnameInfo +------------------------------------------------------------------------- + CPAN: Module::CoreList loaded ok (v5.20190522) +(no description) + G/GB/GBARR/CPAN-DistnameInfo-0.12.tar.gz + /usr/local/Cellar/perl/5.30.0/lib/perl5/site_perl/5.30.0/CPAN/DistnameInfo.pm + Installed: 0.12 + CPAN: 0.12 up to date + Graham Barr (GBARR) + gbarr@pobox.com +``` + + + +##### Liste des modules installés: `cpan -l` + +```bash +$ cpan -l +Spiffy 0.46 +YAML 1.29 +CPAN::DistnameInfo 0.12 +App::pmuninstall 0.30 +Test::YAML 1.07 +``` + + + +##### Désintaller un module: + +Il n'y a pas de commande prévue pour ça. + +On peut installer [pmuninstall](https://github.com/xaicron/pm-uninstall). + +```bash +$ cpan -i App::pmuninstall +``` + +Puis pour désinstaller: + +```bash +$ pm-uninstall -v App::cpnaminus +``` + + + +##### Modules mis-à-jour: + +On peut installer [cpanoutdated](https://github.com/tokuhirom/cpan-outdated) + +```bash +$ cpan -i App::cpanoutdated +``` + +et voir les modules 'outdated' + +```bash +$ cpan-outdated -p +Compress::Raw::Bzip2 +Compress::Raw::Zlib +Compress::Zlib +DB_File + +$ cpan-outdated +P/PM/PMQS/Compress-Raw-Bzip2-2.093.tar.gz +P/PM/PMQS/Compress-Raw-Zlib-2.093.tar.gz +P/PM/PMQS/IO-Compress-2.093.tar.gz +P/PM/PMQS/DB_File-1.852.tar.gz +``` + + + +Il est recommandé d'installer les modules suivants: + +- Term::ReadLine::Perl (réclamé par le shell cpan) + +- CPAN::DistnameInfo (réclamé par l'installeur de module) +- Log::Log4perl + + + +### \ No newline at end of file diff --git a/docs/macos/perl/index.md b/docs/macos/perl/index.md new file mode 100644 index 0000000..1d0d5ee --- /dev/null +++ b/docs/macos/perl/index.md @@ -0,0 +1,24 @@ +# Perl + + + +macOS Catalina est livré avec Perl: + +```bash +$ which perl +/usr/bin/perl + +$ perl -v + +This is perl 5, version 18, subversion 4 (v5.18.4) built for darwin-thread-multi-2level +(with 2 registered patches, see perl -V for more detail) +``` + + + +[Installer une version plus récente de Perl avec **Homebrew**.](homebrew.md) + +[Installer d'autres versions de Perl avec **PerlBrew**.](perlbrew.md) + +[Perl](perl.md). + diff --git a/docs/macos/perl/installer.md b/docs/macos/perl/perlbrew.md similarity index 51% rename from docs/macos/perl/installer.md rename to docs/macos/perl/perlbrew.md index 3f6329e..10c15ca 100644 --- a/docs/macos/perl/installer.md +++ b/docs/macos/perl/perlbrew.md @@ -1,254 +1,8 @@ -# Installer Perl +# PerlBrew -macOS Catalina est livré avec Perl: - -```bash -$ which perl -/usr/bin/perl - -$ perl -v - -This is perl 5, version 18, subversion 4 (v5.18.4) built for darwin-thread-multi-2level -(with 2 registered patches, see perl -V for more detail) -``` - - - -### Homebrew: - -On peut installer une version plus récente de Perl avec Homebrew: - -```bash -$ brew install perl -``` - -```bash -$ brew info perl -zsh: correct 'perl' to 'perl5' [nyae]? n - -perl: stable 5.30.0 (bottled), HEAD -Highly capable, feature-rich programming language -https://www.perl.org/ -/usr/local/Cellar/perl/5.30.0 (2,440 files, 61.8MB) * - Poured from bottle on 2019-08-04 at 13:32:46 -From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/perl.rb -==> Options ---HEAD - Install HEAD version -==> Caveats -By default non-brewed cpan modules are installed to the Cellar. If you wish -for your modules to persist across updates we recommend using `local::lib`. - -You can set that up like this: - PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib - echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.zshrc -``` - -```bash -$ which perl -/usr/local/bin/perl - -$ perl -v - -This is perl 5, version 30, subversion 0 (v5.30.0) built for darwin-thread-multi-2level - -Copyright 1987-2019, Larry Wall - -Perl may be copied only under the terms of either the Artistic License or the -GNU General Public License, which may be found in the Perl 5 source kit. - -Complete documentation for Perl, including FAQ lists, should be found on -this system using "man perl" or "perldoc perl". If you have access to the -Internet, point your browser at http://www.perl.org/, the Perl Home Page. -``` - -#### cpan: - -**cpan** gère les modules Perl. - -```bash -$ cpan -Loading internal logger. Log::Log4perl recommended for better logging - -CPAN.pm requires configuration, but most of it can be done automatically. -If you answer 'no' below, you will enter an interactive dialog for each -configuration option instead. - -Would you like to configure as much as possible automatically? [yes] yes - - -Autoconfiguration complete. - -commit: wrote '/Users/bruno/.cpan/CPAN/MyConfig.pm' - -You can re-run configuration any time with 'o conf init' in the CPAN shell -Terminal does not support AddHistory. - -To fix enter> install Term::ReadLine::Perl - - -cpan shell -- CPAN exploration and modules installation (v2.22) -Enter 'h' for help. -``` - -Sans argument, la commande **cpan** ouvre un shell: - -```bash -$ cpan -Loading internal logger. Log::Log4perl recommended for better logging - -cpan shell -- CPAN exploration and modules installation (v2.27) -Enter 'h' for help. - -cpan[1]> h -``` - -```bash -cpan[1]> h - -Display Information (ver 2.27) - command argument description - a,b,d,m WORD or /REGEXP/ about authors, bundles, distributions, modules - i WORD or /REGEXP/ about any of the above - ls AUTHOR or GLOB about files in the author's directory - (with WORD being a module, bundle or author name or a distribution - name of the form AUTHOR/DISTRIBUTION) - -Download, Test, Make, Install... - get download clean make clean - make make (implies get) look open subshell in dist directory - test make test (implies make) readme display these README files - install make install (implies test) perldoc display POD documentation - -Upgrade installed modules - r WORDs or /REGEXP/ or NONE report updates for some/matching/all - upgrade WORDs or /REGEXP/ or NONE upgrade some/matching/all modules - -Pragmas - force CMD try hard to do command fforce CMD try harder - notest CMD skip testing - -Other - h,? display this menu ! perl-code eval a perl command - o conf [opt] set and query options q quit the cpan shell - reload cpan load CPAN.pm again reload index load newer indices - autobundle Snapshot recent latest CPAN uploads -``` - -La commande **cpan** peut aussi s'utiliser avec arguments: - - - -Avec Perl installé via homebrew, les modules sont installés dans Cellar (`Installing /usr/local/Cellar/perl/5.30.0/lib/perl5/site_perl/5.30.0/CPAN/DistnameInfo.pm`). Ils sont donc perdu à chaque mise-à-jour de Perl. - -Il est donc conseillé d'utiliser `local::lib` - -```bash -PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib -echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> ~/.zshrc - -# les dossiers suivants sont crées: -# $HOME/perl5/bin/ -# $HOME/perl5/lib/ -# -# à côté de $HOME/perl5/perlbrew/ -``` - -Les modules sont alors installés ici `Installing /Users/bruno/perl5/lib/perl5/Log/Log4perl.pm` - - - -##### Info sur un module: `cpan -D ` - -```bash -$ cpan -D CPAN::DistnameInfo -Reading '/Users/bruno/.cpan/Metadata' - Database was generated on Tue, 17 Dec 2019 07:29:02 GMT -CPAN::DistnameInfo -------------------------------------------------------------------------- - CPAN: Module::CoreList loaded ok (v5.20190522) -(no description) - G/GB/GBARR/CPAN-DistnameInfo-0.12.tar.gz - /usr/local/Cellar/perl/5.30.0/lib/perl5/site_perl/5.30.0/CPAN/DistnameInfo.pm - Installed: 0.12 - CPAN: 0.12 up to date - Graham Barr (GBARR) - gbarr@pobox.com -``` - - - -##### Liste des modules installés: `cpan -l` - -```bash -$ cpan -l -Spiffy 0.46 -YAML 1.29 -CPAN::DistnameInfo 0.12 -App::pmuninstall 0.30 -Test::YAML 1.07 -``` - - - -##### Désintaller un module: - -Il n'y a pas de commande prévue pour ça. - -On peut installer [pmuninstall](https://github.com/xaicron/pm-uninstall). - -```bash -$ cpan -i App::pmuninstall -``` - -Puis pour désinstaller: - -```bash -$ pm-uninstall -v App::cpnaminus -``` - - - -##### Modules mis-à-jour: - -On peut installer [cpanoutdated](https://github.com/tokuhirom/cpan-outdated) - -```bash -$ cpan -i App::cpanoutdated -``` - -et voir les modules 'outdated' - -```bash -$ cpan-outdated -p -Compress::Raw::Bzip2 -Compress::Raw::Zlib -Compress::Zlib -DB_File - -$ cpan-outdated -P/PM/PMQS/Compress-Raw-Bzip2-2.093.tar.gz -P/PM/PMQS/Compress-Raw-Zlib-2.093.tar.gz -P/PM/PMQS/IO-Compress-2.093.tar.gz -P/PM/PMQS/DB_File-1.852.tar.gz -``` - - - -Il est recommandé d'installer les modules suivants: - -- Term::ReadLine::Perl (réclamé par le shell cpan) - -- CPAN::DistnameInfo (réclamé par l'installeur de module) -- Log::Log4perl - - - -### PerlBrew: - -On peut installer d'autres versions de Perl avec [PerlBrew](https://perlbrew.pl). +On peut installer d'autres versions de Perl avec [**PerlBrew**](https://perlbrew.pl). Il faut au préalable installer **berkeley-db**, sans quoi il y aura une erreur à l'installer de Perl avec perlbrew. diff --git a/docs/macos/python/pipx.md b/docs/macos/python/pipx.md index f8fea6e..d890a9f 100644 --- a/docs/macos/python/pipx.md +++ b/docs/macos/python/pipx.md @@ -59,6 +59,12 @@ $ which soco +```bash +$ pipx install 'glances[action,browser,cloud,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi]' +``` + + + #### Exécuter un paquet sans l'installer: ```bash @@ -163,6 +169,15 @@ Versions did not change after running 'pip upgrade' for each package 😴 +#### Désinstaller: + +```bash +$ pipx uninstall glances +uninstalled glances! ✨ 🌟 ✨ +``` + + + #### Aide: ```bash diff --git a/mkdocs.yml b/mkdocs.yml index 4460d49..3ddb90d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -103,7 +103,9 @@ nav: - nodeenv: macos/node/nodeenv.md - nvm: macos/node/nvm.md - Perl: - - Installation: macos/perl/installer.md + - Index: macos/perl/index.md + - Homebrew: macos/perl/homebrew.md + - Perlbrew: macos/perl/perlbrew.md - Perl: macos/perl/perl.md - Python: - Index: macos/python/index.md