Test markdown pour patrick
This commit is contained in:
2
patrick-markdown/.gitignore
vendored
Normal file
2
patrick-markdown/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/*.html
|
||||||
|
/assets/css.inc
|
43
patrick-markdown/Makefile
Normal file
43
patrick-markdown/Makefile
Normal file
@@ -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 '<link rel="%s" href="%s">\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 $@ $<
|
24
patrick-markdown/assets/ghost-caca.css
Normal file
24
patrick-markdown/assets/ghost-caca.css
Normal file
@@ -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:
|
||||||
|
}
|
24
patrick-markdown/assets/ghost-dark.css
Normal file
24
patrick-markdown/assets/ghost-dark.css
Normal file
@@ -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:
|
||||||
|
}
|
21
patrick-markdown/assets/ghost.css
Normal file
21
patrick-markdown/assets/ghost.css
Normal file
@@ -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;
|
||||||
|
}
|
70
patrick-markdown/assets/pandoc-template.html5
Normal file
70
patrick-markdown/assets/pandoc-template.html5
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="generator" content="pandoc" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||||
|
$for(author-meta)$
|
||||||
|
<meta name="author" content="$author-meta$" />
|
||||||
|
$endfor$
|
||||||
|
$if(date-meta)$
|
||||||
|
<meta name="dcterms.date" content="$date-meta$" />
|
||||||
|
$endif$
|
||||||
|
$if(keywords)$
|
||||||
|
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
|
||||||
|
$endif$
|
||||||
|
$if(description-meta)$
|
||||||
|
<meta name="description" content="$description-meta$" />
|
||||||
|
$endif$
|
||||||
|
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
|
||||||
|
$for(css)$
|
||||||
|
<link rel="stylesheet" href="$css$" title="$css$" />
|
||||||
|
$endfor$
|
||||||
|
$for(header-includes)$
|
||||||
|
$header-includes$
|
||||||
|
$endfor$
|
||||||
|
$if(math)$
|
||||||
|
$math$
|
||||||
|
$endif$
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
$for(include-before)$
|
||||||
|
$include-before$
|
||||||
|
$endfor$
|
||||||
|
$if(title)$
|
||||||
|
<header id="title-block-header">
|
||||||
|
<h1 class="title">$title$</h1>
|
||||||
|
$if(subtitle)$
|
||||||
|
<p class="subtitle">$subtitle$</p>
|
||||||
|
$endif$
|
||||||
|
$for(author)$
|
||||||
|
<p class="author">$author$</p>
|
||||||
|
$endfor$
|
||||||
|
$if(date)$
|
||||||
|
<p class="date">$date$</p>
|
||||||
|
$endif$
|
||||||
|
$if(abstract)$
|
||||||
|
<div class="abstract">
|
||||||
|
<div class="abstract-title">$abstract-title$</div>
|
||||||
|
$abstract$
|
||||||
|
</div>
|
||||||
|
$endif$
|
||||||
|
</header>
|
||||||
|
$endif$
|
||||||
|
$if(toc)$
|
||||||
|
<nav id="$idprefix$TOC" role="doc-toc">
|
||||||
|
$if(toc-title)$
|
||||||
|
<h2 id="$idprefix$toc-title">$toc-title$</h2>
|
||||||
|
$endif$
|
||||||
|
$table-of-contents$
|
||||||
|
</nav>
|
||||||
|
$endif$
|
||||||
|
$body$
|
||||||
|
$for(include-after)$
|
||||||
|
$include-after$
|
||||||
|
$endfor$
|
||||||
|
</body>
|
||||||
|
</html>
|
69
patrick-markdown/nextcloud.md
Normal file
69
patrick-markdown/nextcloud.md
Normal file
@@ -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
|
||||||
|
```
|
Reference in New Issue
Block a user