New notes & New social icon forgejo

This commit is contained in:
Colmaris 2025-05-23 10:03:29 +02:00
parent ed6b0ea5f9
commit 92bba11c86
5 changed files with 145 additions and 5 deletions

9
archetypes/notes.md Normal file
View file

@ -0,0 +1,9 @@
---
title: "{{ replace (replace .Name "-" " ") "_" " " | title }}"
date: {{ .Date }}
tags:
- 100DaysToOffload
draft: false
author: "Colmaris"
toc: true
---

117
content/notes/borg/index.md Normal file
View file

@ -0,0 +1,117 @@
---
title: "Borg"
date: 2025-05-23T09:14:36+02:00
tags:
- 100DaysToOffload
draft: false
author: "Colmaris"
toc: true
---
## Créer un dépôt distant
*Ne pas oublié d'activité l'authentification par cléf pour SSH*
```shell
borg init -e none ssh://utilisateur@serveur:port/chemin/sur/le/dépôt/distant
```
* `-e none` : signifie que le dépôt n'est pas chiffré, pour chiffré le dépôt on utilisera l'options `repokey`
## Créer une sauvegarde
```shell
borg create --verbose --stats --compression lz4 /repertoire/source ssh://utilisateur@serveur:port/chemin/sur/le/dépôt/distant::nom-de-sauvegarde
```
## Lister les sauvegardes
```shell
borg list ssh://utilisateur@serveur:port/chemin/sur/le/dépôt/distant
```
## Restaurer une sauvegarde
```shell
borg extract ssh://utilisateur@serveur:port/chemin/sur/le/dépôt/distant::nom-de-la-sauvegarde-a-extraire /dossier/dextraction
```
## Automatisation
Placer le script dans `/etc/cron.daily/`pour une sauvegarde quotidienne vers 5h du matin. On peut aussi utiliser les dossier `cron.weekly`ou `cron.monthly` par exemple.
```shell
#!/bin/bash
# Setting this, so the repo does not need to be given on the commandline:
export BORG_REPO=ssh://utilisateur@serveur:port/chemin/sur/le/dépôt/distant
# See the section "Passphrase notes" for more infos.
#export BORG_PASSPHRASE=''
# some helpers and error handling:
info() { printf "\n%s %s\n\n" "$( date )" "$*" >&2; }
trap 'echo $( date ) Backup interrupted >&2; exit 2' INT TERM
info "Starting backup"
# Backup the most important directories into an archive named after
# the machine this script is currently running on:
borg create \
--verbose \
--filter AME \
--list \
--stats \
--show-rc \
--compression lz4 \
--exclude-caches \
--exclude 'home/*/.cache/*' \
--exclude 'var/tmp/*' \
\
::'{hostname}-{now}' \
/dossier/a/sauvegarder \
/dossier/a/sauvegarder \
/dossier/a/sauvegarder
backup_exit=$?
info "Pruning repository"
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
# archives of THIS machine. The '{hostname}-*' matching is very important to
# limit prune's operation to this machine's archives and not apply to
# other machines' archives also:
borg prune \
--list \
--glob-archives '{hostname}-*' \
--show-rc \
--keep-daily 7 \
--keep-weekly 4 \
--keep-monthly 12 \
--keep-yearly 5
prune_exit=$?
# actually free repo disk space by compacting segments
info "Compacting repository"
borg compact
compact_exit=$?
# use highest exit code as global exit code
global_exit=$(( backup_exit > prune_exit ? backup_exit : prune_exit ))
global_exit=$(( compact_exit > global_exit ? compact_exit : global_exit ))
if [ ${global_exit} -eq 0 ]; then
info "Backup, Prune, and Compact finished successfully"
elif [ ${global_exit} -eq 1 ]; then
info "Backup, Prune, and/or Compact finished with warnings"
else
info "Backup, Prune, and/or Compact finished with errors"
fi
exit ${global_exit}
```

View file

@ -0,0 +1,14 @@
---
title: "Proxmox"
date: 2025-05-23T09:12:07+02:00
tags:
- 100DaysToOffload
draft: false
author: "Colmaris"
toc: true
---
## Restaurer un container LXC en ligne de comande
```shell
pct restore <vmid> /chemin/vers/le/fichier/dump --storage <nom du stoackage>
```

View file

@ -137,16 +137,12 @@ theme = ["hugo-blog-awesome", "hugo-shortcode-gallery"]
[[params.socialIcons]] [[params.socialIcons]]
name = "github" name = "github"
url = "https://github.com/colmaris" url = "https://git.colmaris.fr/colmaris"
[[params.socialIcons]] [[params.socialIcons]]
name = "mastodon" name = "mastodon"
url = "https://gts.colmaris.fr" url = "https://gts.colmaris.fr"
[[params.socialIcons]]
name = "peertube"
url = "https://video.colmaris.fr"
[[params.socialIcons]] [[params.socialIcons]]
name = "Rss" name = "Rss"
url = "/index.xml" url = "/index.xml"

View file

@ -720,4 +720,8 @@
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path> <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg> </svg>
{{- else if (eq $icon_name "forgejo") -}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="currentColor" d="M16.777 0a2.9 2.9 0 1 1-2.529 4.322H12.91a4.266 4.266 0 0 0-4.265 4.195v2.118a7.08 7.08 0 0 1 4.147-1.42l.118-.002h1.338a2.9 2.9 0 0 1 5.43 1.422a2.9 2.9 0 0 1-5.43 1.422H12.91a4.266 4.266 0 0 0-4.265 4.195v2.319A2.9 2.9 0 0 1 7.222 24A2.9 2.9 0 0 1 5.8 18.57V8.589a7.11 7.11 0 0 1 6.991-7.108l.118-.001h1.338A2.9 2.9 0 0 1 16.778 0M7.223 19.905a1.194 1.194 0 1 0 0 2.389a1.194 1.194 0 0 0 0-2.389m9.554-10.464a1.194 1.194 0 1 0 0 2.389a1.194 1.194 0 0 0 0-2.39m0-7.735a1.194 1.194 0 1 0 0 2.389a1.194 1.194 0 0 0 0-2.389"/>
</svg>
{{- end -}} {{- end -}}