diff --git a/docs/Divers/Lightroom/Lightroom.md b/docs/Divers/Lightroom/Lightroom.md new file mode 100644 index 0000000..9417981 --- /dev/null +++ b/docs/Divers/Lightroom/Lightroom.md @@ -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 d’utilisateur]/Library/Preferences/**com.adobe.LightroomClassicCC7.plist**
*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 d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat** (2) | +| (dossier) | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-data/** (2)
*À partir de Lightroom Classic 11, Lightroom Classic stocke des informations supplémentaires dans un nouveau fichier portant l’extension **.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 d’aperçu** | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog Previews.lrdata/**
*Quitter Lightroom avant d'effacer le dossier. Les aperçus seront recrées au besoin.* | +| **Cache des aperçus dynamiques** | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog Smart Previews.lrdata/** | +| **Cache des mots-clé, dossiers** | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog Helper.lrdata/**
*Accelère les performances de LR dans l'affichage des métadonnées.* | +| | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog Sync.lrdata/** | +| **Fichier de verrouillage de catalogue** | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat.lock** (1)
*Remarque : Le fichier de verrouillage empêche le catalogue d’être remplacé en cours d’utilisation.* | +| | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-wal** (1) | +| | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-shm** (1) | +| **Fichier journal de catalogue** | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Catalog.lrcat-journal**
*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 d’un catalogue** | /Users/[nom d’utilisateur]/Pictures/Lightroom/Backups/**[date et heure de sauvegarde]/Lightroom Catalog.lrcat** | +| **Lightroom Settings** | /Users/[nom d’utilisateur]/Pictures/Lightroom/**Lightroom Settings/**
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 à l’emplacement suivant : */Users/[nom d’utilisateur]/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 à l’emplacement suivant : */Users/[user name]/Library/Application Support/Adobe/CameraRaw/Settings* | +| | **(Paramètres prédéfinis stockés avec le catalogue) :** si vous avez activé l’option [**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 à l’emplacement suivant : *MacHD/[emplacement du catalogue]/[nom du dossier du catalogue]/Lightroom Settings/Settings* | +| **Catalogue local de Lightroom (cloud)** | /Users/[nom d’utilisateur]/Pictures/**Lightroom Library.lrlibrary** | +| | (1) fichiers présents quand Lightroom Classic est ouvert.
(2) présents dans l'archive Backup/YYYY-MM-DD HHSS/Lightroom Catalog-v13.zip | + diff --git a/docs/Divers/bash/curl.md b/docs/Divers/bash/curl.md new file mode 100644 index 0000000..e2ddbd8 --- /dev/null +++ b/docs/Divers/bash/curl.md @@ -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 +-S, --show-error +-s, --silent + +``` + diff --git a/docs/Divers/bash/passwords.md b/docs/Divers/bash/passwords.md new file mode 100644 index 0000000..10cc16a --- /dev/null +++ b/docs/Divers/bash/passwords.md @@ -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 +``` + diff --git a/docs/Divers/bash/printf.md b/docs/Divers/bash/printf.md index dc670a6..1c210f2 100644 --- a/docs/Divers/bash/printf.md +++ b/docs/Divers/bash/printf.md @@ -77,3 +77,17 @@ n=$((50+bytes-chars)) 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 +``` + diff --git a/docs/Divers/bash/programmation.md b/docs/Divers/bash/programmation.md index e86eec2..c0ae241 100644 --- a/docs/Divers/bash/programmation.md +++ b/docs/Divers/bash/programmation.md @@ -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: diff --git a/docs/Divers/bash/translate.md b/docs/Divers/bash/translate.md new file mode 100644 index 0000000..83abfc9 --- /dev/null +++ b/docs/Divers/bash/translate.md @@ -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 !" +``` + diff --git a/docs/Divers/bash/variables.md b/docs/Divers/bash/variables.md index e1aa6bf..dd0bece 100644 --- a/docs/Divers/bash/variables.md +++ b/docs/Divers/bash/variables.md @@ -83,3 +83,89 @@ SHELL=/bin/zsh [[ $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 +``` + diff --git a/docs/Divers/git/git.md b/docs/Divers/git/git.md index dda8987..9f64481 100644 --- a/docs/Divers/git/git.md +++ b/docs/Divers/git/git.md @@ -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 +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 +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 +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) <= #### => [Synchroniser 2 dépôts (--bare)](sync-repo.md) <= diff --git a/docs/Divers/git/github.md b/docs/Divers/git/github.md new file mode 100644 index 0000000..bb58869 --- /dev/null +++ b/docs/Divers/git/github.md @@ -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 '.' +``` + diff --git a/docs/Linux/archiver.md b/docs/Linux/archiver.md index 4d2f8d2..f4d5a8a 100644 --- a/docs/Linux/archiver.md +++ b/docs/Linux/archiver.md @@ -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 Compresser avec zip: diff --git a/docs/Linux/links.md b/docs/Linux/links.md index 75d1d2a..f21eb9f 100644 --- a/docs/Linux/links.md +++ b/docs/Linux/links.md @@ -75,4 +75,17 @@ hello.txt link hello_you.txt file_1 et hard_ln ont le même inode. -Si on supprime `file_1`, `hard_ln` conserve le même contenu. \ No newline at end of file +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 + +``` + diff --git a/docs/Plesk/Gitea.md b/docs/Plesk/Gitea.md index 2295419..4c5c6c7 100644 --- a/docs/Plesk/Gitea.md +++ b/docs/Plesk/Gitea.md @@ -18,7 +18,7 @@ Sites Web et Domaines -> Ajouter un sous-domaine: - Racine du document: gitea.maboiteverte.fr - Cocher Protéger le domaine avec Let's Encrypt -Sites Web et Domaines -> gitea.maboiteverte.fr -> Paramètres d'Apache et de Nginx -> Directives supplémentaires pour HTTPS : +Sites Web et Domaines -> gitea.maboiteverte.fr -> Hébergement et DNS -> Apache et de Nginx -> Directives supplémentaires pour HTTPS : ``` @@ -103,7 +103,7 @@ adduser \ #### Télécharger Gitea: ```bash -VERSION=1.14.4 +VERSION=1.12.1 sudo wget -O /tmp/gitea https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64 ``` @@ -176,7 +176,7 @@ Confirmer: ```bash $ 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 ``` diff --git a/docs/Plesk/Plesk.md b/docs/Plesk/Plesk.md new file mode 100644 index 0000000..8c46a55 --- /dev/null +++ b/docs/Plesk/Plesk.md @@ -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 ****-domain **** +``` + + + +# Indiquer le mot de passe de l'administrateur + +```php +PSA_PASSWORD= /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 + diff --git a/docs/Plesk/index.md b/docs/Plesk/index.md index e3c30fd..2068bdd 100644 --- a/docs/Plesk/index.md +++ b/docs/Plesk/index.md @@ -98,6 +98,10 @@ plesk repair fs example.com root@localhost:~# usermod -aG sudo bruno ``` +```bash +root@localhost:~# adduser sentier sudo +``` + #### Redémarrer MySQL / MariaDB: @@ -318,3 +322,35 @@ SystemMaxUse=250M $ 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 +``` + diff --git a/docs/Plesk/ionos.md b/docs/Plesk/ionos.md new file mode 100644 index 0000000..9a90e95 --- /dev/null +++ b/docs/Plesk/ionos.md @@ -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 + + + diff --git a/docs/Plesk/nodejs.md b/docs/Plesk/nodejs.md index cb05c4b..1ffe87c 100644 --- a/docs/Plesk/nodejs.md +++ b/docs/Plesk/nodejs.md @@ -10,20 +10,20 @@ ```bash # plesk ext nodejs --versions - Enabled Version Path - false 17.4.0 /opt/plesk/node/17/bin/node - true 16.13.2 /opt/plesk/node/16/bin/node - true 14.19.0 /opt/plesk/node/14/bin/node - false 12.22.10 /opt/plesk/node/12/bin/node + Enabled Version Path + true 21.4.0 /opt/plesk/node/21/bin/node + true 20.10.0 /opt/plesk/node/20/bin/node + true 18.19.0 + true 16.20.2 ``` ```bash -root@localhost:~# /opt/plesk/node/16/bin/node -v -v16.13.2 -root@localhost:~# /opt/plesk/node/16/bin/npm -v -8.1.2 +root@localhost:~# /opt/plesk/node/20/bin/node -v +v20.10.0 +root@localhost:~# /opt/plesk/node/20/bin/npm -v +10.2.3 ``` ```bash @@ -34,8 +34,8 @@ v16.13.2 ```bash -root@localhost:~# ln -s /opt/plesk/node/16/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/node /usr/bin/node +root@localhost:~# ln -s /opt/plesk/node/20/bin/npm /usr/bin/npm ``` @@ -56,9 +56,9 @@ root@localhost:~# ```bash 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 ``` diff --git a/docs/macos/Divers/Divers.md b/docs/macos/Divers/Divers.md index 1c477af..ebc69b3 100644 --- a/docs/macos/Divers/Divers.md +++ b/docs/macos/Divers/Divers.md @@ -35,7 +35,7 @@ $ brew cask install mactex #### Créer une image disque: ```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: ```bash -bruno@SilverBook:~$ system_profiler -detailLevel basic > report.txt +$ system_profiler -detailLevel basic > report.txt ``` #### Comparer fichiers et répertoires: diff --git a/docs/macos/Divers/vuepress.md b/docs/macos/Divers/vuepress.md index 377f7c9..e4fe069 100644 --- a/docs/macos/Divers/vuepress.md +++ b/docs/macos/Divers/vuepress.md @@ -1,4 +1,4 @@ -vuepress +# vuepress diff --git a/docs/macos/homebrew/brew.md b/docs/macos/homebrew/brew.md index 46926ce..aa7df2f 100644 --- a/docs/macos/homebrew/brew.md +++ b/docs/macos/homebrew/brew.md @@ -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) If that is not the case, please 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: diff --git a/docs/macos/node/node-js.md b/docs/macos/node/node-js.md index c33fd74..9ac08a1 100644 --- a/docs/macos/node/node-js.md +++ b/docs/macos/node/node-js.md @@ -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: ##### uninstall-all-modules diff --git a/docs/macos/terminal/commandes.md b/docs/macos/terminal/commandes.md new file mode 100644 index 0000000..483c5ea --- /dev/null +++ b/docs/macos/terminal/commandes.md @@ -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 + +``` + +#### \ No newline at end of file diff --git a/docs/macos/webserver/apache_M1.md b/docs/macos/webserver/apache_M1.md index 52aff24..1ee6bf1 100644 --- a/docs/macos/webserver/apache_M1.md +++ b/docs/macos/webserver/apache_M1.md @@ -66,6 +66,8 @@ $ tail -f /opt/homebrew/var/log/httpd/access_log ```bash $ 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 @@ -387,6 +389,20 @@ Created a new local CA 💥 Sudo password: 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)! 🦊 + +# +# 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: @@ -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" ✅ -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: