From ceb6d4f0ff4ef4add384f2316f91aff461f436b1 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Sat, 14 May 2022 17:17:02 +0200 Subject: [PATCH] Test markdown pour patrick --- patrick-markdown/.gitignore | 2 + patrick-markdown/Makefile | 43 ++++++++++++ patrick-markdown/assets/ghost-caca.css | 24 +++++++ patrick-markdown/assets/ghost-dark.css | 24 +++++++ patrick-markdown/assets/ghost.css | 21 ++++++ patrick-markdown/assets/pandoc-template.html5 | 70 +++++++++++++++++++ patrick-markdown/nextcloud.md | 69 ++++++++++++++++++ 7 files changed, 253 insertions(+) create mode 100644 patrick-markdown/.gitignore create mode 100644 patrick-markdown/Makefile create mode 100644 patrick-markdown/assets/ghost-caca.css create mode 100644 patrick-markdown/assets/ghost-dark.css create mode 100644 patrick-markdown/assets/ghost.css create mode 100644 patrick-markdown/assets/pandoc-template.html5 create mode 100644 patrick-markdown/nextcloud.md diff --git a/patrick-markdown/.gitignore b/patrick-markdown/.gitignore new file mode 100644 index 0000000..5b9f662 --- /dev/null +++ b/patrick-markdown/.gitignore @@ -0,0 +1,2 @@ +/*.html +/assets/css.inc \ No newline at end of file diff --git a/patrick-markdown/Makefile b/patrick-markdown/Makefile new file mode 100644 index 0000000..d21323a --- /dev/null +++ b/patrick-markdown/Makefile @@ -0,0 +1,43 @@ +SHELL := /bin/bash + +TARGETS := $(patsubst %.md,%.html,$(wildcard *.md)) +CSSINC := assets/css.inc + +# our main html5 template, mostly taken from : +# https://github.com/jgm/pandoc-templates/blob/master/default.html5 +TEMPLATE := assets/pandoc-template.html5 + +# CSS to be included as stylesheets and alternate stylesheets +CSS := assets/ghost.css +ALTCSS := assets/ghost-dark.css assets/ghost-caca.css + +OPTS := --standalone --include-in-header=$(CSSINC) --template=$(TEMPLATE) \ + --metadata=title:"$(call TIT,$<)" --from=gfm --to=html5 + +# To provide a title to pandoc. We take the first line starting with '#', +# and remove initial '#' and spaces +TITLE = $(shell sed -n '0,/^#/ s/^[# ]*//p' $1) + +define ADD_LINE +printf '\n' "$(2)" "$(1)" >> $(3); +endef + +.PHONY: all html clean $(CSSINC) + +all: $(CSSINC) html + +html: $(TARGETS) + +clean: + @echo cleaning $(TARGETS) $(CSSINC) + @rm -f $(TARGETS) $(CSSINC) + +$(CSSINC): $(_CSS) $(_ALTCSS) + @echo generating $@ + @rm -f $@ + @$(foreach css,$(_CSS),$(call ADD_LINE,$(css),stylesheet,$@)) + @$(foreach css,$(_ALTCSS),$(call ADD_LINE,$(css),alternate stylesheet,$@)) + +%.html: %.md $(_CSS) + @echo generating $@ + @pandoc $(PANDOCOPTS) -o $@ $< diff --git a/patrick-markdown/assets/ghost-caca.css b/patrick-markdown/assets/ghost-caca.css new file mode 100644 index 0000000..a8a248e --- /dev/null +++ b/patrick-markdown/assets/ghost-caca.css @@ -0,0 +1,24 @@ +@font-face { + font-family: 'Open Sans Regular'; + src: url('OpenSans-Regular.ttf')format('truetype'); +} + +body { + background-color: #500303; + color: #f2f2f2; + width: 34%; + margin: 40px 33% 10px 33%; + font-family: 'Open Sans Regular', sans-serif ; +} + +code { + font-size: 1.1em; +} + +pre { + outline: 1px solid; + border-radius: 3px; + padding: 5px; + background-color: #080808; + color: eeeeee: +} diff --git a/patrick-markdown/assets/ghost-dark.css b/patrick-markdown/assets/ghost-dark.css new file mode 100644 index 0000000..4f5102c --- /dev/null +++ b/patrick-markdown/assets/ghost-dark.css @@ -0,0 +1,24 @@ +@font-face { + font-family: 'Open Sans Regular'; + src: url('OpenSans-Regular.ttf')format('truetype'); +} + +body { + background-color: #050505; + color: #f2f2f2; + width: 34%; + margin: 40px 33% 10px 33%; + font-family: 'Open Sans Regular', sans-serif ; +} + +code { + font-size: 1.1em; +} + +pre { + outline: 1px solid; + border-radius: 3px; + padding: 5px; + background-color: #080808; + color: eeeeee: +} diff --git a/patrick-markdown/assets/ghost.css b/patrick-markdown/assets/ghost.css new file mode 100644 index 0000000..092a476 --- /dev/null +++ b/patrick-markdown/assets/ghost.css @@ -0,0 +1,21 @@ +@font-face { + font-family: 'Open Sans Regular'; + src: url('OpenSans-Regular.ttf')format('truetype'); +} + +body { + width: 34%; + margin: 40px 33% 10px 33%; + font-family: 'Open Sans Regular', sans-serif ; +} + +code { + font-size: 1.1em; +} + +pre { + outline: 1px solid; + border-radius: 3px; + padding: 5px; + background-color: #f2f2f2; +} diff --git a/patrick-markdown/assets/pandoc-template.html5 b/patrick-markdown/assets/pandoc-template.html5 new file mode 100644 index 0000000..d3a247a --- /dev/null +++ b/patrick-markdown/assets/pandoc-template.html5 @@ -0,0 +1,70 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ +$if(description-meta)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ +$for(css)$ + +$endfor$ +$for(header-includes)$ + $header-includes$ +$endfor$ +$if(math)$ + $math$ +$endif$ + + + +$for(include-before)$ +$include-before$ +$endfor$ +$if(title)$ +
+

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +$if(abstract)$ +
+
$abstract-title$
+$abstract$ +
+$endif$ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +$for(include-after)$ +$include-after$ +$endfor$ + + diff --git a/patrick-markdown/nextcloud.md b/patrick-markdown/nextcloud.md new file mode 100644 index 0000000..946563f --- /dev/null +++ b/patrick-markdown/nextcloud.md @@ -0,0 +1,69 @@ +### CRÉER UNE VERSION DE NEXTCLOUD POUR TESTER L’UPGRADE (NEXTCLOUD2) + +1. créer dans [FREENOM](http://www.freenom.com/fr/index.html) un DNS “nextcloud2” puis reporter ces DNS dans les fichiers "certs-faivre.sh" et "ml.faivre-all.conf" de damia : + + ``` + sudo nano /root/bin/certs-faivre.sh + sudo nano /etc/apache2/sites-available/ml.faivre-all.conf + ``` + +2. forcer le renouvellement des certificats : + + ``` + sudo /root/bin/certs-faivre.sh -c + ``` + +3. copier le répertoire “nextcloud” en “nextcloud2”: + + ``` + sudo rsync -aHixv /home/www/ml.faivre/nextcloud/ /home/www/ml.faivre/nextcloud2 + ``` + +4. créer une nouvelle base : + + ``` + mysql -u root -p + CREATE DATABASE IF NOT EXISTS `nextcloud2` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; + ``` + +5. puis créer un nouvel utilisateur et lui donner tous les privilèges sur cette nouvelle base (mot de passe à saisir en fin de la 1ère commande): + + ``` + GRANT ALL ON nextcloud2.* TO 'nextcloud2'@'localhost' IDENTIFIED BY 'mon_mot_de_passe'; + FLUSH PRIVILEGES; + ``` + +6. quitter MYSQL + + ``` + exit + ``` + +7. copier la base nextcloud.sql.gz en nextcloud2 (patience, ça peut durer un bon moment ≈ 25 mn) : + + ``` + cd /var/lib/mysql/ + zcat nextcloud.sql.gz | sudo mysql nextcloud2 + ``` + +8. modifier le fichier “config.php” de nextcloud2 en remplaçant “nextcloud” par “nextcloud2” + + ``` + sudo nano /home/www/ml.faivre/nextcloud2/config/config.php + ``` + +9. ajouter une tâche cron pour nextcloud2 (en copiant celle existant) : + + ``` + sudo crontab -u www-data -e + ``` + +--- + +### RESTAURATION DE NEXTCLOUD ET DE SA BASE : + + ``` + sudo rsync -aHixv /mnt/backup1/damia-mountpoint/daily-01/www/ml.faivre/nextcloud/ /home/www/ml.faivre/nextcloud + + gunzip < /mnt/backup1/damia-mountpoint/daily-01/mysql/nextcloud.sql.gz | mysql -u root -p"MY-PASSWORD" nextcloud + ```