ajout scripts backup

This commit is contained in:
Tykayn 2022-07-06 16:16:12 +02:00 committed by tykayn
parent ca36fab5d2
commit 5d075db351
25 changed files with 1054 additions and 400 deletions

8
.idea/.gitignore vendored Executable file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

6
.idea/misc.xml Executable file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

8
.idea/modules.xml Executable file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/scripts.iml" filepath="$PROJECT_DIR$/.idea/scripts.iml" />
</modules>
</component>
</project>

8
.idea/scripts.iml Executable file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Executable file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

0
LICENSE Normal file → Executable file
View File

9
README.md Normal file → Executable file
View File

@ -1,3 +1,8 @@
# scripts
# scripts de https://www.cipherbliss.com
FR: des scripts et ressources en vrac évoqués sur mon blog
EN: open code and ressources from my blog
# license
AGPLv3+
des scripts en vrac

23
assets/org/.emacs Normal file
View File

@ -0,0 +1,23 @@
;; straight el bootstrap https://github.com/raxod502/straight.el#getting-started
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
(use-package org)
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
(org-babel-load-file "~/Nextcloud/textes/orgmode/config.org")

1
assets/org/bulma.min.css vendored Normal file

File diff suppressed because one or more lines are too long

629
config.org → assets/org/config.org Normal file → Executable file
View File

