Update 03-01-2024

This commit is contained in:
2024-01-03 09:17:00 +01:00
parent d78f93eed2
commit efb8d64ac7
22 changed files with 1047 additions and 44 deletions

View File

@@ -0,0 +1,51 @@
# Lightroom
#### Emplacements des fichiers dans macOS
```bash
~/Pictures/Lightroom/Airbook
drwxr-xr-x - bruno staff 25 déc 16:28 Backups/
.rw-r--r--@ 1,3Gi bruno staff 28 déc 09:03 'Lightroom Catalog-v13.lrcat'
drwx------@ - bruno staff 27 déc 20:13 'Lightroom Catalog-v13.lrcat-data'/
.rw-r--r-- 32Ki bruno staff 27 déc 20:13 'Lightroom Catalog-v13.lrcat-shm'
.rw-r--r-- 4,3Mi bruno staff 28 déc 09:03 'Lightroom Catalog-v13.lrcat-wal'
.rw-r--r-- 72 bruno staff 27 déc 20:13 'Lightroom Catalog-v13.lrcat.lock'
drwxr-xr-x - bruno staff 27 déc 20:13 'Lightroom Catalog-v13 Helper.lrdata'/
drwxr-xr-x - bruno staff 28 déc 09:03 'Lightroom Catalog-v13 Previews.lrdata'/
drwxr-xr-x - bruno staff 27 déc 20:13 'Lightroom Catalog-v13 Sync.lrdata'/
drwxr-xr-x - bruno staff 7 oct 2022 'Lightroom Settings'/
# du -ckh Lightroom\ Catalog-v13\ Helper.lrdata 71Mo
# du -ckh Lightroom\ Catalog-v13\ Sync.lrdata 5 Mo
# du -ckh Lightroom\ Catalog-v13\ Previews.lrdata 28 Go
# Lightroom Catalog-v13.lrcat-data 201 Mo
```
| Fichiers | Emplacement |
| ---------------------------------------- | ------------------------------------------------------------ |
| **Application Lightroom Classic** | Applications/Adobe Lightroom Classic/Adobe Lightroom Classic.app |
| **Préférences Lightroom Classic** | Users/[nom dutilisateur]/Library/Preferences/**com.adobe.LightroomClassicCC7.plist**<br />*Sous macOS, après avoir supprimé le fichier ci-dessus, redémarrez votre ordinateur, puis relancez Lightroom Classic tout en maintenant les touches **Maj** + **Option** enfoncées. Dans la boîte de dialogue, sélectionnez **Réinitialiser les préférences**.* |
| **Catalogue** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat** (2) |
| (dossier) | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-data/** (2)<br />*À partir de Lightroom Classic 11, Lightroom Classic stocke des informations supplémentaires dans un nouveau fichier portant lextension **.lrcat-data,** avec le fichier de catalogue. Ce fichier se situe dans le même dossier que votre fichier de catalogue. Ce fichier contient des informations importantes sur vos photos et vos modifications et doit être inclus dans vos systèmes de sauvegarde éventuels.* |
| **Cache daperçu** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog Previews.lrdata/**<br />*Quitter Lightroom avant d'effacer le dossier. Les aperçus seront recrées au besoin.* |
| **Cache des aperçus dynamiques** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog Smart Previews.lrdata/** |
| **Cache des mots-clé, dossiers** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog Helper.lrdata/**<br />*Accelère les performances de LR dans l'affichage des métadonnées.* |
| | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog Sync.lrdata/** |
| **Fichier de verrouillage de catalogue** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat.lock** (1)<br />*Remarque : Le fichier de verrouillage empêche le catalogue dêtre remplacé en cours dutilisation.* |
| | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-wal** (1) |
| | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-shm** (1) |
| **Fichier journal de catalogue** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-journal**<br />*Les catalogues ouverts utilisent le fichier journal pour vérifier les enregistrements de base de données incomplets. Ne supprimez pas le fichier journal à moins que vous ne supprimiez également son catalogue associé.* |
| **Sauvegarde dun catalogue** | /Users/[nom dutilisateur]/Pictures/Lightroom/Backups/**[date et heure de sauvegarde]/Lightroom Catalog.lrcat** |
| **Lightroom Settings** | /Users/[nom dutilisateur]/Pictures/Lightroom/**Lightroom Settings/**<br />Contient des plugins (**Topaz Photo AI.lrplugin**) et des presets d'éditeurs externes (**TopazPhotoAI.lrtemplate**) |
| **Paramètres prédéfinis et modèles** | **(.lrtemplate)** Les paramètres prédéfinis et modèles au format .lrtemplate sont enregistrés à lemplacement suivant : */Users/[nom dutilisateur]/Library/Application Support/Adobe/Lightroom/[dossier du paramètre prédéfini ou du modèle]/**[nom du fichier de paramètre prédéfini ou de modèle.lrtemplate]*** |
| | **(XMP)** À partir de Lightroom Classic, les paramètres prédéfinis existants au format .lrtemplate sont automatiquement convertis au nouveau format de paramètre prédéfini XMP. Après la conversion, les nouveaux paramètres prédéfinis au format XMP sont enregistrés à lemplacement suivant : */Users/[user name]/Library/Application Support/Adobe/CameraRaw/Settings* |
| | **(Paramètres prédéfinis stockés avec le catalogue) :** si vous avez activé loption [**Stocker les paramètres prédéfinis avec ce catalogue**](https://helpx.adobe.com/fr/lightroom-classic/help/setting-preferences-lightroom.html#Storepresetswithyourcatalog) dans les préférences de Lightroom Classic, les fichiers de paramètres prédéfinis et de modèle sont enregistrés à lemplacement suivant : *MacHD/[emplacement du catalogue]/[nom du dossier du catalogue]/Lightroom Settings/Settings* |
| **Catalogue local de Lightroom (cloud)** | /Users/[nom dutilisateur]/Pictures/**Lightroom Library.lrlibrary** |
| | (1) fichiers présents quand Lightroom Classic est ouvert.<br />(2) présents dans l'archive Backup/YYYY-MM-DD HHSS/Lightroom Catalog-v13.zip |

57
docs/Divers/bash/curl.md Normal file
View File

@@ -0,0 +1,57 @@
# curl
#
#### Envoyer un fichier sur un ftp (Photomanager iPad):
```bash
curl -T /Users/bruno/Pictures/_Canon/Export/2023/Janvier/2023-01-21_FauconPelerin_0518.jpg ftp://192.168.2.112:2121 -u anonymous:
```
#### Envoyer plusieurs fichiers sur un ftp (funnymac):
```bash
find /Users/bruno/Pictures/_Canon/Export/2023/Janvier/ -type f | xargs -L 1 bash -c '/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo -T $1 sftp://ftp.cluster011.ovh.net:22/home/funnymac/www/ftp/${1##*/}' \;
```
```bash
for file in /folder/path/*
do
curl -u username:password -T ${file} http://www.example.com/folder/${file}
done
```
```bash
# Si le dossier juin n'existe pas sur le ftp, on le crée:
find /Users/bruno/Desktop/Juin -type f | xargs -L 1 bash -c '/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo --ftp-create-dirs -T $1 sftp://ftp.cluster011.ovh.net:22/home/funnymac/www/ftp/juin/${1##*/}' \;
```
#### Télécharger un fichier depuis un ftp (funnymac):
```bash
/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo -O sftp://ftp.cluster011.ovh.net:22/home/funnymac/8_2022.jpg
```
#### Télécharger plusieurs fichiers depuis un ftp (funnymac):
```bash
/opt/homebrew/opt/curl/bin/curl --user funnymac:a3XELN4PHTYF9fFHtsY97eshXBxxFo -T '{2023-01-31_RuBlanc_0627,2023-01-31_RuBlanc_0623}.jpg' sftp://ftp.cluster011.ovh.net:22/home/funnymac/www/ftp/ \;
```
```
-Z, --parallel
-#, --progress-bar
-Q, --quote <command>
-S, --show-error
-s, --silent
```

View File

@@ -0,0 +1,36 @@
# Passwords
### Stocker un mot-de-passe, un token dans la Keychain:
```bash
$ security add-generic-password -s gh_access_tokens -a bruno -w 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
```
### Récupérer le mot-de-pass depuius la keychain:
```bash
$ security find-generic-password -w -s gh_access_tokens
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
$ gh_access_tokens=$(security find-generic-password -w -s gh_access_tokens)
```
https://scriptingosx.com/2021/04/get-password-from-keychain-in-shell-scripts/
```bash
$ security unlock-keychain -p API_KEYCHAIN_PASS KEYCHAINPATH
# API_KEYCHAIN_PASS : mot de passe de session
# KEYCHAINPATH : login.keychain, /Library/Keychains/System.keychain, ~/Library/Keychains/login.keychain
```
```bash
$ security lock-keychain KEYCHAINPATH
```

View File

@@ -77,3 +77,17 @@ n=$((50+bytes-chars))
printf '%-${n}s' "${title}" printf '%-${n}s' "${title}"
``` ```
#### Afficher une chaine en couleur
```bash
red="\033[1;31m"
reset="\033[0m"
printf " %-11s %-35b \n" "Width:" "${red}${width}${reset}"
# %b ARGUMENT as a string with '\' escapes interpreted, except that octal
# escapes are of the form \0 or \0NNN
```

View File

@@ -2,28 +2,6 @@
#### Variables:
##### Incrémenter une variable:
```bash
i=$((i+1)) user 0m0.992s
i=$((i++)) user 0m0.964s
((i=i+1)) user 0m0.760s
((i+=1)) user 0m0.700s
((i++)) user 0m0.644s
((++i)) user 0m0.556s
let "i=i+1" user 0m1.116s
let "i+=1" user 0m1.100s
let "i++" user 0m1.008s
let i=i+1 user 0m0.952s
let i+=1 user 0m1.040s
let i++ user 0m0.820s
declare -i i; i=i+1 user 0m0.528s
declare -i i; i+=1 user 0m0.492s
i=0; i=$(expr $i + 1) user 0m5.464s
```
#### Beep: #### Beep:

View File

@@ -0,0 +1,100 @@
# Translate
#### deep-cli
https://github.com/eggplants/deepl-cli
```bash
$ deepl --fr fr --to en -s <<'A'
bonjour
A
Hello
```
#### translate shell
https://github.com/soimort/translate-shell
```bash
# transfert to locale
$ trans -b dog
chien
$ trans dog
dog
/dôɡ/
() chien
() chienne
Définitions de dog
[ English -> Français ]
nom
(le) chien
dog, hound, cock, hanger
(le) mâle
male, buck, bull, cock, stag, dog
(la) fille moche
dog
verbe
suivre de près
monitor, dog
suivre comme un chien
dog
dog
chien
# translate to target
$ trans -b :de dog
Hund
$ trans -b -t de dog
Hund
# translate from source
$ trans -b en: dog
chien
$ trans -b -s en dog
chien
```
API DeepL
https://www.deepl.com/docs-api/introduction/
```bash
$ curl -X POST 'https://api-free.deepl.com/v2/translate' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]' \
--data-urlencode 'text=Hello, world!' \
--data-urlencode 'target_lang=DE'
{"translations":[{"detected_source_language":"EN","text":"Hallo, Welt!"}]}%
```
```bash
translate() {
deepl=$(curl -s -X POST 'https://api-free.deepl.com/v2/translate' \
--header "Authorization: DeepL-Auth-Key $DEEPL_KEY" \
--data-urlencode "text=$2" \
--data-urlencode "target_lang=$1"
)
echo "$deepl" | jq -r .'translations[].text'
}
translate "DE" "il fait beau !"
```

View File

@@ -83,3 +83,89 @@ SHELL=/bin/zsh
[[ $1 == ?(-)+([[:digit:]]) ]] && echo "$1 is an integer" [[ $1 == ?(-)+([[:digit:]]) ]] && echo "$1 is an integer"
``` ```
#### Incrémenter une variable:
```bash
i=$((i+1)) user 0m0.992s
i=$((i++)) user 0m0.964s
((i=i+1)) user 0m0.760s
((i+=1)) user 0m0.700s
((i++)) user 0m0.644s
((++i)) user 0m0.556s
let "i=i+1" user 0m1.116s
let "i+=1" user 0m1.100s
let "i++" user 0m1.008s
let i=i+1 user 0m0.952s
let i+=1 user 0m1.040s
let i++ user 0m0.820s
declare -i i; i=i+1 user 0m0.528s
declare -i i; i+=1 user 0m0.492s
i=0; i=$(expr $i + 1) user 0m5.464s
```
#### Opération mathématiques:
https://www.gnu.org/software/bash/manual/html_node/Arithmetic-Expansion.html
https://www.gnu.org/software/bash/manual/html_node/Shell-Arithmetic.html
##### Multiplication:
```bash
$ echo "$((5 * 3.15))"
15.75
$ echo "5 * 3.15" | bc -l
15.75
$ echo 5 3.15\*p | dc
15.75
```
##### Soustraction:
```bash
$ echo "5 - 3.15" | bc -l
1.85
$ echo "5 3.15 - p" | dc
1.85schell
$ echo "$((5 - 3.15))"
1.8500000000000001
```
##### Addition:
```bash
$ echo "5 + 3.15" | bc -l
8.15
$ echo "$((5 + 3.15))"
8.1500000000000004
$ ((add=5 + 3))
$ echo $add
8
```
##### Division:
```bash
$ echo "5 / 3.15" | bc -l
1.58730158730158730158
$ echo "$((20 / 4))"
5
$ echo "$((5 / 2))"
2
```

View File

@@ -775,6 +775,96 @@ https://blog.zenika.com/2017/01/24/pull-request-demystifie/
### Connaitre la version courante:
```bash
$ git show
commit a3f86d08322bc3ef14157ced679907b2b8ec27ee (HEAD -> master, tag: debian/1.0.12-5, origin/master, origin/HEAD)
Author: James Valleroy <jvalleroy@mailbox.org>
Date: Sat Jan 8 21:31:13 2022 -0500
Release v1.0.12-5 to unstable
$ git show | grep -m 1 "Release"
Release v1.0.12-5 to unstable
$ git show
commit a749e724fbeb5cd1b13272a2784c7c2945dc138a (grafted, HEAD -> master, origin/master)
Author: Jay Salvat <jay@jaysalvat.com>
Date: Sat Jan 30 11:09:55 2021 +0100
Build v2.5.4
$ git show | grep -m 1 "Build" | awk -F"v" '{print $2}'
2.5.4
$ ssh -q -t funnymac@ftp.cluster011.ovh.net "cd www/photoblog/js/vegas && git show | grep -m 1 \"Build\"" | awk -F"v" '{print $2}' | sed 's/.$//'
2.5.4
```
```bash
$ git log
commit a749e724fbeb5cd1b13272a2784c7c2945dc138a (grafted, HEAD -> master, origin/master)
Author: Jay Salvat <jay@jaysalvat.com>
Date: Sat Jan 30 11:09:55 2021 +0100
Build v2.5.4
```
### Savoir si mise-à-jour est dispo:
```bash
$ git remote show origin | grep $(git rev-parse --abbrev-ref HEAD) | tail -1
master pousse vers master (à jour)
```
!!! warning "Si on a un repo partiel, **git remote** recontruit le repo git"
```bash
$ git remote -v update
POST git-upload-pack (188 bytes)
Depuis https://salsa.debian.org/php-team/pear/php-gettext
= [à jour] master -> origin/master
= [à jour] pristine-tar -> origin/pristine-tar
= [à jour] upstream -> origin/upstream
```
```bash
$ git remote update
$ git status -uno
Sur la branche master
Votre branche est à jour avec 'origin/master'.
rien à valider (utilisez -u pour afficher les fichiers non suivis)
```
```bash
$ git remote update
$git show-branch origin/master
[origin/master] Release v1.0.12-6 to unstable
```
```bash
local_commit=$(git rev-list --all -n1)
remote_commit=$(git ls-remote origin master)
```
```bash
$ git ls-remote origin master
7abeca2bd7df910ac546e06a62c128a40f56874a refs/heads/master
```
#### => [Session de travail avec git](git-session.md) <= #### => [Session de travail avec git](git-session.md) <=
#### => [Synchroniser 2 dépôts (--bare)](sync-repo.md) <= #### => [Synchroniser 2 dépôts (--bare)](sync-repo.md) <=

88
docs/Divers/git/github.md Normal file
View File

@@ -0,0 +1,88 @@
# GitHub
### Cloner juste un sous-dossier d'un repo:
```bash
~/Documents $ git init vegas
~/Documents
$ cd vegas
drwxr-xr-x@ - bruno staff 17 nov 16:14 17 nov 16:14 -I  .git/
~/Documents/vegas master
$ git remote add origin https://github.com/jaysalvat/vegas.git
~/Documents/vegas master
$ git config core.sparsecheckout true
~/Documents/vegas master
$ echo "dist/*" >> .git/info/sparse-checkout
~/Documents/vegas master
$ git pull --depth=1 origin master
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (56/56), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 56 (delta 16), reused 39 (delta 14), pack-reused 0
Dépaquetage des objets: 100% (56/56), 89.72 Kio | 1.91 Mio/s, fait.
Depuis https://github.com/jaysalvat/vegas
* branch master -> FETCH_HEAD
* [nouvelle branche] master -> origin/master
```
### Récupérer un sous-dossier d'un repo:
```bash
$ svn export --force https://github.com/jaysalvat/vegas/trunk/dist
```
### Télécharger la dernière release:
```bash
$ wget -O vegas.zip https://github.com/jaysalvat/vegas/archive/refs/heads/master.zip
```
Dernier tag d'un repo:
```bash
$ curl -s 'https://github.com/go-gitea/gitea/tags/'|grep -Eo "$Version v[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}"|sort -r|head -n1
v1.22.0
$ curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/go-gitea/gitea/tags | jq -r '.[0].name'
v1.22.0-dev
```
Récupérer tous les tags d'un repo:
```bash
$ curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/go-gitea/gitea/tags | jq -r '.'
[
{
"name": "v1.22.0-dev",
"zipball_url": "https://api.github.com/repos/go-gitea/gitea/zipball/refs/tags/v1.22.0-dev",
"tarball_url": "https://api.github.com/repos/go-gitea/gitea/tarball/refs/tags/v1.22.0-dev",
"commit": {
"sha": "d7f73a1334ab7a97d4e055b7c58cdd9ac303f77a",
"url": "https://api.github.com/repos/go-gitea/gitea/commits/d7f73a1334ab7a97d4e055b7c58cdd9ac303f77a"
},
"node_id": "MDM6UmVmNzI0OTU1Nzk6cmVmcy90YWdzL3YxLjIyLjAtZGV2"
},
```
```
$ curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/go-gitea/gitea/releases/latest | jq -r '.'
```

View File

@@ -94,6 +94,34 @@ $ ls archive.tar
#### xz (tar 1.22+)
Compresser un fichier au format .xz:
```bash
$ xz -k9 monfichier
```
Compresser une archive au format .tar.xz:
```bash
$ tar cfJ fichier.tar.xz mondossier
```
Décompresser un fichier au format .xz:
```bash
$ xz -d monfichier
```
Décompresser une archive au format .tar.xz:
```bash
$ tar -xJf fichier.tar.xz
```
#### zip #### zip
Compresser avec zip: Compresser avec zip:

View File

@@ -76,3 +76,16 @@ hello.txt link hello_you.txt
file_1 et hard_ln ont le même inode. file_1 et hard_ln ont le même inode.
Si on supprime `file_1`, `hard_ln` conserve le même contenu. Si on supprime `file_1`, `hard_ln` conserve le même contenu.
#### Origine d'un lien
```bash
/opt/homebrew/share/zsh/site-functions stable
readlink -f _yq
/opt/homebrew/Cellar/yq/4.40.5/share/zsh/site-functions/_yq
```

View File

@@ -18,7 +18,7 @@ Sites Web et Domaines -> <u>Ajouter un sous-domaine</u>:
- Racine du document: gitea.maboiteverte.fr - Racine du document: gitea.maboiteverte.fr
- Cocher Protéger le domaine avec Let's Encrypt - Cocher Protéger le domaine avec Let's Encrypt
Sites Web et Domaines -> gitea.maboiteverte.fr -> <u>Paramètres d'Apache et de Nginx</u> -> Directives supplémentaires pour HTTPS : Sites Web et Domaines -> gitea.maboiteverte.fr -> <u>Hébergement et DNS -> Apache et de Nginx</u> -> Directives supplémentaires pour HTTPS :
``` ```
<Proxy *> <Proxy *>
@@ -103,7 +103,7 @@ adduser \
#### Télécharger Gitea: #### Télécharger Gitea:
```bash ```bash
VERSION=1.14.4 VERSION=1.12.1
sudo wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 sudo wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64
``` ```
@@ -176,7 +176,7 @@ Confirmer:
```bash ```bash
$ gitea --version $ gitea --version
Gitea version 1.11.4 built with GNU Make 4.1, go1.13.9 : bindata, sqlite, sqlite_unlock_notify Gitea version 1.12.1 built with GNU Make 4.1, go1.14.4 : bindata, sqlite, sqlite_unlock_notify
``` ```

44
docs/Plesk/Plesk.md Normal file
View File

@@ -0,0 +1,44 @@
# Plesk
https://docs.plesk.com/fr-FR/12.5/deployment-guide/installer-plesk/après-linstallation-de-plesk.70283/
### Initialiser Plesk
Bruno
bruno@clicclac.info
admin / $73qo2xV2
```
/usr/local/psa/bin/init_conf --init -passwd jskekekHTD -email jeandupont@exemple.com
```
### Définir la Vue de Plesk
```
/usr/local/psa/bin/poweruser --on -ip **<adresse-ip>**-domain **<nom_domaine>**
```
# Indiquer le mot de passe de l'administrateur
```php
PSA_PASSWORD=<nouveau_mot_de_passe> /usr/local/psa/bin/init_conf --set-admin-password -passwd "
```
# Définir la langue de Plesk
Outils et Paramètres -> **Apparence de Plesk** -> Langues
https://romantic-nightingale.212-227-191-167.plesk.page:8447/select_components.html

View File

@@ -98,6 +98,10 @@ plesk repair fs example.com
root@localhost:~# usermod -aG sudo bruno root@localhost:~# usermod -aG sudo bruno
``` ```
```bash
root@localhost:~# adduser sentier sudo
```
#### Redémarrer MySQL / MariaDB: #### Redémarrer MySQL / MariaDB:
@@ -318,3 +322,35 @@ SystemMaxUse=250M
$ sudo systemctl restart systemd-journald $ sudo systemctl restart systemd-journald
``` ```
Installer Plesk Firewall
https://support.plesk.com/hc/en-us/articles/12377540171799
```bash
plesk installer add --components psa-firewall
```
```bash
root@eloquent-benz:~# adduser bruno sudo
root@eloquent-benz:~# adduser sentier sudo
```
```bash
# réseaux
root@eloquent-benz:~# apt install net-tools nmap
```
```bash
# Thumbsup
root@eloquent-benz:~# apt install libimage-exiftool-perl graphicsmagick
```

198
docs/Plesk/ionos.md Normal file
View File

@@ -0,0 +1,198 @@
# IONOS
## Serveur Virtuel Cloud L
https://my.ionos.fr/account/subscriptions/72105527?linkId=ct.txt.contract-in-table
### Serveur (ubuntu 18.04):
https://cloudpanel.ionos.fr/panel/app/global?ionospanelid=ionos95fc7dab-6331-462d-9bbb-9dfdc47775ca8802#/servers/C5B08A8E443156B96BDD2EBCD47647B3
- Type : Serveur Cloud L
- CPU : 2 vCore
- RAM : 4 Go
- SSD : 120 Go
### Ajuster le volume logique après avoir agrandi le SSD dans Ubuntu/Debian (Serveur Cloud)
Vérifier l'espace disponible du volume logique:
```bash
root@localhost:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1,9G 0 1,9G 0% /dev
tmpfs 393M 1,4M 391M 1% /run
/dev/mapper/vg00-lv01 47G 40G 5,5G 88% /
tmpfs 2,0G 0 2,0G 0% /dev/shm
tmpfs 5,0M 20K 5,0M 1% /run/lock
tmpfs 2,0G 0 2,0G 0% /sys/fs/cgroup
/dev/sda1 464M 118M 318M 28% /boot
overlay 47G 40G 5,5G 88% /var/lib/docker/overlay2/b84f17ce118f50b8d7db747e72cf46c1f906ef222de79b2a59f16462bf3b7a87/merged
overlay 47G 40G 5,5G 88% /var/lib/docker/overlay2/ef5f892e92cfd2b421800225d7e12db74d4a4d17641f1f58c887e32941b3b9e1/merged
shm 64M 16K 64M 1% /var/lib/docker/containers/2eeccf277a3d6ea64c9f263c6d568f465d121ba2b2e2cadcde7006d1c3e0bb41/mounts/shm
shm 64M 0 64M 0% /var/lib/docker/containers/5ba6ae9f22b843a3e444fb38255f900152db1439255a73339aa83b254505cd29/mounts/shm
tmpfs 393M 0 393M 0% /run/user/10001
tmpfs 393M 0 393M 0% /run/user/0
```
Volume logique: /dev/mapper/vg00-lv01
```bash
root@localhost:~# fdisk -l
Disk /dev/sda: 120 GiB, 128849018880 bytes, 251658240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x41577866
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 999424 104857599 103858176 49,5G 8e Linux LVM
Disk /dev/mapper/vg00-lv00: 1,9 GiB, 2046820352 bytes, 3997696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/vg00-lv01: 47,6 GiB, 51124371456 bytes, 99852288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
```
Système de fichiers:
```bash
root@localhost:~# df -Th | grep "^/dev"
/dev/mapper/vg00-lv01 ext4 47G 40G 5,5G 88% /
/dev/sda1 ext4 464M 118M 318M 28% /boot
```
Agrandir la partition avec growpart:
```bash
root@localhost:~# growpart /dev/sda 2
CHANGED: partition=2 start=999424 old: size=103858176 end=104857600 new: size=250658783,end=251658207
```
Augmenter manuellement le volume logique:
```bash
root@localhost:~# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name vg00
PV Size 49,52 GiB / not usable 3,00 MiB
Allocatable yes (but full)
PE Size 4,00 MiB
Total PE 12677
Free PE 0
Allocated PE 12677
PV UUID DMK49M-JflP-GBt9-0kJq-Kk1W-C7vO-x1nUZi
```
```bash
root@localhost:~# pvresize /dev/sda2
Physical volume "/dev/sda2" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
```
Vérifier l'état des volumes logiques:
```bash
root@localhost:~# lvdisplay
--- Logical volume ---
LV Path /dev/vg00/lv00
LV Name lv00
VG Name vg00
LV UUID loEucb-0VGb-seQj-3Vs0-5oCC-HUdt-0rJfcp
LV Write Access read/write
LV Creation host, time somehost, 2019-08-29 20:27:48 +0200
LV Status available
# open 2
LV Size <1,91 GiB
Current LE 488
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg00/lv01
LV Name lv01
VG Name vg00
LV UUID o6JDyc-lKL9-simp-fDTm-Yhix-2K1U-qiKvc3
LV Write Access read/write
LV Creation host, time somehost, 2019-08-29 20:27:48 +0200
LV Status available
# open 1
LV Size 47,61 GiB
Current LE 12189
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
```
chemin du volume logique que vous voulez agrandir: /dev/vg00/lv01
Augmenter la taille du volume logique avec le programme lvresize:
```bash
root@localhost:~# lvresize -l +100%FREE /dev/vg00/lv01
Size of logical volume vg00/lv01 changed from 47,61 GiB (12189 extents) to 117,61 GiB (30109 extents).
Logical volume vg00/lv01 successfully resized.
```
Redimensionner le système de fichiers à la nouvelle taille à l'aide de resize2fs:
```bash
root@localhost:~# resize2fs /dev/vg00/lv01
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/vg00/lv01 is mounted on /; on-line resizing required
old_desc_blocks = 6, new_desc_blocks = 15
The filesystem on /dev/vg00/lv01 is now 30831616 (4k) blocks long.
```
Vérifier si le système de fichiers a été ajusté:
```bash
root@localhost:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1,9G 0 1,9G 0% /dev
tmpfs 393M 1,4M 391M 1% /run
/dev/mapper/vg00-lv01 116G 40G 72G 36% /
tmpfs 2,0G 0 2,0G 0% /dev/shm
tmpfs 5,0M 20K 5,0M 1% /run/lock
tmpfs 2,0G 0 2,0G 0% /sys/fs/cgroup
/dev/sda1 464M 118M 318M 28% /boot
overlay 116G 40G 72G 36% /var/lib/docker/overlay2/b84f17ce118f50b8d7db747e72cf46c1f906ef222de79b2a59f16462bf3b7a87/merged
overlay 116G 40G 72G 36% /var/lib/docker/overlay2/ef5f892e92cfd2b421800225d7e12db74d4a4d17641f1f58c887e32941b3b9e1/merged
shm 64M 16K 64M 1% /var/lib/docker/containers/2eeccf277a3d6ea64c9f263c6d568f465d121ba2b2e2cadcde7006d1c3e0bb41/mounts/shm
shm 64M 0 64M 0% /var/lib/docker/containers/5ba6ae9f22b843a3e444fb38255f900152db1439255a73339aa83b254505cd29/mounts/shm
tmpfs 393M 0 393M 0% /run/user/10001
tmpfs 393M 0 393M 0% /run/user/0
```
https://www.ionos.fr/assistance/serveurs-et-cloud/administration-serveur/ajuster-le-volume-logique-apres-avoir-agrandi-le-ssd/ajuster-le-volume-logique-apres-avoir-agrandi-le-ssd-dans-ubuntudebian-serveur-cloud/?utm_source=search&utm_medium=global&utm_term=augmenter%20taille%20ssd&utm_campaign=BK_SHOP&utm_content=tariffselect

View File

@@ -10,20 +10,20 @@
```bash ```bash
# plesk ext nodejs --versions # plesk ext nodejs --versions
Enabled Version Path Enabled Version Path
false 17.4.0 /opt/plesk/node/17/bin/node true 21.4.0 /opt/plesk/node/21/bin/node
true 16.13.2 /opt/plesk/node/16/bin/node true 20.10.0 /opt/plesk/node/20/bin/node
true 14.19.0 /opt/plesk/node/14/bin/node true 18.19.0
false 12.22.10 /opt/plesk/node/12/bin/node true 16.20.2
``` ```
```bash ```bash
root@localhost:~# /opt/plesk/node/16/bin/node -v root@localhost:~# /opt/plesk/node/20/bin/node -v
v16.13.2 v20.10.0
root@localhost:~# /opt/plesk/node/16/bin/npm -v root@localhost:~# /opt/plesk/node/20/bin/npm -v
8.1.2 10.2.3
``` ```
```bash ```bash
@@ -34,8 +34,8 @@ v16.13.2
```bash ```bash
root@localhost:~# ln -s /opt/plesk/node/16/bin/node /usr/bin/node root@localhost:~# ln -s /opt/plesk/node/20/bin/node /usr/bin/node
root@localhost:~# ln -s /opt/plesk/node/16/bin/npm /usr/bin/npm root@localhost:~# ln -s /opt/plesk/node/20/bin/npm /usr/bin/npm
``` ```
@@ -56,9 +56,9 @@ root@localhost:~#
```bash ```bash
root@localhost:~# npm install -g thumbsup root@localhost:~# npm install -g thumbsup
/opt/plesk/node/17/lib/node_modules/thumbsup' /opt/plesk/node/20/lib/node_modules/thumbsup'
root@localhost:~# ln -s /opt/plesk/node/17/lib/node_modules/thumbsup/bin/thumbsup.js /usr/bin/thumbsup root@localhost:~# ln -s /opt/plesk/node/20/lib/node_modules/thumbsup/bin/thumbsup.js /usr/bin/thumbsup
``` ```

View File

@@ -35,7 +35,7 @@ $ brew cask install mactex
#### Créer une image disque: #### Créer une image disque:
```bash ```bash
bruno@SilverBook:~$ hdiutil create -srcfolder /Users/bruno/Downloads/PC archive.dmg $ hdiutil create -srcfolder /Users/bruno/Downloads/PC archive.dmg
....................................................................................................................................................................................... .......................................................................................................................................................................................
@@ -45,7 +45,7 @@ created: /Users/bruno/archive.dmg
#### Rapport système: #### Rapport système:
```bash ```bash
bruno@SilverBook:~$ system_profiler -detailLevel basic > report.txt $ system_profiler -detailLevel basic > report.txt
``` ```
#### Comparer fichiers et répertoires: #### Comparer fichiers et répertoires:

View File

@@ -1,4 +1,4 @@
vuepress # vuepress

View File

@@ -1063,7 +1063,7 @@ I wonder if you are in the middle of another rebase. If that is the case, pleas
git rebase (--continue | --abort | --skip) git rebase (--continue | --abort | --skip)
If that is not the case, please If that is not the case, please
rm -fr ".git/rebase-merge" rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something valuable there. and run me again. I am stopping in case you still have something valuable there.
``` ```
Pour corriger, lancer: Pour corriger, lancer:

View File

@@ -477,6 +477,35 @@ $ npm cache clean --force
#### Erreur "npm ERR! 404 'deepl-cli' is not in this registry."
```bash
$ npm view deepl-cli
npm ERR! code E404
npm ERR! 404 Unpublished on 2023-12-27T16:56:29.470Z
npm ERR! 404
npm ERR! 404 'deepl-cli' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
```
##### npm outdated --location=global --long
```bash
npm ERR! code ENOVERSIONS
npm ERR! No versions available for deepl-cli
```
Le paquet n'est plus disponible sur https://registry.npmjs.org/
```bash
~/.nvm/versions/node/v20.9.0/lib/node_modules
$ rm -rf deepl-cli
```
#### Packages: #### Packages:
##### uninstall-all-modules ##### uninstall-all-modules

View File

@@ -0,0 +1,139 @@
# Commandes (terminal)
### Information système
#### sw_vers
```bash
```
#### system_profiler
```bash
```
#### hostinfo
```bash
```
####
### Fichiers et Spotlight
#### mdfind
```bash
```
#### mdls
```bash
```
#### SetFile and GetFileInfo
```bash
```
### Utilitaires disque
#### diskutil
```bash
```
#### hdiutil
```bash
```
####
### Utilitaire réseau
#### networksetup
```bash
```
#### airport
```bash
```
####
### Gestion des logiciels
#### softwareupdate
```bash
```
#### pkgutil
```bash
```
#### mas
```bash
```
### Gestion des utilisateurs et groupes
#### dscl
```bash
```
#### sysadminctl
```bash
```
### Autres
#### dscacheutil
```bash
```
#### sysctl
```bash
```
#### sips
```bash
```
####

View File

@@ -66,6 +66,8 @@ $ tail -f /opt/homebrew/var/log/httpd/access_log
```bash ```bash
$ multitail -s 2 /usr/local/var/log/httpd/error_log /usr/local/var/log/httpd/access_log $ multitail -s 2 /usr/local/var/log/httpd/error_log /usr/local/var/log/httpd/access_log
$ multitail -s 2 /opt/homebrew/var/log/httpd/error_log /opt/homebrew/var/log/httpd/access_log
``` ```
```bash ```bash
@@ -387,6 +389,20 @@ Created a new local CA 💥
Sudo password: Sudo password:
The local CA is now installed in the system trust store! ⚡️ The local CA is now installed in the system trust store! ⚡️
The local CA is now installed in the Firefox trust store (requires browser restart)! 🦊 The local CA is now installed in the Firefox trust store (requires browser restart)! 🦊
#
# Un certificat "mkcert bruno@AirBook (Bruno Pesenti)" est ajouté dans le Trousseau d'accès (Système/Certficats)
```
!!! info "Si Firefox est configuré avec un mot-de-passe"
```bash
$ mkcert -install
The local CA is now installed in the system trust store! ⚡️
Enter Password or Pin for "NSS Certificate DB":
# Entrer le mot-de-passe de Firefox !
# https://github.com/FiloSottile/mkcert/issues/50
``` ```
Créer les dossiers pour les certificats: Créer les dossiers pour les certificats:
@@ -406,7 +422,7 @@ Created a new certificate valid for the following names 📜
The certificate is at "./airbook.local.pem" and the key at "./airbook.local-key.pem" The certificate is at "./airbook.local.pem" and the key at "./airbook.local-key.pem"
It will expire on 29 October 2023 🗓 It will expire on 18 February 2026 🗓
``` ```
Un certificat et une clé sont créer pour chaque domaine: Un certificat et une clé sont créer pour chaque domaine: