08-04-2025
This commit is contained in:
217
docs/Divers/1password-cli.md
Normal file
217
docs/Divers/1password-cli.md
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
# 1 Password-cli
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Login
|
||||||
|
eval $(op signin)
|
||||||
|
|
||||||
|
# Get favorites
|
||||||
|
op item list --vault "Private" --favorite
|
||||||
|
|
||||||
|
# Get a specific item
|
||||||
|
op item get <ID>
|
||||||
|
|
||||||
|
# !! Important: Sign out at the end
|
||||||
|
op signout
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
1login() {
|
||||||
|
eval $(op signin)
|
||||||
|
}
|
||||||
|
|
||||||
|
alias 1signout="op signout"
|
||||||
|
|
||||||
|
1search() {
|
||||||
|
term=$1
|
||||||
|
if [ -n "$2" ]
|
||||||
|
then
|
||||||
|
vault="$2"
|
||||||
|
else
|
||||||
|
vault="Private"
|
||||||
|
fi
|
||||||
|
echo "Searching for '$term' in vaut '$vault'"
|
||||||
|
op item list --vault "$vault" --long | grep "$term" --ignore-case
|
||||||
|
}
|
||||||
|
|
||||||
|
1get() {
|
||||||
|
op item get $*
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Se connecter à 1Password CLI
|
||||||
|
|
||||||
|
```bash
|
||||||
|
eval $(op signin)
|
||||||
|
```
|
||||||
|
|
||||||
|
Liste des coffres:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op vault list
|
||||||
|
|
||||||
|
ID NAME
|
||||||
|
abcdefabcdefabcdefabcdefab Personal
|
||||||
|
```
|
||||||
|
|
||||||
|
Voir tous les items d'un coffre:
|
||||||
|
|
||||||
|
```
|
||||||
|
op item list --vault "Personal"
|
||||||
|
|
||||||
|
ID TITLE VAULT EDITED
|
||||||
|
abcdefabcdefabcdefabcdefab Maxmind Geoip Personal 1 year ago
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Récupérer un mot-de-passe:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item get "OVH - espace client" --fields label=password
|
||||||
|
[use 'op item get abcdefabcdefabcdefabcdefab --reveal' to reveal]
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item get "OVH - espace client" --fields label=password --format json | jq -r .value
|
||||||
|
|
||||||
|
PassW0rd
|
||||||
|
```
|
||||||
|
|
||||||
|
Voir tous les champs d'un item:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item get "OVH - espace client"
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer un nouvel item de connexion:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item create --category login \
|
||||||
|
--title "New Service" \
|
||||||
|
--vault "Personal" \
|
||||||
|
username="user@example.com" \
|
||||||
|
password="mysecret123" \
|
||||||
|
url="https://example.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
Générer et stocker un nouveau mot-de-passe:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item create --category password \
|
||||||
|
--title "Generated Password" \
|
||||||
|
--generate-password
|
||||||
|
|
||||||
|
ID: rwtorqqflnsrx6egzdgfmc3ssy
|
||||||
|
Title: Generated Password
|
||||||
|
Vault: Personal (abcdefabcdefabcdefabcdefab)
|
||||||
|
Created: now
|
||||||
|
Updated: now
|
||||||
|
Favorite: false
|
||||||
|
Version: 1
|
||||||
|
Category: PASSWORD
|
||||||
|
Fields:
|
||||||
|
password: [use 'op item get abcdefabcdefabcdefabcdefab --reveal' to reveal]
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Créer une note sécurisée:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item create --category "Secure Note" \
|
||||||
|
--title "Project Notes" \
|
||||||
|
--vault "Personal" \
|
||||||
|
'notesPlain[text]="Important project details..."'
|
||||||
|
|
||||||
|
ID: wy6lvv2pbs7v46x5pj5d7o2cnm
|
||||||
|
Title: Project Notes
|
||||||
|
Vault: Personal (abcdefabcdefabcdefabcdefab)
|
||||||
|
Created: now
|
||||||
|
Updated: now
|
||||||
|
Favorite: false
|
||||||
|
Version: 1
|
||||||
|
Category: SECURE_NOTE
|
||||||
|
Fields:
|
||||||
|
notesPlain: "Important project details..."
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Utilisation de secrets dans les variables environnement:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
eval $(op signin)
|
||||||
|
export DB_PASSWORD="$(op item get "Database" --fields label=password)"
|
||||||
|
export API_KEY="$(op item get "API Keys" --fields label=key)"
|
||||||
|
```
|
||||||
|
|
||||||
|
Lire une clé SSH:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
op item get "id_rsa" --fields label=private_key
|
||||||
|
[use 'op item get abcdefabcdefabcdefabcdefab --reveal' to reveal]
|
||||||
|
```
|
||||||
|
|
||||||
|
Utilisation avec une API:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Get API token from 1Password and use in API call
|
||||||
|
export API_TOKEN="$(
|
||||||
|
op item get "Service API Key" --fields label=password \
|
||||||
|
--format json | jq -r .value)"
|
||||||
|
|
||||||
|
curl https://api.example.com/v1/endpoint \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: Bearer $API_TOKEN" \
|
||||||
|
-d '{
|
||||||
|
"param1": "value1",
|
||||||
|
"param2": "value2"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Utiliser `op inject` pour les secrets:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ~/.zshrc
|
||||||
|
op inject --in-file "${HOME}/.dotfiles/secrets.zsh" | while read -r line; do
|
||||||
|
eval "$line"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ~/.dotfiles/secrets.zsh
|
||||||
|
export NOTION_API_KEY="op://private/notion.so/api-token"
|
||||||
|
export TEST_PYPI_TOKEN="op://private/test.pypi.org/token"
|
||||||
|
```
|
||||||
|
|
||||||
|
Voir aussi https://samedwardes.com/blog/2023-11-28-1password-for-secret-dotfiles-update/
|
||||||
|
|
||||||
|
Autre méthode:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export NOTION_API_KEY=$(op read "op://private/notion.so/api-token)
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
https://nandovieira.com/using-1password-cli-to-avoid-hardcoded-secrets-in-your-terminal-profile
|
||||||
|
|
||||||
|
https://blog.gruntwork.io/how-to-securely-store-secrets-in-1password-cli-and-load-them-into-your-zsh-shell-when-needed-dd7a716506c8
|
||||||
|
|
||||||
|
https://dev.to/hacksore/using-1password-cli-for-secrets-locally-326e
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker login -u $(op read op://prod/docker/username) -p $(op read op://prod/docker/password)
|
||||||
|
```
|
||||||
|
|
||||||
27
docs/Divers/GPG.md
Normal file
27
docs/Divers/GPG.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# GPG Keys
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### Lister les clés GPG publiques:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gpg --list-secret-keys --keyid-format LONG
|
||||||
|
|
||||||
|
/Users/yourusername/.gnupg/pubring.kbx
|
||||||
|
--------------------------------------
|
||||||
|
sec rsa4096/<key-id> 2021-01-01 [SC]
|
||||||
|
ABCD1234EFGH5678IJKL91011MNOP1213
|
||||||
|
uid [ultimate] Your Name <your.email@example.com>
|
||||||
|
ssb rsa4096/9876ZYXWVUTS5432 2021-01-01 [E]
|
||||||
|
```
|
||||||
|
|
||||||
|
Le Key ID est: ABCD1234EFGH5678IJKL91011MNOP1213
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### Afficher la clé publique:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gpg --armor --export ABCD1234EFGH5678IJKL91011MNOP1213
|
||||||
|
```
|
||||||
|
|
||||||
213
docs/Divers/chezmoi.md
Normal file
213
docs/Divers/chezmoi.md
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
# chezmoi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
https://www.chezmoi.io/reference/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Répertoire *destination*: `~ ($HOME)`
|
||||||
|
|
||||||
|
#### Répertoire source: `~/.local/share/chezmoi`
|
||||||
|
|
||||||
|
#### Fichier config: `~/.config/chezmoi/chezmoi.toml`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Choisir l'éditeur par défaut:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export EDITOR="bbedit --wait"
|
||||||
|
```
|
||||||
|
|
||||||
|
ou par le fichier de config de chezmoi `~/.config/chezmoi/chezmoi.toml`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[edit]
|
||||||
|
command = "bbedit"
|
||||||
|
args = ["--wait"]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Editer un fichier:
|
||||||
|
|
||||||
|
1. **chez-moi edit**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi edit $FILE
|
||||||
|
|
||||||
|
# Appliquer les changements à la fermeture de l'éditeur
|
||||||
|
chezmoi edit --apply $FILE
|
||||||
|
|
||||||
|
# Appliquer les changements quand on sauve le fichier
|
||||||
|
chezmoi edit --watch $FILE
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **chezmoi cd et éditer dans le répertoire source directement:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi cd
|
||||||
|
|
||||||
|
bbedit ~/.zhrcc
|
||||||
|
code ~/.zshrc
|
||||||
|
|
||||||
|
# Voir les différences
|
||||||
|
chezmoi diff
|
||||||
|
|
||||||
|
# Appliquer les changements
|
||||||
|
chezmoi apply
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **chezmoi edit (sans argument):**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ouvre le répertoire dans l'éditeur
|
||||||
|
|
||||||
|
chezmoi edit
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **éditer le fichier dans le répertoire $HOME et le rajouter:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bbedit ~/.zhrcc
|
||||||
|
code ~/.zshrc
|
||||||
|
|
||||||
|
chezmoi add $FILE
|
||||||
|
|
||||||
|
#ou
|
||||||
|
|
||||||
|
chezmoi re-add
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **éditer le fichier dans le répertoire $HOME et puis fusionnez vos modifications avec l'état des sources en exécutant la commande chezmoi merge:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bbedit ~/.zhrcc
|
||||||
|
code ~/.zshrc
|
||||||
|
|
||||||
|
chezmoi merge $FILE
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### Encrypter un fichier:
|
||||||
|
|
||||||
|
Ajouter au début du fichier de config:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
encryption = "gpg"
|
||||||
|
[gpg]
|
||||||
|
recipient = "bruno@clicclac.info"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Puis
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi add --encrypt .env
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### Commit et push automatique vers le dépôt:
|
||||||
|
|
||||||
|
Fichier de config:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[git]
|
||||||
|
autoCommit = true
|
||||||
|
commitMessageTemplate = "{{ promptString \"Commit message\" }}"
|
||||||
|
autoPush = true
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Archiver tous les fichiers dots:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi archive
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Tirer les derniers changements de votre repo et les appliquer:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi update
|
||||||
|
```
|
||||||
|
|
||||||
|
équivalent à `git pull --autostash --rebase && chezmoi apply`
|
||||||
|
|
||||||
|
##### Tirer les derniers changements de votre repo, voir les changements sans les appliquer:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi git pull -- --autostash --rebase && chezmoi diff
|
||||||
|
|
||||||
|
# si ok
|
||||||
|
|
||||||
|
chezmoi apply
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Commandes:
|
||||||
|
|
||||||
|
##### cat-config: afficher le fichier de config
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi cat-config
|
||||||
|
encryption = "gpg"
|
||||||
|
[gpg]
|
||||||
|
recipient = "bruno@clicclac.info"
|
||||||
|
|
||||||
|
[edit]
|
||||||
|
command = "codium"
|
||||||
|
args = ["--wait"]
|
||||||
|
|
||||||
|
[git]
|
||||||
|
autoCommit = true
|
||||||
|
commitMessageTemplate = "{{ promptString \"Commit message\" }}"
|
||||||
|
#commitMessageTemplateFile = ".commit_message.tmpl"
|
||||||
|
autoPush = true
|
||||||
|
|
||||||
|
[diff]
|
||||||
|
pager = "delta"%
|
||||||
|
```
|
||||||
|
|
||||||
|
##### edit-config: éditer le fichier de config
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi edit-config
|
||||||
|
```
|
||||||
|
|
||||||
|
##### status: afficher l'état des fichiers et scripts gérés par chezmoi (cf. git status)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi status
|
||||||
|
|
||||||
|
M .zsh/.zshrc
|
||||||
|
MM Library/Preferences
|
||||||
|
M rsync-list.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
##### verify: vérifie que toutes les cibles correspondent à leur état.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi verify
|
||||||
|
```
|
||||||
|
|
||||||
|
##### update: récupère les modifications depuis le dépôt source et les applique.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi update
|
||||||
|
```
|
||||||
|
|
||||||
|
##### forget: supprimer les cibles de l'état source, autrement dit, cesser de les gérer.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chezmoi forget ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
##### destroy: supprimer la cible de l'état source, du répertoire de destination et de l'état.
|
||||||
|
|
||||||
|
```
|
||||||
|
!!! chezmoi destroy ~/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
@@ -40,3 +40,10 @@ $ git push gitea master
|
|||||||
|
|
||||||
https://charlesreid1.github.io/setting-up-a-self-hosted-github-clone-with-gitea.html#gitea-pushing-local
|
https://charlesreid1.github.io/setting-up-a-self-hosted-github-clone-with-gitea.html#gitea-pushing-local
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Vérifier la clé ssh:
|
||||||
|
|
||||||
|
Configuration -> Clés SSH / GPG -> Vérifier
|
||||||
|
|
||||||
|
Il faut aller très vite, il y a un timeout.
|
||||||
|
|||||||
551
docs/Divers/rclone.md
Normal file
551
docs/Divers/rclone.md
Normal file
@@ -0,0 +1,551 @@
|
|||||||
|
# rclone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> pcloud
|
||||||
|
|
||||||
|
https://rclone.org/pcloud/
|
||||||
|
|
||||||
|
##### rclone config show:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone config show
|
||||||
|
[pcloud]
|
||||||
|
type = pcloud
|
||||||
|
hostname = eapi.pcloud.com
|
||||||
|
token = {"access_token":"zj6mZDnONSzyJXpmZpIYvXkZWhYVxcv5zNzbjHhUTF3FvzEuPkxy","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
|
||||||
|
root_folder_id = 16135343175
|
||||||
|
|
||||||
|
[pcloud2]
|
||||||
|
type = pcloud
|
||||||
|
hostname = eapi.pcloud.com
|
||||||
|
token = {"access_token":"zj6mZDnONSzyJXpmZ28jB7kZgGoK40Ez6LVEVPUezEmUYXmKDzg7","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Copier un fichier sur pcloud:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# rclone copy <file> <remote:path>
|
||||||
|
~/.config/rclone
|
||||||
|
❯ rclone copy rclone.conf pcloud:
|
||||||
|
|
||||||
|
❯ rclone copy -vv pcloud:topgrade.toml .
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Lister les fichiers sur pcloud:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone ls pcloud:
|
||||||
|
400 rclone.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### root_folder_id: 16135343175
|
||||||
|
|
||||||
|
répertoire que rclone considère comme root sur le disque pCloud.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
https://my.pcloud.com/#page=filemanager&folder=16135343175
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> Synology
|
||||||
|
|
||||||
|
https://rclone.org/sftp/
|
||||||
|
|
||||||
|
##### rclone config show
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone config show
|
||||||
|
[ds923]
|
||||||
|
type = sftp
|
||||||
|
host = photos-nas.ovh
|
||||||
|
port = 42667
|
||||||
|
use_insecure_cipher = true
|
||||||
|
shell_type = unix
|
||||||
|
md5sum_command = /bin/md5sum
|
||||||
|
sha1sum_command = /bin/sha1sum
|
||||||
|
```
|
||||||
|
|
||||||
|
##### rclone lsf
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone lsf ds923:/home
|
||||||
|
#recycle/
|
||||||
|
.bash_aliases
|
||||||
|
.bash_history
|
||||||
|
.bash_logout
|
||||||
|
.bashrc
|
||||||
|
.cache/
|
||||||
|
.config/
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> rclone lsf ds923:/Films
|
||||||
|
#recycle/
|
||||||
|
11.6 (2013).m4v
|
||||||
|
12 years a slave.m4v
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> rclone lsf ds923:/web
|
||||||
|
.well-known/
|
||||||
|
1-login.php
|
||||||
|
Locale/
|
||||||
|
_index.html
|
||||||
|
admin/
|
||||||
|
adminer/
|
||||||
|
```
|
||||||
|
|
||||||
|
##### rclone copy
|
||||||
|
|
||||||
|
```bash
|
||||||
|
~
|
||||||
|
❯ rclone copy security.txt -vv ds923:/homes/bruno --sftp-path-override=/volume1/homes/bruno
|
||||||
|
|
||||||
|
# -vv verbose
|
||||||
|
|
||||||
|
❯ rclone copy -vv ds923:/homes/bruno/security.txt --sftp-path-override=/volume1/homes/bruno .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> iCloud
|
||||||
|
|
||||||
|
https://rclone.org/iclouddrive/
|
||||||
|
|
||||||
|
```
|
||||||
|
[iclouddrive]
|
||||||
|
type = iclouddrive
|
||||||
|
apple_id = bxxxxxxxxxxxx@orange.fr
|
||||||
|
password = Passw0rd4
|
||||||
|
cookies = X-APPLE-WEBAUTH-HSA-TRUST=2422434b85789793...
|
||||||
|
trust_token = HSARMTKNSRVXWFlaTNRjqj9rT3DEMu9UFBfRYvmzbJ3B2pWGryz46M....
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rclone config reconnect iclouddrive:
|
||||||
|
```
|
||||||
|
|
||||||
|
L'erreur `Missing PCS cookies from the request` est due à la Protection Avancée des Données (Préférences iCloud). Pour utiliser rclone, il faut la désactiver.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> Seafile
|
||||||
|
|
||||||
|
https://rclone.org/seafile/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[seafile923]
|
||||||
|
type = seafile
|
||||||
|
url = https://seafile.photos-nas.ovh
|
||||||
|
user = liste@blabla.info
|
||||||
|
pass =
|
||||||
|
2fa = true
|
||||||
|
library = Ma bibliothèque
|
||||||
|
auth_token = 71892276ff3cbd92ef86951c9b0939a4b7213286
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone copy security.txt -vv seafile923:
|
||||||
|
|
||||||
|
❯ rclone copy -vv seafile923:security.txt .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> sur-le-sentier.fr
|
||||||
|
|
||||||
|
https://rclone.org/sftp/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone config show
|
||||||
|
|
||||||
|
[sls]
|
||||||
|
type = sftp
|
||||||
|
host = sur-le-sentier.fr
|
||||||
|
user = sentier
|
||||||
|
use_insecure_cipher = false
|
||||||
|
shell_type = unix
|
||||||
|
md5sum_command = md5sum
|
||||||
|
sha1sum_command = sha1sum
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone copy security.txt sls:/var/www/vhosts/sur-le-sentier.fr
|
||||||
|
|
||||||
|
❯ rclone copy sls:/var/www/vhosts/sur-le-sentier.fr/security.txt .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> maboiteverte.fr
|
||||||
|
|
||||||
|
https://rclone.org/sftp/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone config show
|
||||||
|
|
||||||
|
[mbv]
|
||||||
|
type = sftp
|
||||||
|
host = maboiteverte.fr
|
||||||
|
use_insecure_cipher = false
|
||||||
|
shell_type = unix
|
||||||
|
md5sum_command = md5sum
|
||||||
|
sha1sum_command = sha1sum
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone copy security.txt -vv mbv:/var/www/vhosts/maboiteverte.fr
|
||||||
|
|
||||||
|
❯ rclone copy mbv:/var/www/vhosts/maboiteverte.fr/security.txt .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Mac -> ovh
|
||||||
|
|
||||||
|
https://rclone.org/sftp/
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone config show
|
||||||
|
|
||||||
|
[ovh]
|
||||||
|
type = sftp
|
||||||
|
host = ftp.cluster011.ovh.net
|
||||||
|
user = funnymac
|
||||||
|
shell_type = unix
|
||||||
|
md5sum_command = md5sum
|
||||||
|
sha1sum_command = sha1sum
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone copy security.txt -vv ovh:/homez.528/funnymac
|
||||||
|
|
||||||
|
❯ rclone copy ovh:/homez.528/funnymac/security.txt .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Synology -> pCloud
|
||||||
|
|
||||||
|
https://github.com/ravem/synology-pcloud-and-rclone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Commandes:
|
||||||
|
|
||||||
|
#### rclone about
|
||||||
|
|
||||||
|
Affiche les infos du serveur:
|
||||||
|
|
||||||
|
```
|
||||||
|
❯ rclone about sls:
|
||||||
|
Total: 115.535 GiB
|
||||||
|
Used: 36.288 GiB
|
||||||
|
Free: 79.248 GiB
|
||||||
|
|
||||||
|
# Options:
|
||||||
|
--full affiche les valeurs en octets
|
||||||
|
--json affiche le résultat en json
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone authorize
|
||||||
|
|
||||||
|
Pour autoriser un rclone distant ou fonctionnant sans interface graphique depuis un ordinateur équipé d'un navigateur, suivez les instructions de configuration de rclone.
|
||||||
|
|
||||||
|
#### rclone backend
|
||||||
|
|
||||||
|
Cette commande exécute une commande spécifique au backend.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone backend help sls:
|
||||||
|
2025/04/03 08:30:43 NOTICE: Failed to backend: sftp backend has no commands
|
||||||
|
|
||||||
|
❯ rclone backend help pcloud:
|
||||||
|
2025/04/03 08:31:56 NOTICE: Failed to backend: pcloud backend has no commands
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone bisync
|
||||||
|
|
||||||
|
Effectuer une synchronisation bidirectionnelle entre deux chemins.
|
||||||
|
|
||||||
|
#### rclone cat
|
||||||
|
|
||||||
|
Envoie des fichiers à la sortie standard.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone cat mbv:/var/www/vhosts/maboiteverte.fr/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone check
|
||||||
|
|
||||||
|
Vérifie que les fichiers de la source et de la destination correspondent.
|
||||||
|
|
||||||
|
#### rclone checksum
|
||||||
|
|
||||||
|
Vérifie les fichiers de la destination par rapport à un fichier SUM.
|
||||||
|
|
||||||
|
#### rclone cleanup
|
||||||
|
|
||||||
|
Nettoyez la destination si possible. Videz la corbeille ou supprimez les anciennes versions de fichiers. Non pris en charge par toutes les destination.
|
||||||
|
|
||||||
|
#### rclone config
|
||||||
|
|
||||||
|
Lancez une session de configuration interactive pour créer de nouveaux référentiels distants et gérer ceux existants.
|
||||||
|
|
||||||
|
#### rclone copy
|
||||||
|
|
||||||
|
Copie des fichiers de la source à la destination, en ignorant les fichiers identiques.
|
||||||
|
|
||||||
|
#### rclone copyto
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### rclone copyurl
|
||||||
|
|
||||||
|
Copie le contenu de l'URL fournie dans dest:path.
|
||||||
|
|
||||||
|
#### rclone cryptcheck
|
||||||
|
|
||||||
|
Cryptcheck contrôle l'intégrité d'un système distant chiffré.
|
||||||
|
|
||||||
|
#### rclone cryptdecode
|
||||||
|
|
||||||
|
Cryptdecode renvoie les noms de fichiers non chiffrés.
|
||||||
|
|
||||||
|
#### rclone dedupe
|
||||||
|
|
||||||
|
Recherche interactive des noms de fichiers en double et suppression/renommage.
|
||||||
|
|
||||||
|
#### rclone delete
|
||||||
|
|
||||||
|
Supprime les fichiers du chemin d'accès. Contrairement à purge, il obéit aux filtres include/exclude et peut donc être utilisé pour supprimer des fichiers de manière sélective.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Fichier > 100M
|
||||||
|
❯ rclone --min-size 100M lsl sls:/var/www/vhosts/sur-le-sentier.fr
|
||||||
|
|
||||||
|
# Suppression à vide
|
||||||
|
❯ rclone --dry-run --min-size 100M delete sls:/var/www/vhosts/sur-le-sentier.fr
|
||||||
|
|
||||||
|
# Suppression interactive
|
||||||
|
❯ rclone --interactive --min-size 100M delete sls:/var/www/vhosts/sur-le-sentier.fr
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone deletefile
|
||||||
|
|
||||||
|
Supprime un seul fichier d'un site distant. Contrairement à delete, il ne peut pas être utilisé pour supprimer un répertoire et n'obéit pas aux filtres include/exclude.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone --interactive delete sls:/var/www/vhosts/sur-le-sentier.fr/.bashrc
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone gendocs
|
||||||
|
|
||||||
|
Produit la documentation markdown pour rclone dans le répertoire fourni.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone gendocs rclone
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone hashsum
|
||||||
|
|
||||||
|
Génère un fichier de hachage (md5, sha1, whirlpool, crc32, sha256) pour tous les objets du répertoire.
|
||||||
|
|
||||||
|
```
|
||||||
|
md5, sha1, whirlpool, crc32, sha256
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone hashsum MD5 sls:/var/www/vhosts/sur-le-sentier.fr/logs/
|
||||||
|
93193fb044ccc71cb27203532ac334b8 error_log
|
||||||
|
d41d8cd98f00b204e9800998ecf8427e access_log
|
||||||
|
73abaaade6cd1c0a40162014867261f9 proxy_error_log
|
||||||
|
0801b1b10ac5ff6adb9e7bc8fe3647ad access_ssl_log
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone link
|
||||||
|
|
||||||
|
Générer un lien public vers le fichier/dossier.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone link sls:/var/www/vhosts/sur-le-sentier.fr/logs/
|
||||||
|
2025/04/03 11:04:55 NOTICE: Failed to link: sftp://sentier@sur-le-sentier.fr:22//var/www/vhosts/sur-le-sentier.fr/logs/ doesn't support public links
|
||||||
|
|
||||||
|
❯ rclone link pcloud:
|
||||||
|
https://e.pcloud.link/publink/show?code=kZyR1dZalrSWYGJiKYObHx04EzVw8U4hxik
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone listremotes
|
||||||
|
|
||||||
|
Liste toutes les destinations présentes dans le fichier de configuration et définies dans les variables d'environnement.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone listremotes
|
||||||
|
pcloud:
|
||||||
|
pcloud2:
|
||||||
|
ds923:
|
||||||
|
iclouddrive:
|
||||||
|
seafile923:
|
||||||
|
sls:
|
||||||
|
mbv:
|
||||||
|
ovh:
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone md5sum
|
||||||
|
|
||||||
|
Produit un fichier md5sum pour tous les objets du chemin.
|
||||||
|
|
||||||
|
Equivalent à `rclone hashsum MD5 remote:path`
|
||||||
|
|
||||||
|
#### rclone mkdir
|
||||||
|
|
||||||
|
Créez le chemin d'accès s'il n'existe pas déjà.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone mkdir sls:/var/www/vhosts/sur-le-sentier.fr/mkdir/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone mount
|
||||||
|
|
||||||
|
Rclone mount permet à Linux, FreeBSD, macOS et Windows de monter n'importe quel système de stockage en nuage de Rclone en tant que système de fichiers avec FUSE.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone move
|
||||||
|
|
||||||
|
Déplace le contenu du répertoire source vers le répertoire de destination.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rclone move rclone/ sls:/var/www/vhosts/sur-le-sentier.fr/rclone/
|
||||||
|
|
||||||
|
# Supprimer les dossiers vides
|
||||||
|
rclone move --delete-empty-src-dirs rclone/ sls:/var/www/vhosts/sur-le-sentier.fr/rclone/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone moveto
|
||||||
|
|
||||||
|
Déplacer un fichier ou un répertoire de la source vers la destination.
|
||||||
|
|
||||||
|
#### rclone ncdu
|
||||||
|
|
||||||
|
Explorer une destination avec une interface utilisateur textuelle.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone ncdu sls:/var/www/vhosts/sur-le-sentier.fr/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone purge
|
||||||
|
|
||||||
|
Retirer le chemin d'accès et tout son contenu.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Supprime le dossier rclone
|
||||||
|
|
||||||
|
❯ rclone purge sls:/var/www/vhosts/sur-le-sentier.fr/rclone/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone rcat
|
||||||
|
|
||||||
|
Copie l'entrée standard dans un fichier distant.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ echo "Hello" | rclone rcat sls:/var/www/vhosts/sur-le-sentier.fr/test_rcat
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone rmdir
|
||||||
|
|
||||||
|
Supprimer le répertoire vide au niveau du chemin d'accès.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone rmdir sls:/var/www/vhosts/sur-le-sentier.fr/empty_folder
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone rmdirs
|
||||||
|
|
||||||
|
Supprimer les répertoires vides au niveau du chemin d'accès.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
#sls
|
||||||
|
mkdir empty_folder/empty_folder2
|
||||||
|
|
||||||
|
❯ rclone rmdir sls:/var/www/vhosts/sur-le-sentier.fr/empty_folder/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone sha1sum
|
||||||
|
|
||||||
|
Produit un fichier sha1sum pour tous les objets du chemin.
|
||||||
|
|
||||||
|
Equivalent à `rclone hashsum SHA1 remote:path`
|
||||||
|
|
||||||
|
#### rclone size
|
||||||
|
|
||||||
|
Affiche la taille totale et le nombre d'objets situés dans le répertoire distant remote:path.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone size --max-depth 1 sls:/var/www/vhosts/sur-le-sentier.fr/
|
||||||
|
Total objects: 14
|
||||||
|
Total size: 13.468 MiB (14121727 Byte)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone sync
|
||||||
|
|
||||||
|
Rendre la source et la destination identiques, en ne modifiant que la destination.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone sync --interactive rclone sls:/var/www/vhosts/sur-le-sentier.fr/rclone/
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone tree
|
||||||
|
|
||||||
|
Liste le contenu d'un fichier distant de la même manière que la commande unix tree.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone tree sls:/var/www/vhosts/sur-le-sentier.fr/httpdocs/
|
||||||
|
|
||||||
|
/
|
||||||
|
├── Locale
|
||||||
|
│ ├── de_DE
|
||||||
|
│ │ └── LC_MESSAGES
|
||||||
|
│ │ ├── sentier.mo
|
||||||
|
│ │ └── sentier.po
|
||||||
|
│ ├── en_US
|
||||||
|
│ │ └── LC_MESSAGES
|
||||||
|
│ │ ├── sentier.mo
|
||||||
|
│ │ └── sentier.po
|
||||||
|
│ ├── es_ES
|
||||||
|
│ │ └── LC_MESSAGES
|
||||||
|
│ │ ├── sentier.mo
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rclone version
|
||||||
|
|
||||||
|
Affiche le numéro de version.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
❯ rclone version --check
|
||||||
|
yours: 1.69.1
|
||||||
|
latest: 1.69.1 (released 2025-02-14)
|
||||||
|
beta: 1.70.0-beta.8641.839eef0db (released 2025-03-26)
|
||||||
|
upgrade: https://beta.rclone.org/v1.70.0-beta.8641.839eef0db
|
||||||
|
|
||||||
|
❯ rclone version
|
||||||
|
rclone v1.69.1
|
||||||
|
- os/version: darwin 15.3.2 (64 bit)
|
||||||
|
- os/kernel: 24.3.0 (arm64)
|
||||||
|
- os/type: darwin
|
||||||
|
- os/arch: arm64 (ARMv8 compatible)
|
||||||
|
- go/version: go1.24.0
|
||||||
|
- go/linking: dynamic
|
||||||
|
- go/tags: none
|
||||||
|
```
|
||||||
|
|
||||||
@@ -8,6 +8,14 @@
|
|||||||
$ brew install wp-cli
|
$ brew install wp-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Comme wp-cli n'est pas à jour sur Homebrew, on l'installe directement:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||||
|
$ chmod +x wp-cli.phar
|
||||||
|
$ mv wp-cli.phar $HOME/.local/bin/wp
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
wp super-cache
|
#### wp super-cache
|
||||||
|
|
||||||
Cette commande nécessite l'installation du package <u>wp-cli/wp-super-cache-cli</u>
|
Cette commande nécessite l'installation du package <u>wp-cli/wp-super-cache-cli</u>
|
||||||
|
|
||||||
@@ -40,13 +40,49 @@ SUBCOMMANDS
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Lancer le cron immédiatement:
|
#### wp doctor
|
||||||
|
|
||||||
|
Installer le plugin wp-cli/doctor
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wp package install wp-cli/doctor-command
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ wp doctor check --all
|
||||||
|
|
||||||
|
+----------------------------+---------+--------------------------------------------------------------------+
|
||||||
|
| name | status | message |
|
||||||
|
+----------------------------+---------+--------------------------------------------------------------------+
|
||||||
|
| core-verify-checksums | success | WordPress verifies against its checksums. |
|
||||||
|
| file-eval | success | All 'php' files passed check for 'eval\(.*base64_decode\(.*'. |
|
||||||
|
| cache-flush | success | Use of wp_cache_flush() not found. |
|
||||||
|
| autoload-options-size | success | Autoloaded options size (NAN) is less than threshold (900kb). |
|
||||||
|
| constant-savequeries-falsy | success | Constant 'SAVEQUERIES' is undefined. |
|
||||||
|
| constant-wp-debug-falsy | error | Constant 'WP_DEBUG' is defined 'true' but expected to be falsy. |
|
||||||
|
| core-update | success | WordPress is at the latest version. |
|
||||||
|
| cron-count | success | Total number of cron jobs is within normal operating expectations. |
|
||||||
|
| cron-duplicates | success | All cron job counts are within normal operating expectations. |
|
||||||
|
| option-blog-public | error | Site is private but expected to be public. |
|
||||||
|
| plugin-active-count | success | Number of active plugins (0) is less than threshold (80). |
|
||||||
|
| plugin-deactivated | warning | Greater than 40 percent of plugins are deactivated. |
|
||||||
|
| plugin-update | warning | 1 plugin has an update available. |
|
||||||
|
| theme-update | success | Themes are up to date. |
|
||||||
|
| php-in-upload | success | No PHP files found in the Uploads folder. |
|
||||||
|
| language-update | success | Languages are up to date. |
|
||||||
|
+----------------------------+---------+--------------------------------------------------------------------+
|
||||||
|
Error: 2 checks report 'error'.
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Lancer le cron immédiatement:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ wp cron event run --due-now
|
$ wp cron event run --due-now
|
||||||
```
|
```
|
||||||
|
|
||||||
Liste des crons:
|
#### Liste des crons:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ wp cron event list
|
$ wp cron event list
|
||||||
@@ -68,7 +104,7 @@ $ wp cron event list
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Changer l'URL de WordPress:
|
#### Changer l'URL de WordPress:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ wp option update home 'http://example.com'
|
$ wp option update home 'http://example.com'
|
||||||
@@ -77,13 +113,13 @@ $ wp option update siteurl 'http://example.com'
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Supprimer les transients expirés:
|
#### Supprimer les transients expirés:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ wp transient delete --expired
|
$ wp transient delete --expired
|
||||||
```
|
```
|
||||||
|
|
||||||
Vider le cache:
|
#### Vider le cache:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ wp cache flush
|
$ wp cache flush
|
||||||
|
|||||||
41
docs/Divers/wp-cli/wp_option.md
Normal file
41
docs/Divers/wp-cli/wp_option.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# wp option
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Aide:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wp help option
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wp option
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
|
||||||
|
Retrieves and sets site options, including plugin and WordPress settings.
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
|
||||||
|
wp option <command>
|
||||||
|
|
||||||
|
SUBCOMMANDS
|
||||||
|
|
||||||
|
add Adds a new option value.
|
||||||
|
delete Deletes an option.
|
||||||
|
get Gets the value for an option.
|
||||||
|
get-autoload Gets the 'autoload' value for an option.
|
||||||
|
list Lists options and their values.
|
||||||
|
patch Updates a nested value in an option.
|
||||||
|
pluck Gets a nested value from an option.
|
||||||
|
set-autoload Sets the 'autoload' value for an option.
|
||||||
|
update Updates an option value.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Liste des options modifiables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ wp option list
|
||||||
|
```
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Sauvegarde Synlogy NAS sur pCloud avec rClone
|
# Sauvegarde Synology NAS sur pCloud avec rClone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user