@ -5,13 +5,17 @@
* Ma config emacs
Voici la documentation au format Orgmode de ma configuration d'Emacs. Pour que cela fonctionne, il faut demander au fichier de config dans le dossier utilisateur, le fichier ".emacs" débutant par un point, de charger ce fichier config.org.
J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souvent des mentions à ce dossier dans la config.
J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souvent des mentions à ce dossier dans la config. Ma liste des tâches [[file:tasks.org]] pour la gestion de projets se compose d'un fichier principal et de quelques autres.
Les réunions ont leur propre fichier, le journal aussi.
[[file:reunions.org]].
[[file:journal.org]].
[[id:d8636e1d-0137-4502-9384-767b41c892b0][boulot]] [[id:c1c19fdf-ccab-4d78-b191-dbe0f8c66609][lemonway]]
Contenu du fichier de config [[file:~/.emacs]]
#+begin_quote
;; straight el bootstrap https://github.com/raxod502/straight.el#getting-started
(defvar bootstrap-version)
(let ((bootstrap-file
@ -166,18 +170,18 @@ J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souve
** Séquences de choses à faire
#+begin_src emacs-lisp
(setq org-todo-keywords
'((sequence
"STARTED(s)"
"TODO(t)" ; next action
"TOBLOG(b)" ; next action
"WAITING(w@/!)"
"SOMEDAY(.)" "BLOCKED(k@/!)" "|" "DONE(x!)" "CANCELLED(c)")
(sequence "PROJECT" "|" "DONE(x)")
(sequence "LEARN" "TRY" "TEACH" "|" "COMPLETE(x)")
(sequence "TOSKETCH" "SKETCHED" "|" "POSTED")
(sequence "TOBUY" "TOSHRINK" "TOCUT" "TOSEW" "|" "DONE(x)")
(sequence "TODELEGATE(-)" "DELEGATED(d)" "|" "COMPLETE(x)")))
(setq org-todo-keywords
'((sequence
"TODO(t)" ; next action
"STARTED(s)"
;; "TOBLOG(b)" ; next action
"WAITING(w@/!)"
"SOMEDAY(.)" "BLOCKED(k@/!)" "|" "DONE(x!)" "CANCELLED(c)")
(sequence "PROJECT" "|" "DONE(x)")
(sequence "LEARN" "TRY" "TEACH" "|" "DONE(x)")
;; (sequence "TOSKETCH" "SKETCHED" "|" "POSTED")
(sequence "TOBUY" "TOSHRINK" "TOCUT" "TOSEW" "|" "DONE(x)")
(sequence "TODELEGATE(-)" "DELEGATED(d)" "|" "DONE(x)")))
#+end_src
** Vue d'agenda Orgmode
@ -447,65 +451,109 @@ J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souve
#+begin_src emacs-lisp
;;; templates de capture pour les nouvelles tâches
(setq org-capture-templates
'(
("t" "Todo" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox")
"* TODO %?\n %i\n %a")
("l" "ToLearn" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Recherches et éducation")
"* TODO %?\n %i\n %a")
("b" "Boulot" entry (file+headline "~/Nextcloud/textes/orgmode/boulot.org" "Inbox")
"* TODO %?\n :boulot:work: %i\n %a")
("m" "Meeting" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Meetings")
"* MEETING with %? :meeting:\n%t" :clock-in t :clock-resume t)
("e" "E-mail" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox")
"* TODO %? :mail:écriture:\n %i\n %a")
("n" "Next Task" entry (file+headline org-default-notes-file "Next")
"** NEXT %? \nDEADLINE: %t")
("p" "Phone call" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Tel")
"* PHONE %? :tel:\n%U" :clock-in t :clock-resume t)
("j" "Journal" entry (file+datetree "~/Nextcloud/textes/orgmode/journal.org")
"* %?\nEntered on %U\n %i\n %a")))
;;; templates de capture pour les nouvelles tâches
(setq org-capture-templates
'(
("t" "Todo" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox")
"* TODO %?\n %i\n ")
("l" "ToLearn" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Recherches et éducation")
"* LEARN %?\n %i\n %a")
("b" "Boulot" entry (file+headline "~/Nextcloud/textes/orgmode/boulot.org" "Inbox")
"* TODO %?\n :boulot:work: %i\n %a")
;; (file "~/Nextclod/textes/orgmode/org-roam/20220620110632-meeting_template.org")
("m" "Meeting" entry (file+datetree "~/Nextcloud/textes/orgmode/reunions.org" "Réunions")
"* Réunion %T \n :[[id:d8636e1d-0137-4502-9384-767b41c892b0][boulot:meeting:]] \n**** Gens présents\n**** Notes\n - %?\n**** Choses à investiguer\n -\n**** Prochaines actions\n - Fin de la réunion: \n"
)
("e" "E-mail" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Inbox")
"* TODO %? :mail:écriture:\n %i\n %a")
("n" "Next Task" entry (file+headline org-default-notes-file "Next")
"** NEXT %? \nDEADLINE: %t")
("p" "Phone call" entry (file+headline "~/Nextcloud/textes/orgmode/tasks.org" "Tel")
"* PHONE %? :tel:\n%U" :clock-in t :clock-resume t)
("j" "Journal" entry (file+datetree "~/Nextcloud/textes/orgmode/journal.org")
"* %?\nEntered on %U\n %i\n %a"))
)
;; raccourci custom pour clavier sans pavé numérique
(global-set-key (kbd "C-T") 'org-todo)
#+end_src
** Org Roam, wiki personnel
#+begin_src emacs-lisp
(use-package org-roam
https://systemcrafters.net/build-a-second-brain-in-emacs/capturing-notes-efficiently/
Raccourcis Org Roam généraux
#+begin_src emacs-lisp
(use-package org-roam
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-capture-templates
'(("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t)
("m" "meeting" plain (file "~/Nextclod/textes/orgmode/org-roam/20220620110632-meeting_template.org")
:if-new (file+head "%<%Y%m%d%H%M%S>-meeting-${slug}.org" "#+title: ${title}\n")
:unnarrowed t
)
("b" "book notes" plain
"\n* Source\n\nAuthor: %^{Author}\nTitle: ${title}\nYear: %^{Year}\n\n* Summary\n\n%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
:unnarrowed t))
)
:bind (
("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
("C-c n g" . org-roam-graph)
("C-c n t" . org-roam-tag-add)
("C-c n a" . org-roam-alias-add)
)
)
(setq org-roam-directory "~/Nextcloud/textes/orgmode/org-roam")
(setq org-roam-completion-everywhere t)
(setq org-roam-db-autosync-mode t)
:bind (
("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
("C-c n g" . org-roam-graph)
("C-c n t" . org-roam-tag-add)
("C-c n a" . org-roam-alias-add)
:map org-roam-dailies-map
("Y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow)
)
:bind-keymap
("C-c n d" . org-roam-dailies-map)
:config
(require 'org-roam-dailies)
(org-roam-db-autosync-mode)
)
(setq org-roam-directory "~/Nextcloud/textes/orgmode/org-roam")
(setq org-roam-completion-everywhere t)
#+end_src
** Roam graph
Graph naviguable des liens entre les notes Org Roam.
#+begin_src emacs-lisp
(use-package org-roam-ui
:straight
(:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
:after org-roam
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
*** Roam graph
Graph naviguable des liens entre les notes Org Roam.
#+begin_src emacs-lisp
(use-package org-roam-ui
:straight
(:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
:after org-roam
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
#+end_src
#+end_src
** Images incluses dans les fichiers org
#+begin_src emacs-lisp
(setq org-startup-with-inline-images t)
(global-set-key (kbd "M-<f12>") 'org-toggle-inline-images)
(global-set-key (kbd "C-<f12>") 'visible-mode) ;; edit links
#+end_src
* Calendar framework
#+begin_src emacs-lisp
; calendar display
@ -535,6 +583,28 @@ J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souve
#+end_src
* Insérer la date et l'heure
raccourci: *Ctrl c, !*
*Ctrl U Ctrl C .*
exemple : <2022-06-27 lun. 18:51>
#+begin_src emacs-lisp
(defvar bjk-timestamp-format "<%Y-%m-%d %H:%M>"
"Format of date to insert with `bjk-timestamp' function
%Y-%m-%d %H:%M will produce something of the form YYYY-MM-DD HH:MM
Do C-h f on `format-time-string' for more info")
(defun bjk-timestamp ()
"Insert a timestamp at the current point.
Note no attempt to go to beginning of line and no added carriage return.
Uses `bjk-timestamp-format' for formatting the date/time."
(interactive)
(insert (org-format-time-string bjk-timestamp-format (current-time)))
)
;; insérer timestamp date et heure
(global-set-key "\C-c !" 'insert-current-date-time)
#+end_src
* Préconfiguration
#+begin_src emacs-lisp
;; -*- coding: utf-8; lexical-binding: t -*-
@ -554,10 +624,24 @@ J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souve
#+begin_src emacs-lisp
#+end_src
* Plein écran au démarrage
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(fullscreen . maximized))
#+end_src
* Démarrage
** Plein écran au démarrage
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(fullscreen . maximized))
#+end_src
** Fichier par défaut à l'ouverture
Montrer la liste des tâches par défaut
#+begin_src emacs-lisp
(setq initial-buffer-choice "~/Nextcloud/textes/orgmode/tasks.org")
#+end_src
** Centrer la fenêtre
#+begin_src emacs-lisp
(use-package centered-window
:custom
(cwm-centered-window-width 180))
#+end_src
* Fichiers récents
#+begin_src emacs-lisp
@ -574,30 +658,36 @@ J'utilise un dossier Nextcloud pour stocker mes textes, on retrouvera donc souve
#+end_src
* Raccourcis
** Commenter une ligne
Avec Ctrl+Shift+C
#+begin_src emacs-lisp
#+begin_src emacs-lisp
;; commenter une ligne de code, Ctrl Shift C.
;; commenter une ligne de code, Ctrl Shift C.
(defun comment-eclipse ()
(interactive)
(let ((start (line-beginning-position))
(end (line-end-position)))
(when (or (not transient-mark-mode) (region-active-p))
(setq start (save-excursion
(goto-char (region-beginning))
(beginning-of-line)
(point))
end (save-excursion
(goto-char (region-end))
(end-of-line)
(point))))
(comment-or-uncomment-region start end)))
(defun comment-eclipse ()
(interactive)
(let ((start (line-beginning-position))
(end (line-end-position)))
(when (or (not transient-mark-mode) (region-active-p))
(setq start (save-excursion
(goto-char (region-beginning))
(beginning-of-line)
(point))
end (save-excursion
(goto-char (region-end))
(end-of-line)
(point))))
(comment-or-uncomment-region start end)))
(global-set-key (kbd "C-<S-C>") 'comment-eclipse)
(global-set-key (kbd "C-<S-C>") 'comment-eclipse)
#+end_src
#+end_src
** Tout sélectionner
#+begin_src emacs-lisp
(global-set-key (kbd "C-a") 'mark-whole-buffer)
#+end_src
** Retirer les mauvais raccourcis
#+begin_src emacs-lisp
@ -634,199 +724,203 @@ Deft
* Lecture
#+begin_src emacs-lisp
;; raccourcis communs pour copier coller de texte
(cua-mode t)
;; raccourcis communs pour copier coller de texte
(cua-mode t)
;; - - - - - - - - - - - - - - - - - - - - - - - - - custom keys - - - - - - - - - - - - - - - - - - - - - - - - -
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
;;---- open tasks list at startup
(setq initial-buffer-choice "~/Nextcloud/textes/orgmode/config.org")
;; - - - - - - - - - - - - - - - - - - - - - - - - - custom keys - - - - - - - - - - - - - - - - - - - - - - - - -
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
;;---- open tasks list at startup
(setq initial-buffer-choice "~/Nextcloud/textes/orgmode/config.org")
;; barres de GUI
(setq tool-bar-mode t)
(setq scroll-bar-mode t)
(setq menu-bar-mode t)
;; barres de GUI
(setq tool-bar-mode t)
(setq scroll-bar-mode t)
(setq menu-bar-mode t)
(setq left-margin-width 5)
(setq right-margin-width 5)
(setq left-margin-width 5)
(setq right-margin-width 5)
;; highlight of lines
(require 'hl-line)
(add-hook 'prog-mode-hook #'hl-line-mode)
(add-hook 'text-mode-hook #'hl-line-mode)
;; highlight of lines
(require 'hl-line)
(add-hook 'prog-mode-hook #'hl-line-mode)
(add-hook 'text-mode-hook #'hl-line-mode)
;; fonts
;; font for errors
(ignore-errors (set-frame-font "JuliaMono-12"))
;; fonts
;; font for errors
(ignore-errors (set-frame-font "JuliaMono-12"))
(use-package doom-themes
:config
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
;; thème principal https://github.com/doomemacs/themes
(load-theme 'doom-nord t)
(use-package doom-themes
:config
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
;; thème principal https://github.com/doomemacs/themes
(load-theme 'doom-nord t)
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
(doom-themes-treemacs-config)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Enable custom neotree theme (all-the-icons must be installed!)
(doom-themes-neotree-config)
;; or for treemacs users
(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
(doom-themes-treemacs-config)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config))
(use-package doom-modeline
:config (doom-modeline-mode))
(use-package doom-modeline
:config (doom-modeline-mode))
(setq org-agenda-files (list "~/Nextcloud/textes/orgmode"))
(setq org-agenda-files (list "~/Nextcloud/textes/orgmode"))
;; alias
(defalias 'yes-or-no-p 'y-or-n-p)
;; alias
(defalias 'yes-or-no-p 'y-or-n-p)
;; - - - - - - - - - - - - - - matching parentheses - - - - - - - - - - - - - - - - - - - - - - - - - -
(use-package paren
:config
(show-paren-mode +1))
;; - - - - - - - - - - - - - - matching parentheses - - - - - - - - - - - - - - - - - - - - - - - - - -
(use-package paren
:ensure nil
:init
(setq show-paren-delay 0)
:config
(show-paren-mode +1))
(show-paren-mode)
(show-paren-mode)
(use-package rainbow-delimiters
:hook ((prog-mode . rainbow-delimiters-mode)))
;; dir tree
(use-package rainbow-delimiters
:hook ((prog-mode . rainbow-delimiters-mode)))
;; dir tree
;; - - - - - - - - - - - - - - icons - - - - - - - - - - - - - - - - - - - - - - - - - -
;; - - - - - - - - - - - - - - icons - - - - - - - - - - - - - - - - - - - - - - - - - -
(use-package all-the-icons)
(use-package all-the-icons)
(use-package all-the-icons-dired
:after all-the-icons
:hook (dired-mode . all-the-icons-dired-mode))
(use-package all-the-icons-dired
:after all-the-icons
:hook (dired-mode . all-the-icons-dired-mode))
;; - - - - - - - - - - - - - - - - - - - - - - - - - custom keys - - - - - - - - - - - - - - - - - - - - - - - - -
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
;; - - - - - - - - - - - - - - - - - - - - - - - - - custom keys - - - - - - - - - - - - - - - - - - - - - - - - -
(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)
(defun kill-all-buffers ()
"Close all buffers."
(interactive)
(let ((lsp-restart 'ignore))
;; (maybe-unset-buffer-modified)
(delete-other-windows)
(save-some-buffers)
(let
((kill-buffer-query-functions '()))
(mapc 'kill-buffer (buffer-list)))))
(defun kill-all-buffers ()
"Close all buffers."
(interactive)
(let ((lsp-restart 'ignore))
;; (maybe-unset-buffer-modified)
(delete-other-windows)
(save-some-buffers)
(let
((kill-buffer-query-functions '()))
(mapc 'kill-buffer (buffer-list)))))
(bind-key "C-c K" #'kill-all-buffers)
(bind-key "C-x !" #'delete-other-windows) ;; Access to the old keybinding.
(bind-key "C-c K" #'kill-all-buffers)
(bind-key "C-x !" #'delete-other-windows) ;; Access to the old keybinding.
(defun switch-to-scratch-buffer ()
"Switch to the current session's scratch buffer."
(interactive)
(switch-to-buffer "*scratch*"))
(bind-key "C-c s" #'switch-to-scratch-buffer)
(defun switch-to-scratch-buffer ()
"Switch to the current session's scratch buffer."
(interactive)
(switch-to-buffer "*scratch*"))
(bind-key "C-c s" #'switch-to-scratch-buffer)
;; voir la liste des tâches à l'état DONE
(fset 'done-tasks-list
(kmacro-lambda-form [?\C-c ?a ?t kp-2 ?r] 0 "%d"))
;; voir la liste des tâches à l'état DONE
(fset 'done-tasks-list
(kmacro-lambda-form [?\C-c ?a ?t kp-2 ?r] 0 "%d"))
;; archiver les tâches à l'état DONE
(fset 'archive-done-tasks-list
(kmacro-lambda-form [?\C-c ?a ?t kp-2 ?r] 0 "%d"))
;; archiver les tâches à l'état DONE
(fset 'archive-done-tasks-list
(kmacro-lambda-form [?\C-c ?a ?t kp-2 ?r] 0 "%d"))
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-c C-d") 'done-tasks-list)
(global-set-key (kbd "C-M-d") 'archive-done-tasks-list)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-c C-d") 'done-tasks-list)
(global-set-key (kbd "C-M-d") 'archive-done-tasks-list)
;; raccourcis issus d'habitudes de netbeans
;; save all by default Was: isearch-forward
(defun save-all () (interactive) (save-some-buffers t))
(global-set-key (kbd "C-x C-s") 'save-all)
(global-set-key (kbd "C-S-c") 'comment-line)
;; recherche dans tous les fichiers du dossier orgmode
(global-set-key (kbd "C-S-f") 'deft)
;; recherche dans le fichier courant avec ctrl + f
;;(global-set-key (kbd "C-f") 'isearch)
;; raccourcis issus d'habitudes de netbeans
;; save all by default Was: isearch-forward
(defun save-all () (interactive) (save-some-buffers t))
(global-set-key (kbd "C-x C-s") 'save-all)
(global-set-key (kbd "C-S-c") 'comment-line)
;; recherche dans tous les fichiers du dossier orgmode
(global-set-key (kbd "C-S-f") 'deft)
(global-set-key (kbd "<f1>") 'deft)
;; recherche dans le fichier courant avec ctrl + f
(global-set-key (kbd "C-f") 'isearch-forward)
(global-set-key (kbd "C-c C-f") 'org-roam-node-find)
(global-set-key (kbd "C-c C-i") 'org-roam-node-insert)
(global-set-key (kbd "C-c i") 'org-roam-node-insert)
(global-set-key (kbd "C-c C-f") 'org-roam-node-find)
(global-set-key (kbd "C-c C-i") 'org-roam-node-insert)
(global-set-key (kbd "C-c i") 'org-roam-node-insert)
(global-set-key (kbd "<f5>") 'org-capture)
(global-set-key (kbd "<f8>") 'org-cycle-agenda-files)
(global-set-key (kbd "<f12>") 'org-agenda)
(global-set-key (kbd "<f5>") 'org-capture)
(global-set-key (kbd "<f8>") 'org-cycle-agenda-files)
(global-set-key (kbd "<f12>") 'org-agenda)
(global-set-key (kbd "C-c <f9>") 'org-agenda-clock-goto)
(global-set-key (kbd "<f9>") 'org-clock-in)
(global-set-key (kbd "<f10>") 'org-clock-out)
(global-set-key (kbd "C-c <f9>") 'org-agenda-clock-goto)
(global-set-key (kbd "<f9>") 'org-clock-in)
(global-set-key (kbd "<f10>") 'org-clock-out)
(global-set-key (kbd "<f2>") 'dir-treeview)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
(global-set-key (kbd "<f2>") 'dir-treeview)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
(setq org-agenda-sticky t)
(setq org-agenda-sticky t)
;; use org-bullets-mode for utf8 symbols as org bullets
(use-package org-bullets)
(require 'org-bullets)
;; make available "org-bullet-face" such that I can control the font size individually
(setq org-bullets-face-name (quote org-bullet-face))
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(setq org-bullets-bullet-list '("◉"
"○"
"✸"
"✿"
"◇"
"✚"
))
;; use org-bullets-mode for utf8 symbols as org bullets
(use-package org-bullets)
(require 'org-bullets)
;; make available "org-bullet-face" such that I can control the font size individually
(setq org-bullets-face-name (quote org-bullet-face))
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(setq org-bullets-bullet-list '("◉"
"○"
"✸"
"✿"
"◇"
"✚"
))
;; org ellipsis options, other than the default Go to Node...
;; not supported in common font, but supported in Symbola (my fall-back font) ⬎, ⤷, ⤵
(setq org-ellipsis "⤵");; ≫
;; org ellipsis options, other than the default Go to Node...
;; not supported in common font, but supported in Symbola (my fall-back font) ⬎, ⤷, ⤵
(setq org-ellipsis "⤵");; ≫
;; make available "org-bullet-face" such that I can control the font size individually
(setq org-bullets-face-name (quote org-bullet-face))
;; make available "org-bullet-face" such that I can control the font size individually
(setq org-bullets-face-name (quote org-bullet-face))
;; détail de combinaison de touches
(use-package which-key
:diminish
:custom
(which-key-enable-extended-define-key t)
:config
(which-key-mode)
(which-key-setup-minibuffer))
;; détail de combinaison de touches
(use-package which-key
:diminish
:custom
(which-key-enable-extended-define-key t)
:config
(which-key-mode)
(which-key-setup-minibuffer))
(defun display-startup-echo-area-message ()
"Override the normally tedious startup message."
(message "Welcome back."))
(defun display-startup-echo-area-message ()
"Override the normally tedious startup message."
(message "Welcome back."))
#+end_src
@ -854,13 +948,6 @@ Deft
#+end_src
* Images incluses dans les fichiers org
#+begin_src emacs-lisp
(setq org-startup-with-inline-images t)
(global-set-key (kbd "M-<f12>") 'org-toggle-inline-images)
(global-set-key (kbd "C-<f12>") 'visible-mode) ;; edit links
#+end_src
* Heure dans la modeline
#+begin_src emacs-lisp
(display-time-mode 1)
@ -905,28 +992,6 @@ Deft
** Auto format à la sauvegarde
#+begin_src emacs-lisp
#+end_src
* Centrer la fenêtre
#+begin_src emacs-lisp
(use-package centered-window
:custom
(cwm-centered-window-width 180))
#+end_src
* Export Ox-Hugo
#+begin_src emacs-lisp
;; ----- hugo export to publish website
(use-package ox-hugo
:after ox)
(setq org-hugo-base-dir "~/Nextcloud/textes/hugo")
(with-eval-after-load 'ox
(require 'ox-hugo))
#+end_src
* Fichier par défaut à l'ouverture
#+begin_src emacs-lisp
(setq initial-buffer-choice "~/Nextcloud/textes/orgmode/tasks.org")
#+end_src
* Développement
#+begin_src emacs-lisp
#+end_src
@ -1001,6 +1066,11 @@ Deft
:mode ("\\.\\(njk\\|md\\)\\'" . markdown-mode))
#+end_src
** Json
#+begin_src emacs-lisp
(use-package json-mode)
#+end_src
** Sauvegardes des fichiers
#+begin_src emacs-lisp
@ -1043,17 +1113,31 @@ Deft
** Centrer le texte - Olivetti
#+begin_src emacs-lisp
;; olivetti
;; Distraction-free screen
(use-package olivetti
:init
(setq olivetti-body-width .67)
:config
)
;; olivetti
;; Distraction-free screen
(use-package olivetti
:straight t
:init
(setq olivetti-body-width .67)
:config
)
(setq olivetti-body-width .67
text-scale-increase 1.5
olivetti-mode t
)
(add-hook 'text-mode-hook (lambda ()
(interactive)
(message "Olivetti text-mode-hook")
(text-scale-increase 1.5)
(olivetti-set-width .81)
;; (hidden-mode-line-mode)
(olivetti-mode 1)))
(use-package writeroom-mode)
(use-package writeroom-mode)
#+end_src
** Auto complétion
@ -1116,12 +1200,31 @@ Deft
trucs à trouver comment faire
faire de la recherche avec Ctrl + F
faire du remplacement avec Ctrl + H
** Tout sélectionner
#+begin_src emacs-lisp
(global-set-key (kbd "C-a") 'mark-whole-buffer)
#+end_src
#+begin_src emacs-lisp
#+end_src
** Exports
*** fichier JSON
Pour la création d'une page de rapport d'activités en HTML.
#+begin_src emacs-lisp
(use-package ox-json
:straight t)
(require 'ox-json)
#+end_src
*** publication de site web du wiki
Ox-Hugo
#+begin_src emacs-lisp
;; ----- hugo export to publish website
(use-package ox-hugo
:after ox)
(setq org-hugo-base-dir "~/Nextcloud/textes/hugo")
(with-eval-after-load 'ox
(require 'ox-hugo))
#+end_src
* Autre
La suite est à inventer.
Pour installer cette configuration d'emacs, lancez le script

164
assets/org/style.css Normal file
View File

@ -0,0 +1,164 @@
body {
max-width: 80vw;
margin: 1rem auto;
}
#table-of-contents{
font-size: 1rem;
border-left: solid 3px;
padding-left: 1rem;
}
#table-of-contents h2{
font-size: 1rem;
text-align:left;
}
.section-number-2{
display:none;
}
.title sub{
font-size: 1em;
margin-left: 0.5ch;
}
.timestamp{
font-weight:700;
color: crimson;
}
h1 {
color: #111;
font-family: 'Open Sans Condensed', sans-serif;
font-size: 64px;
font-weight: 700;
line-height: 64px;
margin: 0 0 0;
padding: 20px 30px;
text-align: center;
text-transform: uppercase;
}
h2 {
color: #111;
font-family: 'Open Sans Condensed', sans-serif;
font-size: 48px;
font-weight: 700;
line-height: 48px;
margin: 0 0 24px;
padding: 0 30px;
text-align: center;
text-transform: uppercase;
}
p {
color: #111;
font-family: 'Calibri', 'Open Sans', sans-serif;
font-size: 1rem;
line-height: 1.5rem;
margin: 0 0 2rem;
/*columns:3;*/
}
a {
color: #990000;
text-decoration: none;
}
a:hover {
text-decoration: underline
}
.date {
color: #111;
display: block;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
position: relative;
text-align: center;
z-index: 1;
background: white;
}
.date:before {
border-top: 1px solid #111;
content: "";
position: absolute;
top: 0rem;
left: 0;
width: 100%;
z-index: -1;
}
.author {
color: #111;
display: block;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
padding-bottom: 38px;
position: relative;
text-align: center;
z-index: 1;
background: white;
}
.author:before {
border-top: 1px solid #111;
content: "";
position: absolute;
top: 0rem;
left: 0;
width: 100%;
z-index: -1;
}
.date span,
.author span {
background: #fdfdfd;
padding: 0 10px;
text-transform: uppercase;
}
.line {
border-top: 1px solid #111;
display: block;
margin-top: 60px;
padding-top: 50px;
position: relative;
}
.read-more {
-moz-border-radius: 50%;
-moz-transition: all 0.2s ease-in-out;
-webkit-border-radius: 50%;
-webkit-transition: all 0.2s ease-in-out;
background: #111;
border-radius: 50%;
border: 10px solid #fdfdfd;
color: #fff;
display: block;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
height: 80px;
line-height: 80px;
margin: -40px 0 0 -40px;
position: absolute;
bottom: 0px;
left: 50%;
text-align: center;
text-transform: uppercase;
width: 80px;
}
.read-more:hover {
background: #990000;
text-decoration: none;
}
.org-src-container{
background: #dedede;
padding:0.5rem;
margin-bottom: 2rem;
}
pre.example{
background: #ccc;
padding: 0.5rem;
margin: 1rem;
}

0
tasks.org → assets/org/tasks.org Normal file → Executable file
View File

23
assets/org/upcalendar.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# getting a nextcloud calendar without auth and convert it to org file
# add this to a cronjob
#
echo "updating calendar from nextcloud"
#URL="https://cloud.tykayn.fr/remote.php/dav/public-calendars/M2XZMF5KpfmXJcfc\?export" # public link to orgmode calendar of nextcloud https://cloud.tykayn.fr/index.php/apps/calendar/timeGridWeek/now
URL_CAL="https://cloud.tykayn.fr/remote.php/dav/public-calendars/xke8x4NKbyMan92W/?export" # calendrier tkwulfi
echo $URL_CAL
wget $URL_CAL -O orgcalendar.ics --show-progress
# add content of other calendars
#URL_CAL="https://cloud.tykayn.fr/remote.php/dav/calendars/super_admin_tykayn/mobilizonfr/?export"
#wget $URL_CAL -O ->> orgcalendar.ics --show-progress
# annivs
#URL_CAL="https://cloud.tykayn.fr/remote.php/dav/calendars/super_admin_tykayn/contact_birthdays/?export"
#wget $URL_CAL -O ->> orgcalendar.ics --show-progress
# convert the ics to an org file
du -sch orgcalendar.ics
icsorg -i orgcalendar.ics -o calendar.org
cat calendar.org |wc -l
echo "DONE"

0
borg_spaceship.sh → bash/backups/borg_spaceship.sh Normal file → Executable file
View File

0
disk_ext_sync.sh → bash/backups/disk_ext_sync.sh Normal file → Executable file
View File

View File

@ -0,0 +1,155 @@
#/bin/bash
# ----------------- documentation -----------------
#
# @author functions_sync by @tykayn - contact at cipherbliss.com
export today=`date` # to log current time
export ARCHIVE_SYNCABLE="/home/poule/encrypted/stockage-syncable" # place where we have our things sorted, other than home
export BORG_PASSCOMMAND="cat $ARCHIVE_SYNCABLE/.tk-borg-passphrase-light" # get the borg repo pass
export SPACESHIP_BORG_REPO="/home/poule/borg_archives/backup_land4to"
export LOG_FILE_BACKUP="$ARCHIVE_SYNCABLE/www/backup/log_backup.log"
export LOG_FILE_BACKUP_DATES="$ARCHIVE_SYNCABLE/www/backup/summary_log_backup.log" # log dates of execution of the script
CURRENT_YEAR="2022"
USER='tykayn'
# --------- log de la date courante -------- #
function logDate()
{
echo "--- $1" | tee -a $LOG_FILE_BACKUP_DATES 2>&1
date '+%Y-%m-%d %H:%M:%S' | tee -a $LOG_FILE_BACKUP_DATES 2>&1
echo "--- " | tee -a $LOG_FILE_BACKUP_DATES 2>&1
}
# --------- gestion des exclusions de rsync -------- #
EXCLUDE=( '.yarn' 'cache' '.cache' 'Cache' 'Steam' 'steamapps' '.npm' '.yarn' 'node_modules' '.mozilla' 'vendor' 'Steam' '.rbenv' '.config/borg' '@eaDir' 'steamapps' 'bower_components')
exclude_opts=()
for item in "${EXCLUDE[@]}"; do
exclude_opts+=( --exclude="$item" )
done
logDate "exclusions de rsync: \n ${exclude_opts[@]}"
# --------- recopie des éléments de poule zfs -------- #
# les disques de desintation doivent avoir environ 2.5To de place disponible
# chacun doit refléter la partie interne de /home/poule ainsi que le dossier music
function syncToBigDiskName()
{
local diskName=$1
echo ' ' >> $LOG_FILE_BACKUP_DATES
# chech that the disk exists
FILE=/media/$USER/$diskName
if test -d "$FILE"; then
echo "### $FILE , $diskName exists." >> $LOG_FILE_BACKUP_DATES
echo "### ${today} replicate to disk $diskName" >> $LOG_FILE_BACKUP_DATES
logDate 'disk $diskName : part illus';
rsync -avhWP /home/poule/encrypted/dessins_autres_gens /media/$USER/$diskName/encrypted --perms --delete-before --inplace "${exclude_opts[@]}"
rsync -avhWP /home/poule/encrypted/mangas /media/$USER/$diskName/encrypted --perms --delete-before --inplace "${exclude_opts[@]}"
logDate 'disk $diskName : part installateurs';
rsync -avhWP /home/poule/encrypted/home /media/$USER/$diskName/encrypted --perms --delete-before --inplace "${exclude_opts[@]}"
rsync -avhWP /home/poule/encrypted/installateurs /media/$USER/$diskName/encrypted --perms --delete-before --inplace "${exclude_opts[@]}"
logDate 'disk $diskName : part stockage-syncable : photos current year';
rsync -avhWP /home/poule/encrypted/stockage-syncable/photos/$CURRENT_YEAR/* /media/$USER/$diskName/encrypted/stockage-syncable/photos/$CURRENT_YEAR --delete-before --inplace "${exclude_opts[@]}"
logDate 'disk $diskName : part stockage-syncable : photos all';
rsync -avhWP /home/poule/encrypted/stockage-syncable/photos/* /media/$USER/$diskName/encrypted/stockage-syncable/photos --delete-before --inplace "${exclude_opts[@]}"
logDate 'disk $diskName : part production-servers-backup';
rsync -avhWP /home/poule/borg_archives/production-servers-backup/* /media/$USER/$diskName/borg_archives/production-servers-backup --delete-before --inplace "${exclude_opts[@]}"
logDate 'disk $diskName : part encrypted all';
rsync -avhWP /home/poule/encrypted/* /media/$USER/$diskName/encrypted --delete-before "${exclude_opts[@]}"
logDate 'disk $diskName : part music';
rsync -avhWP /home/poule/music /media/$USER/$diskName/ --delete-before --inplace "${exclude_opts[@]}"
else
echo "### $FILE introuvable." >> $LOG_FILE_BACKUP_DATES
fi
date '+%Y-%m-%d %H:%M:%S' | tee -a $LOG_FILE_BACKUP_DATES 2>&1
echo "---- syncToBigDiskName $diskName faite -----------------------" | tee -a $LOG_FILE_BACKUP_DATES 2>&1
}
# ----------------------------------------------------------------------
# --------- le laptop fatland n'a que 2 To de disponible -------- #
function syncfatland()
{
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo ' - envoi vers FATland' >> $LOG_FILE_BACKUP_DATES
#### vers le laptop FATland
rsync /home/poule/encrypted/stockage-syncable/photos/$CURRENT_YEAR tykayn@192.168.1.12:/home/poule/encrypted/stockage-syncable/photos -avhWP --delete-before "${exclude_opts[@]}"
rsync -avhWP /home/poule/encrypted/stockage-syncable/photos/* tykayn@192.168.1.12:/home/poule/encrypted/stockage-syncable/photos --delete-before "${exclude_opts[@]}"
rsync /home/poule/encrypted/stockage-syncable tykayn@192.168.1.12:/home/poule/encrypted -avhWP --delete-before "${exclude_opts[@]}"
rsync /home/poule/encrypted/mangas/* tykayn@192.168.1.12:/home/poule/encrypted/mangas -avhWP --delete-before "${exclude_opts[@]}"
rsync /home/poule/encrypted/home/* tykayn@192.168.1.12:/home/poule/encrypted/home -avhWP --delete-before "${exclude_opts[@]}"
rsync /home/poule/borg_archives/* tykayn@192.168.1.12:/home/poule/borg_archives -avhWP --delete-before
date | tee -a $LOG_FILE_BACKUP_DATES 2>&1
echo "sync fatland fait" | tee -a $LOG_FILE_BACKUP_DATES 2>&1
}
# --------- serveurs web -------- #
# retrieve web servers data to zfs spaceship
# récup des borg backup des serveurs web
function getWebServersBorg()
{
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo "### ${today} copy of servers borg_backup production contents " | tee -a $LOG_FILE_BACKUP_DATES 2>&1
rsync -avzhWP --perms --delete-before tykayn@peertube.cipherbliss.com:/home/$USER/backup/borgbackup_peertube /home/poule/borg_archives/production-servers-backup/spare & rsync -avzhWP --perms --delete-before tykayn@www.cipherbliss.com:/home/$USER/backup/borgbackup_soy /home/poule/borg_archives/production-servers-backup/soyoustart & rsync -avzhWP --perms --delete-before tykayn@peertube.cipherbliss.com:/home/$USER/backup/serveurs-production/borgbackup_cloudland /home/poule/borg_archives/production-servers-backup/cloud
}
# ----------------- BORG -----------------
# partie contenant tout stockage-syncable
function upBorg()
{
killall borg
logDate "### --------- SPACESHIP | creating borg archive at $SPACESHIP_BORG_REPO"
rm -rf /home/$USER/.cache/borg/150867528afd85114c8aba98af201a7ad8cf01869c507a87c025d2f8701040a9/lock.exclusive
rm -rf $SPACESHIP_BORG_REPO/lock.exclusive
borg create $SPACESHIP_BORG_REPO::encrypted_spaceship_{now} $ARCHIVE_SYNCABLE /home/poule/encrypted/home/$USER --exclude 'BAZAR' "${exclude_opts[@]}" --progress --verbose --stats --compression zstd,9 | tee -a $LOG_FILE_BACKUP 2>&1
echo ' ' | tee -a $LOG_FILE_BACKUP 2>&1
logDate '### --------- ${today} | SPACESHIP | pruning old archives' | tee -a $LOG_FILE_BACKUP 2>&1
# nettoyage tk_backup
borg prune -v --list --stats --keep-daily=8 --keep-weekly=6 --keep-monthly=3 --keep-yearly=2 $SPACESHIP_BORG_REPO | tee -a $LOG_FILE_BACKUP 2>&1
logDate '### --------- pruning done'
}
# ---------- manage log git
function logGit_csv()
{
git log --pretty=format:"%cd - %an : %s" --graph --since=8.weeks | tee -a log_boulot.org 2>&1
}
# écrire un log des commits réalisés groupés par jour pour le dossier courant
function logGit_per_day(){
while read -r -u 9 since name
do
until=$(date '+%Y-%m-%d %H:%M:%S' )
echo "$since $name"
echo
GIT_PAGER=cat git log \
--no-merges \
--committer="$name" \
--since="$since 00:00:00 +0000" \
--until="$until 00:00:00 +0000" \
--format=' * [%h] %s'
echo
done 9< <(git log --no-merges --format=$'%cd %cn' --date=short --since=8.weeks | sort --unique --reverse)
}
function logGit_to_org()
{
folder_name=${PWD##*/}
touch log_git_list.org
echo "* Log git $folder_name\n"> log_git_list.org;
pwd >> log_git_list.org;
cat log_git_list.org;
logGit_per_day | tee -a log_git_list.org 2>&1
}

180
bash/backups/sync_spaceship.sh Executable file
View File

@ -0,0 +1,180 @@
#/bin/bash
# ----------------- documentation -----------------
#
# @author sync_spaceship by @tykayn - contact at cipherbliss.com
#
# L'archive Borg contient stockage syncable et vise à être mise dans le NAS pour la postérité
# BORG_NEW_PASSPHRASE=mon_pass_bien_compliqué borg init -e=repokey /home/poule/borg_archives/backup_land4to
# borg create --compression lzma,9 /home/poule/borg_archives/backup_land4to::backup_land4to_{now}
#
#
# à installer en cronjob avec:
# crontab -e
#
# m h dom mon dow command
# */30 * * * * bash /home/$USER/sync_spaceship.sh
#
# ----------------- configs -----------------
source /home/tykayn/functions_sync.sh
logDate ' start backup script from sync_spaceship script'
logDate "${pwd} sync_spaceship.sh"
logDate ' stop all rsync jobs'
killall rsync;
# ------------------
logDate ' copie du script actuel'
cp /home/$USER/sync_spaceship.sh /home/$USER/Nextcloud/boulot/syncro_scripts_spaceship
cp /home/$USER/sync_spaceship.sh $ARCHIVE_SYNCABLE/__scripts_syncro
cp /home/$USER/.bash_aliases $ARCHIVE_SYNCABLE/__scripts_syncro
cp /home/$USER/.emacs /home/$USER/Nextcloud/boulot/emacs
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo "### ${today} start backup script from sync_spaceship script" >> $LOG_FILE_BACKUP_DATES
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo "### ${today} list of debian apt packages saved in borg_archives list_of_debian_apt_packages.txt" >> $LOG_FILE_BACKUP_DATES
# save a list of apt packages
# to restore it:
# dpkg --set-selections < list_of_debian_apt_packages.txt
dpkg --get-selections>/home/$USER/list_of_debian_apt_packages.txt
# back pictures to ARCHIVE_SYNCABLE
logDate 'copy of Nextcloud InstantUpload photos'
mv /home/$USER/Nextcloud/InstantUpload/Camera/* "$ARCHIVE_SYNCABLE/photos/$CURRENT_YEAR" | tee -a $LOG_FILE_BACKUP 2>&1
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo "### ${today} medias in $ARCHIVE_SYNCABLE/photos/2022" >> $LOG_FILE_BACKUP_DATES
ls -l "$ARCHIVE_SYNCABLE/photos/2022" | wc -l | tee -a $LOG_FILE_BACKUP 2>&1
logDate ' Screenshots et Download'
mv /home/$USER/Nextcloud/InstantUpload/Screenshots/* "$ARCHIVE_SYNCABLE/photos/screenshots" | tee -a $LOG_FILE_BACKUP 2>&1
mv /home/$USER/Nextcloud/InstantUpload/Download/* "$ARCHIVE_SYNCABLE/BAZAR" | tee -a $LOG_FILE_BACKUP 2>&1
logDate 'update local nextcloud to stockage syncable';
rsync -avhWP --perms --inplace --delete-before /home/$USER/Nextcloud/* $ARCHIVE_SYNCABLE/archivage/clouds/Nextcloud | tee -a $LOG_FILE_BACKUP 2>&1
logDate 'update home backup';
rsync -avhWP --inplace --delete-before /home/$USER/* /home/poule/encrypted/home/$USER "${exclude_opts[@]}" --exclude 'Nextcloud' --exclude 'www' | tee -a $LOG_FILE_BACKUP 2>&1
# --------- sauver les dossiers de développement dans l'archive stockage syncable sans supprimer les projets présents -------- #
logDate 'WWW et HTML sauver les dossiers de développement';
rsync -avP /home/tykayn/www/* /home/poule/encrypted/stockage-syncable/www/development/html "${exclude_opts[@]}"
rsync -avP /var/www/html/* /home/poule/encrypted/stockage-syncable/www/development/html "${exclude_opts[@]}"
# ----------------------------------------------------------------------
# --------- disques -------- #
# - blue 4To (squatt à lyon)
# - brossadent 4To
# - chaton 5To (usb boitier)
# - lilia 4To
# - louisbraille 4To
# - brossadent 4To (squatt à vovo)
# -|(disque sur dock)
# |--|
# | |- moonmoon 3To
#  | |- rondoudou 1To --- non chiffré
# |
# |--|
# |- catwoman 4To (dans le NAS)
# - Taiga 1To
echo "le log de backup se situe dans : $LOG_FILE_BACKUP_DATES"
# --------- mettre à jour les borg backup des serveurs distants -------- #
getWebServersBorg;
# --- raspberry pi ---------- #
logDate 'update local backup de domoticz vers stockage-syncable/www/backup/domoticz/synced';
rsync -avhWP pi@192.168.1.8:/home/pi /home/poule/encrypted/stockage-syncable/www/backup/domoticz/synced --delete-before --inplace
# --- maj borg de stockage syncable ---------- #
upBorg;
# --------- disques avec beaucoup de place -------- #
# --------- disques chiffrés -------- #
syncToBigDiskName louisbraille
syncToBigDiskName rugged
syncToBigDiskName moonmoon # dernier disque source pour temporisation
syncToBigDiskName lilia
syncToBigDiskName chaton
syncToBigDiskName brossadent
syncToBigDiskName blue
# --------- disques non chiffrés -------- #
# --------- disques de petite taille -------- #
# ne peuvent prendre que le stockage syncable
# ----------- small disks --------------
# syncro vers Taiga de borg
FILE=/media/$USER/Taiga
if test -d "$FILE"; then
echo "### $FILE , Taiga exists." >> $LOG_FILE_BACKUP_DATES
logDate 'Taiga disk monté - sync borg backup';
# rsync -avhWP /home/poule/encrypted/stockage-syncable/* /media/$USER/$diskName/encrypted/stockage-syncable --perms --delete-before --inplace "${exclude_opts[@]}"
rsync -avhWP /home/poule/borg_archives/backup_land4to/* /media/tykayn/Taiga/backup_land4to --delete-before --inplace
else
echo 'Taiga disk NON monté '; >> $LOG_FILE_BACKUP_DATES
fi
# --------- autres pool ZFS -------- #
syncfatland;
## possible amélioration de vitesse de rsync sur les gros dossiers
# ls $dossier_source | xargs -n1 -P4 -I% rsync -Pa % $destination
# ----------------- sync to NAS -----------------
# à destination du NAS, les borg backups perso et de serveurs
logDate ' à destination du NAS: backup_land4to';
rsync -avhWP /home/poule/borg_archives/backup_land4to/* tykayn@192.168.1.15:/var/services/homes/tykayn/borg_archives/backup_land4to --delete-before --inplace --perms
rsync -avhWP /home/poule/cryptomator/* tykayn@192.168.1.15:/volume1/bidules_partagés/cryptomator --delete-before --inplace --perms
logDate ' à destination du NAS: production-servers-backup';
#rsync -avhWP /home/poule/borg_archives/production-servers-backup/* tykayn@192.168.1.15:/var/services/homes/tykayn/borg_archives/production-servers-backup --delete-before --inplace --perms --exclude="@eaDir" "${exclude_opts[@]}"
logDate ' à destination du NAS: vidéos DL';
#rsync -avhWP /home/poule/videos/DOCU-CONF-YOUTUBE/* tykayn@192.168.1.15:/volume1/bidules_partagés/videos/DOCU-CONF-YOUTUBE --delete-before --inplace --perms
logDate ' à destination du NAS: vidéos';
#rsync -avhWP /home/poule/videos/* tykayn@192.168.1.15:/volume1/bidules_partagés/videos --delete-before --inplace --perms
logDate ' à destination du NAS: music';
#rsync -avhWP /home/poule/music tykayn@192.168.1.15:/volume1/music --delete-before --inplace --perms
# en provenance du NAS ----- les bidules partagés
logDate 'en provenance du NAS: bidules_partagés Documents administratifs';
#rsync -avhWP tykayn@192.168.1.15:/volume1/bidules_partagés/Documents\\\ administratifs /home/poule/encrypted/bidules_partagés_backup --delete-before --inplace --perms "${exclude_opts[@]}"
logDate 'en provenance du NAS: bidules_partagés Briis';
#rsync -avhWP tykayn@192.168.1.15:/volume1/bidules_partagés/Briis /home/poule/encrypted/bidules_partagés_backup --delete-before --inplace --perms "${exclude_opts[@]}"
logDate 'en provenance du NAS: bidules_partagés Mariage';
#rsync -avhWP tykayn@192.168.1.15:/volume1/bidules_partagés/Mariage /home/poule/encrypted/bidules_partagés_backup --delete-before --inplace --perms "${exclude_opts[@]}"
logDate 'en provenance du NAS: bidules_partagés wulfila_home sans backups ordi';
#rsync -avhWP tykayn@192.168.1.15:/volume1/bidules_partagés/wulfila_home /home/poule/encrypted/other_people_content --inplace --exclude=TK-LAND --exclude=musique_tykayn --exclude=windows_backup_laptop_claire --delete-before --inplace --perms "${exclude_opts[@]}"
logDate 'en provenance du NAS: fait';
echo "### ${today} end" >> $LOG_FILE_BACKUP_DATES
date -ud "@$SECONDS" | tee -a $LOG_FILE_BACKUP 2>&1
echo "voir les logs: gedit $LOG_FILE_BACKUP"
echo "voir les logs des sections par dates: gedit $LOG_FILE_BACKUP_DATES"
echo " " | tee -a $LOG_FILE_BACKUP 2>&1
echo "taille du BAZAR: $ARCHIVE_SYNCABLE/BAZAR " | tee -a $LOG_FILE_BACKUP 2>&1
du -sch $ARCHIVE_SYNCABLE/BAZAR | tee -a $LOG_FILE_BACKUP 2>&1
date -ud "@$SECONDS" | tee -a $LOG_FILE_BACKUP_DATES 2>&1
echo " " | tee -a $LOG_FILE_BACKUP 2>&1
echo " " | tee -a $LOG_FILE_BACKUP 2>&1
logDate 'fin de sync_spaceship.sh';

58
bash/backups/test-func.sh Normal file
View File

@ -0,0 +1,58 @@
#/bin/bash
# @author sync_spaceship by @tykayn - contact at cipherbliss.com
#
# disques ext
# - blue 4To
# - brossadent 4To
# - catwoman 4To
# - chaton 5To
# - kouignamann 4To
# - lilia 4To
# - louisbraille 4To
# - monolith 6.2To
# - rondoudou 4To non chiffré
# - Taiga 1To
# configs
export today=`date` # to log current time
export ARCHIVE_CLEAR="/home/poule/encrypted/stockage-syncable" # place where we have our things sorted, other than home
export BORG_PASSCOMMAND="cat $ARCHIVE_CLEAR/.tk-borg-passphrase" # get the borg repo pass
export LOG_FILE_BACKUP="$ARCHIVE_CLEAR/www/backup/log_backup.log"
export LOG_FILE_BACKUP_DATES="$ARCHIVE_CLEAR/www/backup/summary_log_backup.log" # log dates of execution of the script
echo "watch the logs with \n tail -f $LOG_FILE_BACKUP_DATES"
# big disks can replicate the whole ZFS encrypted archives
big_disks=("blue","brossadent","catwoman","chaton","kouignamann","monolith","lilia","louisbraille","monolith")
# clear disk will take medias
clear_disks=("rondoudou")
# small disks will only take borg backups
small_disks=("Taiga")
# déclaration d'une fonction
function syncToBigDiskName()
{
local diskName=$1
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo "### ${today} replicate to disk ${diskName}" >> $LOG_FILE_BACKUP_DATES
# chech that the mounted folder of the disk exists
FILE=/media/$USER/$diskName
if test -d "$FILE"; then
echo "### $FILE exists." >> $LOG_FILE_BACKUP_DATES
# ok to send Rsync of encrypted folder
rsync -avP /home/poule/encrypted/* /media/$USER/$diskName/encrypted --delete --exclude '.npm' --exclude '.yarn' --exclude 'node_modules' --exclude '.mozilla' --delete --exclude '.cache' --exclude 'Cache'
rsync -avP /home/poule/borg_archives/* /media/$USER/$diskName/borg_archives --delete --exclude '.npm' --exclude '.yarn' --exclude 'node_modules' --exclude '.mozilla' --delete --exclude '.cache' --exclude 'Cache'
else
echo "### /!\ - folder not found $FILE"
fi
}
syncToBigDiskName "monolith"

View File

@ -1,10 +0,0 @@
#Script d'install de Mastodon sur Ubuntu 18.04
à lancer après une installation toute neuve d'ubuntu 18.04 server.
Cette install de Mastodon fonctionne avec Ruby, Nginx, NPM, yarn qui seront installés automatiquement si besoin
```bash
&& wget https://gitlab.com/tykayn1/cipherbliss.com/raw/master/bash/mastodon/mastodon_install.sh \
&& chmod +x mastodon_install.sh
&& sudo bash mastodon_install.sh
```

View File

@ -1 +0,0 @@
# config nginx

View File

@ -1,60 +0,0 @@
#!/bin/bash
# version 1.0.0
# Script crée par Tykayn
# Copyleft 2018 Tykayn
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#code mise en forme
neutre='\e[0;m'
conseil='\e[1;32m' #vert
clear
# sudo!
if [ "$UID" -ne "0" ]
then
echo -e "Il faut etre root pour executer ce script. ==> ${conseil} sudo ./tykayn_postinstall.sh ${neutre}"
exit
fi
echo -e "**************************************************";
echo -e "";
echo -e "Ce script va installer Mastodon sur votre serveur.";
echo -e "";
echo -e "**************************************************";
read -p " Quel est le nom de domaine de votre site? ( www.exemple.com sans https:// devant) " domainName
read -p "${conseil} Installation pour ${domainName}, vous confirmez? [Yn]" -i "Y" confirmationAnswer
case $answer in
[yY]* )
echo "Okay, C'est parti pour ${domainName}"
break;;
[nN]* ) exit;;
* ) echo "Dude, just enter Y or N, please.";;
esac
echo -e "${conseil} TADAM! ça c'est fait ${neutre}"
echo "*******************************************************"
echo "Script fait par Tykayn - https://www.cipherbliss.com"
echo "Pour prendre en compte tous les changements, il faut maintenant redémarrer !"
read -p "Voulez-vous redémarrer immédiatement ? [o/N] " rep_reboot
if [ "$rep_reboot" = "o" ] || [ "$rep_reboot" = "O" ]
then
reboot
fi

0
bash/postinstall/user_config/keyboard Normal file → Executable file
View File

14
install_emacs_tk.sh Normal file → Executable file
View File

@ -3,6 +3,9 @@
echo "### installation de emacs avec la config TK"
echo "### ce script suppose que vous ayez Apt et Bash"
username="tykayn"
sudo apt install snapd
snap install emacs --channel-beta --classic
emacs --version
@ -12,11 +15,14 @@ mkdir -p ~/Nextcloud/textes/library
rm -rf ~/.emacs.d
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/config.org ~/Nextcloud/textes/orgmode/
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/tasks.org ~/Nextcloud/textes/orgmode/
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/.emacs ~/
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/assets/org/.emacs "/home/$username/"
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/assets/org/config.org "/home/$username/Nextcloud/textes/orgmode/"
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/assets/org/tasks.org "/home/$username/Nextcloud/textes/orgmode/"
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/assets/org/bulma.min.css "/home/$username/Nextcloud/textes/orgmode/"
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/assets/org/style.css "/home/$username/Nextcloud/textes/orgmode/"
wget https://forge.chapril.org/tykayn/scripts/raw/branch/master/assets/org/upcalendar.sh "/home/$username/Nextcloud/textes/orgmode/"
echo "export PATH=$PATH:/snap/bin/emacs" >> .bash_aliases
echo "export PATH=$PATH:/snap/bin/" >> .bash_aliases
cp ~/.emacs .emacs_backup

31
refresh_from_current_assets.sh Executable file
View File

@ -0,0 +1,31 @@
#/bin/bash
# @author script by @tykayn - contact at cipherbliss.com
# rafraîchir les assets du dépot d'example versionné avec ceux couramment utilisés.
# à installer sur un ordi que l'on utilise en tant que référence d'assets
# à installer en cronjob avec:
# crontab -e
#
# m h dom mon dow command
# */30 * * * * bash /home/tykayn/www/scripts/refresh_from_current_assets.sh
# configs
export USERNAME_CURRENT=tykayn
export HOME_OF_SCRIPTS=/home/$USERNAME_CURRENT/www/scripts
export HOME_OF_USERNAME_CURRENT=/home/$USERNAME_CURRENT
echo "mise à jour des assets de référence dans les scripts custom $HOME_OF_SCRIPTS depuis l'ordinateur actuel"
# orgmode
cp "$HOME_OF_USERNAME_CURRENT/.emacs" "$HOME_OF_SCRIPTS/assets/org" -r
cp "$HOME_OF_USERNAME_CURRENT/Nextcloud/textes/orgmode/config.org" "$HOME_OF_SCRIPTS/assets/org" -r
cp "$HOME_OF_USERNAME_CURRENT/Nextcloud/textes/orgmode/style.css" "$HOME_OF_SCRIPTS/assets/org" -r
cp "$HOME_OF_USERNAME_CURRENT/Nextcloud/textes/orgmode/upcalendar.sh" "$HOME_OF_SCRIPTS/assets/org" -r
# sauvegardes
echo "HOME_OF_SCRIPTS : $HOME_OF_SCRIPTS"
ls -l "$HOME_OF_SCRIPTS/assets/org"
cd $HOME_OF_SCRIPTS
git add .
git commit -m "update of assets from refresh script"
git push origin

View File

@ -1,60 +0,0 @@
#/bin/bash
# @author sync_spaceship by @tykayn - contact at cipherbliss.com
#
# On peut lancer ce script après avoir créé le dépot borg dans ARCHIVE_CLEAR
# borg init --encryption=repokey-blake2 /media/tykayn/catwoman/backup_land4to
#
# à installer en cronjob avec:
# crontab -e
#
# m h dom mon dow command
# */30 * * * * bash /media/tykayn/catwoman/stockage-syncable/sync_spaceship.sh
# configs
export today=$(get_date()) # to log current time
export ARCHIVE_CLEAR="/media/tykayn/catwoman/stockage-syncable" # place where we have our things sorted, other than home
export BORG_PASSCOMMAND="cat /media/tykayn/catwoman/stockage-syncable/.borg-passphrase" # get the borg repo pass
export LOG_FILE_BACKUP="$ARCHIVE_CLEAR/www/backup/log_backup.log"
export LOG_FILE_BACKUP_DATES="$ARCHIVE_CLEAR/www/backup/summary_log_backup.log" # log dates of execution of the script
echo ' ' >> $LOG_FILE_BACKUP
echo "### ${today} start backup script from sync_spaceship script" >> $LOG_FILE_BACKUP
echo "### ${today} ${pwd} sync_spaceship.sh" >> $LOG_FILE_BACKUP
echo ' ' >> $LOG_FILE_BACKUP_DATES
echo "### ${today} start backup script from sync_spaceship script" >> $LOG_FILE_BACKUP_DATES
# clean borg current task
killall borg
rm -rf /media/tykayn/catwoman/backup_land4to/lock.exclusive
rm -rf /home/tykayn/.cache/borg/83e2bcd4c1832b93b0926232b9bb5e942ca469b6c4c90cff66f327e879f04027/lock.exclusive
echo "### ${today} clean of borg task ok " | tee -a $LOG_FILE_BACKUP_DATES 2>&1
date -ud "@$SECONDS" "+Time elapsed: %H:%M:%S" | tee -a $LOG_FILE_BACKUP_DATES 2>&1
# retrieve web servers data to the ARCHIVE_CLEAR
# bash webservers_sync.sh
# back pictures to ARCHIVE_CLEAR
mv /home/tykayn/Nextcloud/InstantUpload/Camera/* "$ARCHIVE_CLEAR/photos/2021" | tee -a $LOG_FILE_BACKUP 2>&1
mv /home/tykayn/Nextcloud/InstantUpload/Screenshots/* "$ARCHIVE_CLEAR/photos/screenshots" | tee -a $LOG_FILE_BACKUP 2>&1
mv /home/tykayn/Nextcloud/InstantUpload/Download/* "$ARCHIVE_CLEAR/BAZAR" | tee -a $LOG_FILE_BACKUP 2>&1
# update local nextcloud to stockage syncable
rsync -avzP --perms --delete-after --progress /home/tykayn/Nextcloud/* $ARCHIVE_CLEAR/clouds/Nextcloud | tee -a $LOG_FILE_BACKUP 2>&1
echo "### ${today} copy of nextcloud content ok " | tee -a $LOG_FILE_BACKUP_DATES 2>&1
date -ud "@$SECONDS" "+Time elapsed: %H:%M:%S" | tee -a $LOG_FILE_BACKUP_DATES 2>&1
bash $ARCHIVE_CLEAR/__scripts_syncro/borg_spaceship.sh
bash $ARCHIVE_CLEAR/__scripts_syncro/disk_ext_sync.sh
bash sync_to_nas.sh
echo "### ${today} end" >> $LOG_FILE_BACKUP_DATES
date -ud "@$SECONDS" "+Time elapsed: %H:%M:%S" | tee -a $LOG_FILE_BACKUP 2>&1
echo "voir les logs: gedit $LOG_FILE_BACKUP"
echo "voir les logs: gedit $LOG_FILE_BACKUP_DATES"
echo " " | tee -a $LOG_FILE_BACKUP 2>&1
echo "taille du BAZAR: " | tee -a $LOG_FILE_BACKUP 2>&1
du -sch $ARCHIVE_CLEAR/BAZAR | tee -a $LOG_FILE_BACKUP 2>&1