4267 lines
319 KiB
HTML
4267 lines
319 KiB
HTML
|
<!DOCTYPE html><html lang="fr">
|
|||
|
<head><meta charset="utf-8">
|
|||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><title>PC1 - Endeavour Neo XFCE sur partition LVM chiffrée - YannStatic</title>
|
|||
|
|
|||
|
<meta name="description" content="EndeavourOS est une distribution GNU/Linux basée sur Arch Linux">
|
|||
|
<link rel="canonical" href="https://static.rnmkcy.eu/2024/10/07/PC1-EndeavourOS-XFCE-nvme_2To-LVM-Chiffre.html"><link rel="alternate" type="application/rss+xml" title="YannStatic" href="/feed.xml">
|
|||
|
|
|||
|
<!-- - include head/favicon.html - -->
|
|||
|
<link rel="shortcut icon" type="image/png" href="/assets/favicon/favicon.png"><link rel="stylesheet" href="/assets/css/main.css"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" ><!-- start custom head snippets --><link rel="stylesheet" href="/assets/css/expand.css">
|
|||
|
<!-- end custom head snippets --><script>(function() {
|
|||
|
window.isArray = function(val) {
|
|||
|
return Object.prototype.toString.call(val) === '[object Array]';
|
|||
|
};
|
|||
|
window.isString = function(val) {
|
|||
|
return typeof val === 'string';
|
|||
|
};
|
|||
|
|
|||
|
window.hasEvent = function(event) {
|
|||
|
return 'on'.concat(event) in window.document;
|
|||
|
};
|
|||
|
|
|||
|
window.isOverallScroller = function(node) {
|
|||
|
return node === document.documentElement || node === document.body || node === window;
|
|||
|
};
|
|||
|
|
|||
|
window.isFormElement = function(node) {
|
|||
|
var tagName = node.tagName;
|
|||
|
return tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA';
|
|||
|
};
|
|||
|
|
|||
|
window.pageLoad = (function () {
|
|||
|
var loaded = false, cbs = [];
|
|||
|
window.addEventListener('load', function () {
|
|||
|
var i;
|
|||
|
loaded = true;
|
|||
|
if (cbs.length > 0) {
|
|||
|
for (i = 0; i < cbs.length; i++) {
|
|||
|
cbs[i]();
|
|||
|
}
|
|||
|
}
|
|||
|
});
|
|||
|
return {
|
|||
|
then: function(cb) {
|
|||
|
cb && (loaded ? cb() : (cbs.push(cb)));
|
|||
|
}
|
|||
|
};
|
|||
|
})();
|
|||
|
})();
|
|||
|
(function() {
|
|||
|
window.throttle = function(func, wait) {
|
|||
|
var args, result, thisArg, timeoutId, lastCalled = 0;
|
|||
|
|
|||
|
function trailingCall() {
|
|||
|
lastCalled = new Date;
|
|||
|
timeoutId = null;
|
|||
|
result = func.apply(thisArg, args);
|
|||
|
}
|
|||
|
return function() {
|
|||
|
var now = new Date,
|
|||
|
remaining = wait - (now - lastCalled);
|
|||
|
|
|||
|
args = arguments;
|
|||
|
thisArg = this;
|
|||
|
|
|||
|
if (remaining <= 0) {
|
|||
|
clearTimeout(timeoutId);
|
|||
|
timeoutId = null;
|
|||
|
lastCalled = now;
|
|||
|
result = func.apply(thisArg, args);
|
|||
|
} else if (!timeoutId) {
|
|||
|
timeoutId = setTimeout(trailingCall, remaining);
|
|||
|
}
|
|||
|
return result;
|
|||
|
};
|
|||
|
};
|
|||
|
})();
|
|||
|
(function() {
|
|||
|
var Set = (function() {
|
|||
|
var add = function(item) {
|
|||
|
var i, data = this._data;
|
|||
|
for (i = 0; i < data.length; i++) {
|
|||
|
if (data[i] === item) {
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
this.size ++;
|
|||
|
data.push(item);
|
|||
|
return data;
|
|||
|
};
|
|||
|
|
|||
|
var Set = function(data) {
|
|||
|
this.size = 0;
|
|||
|
this._data = [];
|
|||
|
var i;
|
|||
|
if (data.length > 0) {
|
|||
|
for (i = 0; i < data.length; i++) {
|
|||
|
add.call(this, data[i]);
|
|||
|
}
|
|||
|
}
|
|||
|
};
|
|||
|
Set.prototype.add = add;
|
|||
|
Set.prototype.get = function(index) { return this._data[index]; };
|
|||
|
Set.prototype.has = function(item) {
|
|||
|
var i, data = this._data;
|
|||
|
for (i = 0; i < data.length; i++) {
|
|||
|
if (this.get(i) === item) {
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
return false;
|
|||
|
};
|
|||
|
Set.prototype.is = function(map) {
|
|||
|
if (map._data.length !== this._data.length) { return false; }
|
|||
|
var i, j, flag, tData = this._data, mData = map._data;
|
|||
|
for (i = 0; i < tData.length; i++) {
|
|||
|
for (flag = false, j = 0; j < mData.length; j++) {
|
|||
|
if (tData[i] === mData[j]) {
|
|||
|
flag = true;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
if (!flag) { return false; }
|
|||
|
}
|
|||
|
return true;
|
|||
|
};
|
|||
|
Set.prototype.values = function() {
|
|||
|
return this._data;
|
|||
|
};
|
|||
|
return Set;
|
|||
|
})();
|
|||
|
|
|||
|
window.Lazyload = (function(doc) {
|
|||
|
var queue = {js: [], css: []}, sources = {js: {}, css: {}}, context = this;
|
|||
|
var createNode = function(name, attrs) {
|
|||
|
var node = doc.createElement(name), attr;
|
|||
|
for (attr in attrs) {
|
|||
|
if (attrs.hasOwnProperty(attr)) {
|
|||
|
node.setAttribute(attr, attrs[attr]);
|
|||
|
}
|
|||
|
}
|
|||
|
return node;
|
|||
|
};
|
|||
|
var end = function(type, url) {
|
|||
|
var s, q, qi, cbs, i, j, cur, val, flag;
|
|||
|
if (type === 'js' || type ==='css') {
|
|||
|
s = sources[type], q = queue[type];
|
|||
|
s[url] = true;
|
|||
|
for (i = 0; i < q.length; i++) {
|
|||
|
cur = q[i];
|
|||
|
if (cur.urls.has(url)) {
|
|||
|
qi = cur, val = qi.urls.values();
|
|||
|
qi && (cbs = qi.callbacks);
|
|||
|
for (flag = true, j = 0; j < val.length; j++) {
|
|||
|
cur = val[j];
|
|||
|
if (!s[cur]) {
|
|||
|
flag = false;
|
|||
|
}
|
|||
|
}
|
|||
|
if (flag && cbs && cbs.length > 0) {
|
|||
|
for (j = 0; j < cbs.length; j++) {
|
|||
|
cbs[j].call(context);
|
|||
|
}
|
|||
|
qi.load = true;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
};
|
|||
|
var load = function(type, urls, callback) {
|
|||
|
var s, q, qi, node, i, cur,
|
|||
|
_urls = typeof urls === 'string' ? new Set([urls]) : new Set(urls), val, url;
|
|||
|
if (type === 'js' || type ==='css') {
|
|||
|
s = sources[type], q = queue[type];
|
|||
|
for (i = 0; i < q.length; i++) {
|
|||
|
cur = q[i];
|
|||
|
if (_urls.is(cur.urls)) {
|
|||
|
qi = cur;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
val = _urls.values();
|
|||
|
if (qi) {
|
|||
|
callback && (qi.load || qi.callbacks.push(callback));
|
|||
|
callback && (qi.load && callback());
|
|||
|
} else {
|
|||
|
q.push({
|
|||
|
urls: _urls,
|
|||
|
callbacks: callback ? [callback] : [],
|
|||
|
load: false
|
|||
|
});
|
|||
|
for (i = 0; i < val.length; i++) {
|
|||
|
node = null, url = val[i];
|
|||
|
if (s[url] === undefined) {
|
|||
|
(type === 'js' ) && (node = createNode('script', { src: url }));
|
|||
|
(type === 'css') && (node = createNode('link', { rel: 'stylesheet', href: url }));
|
|||
|
if (node) {
|
|||
|
node.onload = (function(type, url) {
|
|||
|
return function() {
|
|||
|
end(type, url);
|
|||
|
};
|
|||
|
})(type, url);
|
|||
|
(doc.head || doc.body).appendChild(node);
|
|||
|
s[url] = false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
};
|
|||
|
return {
|
|||
|
js: function(url, callback) {
|
|||
|
load('js', url, callback);
|
|||
|
},
|
|||
|
css: function(url, callback) {
|
|||
|
load('css', url, callback);
|
|||
|
}
|
|||
|
};
|
|||
|
})(this.document);
|
|||
|
})();
|
|||
|
</script><script>
|
|||
|
(function() {
|
|||
|
var TEXT_VARIABLES = {
|
|||
|
version: '2.2.6',
|
|||
|
sources: {
|
|||
|
font_awesome: 'https://use.fontawesome.com/releases/v5.0.13/css/all.css',
|
|||
|
jquery: '/assets/js/jquery.min.js',
|
|||
|
leancloud_js_sdk: '//cdn.jsdelivr.net/npm/leancloud-storage@3.13.2/dist/av-min.js',
|
|||
|
chart: 'https://cdn.bootcss.com/Chart.js/2.7.2/Chart.bundle.min.js',
|
|||
|
gitalk: {
|
|||
|
js: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.js',
|
|||
|
css: 'https://cdn.bootcss.com/gitalk/1.2.2/gitalk.min.css'
|
|||
|
},
|
|||
|
valine: 'https://unpkg.com/valine/dist/Valine.min.js'
|
|||
|
},
|
|||
|
site: {
|
|||
|
toc: {
|
|||
|
selectors: 'h1,h2,h3'
|
|||
|
}
|
|||
|
},
|
|||
|
paths: {
|
|||
|
search_js: '/assets/search.js'
|
|||
|
}
|
|||
|
};
|
|||
|
window.TEXT_VARIABLES = TEXT_VARIABLES;
|
|||
|
})();
|
|||
|
</script>
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
<div class="root" data-is-touch="false">
|
|||
|
<div class="layout--page js-page-root"><!----><div class="page__main js-page-main page__viewport hide-footer has-aside has-aside cell cell--auto">
|
|||
|
|
|||
|
<div class="page__main-inner"><div class="page__header d-print-none"><header class="header"><div class="main">
|
|||
|
<div class="header__title">
|
|||
|
<div class="header__brand"><svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="478.9473684210526" viewBox="0, 0, 400,478.9473684210526"><g id="svgg"><path id="path0" d="M308.400 56.805 C 306.970 56.966,303.280 57.385,300.200 57.738 C 290.906 58.803,278.299 59.676,269.200 59.887 L 260.600 60.085 259.400 61.171 C 258.010 62.428,256.198 63.600,255.645 63.600 C 255.070 63.600,252.887 65.897,252.598 66.806 C 252.460 67.243,252.206 67.600,252.034 67.600 C 251.397 67.600,247.206 71.509,247.202 72.107 C 247.201 72.275,246.390 73.190,245.400 74.138 C 243.961 75.517,243.598 76.137,243.592 77.231 C 243.579 79.293,241.785 83.966,240.470 85.364 C 239.176 86.740,238.522 88.365,237.991 91.521 C 237.631 93.665,236.114 97.200,235.554 97.200 C 234.938 97.200,232.737 102.354,232.450 104.472 C 232.158 106.625,230.879 109.226,229.535 110.400 C 228.933 110.926,228.171 113.162,226.434 119.500 C 226.178 120.435,225.795 121.200,225.584 121.200 C 225.373 121.200,225.200 121.476,225.200 121.813 C 225.200 122.149,224.885 122.541,224.500 122.683 C 223.606 123.013,223.214 123.593,223.204 124.600 C 223.183 126.555,220.763 132.911,219.410 134.562 C 218.443 135.742,217.876 136.956,217.599 138.440 C 217.041 141.424,215.177 146.434,214.532 146.681 C 214.240 146.794,214.000 147.055,214.000 147.261 C 214.000 147.467,213.550 148.086,213.000 148.636 C 212.450 149.186,212.000 149.893,212.000 150.208 C 212.000 151.386,208.441 154.450,207.597 153.998 C 206.319 153.315,204.913 150.379,204.633 147.811 C 204.365 145.357,202.848 142.147,201.759 141.729 C 200.967 141.425,199.200 137.451,199.200 135.974 C 199.200 134.629,198.435 133.224,196.660 131.311 C 195.363 129.913,194.572 128.123,193.870 125.000 C 193.623 123.900,193.236 122.793,193.010 122.540 C 190.863 120.133,190.147 118.880,188.978 115.481 C 188.100 112.928,187.151 111.003,186.254 109.955 C 185.358 108.908,184.518 107.204,183.847 105.073 C 183.280 103.273,182.497 101.329,182.108 100.753 C 181.719 100.177,180.904 98.997,180.298 98.131 C 179.693 97.265,178.939 95.576,178.624 94.378 C 178.041 92.159,177.125 90.326,175.023 87.168 C 174.375 86.196,173.619 84.539,173.342 83.486 C 172.800 81.429,171.529 79.567,170.131 78.785 C 169.654 78.517,168.697 77.511,168.006 76.549 C 167.316 75.587,166.594 74.800,166.402 74.800 C 166.210 74.800,164.869 73.633,163.421 72.206 C 160.103 68.936,161.107 69.109,146.550 69.301 C 133.437 69.474,128.581 70.162,126.618 72.124 C 126.248 72.495,125.462 72.904,124.872 73.033 C 124.282 73.163,123.088 73.536,122.219 73.863 C 121.349 74.191,119.028 74.638,117.061 74.858 C 113.514 75.254,109.970 76.350,108.782 77.419 C 107.652 78.436,100.146 80.400,97.388 80.400 C 95.775 80.400,93.167 81.360,91.200 82.679 C 90.430 83.195,89.113 83.804,88.274 84.031 C 85.875 84.681,78.799 90.910,74.400 96.243 L 73.400 97.456 73.455 106.028 C 73.526 117.055,74.527 121.238,77.820 124.263 C 78.919 125.273,80.400 127.902,80.400 128.842 C 80.400 129.202,81.075 130.256,81.900 131.186 C 83.563 133.059,85.497 136.346,86.039 138.216 C 86.233 138.886,87.203 140.207,88.196 141.153 C 89.188 142.098,90.000 143.104,90.000 143.388 C 90.000 144.337,92.129 148.594,92.869 149.123 C 93.271 149.410,93.600 149.831,93.600 150.059 C 93.600 150.286,93.932 150.771,94.337 151.136 C 94.743 151.501,95.598 153.004,96.237 154.475 C 96.877 155.947,97.760 157.351,98.200 157.596 C 98.640 157.841,99.900 159.943,101.000 162.267 C 102.207 164.817,103.327 166.644,103.825 166.876 C 104.278 167.087,105.065 168.101,105.573 169.130 C 107.658 173.348,108.097 174.093,110.006 176.647 C 111.103 178.114,112.000 179.725,112.000 180.227 C 112.000 181.048,113.425 183.163,114.678 184.200 C 115.295 184.711,117.396 188.733,117.720 190.022 C 117.855 190.562,118.603 191.633,119.381 192.402 C 120.160 193.171,121.496 195.258,122.351 197.039 C 123.206 198.820,124.167 200.378,124.487 200.501 C 124.807 200.624,125.953 202.496,127.034 204.662 C 128.114 206.828,129.676 209.299,130.505 210.153 C 131.333 211.007,132.124 212.177,132.262 212.753 C 132.618 214.239,134.291 217.048,136.288 219.5
|
|||
|
" href="/">YannStatic</a></div><!--<button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button>--><!-- <li><button class="button button--secondary button--circle search-button js-search-toggle"><i class="fas fa-search"></i></button></li> -->
|
|||
|
<!-- Champ de recherche -->
|
|||
|
<div id="searchbox" class="search search--dark" style="visibility: visible">
|
|||
|
<div class="main">
|
|||
|
<div class="search__header"></div>
|
|||
|
<div class="search-bar">
|
|||
|
<div class="search-box js-search-box">
|
|||
|
<div class="search-box__icon-search"><i class="fas fa-search"></i></div>
|
|||
|
<input id="search-input" type="text" />
|
|||
|
<!-- <div class="search-box__icon-clear js-icon-clear">
|
|||
|
<a><i class="fas fa-times"></i></a>
|
|||
|
</div> -->
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<!-- Script pointing to search-script.js -->
|
|||
|
<script>/*!
|
|||
|
* Simple-Jekyll-Search
|
|||
|
* Copyright 2015-2020, Christian Fei
|
|||
|
* Licensed under the MIT License.
|
|||
|
*/
|
|||
|
|
|||
|
(function(){
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$Templater_7 = {
|
|||
|
compile: compile,
|
|||
|
setOptions: setOptions
|
|||
|
}
|
|||
|
|
|||
|
const options = {}
|
|||
|
options.pattern = /\{(.*?)\}/g
|
|||
|
options.template = ''
|
|||
|
options.middleware = function () {}
|
|||
|
|
|||
|
function setOptions (_options) {
|
|||
|
options.pattern = _options.pattern || options.pattern
|
|||
|
options.template = _options.template || options.template
|
|||
|
if (typeof _options.middleware === 'function') {
|
|||
|
options.middleware = _options.middleware
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function compile (data) {
|
|||
|
return options.template.replace(options.pattern, function (match, prop) {
|
|||
|
const value = options.middleware(prop, data[prop], options.template)
|
|||
|
if (typeof value !== 'undefined') {
|
|||
|
return value
|
|||
|
}
|
|||
|
return data[prop] || match
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
'use strict';
|
|||
|
|
|||
|
function fuzzysearch (needle, haystack) {
|
|||
|
var tlen = haystack.length;
|
|||
|
var qlen = needle.length;
|
|||
|
if (qlen > tlen) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
if (qlen === tlen) {
|
|||
|
return needle === haystack;
|
|||
|
}
|
|||
|
outer: for (var i = 0, j = 0; i < qlen; i++) {
|
|||
|
var nch = needle.charCodeAt(i);
|
|||
|
while (j < tlen) {
|
|||
|
if (haystack.charCodeAt(j++) === nch) {
|
|||
|
continue outer;
|
|||
|
}
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
var _$fuzzysearch_1 = fuzzysearch;
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
/* removed: const _$fuzzysearch_1 = require('fuzzysearch') */;
|
|||
|
|
|||
|
var _$FuzzySearchStrategy_5 = new FuzzySearchStrategy()
|
|||
|
|
|||
|
function FuzzySearchStrategy () {
|
|||
|
this.matches = function (string, crit) {
|
|||
|
return _$fuzzysearch_1(crit.toLowerCase(), string.toLowerCase())
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$LiteralSearchStrategy_6 = new LiteralSearchStrategy()
|
|||
|
|
|||
|
function LiteralSearchStrategy () {
|
|||
|
this.matches = function (str, crit) {
|
|||
|
if (!str) return false
|
|||
|
|
|||
|
str = str.trim().toLowerCase()
|
|||
|
crit = crit.trim().toLowerCase()
|
|||
|
|
|||
|
return crit.split(' ').filter(function (word) {
|
|||
|
return str.indexOf(word) >= 0
|
|||
|
}).length === crit.split(' ').length
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$Repository_4 = {
|
|||
|
put: put,
|
|||
|
clear: clear,
|
|||
|
search: search,
|
|||
|
setOptions: __setOptions_4
|
|||
|
}
|
|||
|
|
|||
|
/* removed: const _$FuzzySearchStrategy_5 = require('./SearchStrategies/FuzzySearchStrategy') */;
|
|||
|
/* removed: const _$LiteralSearchStrategy_6 = require('./SearchStrategies/LiteralSearchStrategy') */;
|
|||
|
|
|||
|
function NoSort () {
|
|||
|
return 0
|
|||
|
}
|
|||
|
|
|||
|
const data = []
|
|||
|
let opt = {}
|
|||
|
|
|||
|
opt.fuzzy = false
|
|||
|
opt.limit = 10
|
|||
|
opt.searchStrategy = opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
|
|||
|
opt.sort = NoSort
|
|||
|
opt.exclude = []
|
|||
|
|
|||
|
function put (data) {
|
|||
|
if (isObject(data)) {
|
|||
|
return addObject(data)
|
|||
|
}
|
|||
|
if (isArray(data)) {
|
|||
|
return addArray(data)
|
|||
|
}
|
|||
|
return undefined
|
|||
|
}
|
|||
|
function clear () {
|
|||
|
data.length = 0
|
|||
|
return data
|
|||
|
}
|
|||
|
|
|||
|
function isObject (obj) {
|
|||
|
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Object]'
|
|||
|
}
|
|||
|
|
|||
|
function isArray (obj) {
|
|||
|
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Array]'
|
|||
|
}
|
|||
|
|
|||
|
function addObject (_data) {
|
|||
|
data.push(_data)
|
|||
|
return data
|
|||
|
}
|
|||
|
|
|||
|
function addArray (_data) {
|
|||
|
const added = []
|
|||
|
clear()
|
|||
|
for (let i = 0, len = _data.length; i < len; i++) {
|
|||
|
if (isObject(_data[i])) {
|
|||
|
added.push(addObject(_data[i]))
|
|||
|
}
|
|||
|
}
|
|||
|
return added
|
|||
|
}
|
|||
|
|
|||
|
function search (crit) {
|
|||
|
if (!crit) {
|
|||
|
return []
|
|||
|
}
|
|||
|
return findMatches(data, crit, opt.searchStrategy, opt).sort(opt.sort)
|
|||
|
}
|
|||
|
|
|||
|
function __setOptions_4 (_opt) {
|
|||
|
opt = _opt || {}
|
|||
|
|
|||
|
opt.fuzzy = _opt.fuzzy || false
|
|||
|
opt.limit = _opt.limit || 10
|
|||
|
opt.searchStrategy = _opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
|
|||
|
opt.sort = _opt.sort || NoSort
|
|||
|
opt.exclude = _opt.exclude || []
|
|||
|
}
|
|||
|
|
|||
|
function findMatches (data, crit, strategy, opt) {
|
|||
|
const matches = []
|
|||
|
for (let i = 0; i < data.length && matches.length < opt.limit; i++) {
|
|||
|
const match = findMatchesInObject(data[i], crit, strategy, opt)
|
|||
|
if (match) {
|
|||
|
matches.push(match)
|
|||
|
}
|
|||
|
}
|
|||
|
return matches
|
|||
|
}
|
|||
|
|
|||
|
function findMatchesInObject (obj, crit, strategy, opt) {
|
|||
|
for (const key in obj) {
|
|||
|
if (!isExcluded(obj[key], opt.exclude) && strategy.matches(obj[key], crit)) {
|
|||
|
return obj
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function isExcluded (term, excludedTerms) {
|
|||
|
for (let i = 0, len = excludedTerms.length; i < len; i++) {
|
|||
|
const excludedTerm = excludedTerms[i]
|
|||
|
if (new RegExp(excludedTerm).test(term)) {
|
|||
|
return true
|
|||
|
}
|
|||
|
}
|
|||
|
return false
|
|||
|
}
|
|||
|
|
|||
|
/* globals ActiveXObject:false */
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$JSONLoader_2 = {
|
|||
|
load: load
|
|||
|
}
|
|||
|
|
|||
|
function load (location, callback) {
|
|||
|
const xhr = getXHR()
|
|||
|
xhr.open('GET', location, true)
|
|||
|
xhr.onreadystatechange = createStateChangeListener(xhr, callback)
|
|||
|
xhr.send()
|
|||
|
}
|
|||
|
|
|||
|
function createStateChangeListener (xhr, callback) {
|
|||
|
return function () {
|
|||
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|||
|
try {
|
|||
|
callback(null, JSON.parse(xhr.responseText))
|
|||
|
} catch (err) {
|
|||
|
callback(err, null)
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function getXHR () {
|
|||
|
return window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP')
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$OptionsValidator_3 = function OptionsValidator (params) {
|
|||
|
if (!validateParams(params)) {
|
|||
|
throw new Error('-- OptionsValidator: required options missing')
|
|||
|
}
|
|||
|
|
|||
|
if (!(this instanceof OptionsValidator)) {
|
|||
|
return new OptionsValidator(params)
|
|||
|
}
|
|||
|
|
|||
|
const requiredOptions = params.required
|
|||
|
|
|||
|
this.getRequiredOptions = function () {
|
|||
|
return requiredOptions
|
|||
|
}
|
|||
|
|
|||
|
this.validate = function (parameters) {
|
|||
|
const errors = []
|
|||
|
requiredOptions.forEach(function (requiredOptionName) {
|
|||
|
if (typeof parameters[requiredOptionName] === 'undefined') {
|
|||
|
errors.push(requiredOptionName)
|
|||
|
}
|
|||
|
})
|
|||
|
return errors
|
|||
|
}
|
|||
|
|
|||
|
function validateParams (params) {
|
|||
|
if (!params) {
|
|||
|
return false
|
|||
|
}
|
|||
|
return typeof params.required !== 'undefined' && params.required instanceof Array
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$utils_9 = {
|
|||
|
merge: merge,
|
|||
|
isJSON: isJSON
|
|||
|
}
|
|||
|
|
|||
|
function merge (defaultParams, mergeParams) {
|
|||
|
const mergedOptions = {}
|
|||
|
for (const option in defaultParams) {
|
|||
|
mergedOptions[option] = defaultParams[option]
|
|||
|
if (typeof mergeParams[option] !== 'undefined') {
|
|||
|
mergedOptions[option] = mergeParams[option]
|
|||
|
}
|
|||
|
}
|
|||
|
return mergedOptions
|
|||
|
}
|
|||
|
|
|||
|
function isJSON (json) {
|
|||
|
try {
|
|||
|
if (json instanceof Object && JSON.parse(JSON.stringify(json))) {
|
|||
|
return true
|
|||
|
}
|
|||
|
return false
|
|||
|
} catch (err) {
|
|||
|
return false
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var _$src_8 = {};
|
|||
|
(function (window) {
|
|||
|
'use strict'
|
|||
|
|
|||
|
let options = {
|
|||
|
searchInput: null,
|
|||
|
resultsContainer: null,
|
|||
|
json: [],
|
|||
|
success: Function.prototype,
|
|||
|
searchResultTemplate: '<li><a href="{url}" title="{desc}">{title}</a></li>',
|
|||
|
templateMiddleware: Function.prototype,
|
|||
|
sortMiddleware: function () {
|
|||
|
return 0
|
|||
|
},
|
|||
|
noResultsText: 'No results found',
|
|||
|
limit: 10,
|
|||
|
fuzzy: false,
|
|||
|
debounceTime: null,
|
|||
|
exclude: []
|
|||
|
}
|
|||
|
|
|||
|
let debounceTimerHandle
|
|||
|
const debounce = function (func, delayMillis) {
|
|||
|
if (delayMillis) {
|
|||
|
clearTimeout(debounceTimerHandle)
|
|||
|
debounceTimerHandle = setTimeout(func, delayMillis)
|
|||
|
} else {
|
|||
|
func.call()
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
const requiredOptions = ['searchInput', 'resultsContainer', 'json']
|
|||
|
|
|||
|
/* removed: const _$Templater_7 = require('./Templater') */;
|
|||
|
/* removed: const _$Repository_4 = require('./Repository') */;
|
|||
|
/* removed: const _$JSONLoader_2 = require('./JSONLoader') */;
|
|||
|
const optionsValidator = _$OptionsValidator_3({
|
|||
|
required: requiredOptions
|
|||
|
})
|
|||
|
/* removed: const _$utils_9 = require('./utils') */;
|
|||
|
|
|||
|
window.SimpleJekyllSearch = function (_options) {
|
|||
|
const errors = optionsValidator.validate(_options)
|
|||
|
if (errors.length > 0) {
|
|||
|
throwError('You must specify the following required options: ' + requiredOptions)
|
|||
|
}
|
|||
|
|
|||
|
options = _$utils_9.merge(options, _options)
|
|||
|
|
|||
|
_$Templater_7.setOptions({
|
|||
|
template: options.searchResultTemplate,
|
|||
|
middleware: options.templateMiddleware
|
|||
|
})
|
|||
|
|
|||
|
_$Repository_4.setOptions({
|
|||
|
fuzzy: options.fuzzy,
|
|||
|
limit: options.limit,
|
|||
|
sort: options.sortMiddleware,
|
|||
|
exclude: options.exclude
|
|||
|
})
|
|||
|
|
|||
|
if (_$utils_9.isJSON(options.json)) {
|
|||
|
initWithJSON(options.json)
|
|||
|
} else {
|
|||
|
initWithURL(options.json)
|
|||
|
}
|
|||
|
|
|||
|
const rv = {
|
|||
|
search: search
|
|||
|
}
|
|||
|
|
|||
|
typeof options.success === 'function' && options.success.call(rv)
|
|||
|
return rv
|
|||
|
}
|
|||
|
|
|||
|
function initWithJSON (json) {
|
|||
|
_$Repository_4.put(json)
|
|||
|
registerInput()
|
|||
|
}
|
|||
|
|
|||
|
function initWithURL (url) {
|
|||
|
_$JSONLoader_2.load(url, function (err, json) {
|
|||
|
if (err) {
|
|||
|
throwError('failed to get JSON (' + url + ')')
|
|||
|
}
|
|||
|
initWithJSON(json)
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
function emptyResultsContainer () {
|
|||
|
options.resultsContainer.innerHTML = ''
|
|||
|
}
|
|||
|
|
|||
|
function appendToResultsContainer (text) {
|
|||
|
options.resultsContainer.innerHTML += text
|
|||
|
}
|
|||
|
|
|||
|
function registerInput () {
|
|||
|
options.searchInput.addEventListener('input', function (e) {
|
|||
|
if (isWhitelistedKey(e.which)) {
|
|||
|
emptyResultsContainer()
|
|||
|
debounce(function () { search(e.target.value) }, options.debounceTime)
|
|||
|
}
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
function search (query) {
|
|||
|
if (isValidQuery(query)) {
|
|||
|
emptyResultsContainer()
|
|||
|
render(_$Repository_4.search(query), query)
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function render (results, query) {
|
|||
|
const len = results.length
|
|||
|
if (len === 0) {
|
|||
|
return appendToResultsContainer(options.noResultsText)
|
|||
|
}
|
|||
|
for (let i = 0; i < len; i++) {
|
|||
|
results[i].query = query
|
|||
|
appendToResultsContainer(_$Templater_7.compile(results[i]))
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function isValidQuery (query) {
|
|||
|
return query && query.length > 0
|
|||
|
}
|
|||
|
|
|||
|
function isWhitelistedKey (key) {
|
|||
|
return [13, 16, 20, 37, 38, 39, 40, 91].indexOf(key) === -1
|
|||
|
}
|
|||
|
|
|||
|
function throwError (message) {
|
|||
|
throw new Error('SimpleJekyllSearch --- ' + message)
|
|||
|
}
|
|||
|
})(window)
|
|||
|
|
|||
|
}());
|
|||
|
</script>
|
|||
|
|
|||
|
<!-- Configuration -->
|
|||
|
<script>
|
|||
|
SimpleJekyllSearch({
|
|||
|
searchInput: document.getElementById('search-input'),
|
|||
|
resultsContainer: document.getElementById('results-container'),
|
|||
|
json: '/search.json',
|
|||
|
//searchResultTemplate: '<li><a href="https://static.rnmkcy.eu{url}">{date} {title}</a></li>'
|
|||
|
searchResultTemplate: '<li><a href="{url}">{date} {title}</a></li>'
|
|||
|
})
|
|||
|
</script>
|
|||
|
<!-- Fin déclaration champ de recherche --></div><nav class="navigation">
|
|||
|
<ul><li class="navigation__item"><a href="/archive.html">Etiquettes</a></li><li class="navigation__item"><a href="/htmldoc.html">Documents</a></li><li class="navigation__item"><a href="/liens_ttrss.html">Liens</a></li><li class="navigation__item"><a href="/aide-jekyll-text-theme.html">Aide</a></li></ul>
|
|||
|
</nav></div>
|
|||
|
</header>
|
|||
|
|
|||
|
</div><div class="page__content"><div class ="main"><div class="grid grid--reverse">
|
|||
|
<div class="col-main cell cell--auto"><!-- start custom main top snippet --><div id="results-container" class="search-result js-search-result"></div><!-- end custom main top snippet -->
|
|||
|
<article itemscope itemtype="http://schema.org/Article"><div class="article__header"><header><h1 style="color:Tomato;">PC1 - Endeavour Neo XFCE sur partition LVM chiffrée</h1></header></div><meta itemprop="headline" content="PC1 - Endeavour Neo XFCE sur partition LVM chiffrée"><div class="article__info clearfix"><ul class="left-col menu"><li>
|
|||
|
<a class="button button--secondary button--pill button--sm"
|
|||
|
href="/archive.html?tag=archlinux">archlinux</a>
|
|||
|
</li><li>
|
|||
|
<a class="button button--secondary button--pill button--sm"
|
|||
|
href="/archive.html?tag=chiffrement">chiffrement</a>
|
|||
|
</li></ul><ul class="right-col menu"><li>
|
|||
|
<i class="far fa-calendar-alt"></i> <span title="Création" style="color:#FF00FF"> 7 oct. 2024</span>
|
|||
|
|
|||
|
<span title="Modification" style="color:#00FF7F">31 oct. 2024</span></li></ul></div><meta itemprop="datePublished" content="2024-10-31T00:00:00+01:00">
|
|||
|
<meta itemprop="keywords" content="archlinux,chiffrement"><div class="js-article-content">
|
|||
|
<div class="layout--article"><!-- start custom article top snippet -->
|
|||
|
<style>
|
|||
|
#myBtn {
|
|||
|
display: none;
|
|||
|
position: fixed;
|
|||
|
bottom: 10px;
|
|||
|
right: 10px;
|
|||
|
z-index: 99;
|
|||
|
font-size: 12px;
|
|||
|
font-weight: bold;
|
|||
|
border: none;
|
|||
|
outline: none;
|
|||
|
background-color: white;
|
|||
|
color: black;
|
|||
|
cursor: pointer;
|
|||
|
padding: 5px;
|
|||
|
border-radius: 4px;
|
|||
|
}
|
|||
|
|
|||
|
#myBtn:hover {
|
|||
|
background-color: #555;
|
|||
|
}
|
|||
|
</style>
|
|||
|
|
|||
|
<button onclick="topFunction()" id="myBtn" title="Haut de page">⇧</button>
|
|||
|
|
|||
|
<script>
|
|||
|
//Get the button
|
|||
|
var mybutton = document.getElementById("myBtn");
|
|||
|
|
|||
|
// When the user scrolls down 20px from the top of the document, show the button
|
|||
|
window.onscroll = function() {scrollFunction()};
|
|||
|
|
|||
|
function scrollFunction() {
|
|||
|
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
|||
|
mybutton.style.display = "block";
|
|||
|
} else {
|
|||
|
mybutton.style.display = "none";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// When the user clicks on the button, scroll to the top of the document
|
|||
|
function topFunction() {
|
|||
|
document.body.scrollTop = 0;
|
|||
|
document.documentElement.scrollTop = 0;
|
|||
|
}
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
<!-- end custom article top snippet -->
|
|||
|
<div class="article__content" itemprop="articleBody"><details>
|
|||
|
<summary><b>Afficher/cacher Sommaire</b></summary>
|
|||
|
<!-- affichage sommaire -->
|
|||
|
<div class="toc-aside js-toc-root"></div>
|
|||
|
</details><p><em>EndeavourOS est une distribution GNU/Linux basée sur Arch Linux</em></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="/2023/01/20/Description_materiel_minitour_PC1.html">Description matériel mini tour PC1</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p><img src="/images/yannick.drawio.png" alt="" /></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><strong>LVM/LUKS</strong>, flexibilité de partitionnement en utilisant LVM dans une seule partition cryptée LUKS.
|
|||
|
<ul>
|
|||
|
<li><u>Avantages</u>:
|
|||
|
<ul>
|
|||
|
<li>partitionnement simple avec connaissance de LVM</li>
|
|||
|
<li>Une seule clé nécessaire pour déverrouiller tous les volumes (p. ex. installation facile de récupération de disque)</li>
|
|||
|
<li>Mise en page du volume non visible lorsque verrouillé</li>
|
|||
|
<li>Méthode la plus facile pour permettre la <a href="https://wiki.archlinux.org/title/Dm-crypt/Swap_encryption#With_suspend-to-disk_support">suspension du disque</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><u>Inconvénients</u>:
|
|||
|
<ul>
|
|||
|
<li>LVM ajoute une couche de mappage supplémentaire et un “hook”</li>
|
|||
|
<li>Moins utile, si un volume doit recevoir une clé séparée</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p><code class="language-plaintext warning highlighter-rouge">Installer une distribution EndeavourOS chiffrée sur une partition LVM est impossible avec l'outil "Calamarès"</code></p>
|
|||
|
|
|||
|
<h2 id="endeavouros-temporaire">EndeavourOS temporaire</h2>
|
|||
|
|
|||
|
<p><em>Pour une installation EndavourOS LVM/LUKS, il faut passer par une installation temporaire</em></p>
|
|||
|
|
|||
|
<h3 id="création-eos-usb-live">Création Eos USB Live</h3>
|
|||
|
|
|||
|
<p><em>Création d’une clé USB EndeavourOS bootable</em></p>
|
|||
|
|
|||
|
<p>Dans un terminal linux<br />
|
|||
|
Télécharger le dernier fichier iSO : <a href="https://endeavouros.com/latest-release/">https://endeavouros.com/latest-release/</a><br />
|
|||
|
<strong>EndeavourOS_Endeavour_neo-2024.09.22.iso</strong></p>
|
|||
|
|
|||
|
<p>Vérifier checksum</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sha512sum</span> <span class="nt">-c</span> EndeavourOS_Endeavour_neo-2024.09.22.iso.sha512sum
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Résultat de la commande ci dessus après quelques minutes<br />
|
|||
|
<em>EndeavourOS_Endeavour_neo-2024.09.22.iso: Réussi</em></p>
|
|||
|
|
|||
|
<p>Créer la clé bootable<br />
|
|||
|
Pour savoir sur quel périphérique, connecter la clé sur un port USB d’un ordinateur et lancer la commande <code class="language-plaintext highlighter-rouge">sudo dmesg</code> ou <code class="language-plaintext highlighter-rouge">lsblk</code><br />
|
|||
|
Dans le cas présent , le périphérique USB est <strong>/dev/sdc</strong></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo dd </span><span class="k">if</span><span class="o">=</span>EndeavourOS_Endeavour_neo-2024.09.22.iso <span class="nv">of</span><span class="o">=</span>/dev/sdc <span class="nv">bs</span><span class="o">=</span>4M <span class="nt">--progress</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="démarrer-sur-eos-usb-live">Démarrer sur Eos USB Live</h3>
|
|||
|
|
|||
|
<p>Insérer la clé USB EndeavourOS, redémarrer la machine, sur Eos live<br />
|
|||
|
Démarrage avec la clé USB insérée dans le Mini tour PC1 et appui sur F8 pour un accès au menu <br />
|
|||
|
Choisir <code class="language-plaintext highlighter-rouge">UEFI: KingstonDataTraveler 2.0PMAP (3820MB)</code></p>
|
|||
|
|
|||
|
<p>Vous arrivez sur la page de sélection<br />
|
|||
|
<img src="/images/endos0001.png" alt="" width="400" /><br />
|
|||
|
Valider le choix par défaut</p>
|
|||
|
|
|||
|
<ol>
|
|||
|
<li>basculer en FR</li>
|
|||
|
<li>ouvrir un terminal</li>
|
|||
|
</ol>
|
|||
|
|
|||
|
<p><img src="/images/eos-lvm-luks01.png" alt="" width="600" /></p>
|
|||
|
|
|||
|
<p><code class="language-plaintext warning highlighter-rouge">Clavier QWERTY!!!</code></p>
|
|||
|
|
|||
|
<p><img src="/images/eos-lvm-luks01a.png" alt="" width="600" /><br />
|
|||
|
1 –> System Settings –> Keyboard<br />
|
|||
|
Remove Us… <br />
|
|||
|
Apply</p>
|
|||
|
|
|||
|
<p>On va se connecter en SSH</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip a # relever adresse IP
|
|||
|
sudo systemctl start sshd
|
|||
|
passwd liveuser # changer le mot de passe liveuser --> rtyuiop
|
|||
|
sudo firewall-cmd --zone=public --add-port=22/tcp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Se connecter depuis un poste sur le même réseau: <code class="language-plaintext highlighter-rouge">ssh liveuser@adresse_IP</code></p>
|
|||
|
|
|||
|
<h3 id="partionnement">Partionnement</h3>
|
|||
|
|
|||
|
<p>en mode su</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Le disque : <code class="language-plaintext highlighter-rouge">lsblk</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvme0n1 259:0 0 1,9T 0 disk
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On partitionne un disque en 3 avec <code class="language-plaintext highlighter-rouge">gdisk</code></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Partition 1 : 512M EFI (code ef00) système de fichier FAT32</li>
|
|||
|
<li>Partition 2 : 1895G LVM (code 8e00) système de fichier EXT4</li>
|
|||
|
<li>Partition restante pour Installation temporaire</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Zapper le disque,</p>
|
|||
|
|
|||
|
<p>(<strong>Attention</strong> Ceci effacera de manière irréversible toutes les données de votre disque, veuillez sauvegarder toutes les données importantes) :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sgdisk --zap-all /dev/nvme0n1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Partitionnement du disque NVME 2To GPT + LVM<br />
|
|||
|
Créer une table de partition GPT à l’aide de la commande <code class="language-plaintext highlighter-rouge">sgdisk</code> :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sgdisk --clear --new=1:0:+512MiB --typecode=1:ef00 --new=2:0:+1885G --typecode=2:8e00 /dev/nvme0n1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Format la partition EFI</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.fat -F32 /dev/nvme0n1p1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="installer-eos-xfce">Installer Eos XFCE</h3>
|
|||
|
|
|||
|
<p>Utilisation de Calamarès, cliquer sur <strong>Démarrer l’installateur</strong><br />
|
|||
|
Installation “en ligne”<br />
|
|||
|
Bureau: XFCE4<br />
|
|||
|
Paquets : Tout sauf LTS Kernel
|
|||
|
Chargeur: systemd-boot<br />
|
|||
|
Partitions:<br />
|
|||
|
<img src="/images/endos0007n.png" alt="" width="600" /><br />
|
|||
|
Utilisateur: yann<br />
|
|||
|
Ordi: PC1<br />
|
|||
|
mot passe utilisateur identique admin<br />
|
|||
|
Résumé:<br />
|
|||
|
<img src="/images/eos-lvm-luks03.png" alt="" width="600" /><br />
|
|||
|
Cliquer sur <strong>Installer</strong></p>
|
|||
|
|
|||
|
<p><img src="/images/eos-lvm-luks04.png" alt="" width="600" /><br />
|
|||
|
L’installation est terminée, cliquer “Redémarrer maintenant” et sur <strong>Terminé</strong></p>
|
|||
|
|
|||
|
<h3 id="créer-nouveau-système">Créer nouveau système</h3>
|
|||
|
|
|||
|
<p><code class="language-plaintext info highlighter-rouge">Clé USB Eos Live insérée, redémarrer dans l'environnement Live-Cd</code></p>
|
|||
|
|
|||
|
<p><code class="language-plaintext warning highlighter-rouge">Clavier QWERTY!!!</code><br />
|
|||
|
Ouvrir un terminal<br />
|
|||
|
Créer un accès sur la machine via SSH depuis un poste distant<br />
|
|||
|
Lancer le service : <code class="language-plaintext highlighter-rouge">sudo systemctl start sshd</code><br />
|
|||
|
Ouvrir le port 22 firewall: <code class="language-plaintext highlighter-rouge">sudo firewall-cmd --zone=public --add-port=22/tcp</code><br />
|
|||
|
Créer un mot de passe à liveuser : <code class="language-plaintext highlighter-rouge">passwd liveuser</code> –> rtyuiop
|
|||
|
Relever l’adresse ip de la machine : <code class="language-plaintext highlighter-rouge">ip a</code></p>
|
|||
|
|
|||
|
<p><strong>Déchiffrer système temporaire</strong></p>
|
|||
|
|
|||
|
<p>Le système temporaire chiffré <code class="language-plaintext highlighter-rouge">/dev/nvme0n1p3</code></p>
|
|||
|
|
|||
|
<p>Dans l’environnement live-CD, ouvrez un Terminal ,basculez en mode su et tapez (ou marquez et copiez la ligne avec ctrl-c et collez dans le terminal avec shift-ctrl-v ) …</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksOpen /dev/nvme0n1p3 crypttemp <span class="c"># saisir la phrase mot de passe de l'installation</span>
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /media/crypttemp
|
|||
|
mount /dev/mapper/crypttemp /media/crypttemp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Nos données d’installation temporaires sont désormais accessibles sous <code class="language-plaintext highlighter-rouge">/media/crypttemp</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bin boot dev efi etc home lib lib64 lost+found mnt opt proc root run sbin srv sys tmp usr var
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Créer nouveau système</strong></p>
|
|||
|
|
|||
|
<p>Chiffrer la partition /dev/nvme0n1p2,saisir la passphrase définitive</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksFormat <span class="nt">--type</span> luks2 /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Une demande de confirmation est exigée</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>WARNING!
|
|||
|
========
|
|||
|
This will overwrite data on /dev/nvme0n1p2 irrevocably.
|
|||
|
|
|||
|
Are you sure? (Type 'yes' in capital letters): YES
|
|||
|
Enter passphrase for /dev/nvme0n1p2:
|
|||
|
Verify passphrase:
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Choisissez un mot de passe sécurisé ( <a href="https://xkcd.com/936/">https://xkcd.com/936/</a> )</p>
|
|||
|
|
|||
|
<p>Ouvrir le nouveau système chiffré</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksOpen /dev/nvme0n1p2 crypt
|
|||
|
<span class="c"># Enter passphrase for /dev/nvme0n1p2:</span>
|
|||
|
pvcreate /dev/mapper/crypt
|
|||
|
<span class="c"># Physical volume "/dev/mapper/crypt" successfully created.</span>
|
|||
|
vgcreate vg0 /dev/mapper/crypt
|
|||
|
<span class="c"># Volume group "vg0" successfully created</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Une bonne taille de départ pour le volume racine (lvroot) est d’environ 30 Go. Si vous envisagez d’utiliser ultérieurement un fichier d’échange résidant sur root, vous devez en tenir compte.<br />
|
|||
|
Le redimensionnement ultérieur des volumes est assez facile, alors n’y réfléchissez pas trop.<br />
|
|||
|
Vous pouvez attribuer tout l’espace libre restant au volume d’accueil,<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">lvcreate --extents 100%FREE vg0 -n lvhome</code><br />
|
|||
|
mais pour augmenter les volumes plus tard et pour les instantanés , il faut de l’espace vide à l’intérieur du groupe de volumes, donc je choisis généralement une taille pour lvhome qui laisse environ 30 Go d’espace inutilisé global dans le volume groupe (en supposant un lecteur de 500 Go, par exemple 500 – 0,512 – 40 – 430 = 29,488)</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># 40G root dont 8 swapfile</span>
|
|||
|
lvcreate <span class="nt">-L</span> 40G vg0 <span class="nt">-n</span> lvroot <span class="c"># Logical volume "lvroot" created.</span>
|
|||
|
lvcreate <span class="nt">-L</span> 150G vg0 <span class="nt">-n</span> lvhome <span class="c"># Logical volume "lvhome" created.</span>
|
|||
|
lvcreate <span class="nt">-L</span> 300G vg0 <span class="nt">-n</span> lvmedia <span class="c"># Logical volume "lvmedia" created.</span>
|
|||
|
<span class="c">#lvcreate -l 100%FREE vg0 -n lvhome # Logical volume "lvhome" created.</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créez un système de fichiers ext4 sur les volumes logiques.</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.ext4 <span class="nt">-L</span> root /dev/mapper/vg0-lvroot
|
|||
|
mkfs.ext4 <span class="nt">-L</span> home /dev/mapper/vg0-lvhome
|
|||
|
mkfs.ext4 <span class="nt">-L</span> home /dev/mapper/vg0-lvmedia
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="montage-sur-mnt">Montage sur “mnt”</h3>
|
|||
|
|
|||
|
<p>Monter le nouveau système sur <code class="language-plaintext highlighter-rouge">/mnt</code> pour les systèmes UEFI</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/mapper/vg0-lvroot /mnt
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/home
|
|||
|
mount /dev/mapper/vg0-lvhome /mnt/home
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/efi
|
|||
|
mount /dev/nvme0n1p1 /mnt/efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsblk
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>devrait maintenant fournir une sortie similaire à la suivante (ignorez les tailles, celles-ci proviennent d’une installation de test) …</p>
|
|||
|
|
|||
|
<p>pour les systèmes UEFI :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvme0n1 259:0 0 1.9T 0 disk
|
|||
|
├─nvme0n1p1 259:1 0 512M 0 part /mnt/efi
|
|||
|
├─nvme0n1p2 259:2 0 1.8T 0 part
|
|||
|
│ └─crypt 254:3 0 1.8T 0 crypt
|
|||
|
│ ├─vg0-lvroot 254:4 0 40G 0 lvm /mnt
|
|||
|
│ ├─vg0-lvhome 254:5 0 150G 0 lvm /mnt/home
|
|||
|
│ └─vg0-lvmedia 254:6 0 300G 0 lvm
|
|||
|
└─nvme0n1p3 259:3 0 22.2G 0 part
|
|||
|
└─crypttemp 254:2 0 22.2G 0 crypt /media/crypttemp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="cloner-système-temporaire">Cloner système temporaire</h3>
|
|||
|
|
|||
|
<p>pour remplir les nouveaux points de montage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rsync -avA /media/crypttemp/ /mnt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>Veuillez patienter quelques minutes</em></p>
|
|||
|
|
|||
|
<h3 id="démonter-système-temporaire">Démonter système temporaire</h3>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>umount /media/crypttemp
|
|||
|
cryptsetup luksClose crypttemp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>lsblk</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvme0n1 259:0 0 1.9T 0 disk
|
|||
|
├─nvme0n1p1 259:1 0 512M 0 part /mnt/efi
|
|||
|
├─nvme0n1p2 259:2 0 1.8T 0 part
|
|||
|
│ └─crypt 254:3 0 1.8T 0 crypt
|
|||
|
│ ├─vg0-lvroot 254:4 0 40G 0 lvm /mnt
|
|||
|
│ ├─vg0-lvhome 254:5 0 150G 0 lvm /mnt/home
|
|||
|
│ └─vg0-lvmedia 254:6 0 300G 0 lvm
|
|||
|
└─nvme0n1p3 259:3 0 22.2G 0 part
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="configurer-crypttab">Configurer “crypttab”</h3>
|
|||
|
|
|||
|
<p>Configuration <code class="language-plaintext highlighter-rouge">/etc/crypttab</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksUUID /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie <strong>5fa90f9d-ac40-4c70-8f58-730a423ce76b</strong><br />
|
|||
|
Votre UUID sera différent, alors <u>**assurez-vous d'utiliser votre UUID à l'étape suivante !**</u></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /mnt/etc/crypttab
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>contient une ligne non commentée commençant par <code class="language-plaintext highlighter-rouge">luks-</code>…<br />
|
|||
|
Remplacez cette ligne par la suivante ; <u>**n'oubliez pas d' utiliser votre UUID**</u></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptlvm UUID=5fa90f9d-ac40-4c70-8f58-730a423ce76b none luks
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sauvegarder et quitter.</p>
|
|||
|
|
|||
|
<h3 id="basculer-en-chroot">Basculer en chroot</h3>
|
|||
|
|
|||
|
<p>Passer en chroot</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>arch-chroot /mnt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>le prompt <code class="language-plaintext highlighter-rouge">[root@EndeavourOS /]#</code></p>
|
|||
|
|
|||
|
<h3 id="configurer-fstab">Configurer “fstab”</h3>
|
|||
|
|
|||
|
<p>Configurer /etc/fstab</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid -s UUID -o value /dev/mapper/vg0-lvroot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie l’UUID du volume racine : <strong>04b9e250-1fcd-485b-989f-e753c89bf60f</strong>.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid -s UUID -o value /dev/mapper/vg0-lvhome
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie l’UUID du volume d’accueil : <strong>c35a3f8b-583b-4952-9ceb-f9a19194fa6c</strong>.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/fstab
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>contient une ligne commençant par <code class="language-plaintext highlighter-rouge">/dev/mapper/luks-</code>…<br />
|
|||
|
<strong>Supprimez</strong> cette ligne et ajoutez ce qui suit (<u>**n'oubliez pas d' utiliser vos UUID**</u>)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>UUID=04b9e250-1fcd-485b-989f-e753c89bf60f / ext4 noatime 0 0
|
|||
|
UUID=c35a3f8b-583b-4952-9ceb-f9a19194fa6c /home ext4 noatime 0 0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sauvegarder et quitter.</p>
|
|||
|
|
|||
|
<h3 id="options-du-noyau">Options du noyau</h3>
|
|||
|
|
|||
|
<p>Dans <strong>systemd-boot</strong>, vous éditez le fichier d’entrée approprié qui se trouve sur votre partition EFI dans le répertoire <code class="language-plaintext highlighter-rouge">loader/entries</code><br />
|
|||
|
Chaque entrée est une option de démarrage dans le menu et chacune a une ligne appelée options. Vous pouvez modifier ces entrées directement, mais ces changements peuvent être écrasés lors de l’installation ou de la mise à jour de paquets.</p>
|
|||
|
|
|||
|
<p>UUID de /dev/nvme0n1p2 : <code class="language-plaintext highlighter-rouge">blkid -s UUID -o value /dev/nvme0n1p2</code></p>
|
|||
|
|
|||
|
<p>Pour effectuer les changements, au lieu de modifier les entrées, modifiez le fichier <code class="language-plaintext highlighter-rouge">/etc/kernel/cmdline</code> qui est un fichier d’une ligne contenant une liste d’options du noyau.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/kernel/cmdline
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvme_load=YES nowatchdog rw rd.luks.uuid=5fa90f9d-ac40-4c70-8f58-730a423ce76b root=/dev/mapper/vg0-lvroot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Exécutez ensuite <code class="language-plaintext highlighter-rouge">sudo reinstall-kernels</code> qui remplira les entrées et régénérera les initrds.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>reinstall-kernels
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="sortie-chroot">Sortie chroot</h3>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>exit
|
|||
|
umount -R /mnt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Oter la clé USB , redémarrer</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>reboot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><code class="language-plaintext info highlighter-rouge">FINI! Vous devriez maintenant avoir un système LVMonLUKS fonctionnel avec un volume logique séparé pour /home</code></p>
|
|||
|
|
|||
|
<h2 id="endeavouros-chiffré-lvmluks">EndeavourOS chiffré LVM/LUKS</h2>
|
|||
|
|
|||
|
<h3 id="premier-démarrage">Premier démarrage</h3>
|
|||
|
|
|||
|
<p>La partition est chiffrée<br />
|
|||
|
<img src="/images/eos-lvm-luks05.png" alt="" /><br />
|
|||
|
Au message “Please enter passphrase for disk endeavouros…”, saisir la phrase mot de passe pour déchiffrer le disque</p>
|
|||
|
|
|||
|
<h4 id="activation-ssh">Activation SSH</h4>
|
|||
|
|
|||
|
<p>Activer et lancer le service</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable sshd --now
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Autoriser ssh</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>firewall-cmd <span class="nt">--zone</span><span class="o">=</span>public <span class="nt">--add-port</span><span class="o">=</span>22/tcp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Relever adresse : <code class="language-plaintext highlighter-rouge">ip a</code> –> 192.168.0.37</p>
|
|||
|
|
|||
|
<p>Se connecter depuis un poste sur le même réseau: <code class="language-plaintext highlighter-rouge">ssh yann@192.168.0.37</code></p>
|
|||
|
|
|||
|
<h4 id="accès-sudo">Accès sudo</h4>
|
|||
|
|
|||
|
<p>Modifier sudoers pour accès sudo sans mot de passe à l’utilisateur yano</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>su # mot de passe root identique utilisateur
|
|||
|
echo "yann ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/20-yann
|
|||
|
exit # sortie su
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="historique-de-la-ligne-de-commande">Historique de la ligne de commande</h4>
|
|||
|
|
|||
|
<p>Ajoutez la recherche d’historique de la ligne de commande au terminal<br />
|
|||
|
Se connecter en utilisateur<br />
|
|||
|
Tapez un début de commande précédent, puis utilisez shift + up (flèche haut) pour rechercher l’historique filtré avec le début de la commande.</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Global, tout utilisateur</span>
|
|||
|
<span class="nb">echo</span> <span class="s1">'"\e[1;2A": history-search-backward'</span> | <span class="nb">sudo tee</span> <span class="nt">-a</span> /etc/inputrc
|
|||
|
<span class="nb">echo</span> <span class="s1">'"\e[1;2B": history-search-forward'</span> | <span class="nb">sudo tee</span> <span class="nt">-a</span> /etc/inputrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="unités-disques">Unités disques</h4>
|
|||
|
|
|||
|
<p>Liste : <code class="language-plaintext highlighter-rouge">lsblk</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
|||
|
sda 8:0 0 111,8G 0 disk
|
|||
|
└─sda1 8:1 0 111,8G 0 part
|
|||
|
└─ssd--120-lv120 254:1 0 111,8G 0 lvm
|
|||
|
sdb 8:16 0 476,9G 0 disk
|
|||
|
└─sdb1 8:17 0 476,9G 0 part
|
|||
|
└─ssd--512-virtuel 254:0 0 476,9G 0 lvm
|
|||
|
nvme0n1 259:0 0 1,9T 0 disk
|
|||
|
├─nvme0n1p1 259:1 0 512M 0 part /efi
|
|||
|
├─nvme0n1p2 259:2 0 1,8T 0 part
|
|||
|
│ └─cryptlvm 254:2 0 1,8T 0 crypt
|
|||
|
│ ├─vg0-lvroot 254:3 0 40G 0 lvm /
|
|||
|
│ ├─vg0-lvhome 254:4 0 150G 0 lvm /home
|
|||
|
│ └─vg0-lvmedia 254:5 0 300G 0 lvm
|
|||
|
└─nvme0n1p3 259:3 0 22,2G 0 part
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer les points de montage</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo mkdir</span> <span class="nt">-p</span> /srv/media
|
|||
|
<span class="nb">sudo chown</span> <span class="nv">$USER</span>:<span class="nv">$USER</span> /srv/media
|
|||
|
<span class="nb">sudo mkdir</span> <span class="nt">-p</span> /mnt/<span class="o">{</span>ssd,sharenfs,FreeUSB2To<span class="o">}</span>
|
|||
|
<span class="nb">sudo chown</span> <span class="nv">$USER</span>:<span class="nv">$USER</span> /mnt/<span class="o">{</span>ssd,sharenfs,FreeUSB2To<span class="o">}</span>
|
|||
|
<span class="nb">sudo mkdir</span> <span class="nt">-p</span> /virtuel
|
|||
|
<span class="nb">sudo chown</span> <span class="nv">$USER</span>:<span class="nv">$USER</span> /virtuel
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Relever les UUID des unités : <code class="language-plaintext highlighter-rouge">sudo blkid</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/dev/mapper/ssd--120-lv120: UUID="6b48e98c-9b85-461b-9371-040765aae682" BLOCK_SIZE="4096" TYPE="ext4"
|
|||
|
/dev/nvme0n1p3: UUID="1a64bf47-fa14-4c9f-b8c4-7c3484f60e94" TYPE="crypto_LUKS" PARTLABEL="endeavouros" PARTUUID="22e5c948-0f32-44d2-9040-cde9534e34e7"
|
|||
|
/dev/nvme0n1p1: UUID="E522-8D8D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="114324a5-4aa7-4ee5-a57e-8568ac5f2f74"
|
|||
|
/dev/nvme0n1p2: UUID="5fa90f9d-ac40-4c70-8f58-730a423ce76b" TYPE="crypto_LUKS" PARTUUID="c9640813-16da-4fde-87f6-98a5620e7b72"
|
|||
|
/dev/sdb1: UUID="AYko64-7Ysg-IK1P-2hCq-9MUo-VjQl-4NOuWY" TYPE="LVM2_member" PARTUUID="19dd6163-01"
|
|||
|
/dev/mapper/vg0-lvhome: LABEL="home" UUID="c35a3f8b-583b-4952-9ceb-f9a19194fa6c" BLOCK_SIZE="4096" TYPE="ext4"
|
|||
|
/dev/mapper/cryptlvm: UUID="LwRekN-16qI-L1Nf-WfEY-OLgo-rd3A-XTE3Fg" TYPE="LVM2_member"
|
|||
|
/dev/mapper/ssd--512-virtuel: UUID="84bc1aa9-23ac-4530-b861-bc33171b7b42" BLOCK_SIZE="4096" TYPE="ext4"
|
|||
|
/dev/sda1: UUID="o2NaLz-2Biv-Dx3C-LYJD-vuyp-1Ogl-Oa4Iu2" TYPE="LVM2_member" PARTLABEL="Linux LVM" PARTUUID="3eee16e4-fe68-42bf-861a-cd9e46d22805"
|
|||
|
/dev/mapper/vg0-lvmedia: LABEL="home" UUID="0e48444f-104c-4ba0-8b55-5d38ea0583ee" BLOCK_SIZE="4096" TYPE="ext4"
|
|||
|
/dev/mapper/vg0-lvroot: LABEL="root" UUID="04b9e250-1fcd-485b-989f-e753c89bf60f" BLOCK_SIZE="4096" TYPE="ext4"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajout au fichier <code class="language-plaintext highlighter-rouge">/etc/fstab</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># /dev/mapper/vg0-lvmedia
|
|||
|
UUID=0e48444f-104c-4ba0-8b55-5d38ea0583ee /srv/media ext4 rw,relatime 0 2
|
|||
|
|
|||
|
# /dev/mapper/ssd--512-virtuel
|
|||
|
UUID=84bc1aa9-23ac-4530-b861-bc33171b7b42 /virtuel ext4 defaults 0 2
|
|||
|
|
|||
|
# /dev/mapper/ssd--120-lv120
|
|||
|
UUID=6b48e98c-9b85-461b-9371-040765aae682 /mnt/ssd ext4 defaults 0 2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Recharger et monter les unités</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
|
|||
|
sudo mount -a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Restauration des données /srv/data</strong></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-s</span>
|
|||
|
rsync <span class="nt">-avA</span> /mnt/ssd/lvmedia/ /srv/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les dossiers musicyan et dplus sont ailleurs</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /srv/media/<span class="o">{</span>musicyan,dplus<span class="o">}</span>
|
|||
|
<span class="nb">sudo</span> <span class="nt">-s</span>
|
|||
|
rsync <span class="nt">-avA</span> /virtuel/musicyan/<span class="k">*</span> /srv/media/musicyan/
|
|||
|
rsync <span class="nt">-avA</span> /virtuel/dplus/<span class="k">*</span> /srv/media/dplus/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Suppression des dossiers de sauvegardes</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo rm</span> <span class="nt">-r</span> /mnt/ssd/lvmedia
|
|||
|
<span class="nb">sudo rm</span> <span class="nt">-r</span> /virtuel/<span class="o">{</span>musicyan,dplus<span class="o">}</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="mise-à-jour-système">Mise à jour Système</h3>
|
|||
|
|
|||
|
<p>Mode terminal</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -Syu
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Mode graphique<br />
|
|||
|
<img src="/images/plasma-kde01.png" alt="" /></p>
|
|||
|
|
|||
|
<h3 id="réseau">Réseau</h3>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="https://docs.redhat.com/fr/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/configuring-a-network-bridge_configuring-and-managing-networking#configuring-a-network-bridge-by-using-nmcli_configuring-a-network-bridge">Réseau - Doc RedHat</a></li>
|
|||
|
<li><a href="/2024/10/31/NetworkManager-nmcli.html">Réseau NetworkManager - nmcli</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<h4 id="interface-pont-bridge">Interface pont (bridge)</h4>
|
|||
|
|
|||
|
<p><strong>Créer une interface de pont</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection add type bridge con-name bridge0 ifname bridge0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>Connexion « bridge0 » (c692299c-5076-4b84-adfb-913e154ebf46) ajoutée avec succès.</em></p>
|
|||
|
|
|||
|
<p>Affichez les interfaces réseau et notez les noms des interfaces que vous souhaitez ajouter au pont</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli device status
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DEVICE TYPE STATE CONNECTION
|
|||
|
enp0s31f6 ethernet connecté eth_enp0s31f6
|
|||
|
bridge0 bridge connexion (obtention de la configuration IP) bridge0
|
|||
|
lo loopback connecté (en externe) lo
|
|||
|
wg0-mullvad wireguard connecté (en externe) wg0-mullvad
|
|||
|
enp3s0f0 ethernet déconnecté --
|
|||
|
enp3s0f1 ethernet indisponible --
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Attribuer les interfaces au pont.</strong><br />
|
|||
|
<em>Si les interfaces que vous souhaitez affecter au pont ne sont pas configurées, créez de nouveaux profils de connexion pour elles</em></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection add type ethernet slave-type bridge con-name bridge0-port1 ifname enp3s0f0 master bridge0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>Connexion « bridge0-port1 » (34425bb4-3d61-4e6c-81c1-6f76ffe78539) ajoutée avec succès.</em></p>
|
|||
|
|
|||
|
<p><strong>Paramétrage pont</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Utiliser le DHCP, <u>aucune action n'est nécessaire</u></li>
|
|||
|
<li>Définir une adresse IPv4 statique, un masque de réseau, une passerelle par défaut pour la connexion bridge0 :<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">nmcli connection modify bridge0 ipv4.addresses '192.168.10.2/24' ipv4.gateway '192.168.10.1' ipv4.method manual</code></li>
|
|||
|
<li>Désactiver ipv6 : <code class="language-plaintext highlighter-rouge">nmcli connection modify bridge0 ipv6.method disabled</code></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Activer la connexion pont</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection up bridge0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>Connexion activée (controller waiting for ports) (Chemin D-Bus actif : /org/freedesktop/NetworkManager/ActiveConnection/6)</em></p>
|
|||
|
|
|||
|
<p>Vérifiez que les ports sont connectés et que la colonne CONNECTION affiche le nom de connexion du port</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli device
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>DEVICE TYPE STATE CONNECTION
|
|||
|
enp0s31f6 ethernet connecté eth_enp0s31f6
|
|||
|
bridge0 bridge connecté bridge0
|
|||
|
enp3s0f0 ethernet connecté bridge0-port1
|
|||
|
lo loopback connecté (en externe) lo
|
|||
|
enp3s0f1 ethernet indisponible --
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="priorité-réseau">Priorité réseau</h4>
|
|||
|
|
|||
|
<p>L’ordinateur de bureau PC1 a 3 cartes réseau</p>
|
|||
|
|
|||
|
<p class="info">Souvent, les périphériques intégrés disposent de plusieurs interfaces réseau disponibles simultanément, comme les routeurs réseau dotés d’interfaces filaires et sans fil. Ces périphériques doivent pouvoir sélectionner automatiquement une interface réseau préférée. Pour y parvenir sur une machine Linux, chaque interface possède une valeur métrique qui indique le coût d’utilisation de l’interface. (<a href="https://www.baeldung.com/linux/change-network-routing-metric">Changing the Network Routing Metric Permanently</a>)</p>
|
|||
|
|
|||
|
<p><code class="language-plaintext warning highlighter-rouge">La connexion au réseau 192.168.0.0/24 via NetworkManager ne se fait pas correctement car il peut se connecter au réseau 192.168.10.0/24</code></p>
|
|||
|
|
|||
|
<p>Il faut donner la priorité au réseau 192.168.0.0/24</p>
|
|||
|
|
|||
|
<p>Commande <code class="language-plaintext highlighter-rouge">nmcli device</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>enp0s31f6 ethernet connecté eth_enp0s31f6
|
|||
|
bridge0 bridge connecté bridge0
|
|||
|
enp3s0f0 ethernet connecté bridge0-port1
|
|||
|
...
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Obtenir la valeur métrique</strong><br />
|
|||
|
Obtenons la valeur métrique initiale de nos interfaces réseau.<br />
|
|||
|
Pour cela, nous utilisons la commande suivante</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip route
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>default via 192.168.0.254 dev enp0s31f6 proto static metric 100
|
|||
|
default via 192.168.10.1 dev bridge0 proto static metric 425
|
|||
|
...
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Il s’agit de la table de routage pour les interfaces enp0s31f6 et bridge0<br />
|
|||
|
A la fin de chaque ligne, nous pouvons voir une valeur métrique</p>
|
|||
|
|
|||
|
<p><strong>Modifier la valeur métrique</strong><br />
|
|||
|
Commande nmcli pour modifier la valeur métrique de l’ interface</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nmcli connection modify 'eth_enp0s31f6' ipv4.route-metric 10
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)</p>
|
|||
|
|
|||
|
<p>La connexion avec une nouvelle valeur métrique est désormais active.<br />
|
|||
|
Si nous vérifions la table de routage, nous devrions pouvoir voir la nouvelle valeur métrique</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip route
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>default via 192.168.0.254 dev enp0s31f6 proto static metric 10
|
|||
|
default via 192.168.10.1 dev bridge0 proto static metric 425
|
|||
|
...
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>L’ interface <strong>enp0s31f6</strong> a désormais une valeur métrique de 10</p>
|
|||
|
|
|||
|
<h3 id="partage-disque">Partage disque</h3>
|
|||
|
|
|||
|
<p><a href="/2022/08/03/Partage_disque_externe_USB_sur_Freebox.html">Partage disque externe USB sur Freebox</a></p>
|
|||
|
|
|||
|
<h4 id="disque-freebox-partagé-freeusb2to">Disque freebox partagé FreeUSB2To</h4>
|
|||
|
|
|||
|
<p><strong>FreeBox</strong><br />
|
|||
|
HDD Mobile 2To connecté en USB sur la freebox<br />
|
|||
|
Nom de partage : FreeUSB2To + EXT4 + vérification après formatage<br />
|
|||
|
Partage windows activé : yannfreebox + mot de passe</p>
|
|||
|
|
|||
|
<p><strong>PC1</strong><br />
|
|||
|
Partage linux samba : <code class="language-plaintext highlighter-rouge">sudo pacman -S cifs-utils</code> Installé par défaut <br />
|
|||
|
Point de montage : <code class="language-plaintext highlighter-rouge">sudo mkdir -p /mnt/FreeUSB2To</code> <br />
|
|||
|
Lien : <code class="language-plaintext highlighter-rouge">sudo ln -s /mnt/FreeUSB2To $HOME/FreeUSB2To</code></p>
|
|||
|
|
|||
|
<p>Credential : <code class="language-plaintext highlighter-rouge">/root/.smbcredentials</code> avec 2 lignes<br />
|
|||
|
username=XXXXXX<br />
|
|||
|
password=XXXXXX</p>
|
|||
|
|
|||
|
<p>Droits</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo chown</span> <span class="nt">-R</span> root:root /root/.smbcredentials
|
|||
|
<span class="nb">sudo chmod</span> <span class="nt">-R</span> 600 /root/.smbcredentials
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les fichiers systèmes</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># /etc/systemd/system/mnt-FreeUSB2To.mount
|
|||
|
[Unit]
|
|||
|
Description=cifs mount script
|
|||
|
Requires=network-online.target
|
|||
|
After=network-online.service
|
|||
|
|
|||
|
[Mount]
|
|||
|
What=//192.168.0.254/FreeUSB2To
|
|||
|
Where=/mnt/FreeUSB2To
|
|||
|
Options=credentials=/root/.smbcredentials,rw,uid=1000,gid=1000,vers=3.0
|
|||
|
Type=cifs
|
|||
|
|
|||
|
[Install]
|
|||
|
WantedBy=multi-user.target
|
|||
|
|
|||
|
# /etc/systemd/system/mnt-FreeUSB2To.automount
|
|||
|
[Unit]
|
|||
|
Description=cifs mount script
|
|||
|
Requires=network-online.target
|
|||
|
After=network-online.service
|
|||
|
|
|||
|
[Automount]
|
|||
|
Where=/mnt/FreeUSB2To
|
|||
|
TimeoutIdleSec=10
|
|||
|
|
|||
|
[Install]
|
|||
|
WantedBy=multi-user.target
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable mnt-FreeUSB2To.automount --now
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="partage-avec-lenovo-serveur-nfs">Partage avec Lenovo serveur NFS</h4>
|
|||
|
|
|||
|
<p><strong>PC1</strong><br />
|
|||
|
Points de montage : <code class="language-plaintext highlighter-rouge">sudo mkdir -p /mnt/sharenfs</code> <br />
|
|||
|
Lien : <code class="language-plaintext highlighter-rouge">sudo ln -s /mnt/sharenfs $HOME/sharenfs</code></p>
|
|||
|
|
|||
|
<p>Ajouter les points de montage du serveur nfs au fichier <code class="language-plaintext highlighter-rouge">/etc/fstab</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Les montage NFS du serveur lenovo 192.168.0.215
|
|||
|
192.168.0.215:/sharenfs /mnt/sharenfs nfs4 nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s,rsize=8192,wsize=8192 0 0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rechargement et montage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload && sudo mount -a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Points de montage : <code class="language-plaintext highlighter-rouge">sudo mkdir -p /mnt/nfs-ssd</code> <br />
|
|||
|
Lien : <code class="language-plaintext highlighter-rouge">sudo ln -s /mnt/nfs-ssd $HOME/nfs-ssd</code></p>
|
|||
|
|
|||
|
<p>Ajouter les points de montage du serveur nfs au fichier <code class="language-plaintext highlighter-rouge">/etc/fstab</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>192.168.0.215:/mnt/nfs-ssd /mnt/nfs-ssd nfs4 nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10s,rsize=8192,wsize=8192 0 0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rechargement et montage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload && sudo mount -a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="dossiers-et-liens">Dossiers et Liens</h4>
|
|||
|
|
|||
|
<p>Les dossiers et <strong>Liens sur les autres unités</strong> et les dossiers <code class="language-plaintext highlighter-rouge">.keepassx</code> , <code class="language-plaintext highlighter-rouge">Notes</code> , <code class="language-plaintext highlighter-rouge">scripts</code> <code class="language-plaintext highlighter-rouge">statique/images</code> et <code class="language-plaintext highlighter-rouge">statique/_posts</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /srv/media/{Notes,statique}
|
|||
|
sudo mkdir -p /srv/media/statique/{images,_posts}
|
|||
|
sudo ln -s /srv/media $HOME/media
|
|||
|
sudo mkdir -p /virtuel
|
|||
|
sudo ln -s /virtuel $HOME/virtuel
|
|||
|
mkdir -p ~/{.ssh,.keepassx}
|
|||
|
sudo mkdir -p /mnt/sharenfs/scripts
|
|||
|
sudo chown $USER:$USER -R /mnt/sharenfs/scripts
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer liens sharenfs</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ln</span> <span class="nt">-s</span> /mnt/sharenfs/pc1/.borg <span class="nv">$HOME</span>/Private/.borg
|
|||
|
<span class="nb">ln</span> <span class="nt">-s</span> /mnt/sharenfs/scripts <span class="nv">$HOME</span>/scripts
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Liens “statique” et “Notes”</strong><br />
|
|||
|
les liens pour la rédaction des posts markdown et le dossier des fichiers</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Lien pour affichage des images avec éditeur Retext</span>
|
|||
|
<span class="nb">sudo ln</span> <span class="nt">-s</span> /srv/media/statique/images /images
|
|||
|
<span class="c"># Lien pour les fichiers autres</span>
|
|||
|
<span class="nb">sudo ln</span> <span class="nt">-s</span> /srv/media/statique/files /files
|
|||
|
</code></pre></div></div>
|
|||
|
<p><strong>Dossiers Documents et Musique</strong><br />
|
|||
|
Supprimer les dossiers par défaut Documents et Musique et créer des liens</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># suppression Documents et Musique
|
|||
|
sudo rm -r $HOME/Documents
|
|||
|
sudo rm -r $HOME/Musique
|
|||
|
#Création des liens
|
|||
|
sudo ln -s /srv/media/Documents $HOME/Documents
|
|||
|
sudo ln -s /mnt/sharenfs/Musique $HOME/Musique
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="mise-à-jour-endeavouros">Mise à jour EndeavourOS</h3>
|
|||
|
|
|||
|
<p><strong>Mode graphique</strong></p>
|
|||
|
|
|||
|
<p><img src="/images/eos-cassini-009.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/eos-cassini-009a.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/eos-cassini-009c.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<p><img src="/images/eos-cassini-010.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/eos-cassini-010a.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/eos-cassini-010b.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<p><img src="/images/eos-cassini-011.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/eos-cassini-011a.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/eos-cassini-011b.png" alt="" width="300" /><br />
|
|||
|
<img src="/images/eos-cassini-011c.png" alt="" width="400" /></p>
|
|||
|
|
|||
|
<p><strong>Résumé</strong></p>
|
|||
|
|
|||
|
<p><img src="/images/eos-welcome.png" alt="" /></p>
|
|||
|
|
|||
|
<h3 id="paramètres-xfce">Paramètres XFCE</h3>
|
|||
|
|
|||
|
<p>On déplace le <strong>tableau de bord</strong> du bas vers le haut de l’écran<br />
|
|||
|
Gestion des 2 écrans</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Sharp en primaire</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Modification du <strong>tableau de bord</strong> , clic-droit → Tableau de bord → Préférences de tableau de bord → Eléments</p>
|
|||
|
|
|||
|
<p>Affichage date et heure<br />
|
|||
|
<img src="/images/eos-cassini-012.png" alt="" /><br />
|
|||
|
ou <strong>format personnalisé</strong> dans <strong>Horloge</strong> : <code class="language-plaintext highlighter-rouge">%e %b %Y %R</code></p>
|
|||
|
|
|||
|
<p>Gestionnaire d’alimentation<br />
|
|||
|
<img src="/images/alimentation01.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/alimentation02.png" alt="" width="400" /></p>
|
|||
|
|
|||
|
<p>Supprimer icône alimentation dans la barre des tâches<br />
|
|||
|
<img src="/images/alimentation03.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Apparence<br />
|
|||
|
<img src="/images/apparence.png" alt="" width="300" /><img src="/images/apparence-icones.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<p>Economiseur d’écran<br />
|
|||
|
<img src="/images/economiseur01.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/economiseur02.png" alt="" width="400" /></p>
|
|||
|
|
|||
|
<p>Deux cartes réseau sont installés<br />
|
|||
|
<img src="/images/reseau01.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/reseau02.png" alt="" width="400" /><br />
|
|||
|
<img src="/images/reseau03.png" alt="" width="400" /></p>
|
|||
|
|
|||
|
<h3 id="lightdm">LightDM</h3>
|
|||
|
|
|||
|
<p><em>Utilise <code class="language-plaintext highlighter-rouge">lightdm-slick-greeter</code> Un greeter basé sur GTK plus axé sur l’apparence que <code class="language-plaintext highlighter-rouge">lightdm-gtk-greeter</code></em></p>
|
|||
|
|
|||
|
<p>Les paramètres sont dans le fichier <code class="language-plaintext highlighter-rouge">/etc/lightdm/slick-greeter.conf</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Greeter]
|
|||
|
background=/srv/media/dplus/images/Fonds/wp2618258.jpg
|
|||
|
draw-user-backgrounds=false
|
|||
|
draw-grid=false
|
|||
|
theme-name=Arc-Dark
|
|||
|
icon-theme-name=Qogir
|
|||
|
cursor-theme-name=Qogir
|
|||
|
cursor-theme-size=16
|
|||
|
show-a11y=false
|
|||
|
show-power=false
|
|||
|
background-color=#000000
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Démarre auto ou pas de la session, modifier le fichier <code class="language-plaintext highlighter-rouge">/etc/lightdm/lightdm.conf</code> ‘, (début ligne sans ou avec commentaire <code class="language-plaintext highlighter-rouge">#</code>)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/lightdm/lightdm.conf
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Seat:*]
|
|||
|
autologin-user=yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ecran principal pour la fenêtre de connexion : <a href="/2023/08/02/EndeavourOS_XFCE_-_Environnements_de_bureau_LightDM.html">EndeavourOS XFCE - LightDM sur les systèmes multi-affichages</a></p>
|
|||
|
|
|||
|
<p>Si vous changez l’image de fond, il désactiver draw-grid</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>background=/usr/share/endeavouros/backgrounds/light_sky_stars_85555_1366x768_yano.jpg
|
|||
|
draw-grid=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="déverrouillage-des-volumes-luks2">Déverrouillage des volumes LUKS2</h3>
|
|||
|
|
|||
|
<p>Description</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Slot 0 pour le déverrouillage du volume par saisie d’une phrase mot de passe.</li>
|
|||
|
<li>Slot 1 ,2 et 3 pour le déverrouillage par des clés avec un appui sur une touche.</li>
|
|||
|
<li>Slot 4 - Ajout d’une phrase mot de passe pour le recovery (OPTION)</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Au final nous aurons 4 “slot” utilisés</p>
|
|||
|
|
|||
|
<p>Installer librairie libfido2 pour la prise en charge des clés Yubico et SoloKeys</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S libfido2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="enroler-clé-usb-yubikey-5-nfc">Enroler clé USB YubiKey 5 NFC</h4>
|
|||
|
|
|||
|
<p><img src="/images/yubikey5nfc.png" alt="" height="150" /></p>
|
|||
|
|
|||
|
<p>Vérifier que la YubiKey est insérée dans un port USB</p>
|
|||
|
|
|||
|
<p>Lister et enroler la yubikey</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemd-cryptenroll --fido2-device=list
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PATH MANUFACTURER PRODUCT
|
|||
|
/dev/hidraw5 Yubico YubiKey OTP+FIDO+CCID
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Enroler la clé pour le déverrouillage du disque chiffré nvme0n1p2</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemd-cryptenroll --fido2-device=auto /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>🔐 Please enter current passphrase for disk /dev/nvme0n1p2: *********************
|
|||
|
Requested to lock with PIN, but FIDO2 device /dev/hidraw5 does not support it, disabling.
|
|||
|
Initializing FIDO2 credential on security token.
|
|||
|
👆 (Hint: This might require confirmation of user presence on security token.)
|
|||
|
Generating secret key on FIDO2 security token.
|
|||
|
👆 In order to allow secret key generation, please confirm presence on security token.
|
|||
|
New FIDO2 token enrolled as key slot 1.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p class="info">Le <strong>Y</strong> de la clé se met à clignoter , il suffit de poser son doigt sur l’emplacement du <strong>Y</strong> pour le déverrouillage</p>
|
|||
|
|
|||
|
<p>Retirer la première clé et répéter l’opération ci-dessus pour les autres clés</p>
|
|||
|
|
|||
|
<h4 id="enroler-une-passphrase-de-recouvrement-option">Enroler une passphrase de recouvrement (OPTION)</h4>
|
|||
|
|
|||
|
<p>Les jetons et puces de sécurité FIDO2, PKCS#11 et TPM2 s’associent bien avec les clés de recouvrement : puisque vous n’avez plus besoin de taper votre mot de passe tous les jours, il est logique de vous en débarrasser et d’enregistrer à la place une clé de recouvrement à forte entropie que vous imprimez ou scannez hors écran et conservez dans un endroit physique sûr.<br />
|
|||
|
Voici comment procéder :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemd-cryptenroll --recovery-key /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>🔐 Please enter current passphrase for disk /dev/nvme0n1p2: ***********
|
|||
|
A secret recovery key has been generated for this volume:
|
|||
|
|
|||
|
🔐 vbcrnbjn-vkrkihte-rctbufne-nlihihjl-tegudteu-rkjthcgd-hvhuvgik-rugeregh
|
|||
|
|
|||
|
Please save this secret recovery key at a secure location. It may be used to
|
|||
|
regain access to the volume if the other configured access credentials have
|
|||
|
been lost or forgotten. The recovery key may be entered in place of a password
|
|||
|
whenever authentication is requested.
|
|||
|
New recovery key enrolled as key slot 3.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Cette opération génère une clé, l’enregistre dans le volume LUKS2, l’affiche à l’écran et génère un code QR que vous pouvez scanner en dehors de l’écran si vous le souhaitez.<br />
|
|||
|
La clé possède la plus grande entropie et peut être saisie partout où vous pouvez saisir une phrase d’authentification.<br />
|
|||
|
C’est pourquoi il n’est pas nécessaire de modifier le fichier /etc/crypttab pour que la clé de récupération fonctionne.</p>
|
|||
|
|
|||
|
<h4 id="enroler-une-clé-usb-solokeys-optionnel">Enroler une clé USB SoloKeys (OPTIONNEL)</h4>
|
|||
|
|
|||
|
<p><img src="/images/solokeys.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Lister la clé</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemd-cryptenroll --fido2-device=list
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PATH MANUFACTURER PRODUCT
|
|||
|
/dev/hidraw4 SoloKeys Solo 4.1.5
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajout de la solokeys</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemd-cryptenroll --fido2-device=auto /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>🔐 Please enter current passphrase for disk /dev/nvme0n1p2: ***********
|
|||
|
Requested to lock with PIN, but FIDO2 device /dev/hidraw1 does not support it, disabling.
|
|||
|
Initializing FIDO2 credential on security token.
|
|||
|
👆 (Hint: This might require confirmation of user presence on security token.)
|
|||
|
Generating secret key on FIDO2 security token.
|
|||
|
👆 In order to allow secret key generation, please confirm presence on security token.
|
|||
|
New FIDO2 token enrolled as key slot 3.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p class="info">Lors du boot , le <strong>S</strong> de la SoloKeys passe au ROUGE et il suffit d’appuyer sur le voyant pour qu’il repasse au vert afin de lancer le processus de déchiffrement et finir le démarrage</p>
|
|||
|
|
|||
|
<h4 id="prise-en-charge-yubikey-et-solokey">Prise en charge YubiKey et SoloKey</h4>
|
|||
|
|
|||
|
<p>Les options timeout de <a href="https://www.man7.org/linux/man-pages/man5/crypttab.5.html">crypttab</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>timeout=
|
|||
|
Spécifie le délai d'attente pour la demande d'un mot de passe. Si aucune unité
|
|||
|
n'est spécifiée, l'unité utilisée est la seconde. Les unités prises en charge sont s, ms, us,
|
|||
|
min, h, d. Un délai de 0 permet d'attendre indéfiniment (valeur par défaut).
|
|||
|
|
|||
|
token-timeout=
|
|||
|
Spécifie le temps d'attente maximum pour que les dispositifs de sécurité configurés (c'est-à-dire FIDO2, PKCS#11, TPM2) apparaissent.
|
|||
|
configurés (c'est-à-dire FIDO2, PKCS#11, TPM2). Prend une valeur
|
|||
|
en secondes (mais d'autres unités de temps peuvent être spécifiées,
|
|||
|
voir systemd.time(7) pour les formats supportés). La valeur par défaut est 30s.
|
|||
|
Une fois le délai spécifié écoulé, l'authentification par
|
|||
|
mot de passe est tentée. Notez que ce délai s'applique à
|
|||
|
l'attente de l'apparition du dispositif de sécurité - il ne s'applique pas
|
|||
|
ne s'applique pas à la demande de code PIN pour le dispositif (le cas échéant)
|
|||
|
ou autre. Passez 0 pour désactiver le délai et attendre indéfiniment.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Configurer /etc/crypttab pour la prise en charge des clés</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/crypttab
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># <name> <device> <password> <options>
|
|||
|
#cryptlvm UUID=5fa90f9d-ac40-4c70-8f58-730a423ce76b /crypto_keyfile.bin luks
|
|||
|
cryptlvm UUID=5fa90f9d-ac40-4c70-8f58-730a423ce76b - fido2-device=auto,token-timeout=20s
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><code class="language-plaintext highlighter-rouge">token-timeout=20s</code> –> Si aucune clé n’est connectée , le mot de passe devra être saisi après 20 secondes de délai</p>
|
|||
|
|
|||
|
<p>Sauvegarder et quitter.</p>
|
|||
|
|
|||
|
<p>Réinitialiser</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo reinstall-kernels
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><code class="language-plaintext info highlighter-rouge">Redémarrer la machine</code></p>
|
|||
|
|
|||
|
<h4 id="plymouth---processus-de-démarrage-graphique">Plymouth - Processus de démarrage graphique</h4>
|
|||
|
|
|||
|
<p><a href="/2023/10/14/Plymouth_Processus_de_demarrage_graphique.html">Plymouth - Processus de démarrage graphique</a></p>
|
|||
|
|
|||
|
<h3 id="installation-paquets">Installation Paquets</h3>
|
|||
|
|
|||
|
<p>On commence par tout ce qui est graphique : gimp, cups (gestion de l’imprimante) et hplip (si vous avez une imprimante scanner Hewlett Packard). Le paquet python-pyqt5 est indispensable pour l’interface graphique de HPLIP+scan. Webkigtk2 étant indispensable pour la lecture de l’aide en ligne de Gimp. outil rsync, Retext éditeur markdown, firefox fr, thunderbird, libreoffice, gdisk, bluefish, <strong>Double Commander</strong> , <strong>Menulibre</strong> pour la gestion des menus , outils android clementine</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay <span class="nt">-S</span> cups system-config-printer gimp hplip libreoffice-fresh-fr thunderbird-i18n-fr jq figlet p7zip tmux calibre retext bluefish gedit doublecmd-gtk2 terminator filezilla minicom zenity android-tools yt-dlp qrencode zbar xclip nmap jre-openjdk-headless openbsd-netcat borg xterm gparted tigervnc xournalpp qbittorrent ldns strawberry
|
|||
|
|
|||
|
<span class="c"># Autres avec compilation</span>
|
|||
|
yay <span class="nt">-S</span> freetube-bin signal-desktop xsane
|
|||
|
|
|||
|
<span class="c"># Gestion des menus du bureau, construction du paquet avant installation</span>
|
|||
|
yay <span class="nt">-S</span> menulibre
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><strong>System-config-printer</strong> est une interface graphique écrite en Python et qui utilise Gtk+ pour configurer un serveur CUPS. Son but premier est de configurer le système d’impression sur l’hôte local, mais il peut également configurer une imprimante distante.</li>
|
|||
|
<li><strong>HPLIP</strong> est un ensemble de pilotes pour l’impression sous GNU / Linux des imprimantes Hewlett Packard.</li>
|
|||
|
<li><strong>FIGlet</strong> est un logiciel qui crée des bannières textuelles dans différentes polices d’écriture</li>
|
|||
|
<li><strong>Jq</strong> est un programme qui permet de filtrer, découper, transformer et grouper des données JSON facilement.</li>
|
|||
|
<li><strong>p7zip</strong> est le portage en ligne de commande Unix de 7-Zip, un archiveur de fichier qui compresse avec des gros ratios de compression.</li>
|
|||
|
<li><strong>Tmux</strong> est un outil qui permet d’exploiter plusieurs terminaux au sein d’un seul affichage.</li>
|
|||
|
<li><strong>calibre</strong> est un logiciel gratuit et open source qui vous permet de gérer, convertir et synchroniser vos livres numériques.</li>
|
|||
|
<li><strong>ReText</strong> est multiplateforme et écrit en Python. Il permet d’éditer des documents au balisage léger, en particulier le Markdown, et peut afficher le rendu HTML, en écran partagé</li>
|
|||
|
<li><strong>Bluefish</strong> est un éditeur de texte dédié à la programmation informatique. Il se distingue notamment par ses nombreux outils et par la longue liste de langages de développement compatibles.</li>
|
|||
|
<li><strong>Double Commander</strong> est un gestionnaire de fichiers multiplateforme au source ouvert avec deux panneaux côte à côte.</li>
|
|||
|
<li><strong>Terminator</strong> est un terminal virtuel qui a la particularité de permettre de partager la fenêtre selon vos envies et ainsi organiser plus simplement vos différentes fenêtres.</li>
|
|||
|
<li><strong>FileZilla</strong> est un logiciel qui vous permet de transférer des fichiers entre votre ordinateur et un serveur distant. Il est compatible avec Windows, Mac, Linux et les protocoles FTP, FTPS et SFTP.</li>
|
|||
|
<li><strong>Minicom</strong> est un programme de contrôle de modem et d’émulation de terminal pour les Unix-like. Il permet de configurer des équipements réseaux via leur port console, comme les routeurs Cisco.</li>
|
|||
|
<li><strong>Zenity</strong> est un outil qui permet d’afficher des boîtes de dialogue GTK+ depuis la ligne de commandes ou au travers de scripts shell</li>
|
|||
|
<li><strong>Android SDK Platform-Tools</strong> (ADB) est l’outil officiel de Google qui permet d’utiliser les commandes ADB sur les appareils Android.</li>
|
|||
|
<li><strong>yt-dlp</strong>, script écrit en Python, est un logiciel open source qui permet de télécharger des vidéos à partir de plusieurs sites de partage de vidéos, notamment YouTube</li>
|
|||
|
<li><strong>Qrencode</strong> est une bibliothèque rapide et compacte pour l’encodage de données en QR Code, un symbole 2D qui peut être scanné par un téléphone portable</li>
|
|||
|
<li><strong>ZBar</strong> est un logiciel de lecture de codes-barres à partir de diverses sources, telles que les flux vidéo, les fichiers d’images et les capteurs d’intensité brute. Il prend en charge de nombreuses symbologies courantes, dispose d’une mise en œuvre souple et en couches et d’un code de petite taille, et convient à une utilisation embarquée.</li>
|
|||
|
<li><strong>Xournal</strong> est un outil open source permettant d’annoter des fichiers PDF. Il prend en charge la saisie au stylo, à la souris et au clavier. Il est couramment utilisé, avec Xournal++, pour ajouter des annotations et des signatures électroniques aux fichiers PDF, en particulier sur les ordinateurs de bureau Linux.</li>
|
|||
|
<li><strong>TigerVNC</strong> (de l’anglais, « Tiger Virtual Network Computing ») est un système pour le partage de bureau graphique vous permettant de contrôler d’autres ordinateurs à distance.</li>
|
|||
|
<li><strong>Borg Backup</strong> (Borg en abrégé) est un programme de sauvegarde incrémentielle en ligne de commande.</li>
|
|||
|
<li><strong>qBittorrent</strong> est un client Bittorrent gratuit et fiable qui vous permet de télécharger et de partager des fichiers via le protocole BitTorrent</li>
|
|||
|
<li><strong>Xclip</strong> Cette application permet d’utiliser le presse-papier en ligne de commande. Elle permet notamment de rediriger la sortie standard d’une commande directement vers le presse-papier, afin de pouvoir s’en servir immédiatement.</li>
|
|||
|
<li><strong>ldns</strong> est une bibliothèque DNS rapide avec le but de simplifier la programmation DNS et pour permettre aux développeurs de facilement créer des programmes qui soient conformes aux RFC actuelles et aux brouillons Internet.</li>
|
|||
|
<li><strong>Nmap</strong> (« Network Mapper ») est un outil open source d’exploration réseau et d’audit de sécurité. Il a été conçu pour rapidement scanner de grands réseaux, mais il fonctionne aussi très bien sur une cible unique.</li>
|
|||
|
<li><strong>GParted</strong> est une application de gestion et d’organisation de partitions distribuée sous licence libre GPLv2. Elle permet de créer, d’effacer et de modifier les partitions de vos disques durs, clés USB, cartes SD, etc.</li>
|
|||
|
<li><strong>openbsd-netcat</strong> L’utilitaire nc (ou netcat) est utilisé pour tout ce qui concerne TCP, UDP ou les sockets du domaine UNIX. Il peut ouvrir des connexions TCP, envoyer des paquets UDP, écouter sur des ports TCP et UDP arbitraires, effectuer un balayage des ports et gérer à la fois IPv4 et IPv6.</li>
|
|||
|
<li><strong>xterm</strong> est l’émulateur de terminal standard pour l’environnement graphique X Window System. Un utilisateur peut disposer de plusieurs instances de xterm simultanément dans le même écran, chacune d’entre elles offrant des entrées/sorties indépendantes pour les processus qui s’y exécutent</li>
|
|||
|
<li><strong>Strawberry Music Player</strong> excelle par la richesse de ses fonctionnalités. Outre la lecture de musique, l’utilisateur peut créer et gérer des playlists, organiser aisément sa collection selon divers critères, et même éditer les tags des pistes audio.</li>
|
|||
|
<li><strong>FreeTube</strong> est un client privé multiplateforme qui vous permet de regarder YouTube sur votre ordinateur en toute tranquillité.</li>
|
|||
|
<li><strong>Signal</strong>, l’équivalent libre de WhatsApp. Signal est une application de messagerie similaire à WhatsApp, mais étant plus indépendante. Elle permet aux utilisateurs de se transmettre des messages, des photos, des vidéos et des documents. La transmission des messages est chiffrée de bout en bout.</li>
|
|||
|
<li><strong>XSane</strong> a été conçu pour l’acquisition d’images avec votre scanner. Vous pouvez scanner un fichier, faire une photocopie, créer un fax, créer un courriel, et enfin démarrer xSane à partir de GIMP avec un greffon spécifique.</li>
|
|||
|
<li><strong>MenuLibre</strong> est un éditeur de menu pour les environnements de bureau tels que Budgie, LXDE (Lubuntu), XFCE (Xubuntu), et également GNOME ou Unity.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<h3 id="retext">ReText</h3>
|
|||
|
|
|||
|
<p>Fichier de configuration <code class="language-plaintext highlighter-rouge">~/.config/ReText project/ReText.conf</code></p>
|
|||
|
|
|||
|
<div class="language-conf highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[<span class="n">General</span>]
|
|||
|
<span class="n">appStyleSheet</span>=/<span class="n">home</span>/<span class="n">yann</span>/.<span class="n">config</span>/<span class="n">ReText</span> <span class="n">project</span>/<span class="n">retext</span>.<span class="n">qss</span>
|
|||
|
<span class="n">defaultPreviewState</span>=<span class="n">normal</span>-<span class="n">preview</span>
|
|||
|
<span class="n">recentFileList</span>=
|
|||
|
<span class="n">styleSheet</span>=/<span class="n">home</span>/<span class="n">yann</span>/.<span class="n">config</span>/<span class="n">ReText</span> <span class="n">project</span>/<span class="n">retext</span>.<span class="n">css</span>
|
|||
|
<span class="n">useWebEngine</span>=<span class="n">true</span>
|
|||
|
<span class="n">useWebKit</span>=<span class="n">true</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les fichiers retext.css et retext.qss</p>
|
|||
|
|
|||
|
<details>
|
|||
|
<summary><b>Etendre Réduire retext.css</b></summary>
|
|||
|
|
|||
|
<figure class="highlight"><pre><code class="language-css" data-lang="css">
|
|||
|
<span class="nt">body</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-family</span><span class="p">:</span> <span class="n">Helvetica</span><span class="p">,</span> <span class="n">Arial</span><span class="p">,</span> <span class="nb">sans-serif</span><span class="p">;</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">15px</span><span class="p">;</span>
|
|||
|
<span class="nl">line-height</span><span class="p">:</span> <span class="m">1.3</span><span class="p">;</span>
|
|||
|
<span class="nl">color</span><span class="p">:</span> <span class="m">#f6e6cc</span><span class="p">;</span>
|
|||
|
<span class="nl">width</span><span class="p">:</span> <span class="m">700px</span><span class="p">;</span>
|
|||
|
<span class="nl">margin</span><span class="p">:</span> <span class="nb">auto</span><span class="p">;</span>
|
|||
|
<span class="c">/*background: #27221a;*/</span>
|
|||
|
<span class="nl">background</span><span class="p">:</span> <span class="m">#121212</span><span class="p">;</span>
|
|||
|
<span class="nl">position</span><span class="p">:</span> <span class="nb">relative</span><span class="p">;</span>
|
|||
|
<span class="nl">padding</span><span class="p">:</span> <span class="m">0</span> <span class="m">30px</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">body</span><span class="o">></span><span class="nd">:first-child</span>
|
|||
|
<span class="p">{</span>
|
|||
|
<span class="nl">margin-top</span><span class="p">:</span><span class="m">0</span><span class="cp">!important</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">img</span> <span class="p">{</span>
|
|||
|
<span class="nl">max-width</span><span class="p">:</span> <span class="m">100%</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">table</span> <span class="p">{</span>
|
|||
|
<span class="nl">width</span><span class="p">:</span> <span class="m">100%</span><span class="p">;</span>
|
|||
|
<span class="nl">border-collapse</span><span class="p">:</span> <span class="nb">collapse</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">th</span> <span class="p">{</span>
|
|||
|
<span class="nl">background-color</span><span class="p">:</span> <span class="n">rgba</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0.3</span><span class="p">);</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">table</span><span class="o">,</span> <span class="nt">th</span><span class="o">,</span> <span class="nt">td</span> <span class="p">{</span>
|
|||
|
<span class="nl">padding</span><span class="p">:</span> <span class="m">5px</span><span class="p">;</span>
|
|||
|
<span class="nl">border</span><span class="p">:</span> <span class="m">1px</span> <span class="nb">solid</span> <span class="n">rgba</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0.3</span><span class="p">);</span>
|
|||
|
<span class="nl">border-radius</span><span class="p">:</span> <span class="m">0.4em</span><span class="p">;</span>
|
|||
|
<span class="nl">-moz-border-radius</span><span class="p">:</span> <span class="m">0.4em</span><span class="p">;</span>
|
|||
|
<span class="nl">-webkit-border-radius</span><span class="p">:</span> <span class="m">0.4em</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">tr</span><span class="nd">:nth-child</span><span class="o">(</span><span class="nt">even</span><span class="o">)</span> <span class="p">{</span>
|
|||
|
<span class="nl">background-color</span><span class="p">:</span> <span class="n">rgba</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">0.3</span><span class="p">);</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">p</span><span class="o">,</span> <span class="nt">ul</span><span class="o">,</span> <span class="nt">ol</span><span class="o">,</span> <span class="nt">dl</span><span class="o">,</span> <span class="nt">table</span><span class="o">,</span> <span class="nt">pre</span> <span class="p">{</span>
|
|||
|
<span class="nl">margin-bottom</span><span class="p">:</span> <span class="m">1em</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">ul</span> <span class="p">{</span>
|
|||
|
<span class="nl">margin-left</span><span class="p">:</span> <span class="m">20px</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">a</span> <span class="p">{</span>
|
|||
|
<span class="nl">text-decoration</span><span class="p">:</span> <span class="nb">none</span><span class="p">;</span>
|
|||
|
<span class="nl">cursor</span><span class="p">:</span> <span class="nb">pointer</span><span class="p">;</span>
|
|||
|
<span class="nl">color</span><span class="p">:</span> <span class="m">#ba832c</span><span class="p">;</span>
|
|||
|
<span class="nl">font-weight</span><span class="p">:</span> <span class="nb">bold</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">a</span><span class="nd">:focus</span> <span class="p">{</span>
|
|||
|
<span class="nl">outline</span><span class="p">:</span> <span class="m">1px</span> <span class="nb">dotted</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">a</span><span class="nd">:visited</span> <span class="p">{}</span>
|
|||
|
|
|||
|
<span class="nt">a</span><span class="nd">:hover</span><span class="o">,</span> <span class="nt">a</span><span class="nd">:focus</span> <span class="p">{</span>
|
|||
|
<span class="nl">color</span><span class="p">:</span> <span class="m">#d3a459</span><span class="p">;</span>
|
|||
|
<span class="nl">text-decoration</span><span class="p">:</span> <span class="nb">none</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">a</span> <span class="o">*,</span> <span class="nt">button</span> <span class="o">*</span> <span class="p">{</span>
|
|||
|
<span class="nl">cursor</span><span class="p">:</span> <span class="nb">pointer</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">hr</span> <span class="p">{</span>
|
|||
|
<span class="nl">display</span><span class="p">:</span> <span class="nb">none</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">small</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">90%</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">input</span><span class="o">,</span> <span class="nt">select</span><span class="o">,</span> <span class="nt">button</span><span class="o">,</span> <span class="nt">textarea</span><span class="o">,</span> <span class="nt">option</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-family</span><span class="p">:</span> <span class="n">Arial</span><span class="p">,</span> <span class="s1">"Lucida Grande"</span><span class="p">,</span> <span class="s1">"Lucida Sans Unicode"</span><span class="p">,</span> <span class="n">Arial</span><span class="p">,</span> <span class="n">Verdana</span><span class="p">,</span> <span class="nb">sans-serif</span><span class="p">;</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">100%</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">button</span><span class="o">,</span> <span class="nt">label</span><span class="o">,</span> <span class="nt">select</span><span class="o">,</span> <span class="nt">option</span><span class="o">,</span> <span class="nt">input</span><span class="o">[</span><span class="nt">type</span><span class="o">=</span><span class="nt">submit</span><span class="o">]</span> <span class="p">{</span>
|
|||
|
<span class="nl">cursor</span><span class="p">:</span> <span class="nb">pointer</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">sup</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">80%</span><span class="p">;</span>
|
|||
|
<span class="nl">line-height</span><span class="p">:</span> <span class="m">1</span><span class="p">;</span>
|
|||
|
<span class="nl">vertical-align</span><span class="p">:</span> <span class="nb">super</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h1</span><span class="o">,</span> <span class="nt">h2</span><span class="o">,</span> <span class="nt">h3</span><span class="o">,</span> <span class="nt">h4</span><span class="o">,</span> <span class="nt">h5</span><span class="o">,</span> <span class="nt">h6</span> <span class="p">{</span>
|
|||
|
<span class="nl">line-height</span><span class="p">:</span> <span class="m">1.1</span><span class="p">;</span>
|
|||
|
<span class="nl">font-family</span><span class="p">:</span> <span class="n">Baskerville</span><span class="p">,</span> <span class="s1">"Goudy Old Style"</span><span class="p">,</span> <span class="s1">"Palatino"</span><span class="p">,</span> <span class="s1">"Book Antiqua"</span><span class="p">,</span> <span class="nb">serif</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h1</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">24pt</span><span class="p">;</span>
|
|||
|
<span class="nl">margin</span><span class="p">:</span> <span class="m">1em</span> <span class="m">0</span> <span class="m">0.1em</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h2</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">22pt</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h3</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">20pt</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h4</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">18pt</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h5</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">16pt</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h6</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">14pt</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">h1</span> <span class="nt">a</span><span class="o">,</span> <span class="nt">h1</span> <span class="nt">a</span><span class="nd">:hover</span> <span class="p">{</span>
|
|||
|
<span class="nl">color</span><span class="p">:</span> <span class="m">#d7af72</span><span class="p">;</span>
|
|||
|
<span class="nl">font-weight</span><span class="p">:</span> <span class="nb">normal</span><span class="p">;</span>
|
|||
|
<span class="nl">text-decoration</span><span class="p">:</span> <span class="nb">none</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nd">::selection</span> <span class="p">{</span>
|
|||
|
<span class="nl">background</span><span class="p">:</span> <span class="m">#745626</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nd">::-moz-selection</span> <span class="p">{</span>
|
|||
|
<span class="nl">background</span><span class="p">:</span> <span class="m">#745626</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">pre</span> <span class="p">{</span>
|
|||
|
<span class="nl">background</span><span class="p">:</span> <span class="m">#1B1812</span><span class="p">;</span>
|
|||
|
<span class="nl">color</span><span class="p">:</span> <span class="m">#fff</span><span class="p">;</span>
|
|||
|
<span class="nl">padding</span><span class="p">:</span> <span class="m">8px</span> <span class="m">10px</span><span class="p">;</span>
|
|||
|
<span class="nl">overflow-x</span><span class="p">:</span> <span class="nb">hidden</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
|
|||
|
<span class="nt">pre</span> <span class="nt">code</span> <span class="p">{</span>
|
|||
|
<span class="nl">font-size</span><span class="p">:</span> <span class="m">10pt</span><span class="p">;</span>
|
|||
|
<span class="p">}</span></code></pre></figure>
|
|||
|
|
|||
|
</details>
|
|||
|
|
|||
|
<p>Fichier retext.qss</p>
|
|||
|
|
|||
|
<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">QTextEdit</span> <span class="p">{</span>
|
|||
|
<span class="nl">color</span><span class="p">:</span> <span class="no">black</span><span class="p">;</span>
|
|||
|
<span class="nl">background-color</span><span class="p">:</span> <span class="no">white</span><span class="p">;</span>
|
|||
|
<span class="p">}</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="tmux">Tmux</h3>
|
|||
|
|
|||
|
<details>
|
|||
|
<summary><b>Etendre Réduire fichier de configuration "~/.tmux.conf"</b></summary>
|
|||
|
|
|||
|
|
|||
|
<figure class="highlight"><pre><code class="language-text" data-lang="text">
|
|||
|
#Configuration de tmux
|
|||
|
#Origine : http://denisrosenkranz.com
|
|||
|
#Yannick juin 2017
|
|||
|
# Copier/Coller par la souris se fait avec la touche "Shift" appuyée
|
|||
|
|
|||
|
##################################
|
|||
|
#Changements des raccourcis claviers
|
|||
|
##################################
|
|||
|
#On change Control +b par Control +x
|
|||
|
#set -g prefix C-x
|
|||
|
#unbind C-b
|
|||
|
#bind C-x send-prefix
|
|||
|
|
|||
|
#On utilise control + flèches pour naviguer entre les terminaux
|
|||
|
bind-key -n C-right next
|
|||
|
bind-key -n C-left prev
|
|||
|
|
|||
|
#on utilise alt + flèches our naviguer entre les panels
|
|||
|
bind-key -n M-left select-pane -L
|
|||
|
bind-key -n M-right select-pane -R
|
|||
|
bind-key -n M-up select-pane -U
|
|||
|
bind-key -n M-down select-pane -D
|
|||
|
|
|||
|
#On change les raccourcis pour faire du split vertical et horizontal
|
|||
|
#On utilise la touche "|" (pipe) pour faire un split vertical
|
|||
|
bind | split-window -h
|
|||
|
#Et la touche "-" pour faire un split horizontal
|
|||
|
bind - split-window -v
|
|||
|
|
|||
|
##################################
|
|||
|
#Changements pratiques
|
|||
|
##################################
|
|||
|
#On permet l'utilisation de la souris pour changer de terminal et de panel
|
|||
|
set -g mouse on
|
|||
|
|
|||
|
# Sélection zone par clic gauche souris (texte sélectionné sur fond jaune)
|
|||
|
# Après relachement du clic , le texte sélectionné est copié dans le presse-papier
|
|||
|
# Le fond jaune disparaît
|
|||
|
set-option -s set-clipboard off
|
|||
|
# For emacs copy mode bindings
|
|||
|
# Il faut installer l'utilitaire 'xclip' (sudo pacman -S xclip)
|
|||
|
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
|
|||
|
|
|||
|
#Les fenêtres commencent par 1 et non par 0
|
|||
|
set -g base-index 1
|
|||
|
|
|||
|
##################################
|
|||
|
#Changements visuels
|
|||
|
##################################
|
|||
|
#On met les panneaux non actif en gris
|
|||
|
#set -g pane-border-fg colour244
|
|||
|
#set -g pane-border-bg default
|
|||
|
|
|||
|
#On met le panneau actif en rouge
|
|||
|
#set -g pane-active-border-fg colour124
|
|||
|
#set -g pane-active-border-bg default
|
|||
|
|
|||
|
#On met la barre de status en gris
|
|||
|
set -g status-fg colour235
|
|||
|
set -g status-bg colour250
|
|||
|
#set -g status-attr dim
|
|||
|
|
|||
|
# On surligne les fenêtres actives dans la barre de status en gris foncés
|
|||
|
#set-window-option -g window-status-current-fg colour15
|
|||
|
#set-window-option -g window-status-current-bg colour0</code></pre></figure>
|
|||
|
|
|||
|
|
|||
|
</details>
|
|||
|
|
|||
|
<h3 id="minicom">Minicom</h3>
|
|||
|
|
|||
|
<p>Paramétrage de l’application terminale <strong>minicom</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> sudo minicom -s
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>Seul les paramètres à modifier sont cités</p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<p>Configuration du port série<br />
|
|||
|
<img src="/images/minicom01.png" alt="" /><br />
|
|||
|
A - Port série : <strong>/dev/ttyUSB0</strong> <br />
|
|||
|
F - Contrôle de flux matériel : <strong>Non</strong><br />
|
|||
|
<img src="/images/minicom02.png" alt="" /><br />
|
|||
|
Echap<br />
|
|||
|
Enregistrer config. sous dfl<br />
|
|||
|
<img src="/images/minicom03.png" alt="" /><br />
|
|||
|
Sortir de Minicom</p>
|
|||
|
|
|||
|
<h3 id="flameshot-copie-écran">Flameshot (copie écran)</h3>
|
|||
|
|
|||
|
<p><strong>Copie écran (flameshot)</strong><br />
|
|||
|
<strong><a href="https://github.com/lupoDharkael/flameshot">Flameshot</a></strong> c’est un peu THE TOOL pour faire des captures d’écrans</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S flameshot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Lancer l’application XFCE Flameshot et l’icône est visible dans la barre des tâches<br />
|
|||
|
<img src="/images/flameshot_e6230-1a.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<p>Paramétrage de flameshot, clic droit sur icône , Configuration <br />
|
|||
|
<img src="/images/flameshot_e6230-1b.png" alt="" width="300" /><br />
|
|||
|
Paramétrage de flameshot<br />
|
|||
|
<img src="/images/flameshot01.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<h3 id="scrpy-émulation-android">scrpy émulation android</h3>
|
|||
|
|
|||
|
<p>Utilise adb et le port USB</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S scrcpy
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="client-nextcloud">Client Nextcloud</h3>
|
|||
|
|
|||
|
<p>Installation client nextcloud</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S nextcloud-client libgnome-keyring gnome-keyring
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Démarrer le client nextcloud , après avoir renseigné l’url ,login et mot de passe pour la connexion</p>
|
|||
|
|
|||
|
<p>Trousseau de clé avec mot de passe idem connexion utilisateur</p>
|
|||
|
|
|||
|
<p>Paramétrage</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Menu → Lancer <strong>Client de synchronisation nextcloud</strong></li>
|
|||
|
<li>Adresse du serveur : <a href="https://cloud.xoyaz.xyz">https://cloud.xoyaz.xyz</a><br />
|
|||
|
<img src="/images/nextcloud_xfce01.png" alt="" width="300" /></li>
|
|||
|
<li>Nom d’utilisateur : yann</li>
|
|||
|
<li>Mot de passe : xxxxx<br />
|
|||
|
<img src="/images/nextcloud_xfce02.png" alt="" width="200" /><br />
|
|||
|
<img src="/images/nextcloud_xfce03.png" alt="" width="300" /><br />
|
|||
|
<img src="/images/nextcloud_xfce04.png" alt="" width="200" /></li>
|
|||
|
<li>Sauter les dossiers à synchroniser, Ignorer la configuration des dossiers</li>
|
|||
|
<li>Trousseau de clés = mot de passe connexion utilisateur<br />
|
|||
|
<img src="/images/nextcloud_xfce05.png" alt="" width="400" /></li>
|
|||
|
<li>Paramètres nextcloud<br />
|
|||
|
<img src="/images/e6230-nextcloud-a.png" alt="" width="400" /></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Saisir les différents dossiers à synhroniser<br />
|
|||
|
<img src="/images/e6230-nextcloud.png" alt="" width="400" /></p>
|
|||
|
|
|||
|
<p>Au prochain redémarrage, il faudra confirmer le mot de passe du trousseau</p>
|
|||
|
|
|||
|
<h3 id="gestion-mot-de-passe-keepassxc">Gestion mot de passe (keepassxc)</h3>
|
|||
|
|
|||
|
<p><img src="/images/KeePassXC.png" alt="" width="50" /><br />
|
|||
|
Ajouter une synchronisation de dossier nextcloud : /home/yann/.keepassx (local) → Home/.keepasx (serveur)</p>
|
|||
|
|
|||
|
<p>Installer keepassxc</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S keepassxc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajouter aux favoris “KeepassXC” et lancer l’application → <strong>Ouvrir une base de données existante</strong><br />
|
|||
|
Base de données –> Ouvrir une base de données (afficher les fichiers cachés) : <strong>~/.keepassx/yannick_xc.kdbx</strong> –> Ouvrir<br />
|
|||
|
<img src="/images/e6230-keepassx01.png" alt="" width="400" /></p>
|
|||
|
|
|||
|
<p><strong>Affichage → Thème</strong> : Sombre<br />
|
|||
|
<strong>Affichage → Mode compact</strong> , un redémarrage de l’application est nécessaire</p>
|
|||
|
|
|||
|
<p>Déverrouillage avec clé matérielle</p>
|
|||
|
|
|||
|
<h3 id="sshfs-facultatif">SSHFS (facultatif)</h3>
|
|||
|
|
|||
|
<p><img src="/images/sshfs-logo.png" alt="" width="50" /><br />
|
|||
|
<em>SSHFS sert à monter sur son système de fichier, un autre système de fichier distant, à travers une connexion SSH, le tout avec des droits utilisateur.</em></p>
|
|||
|
|
|||
|
<p>Installer paquet SSHFS</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S sshfs
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p class="warning">sshfs est installé par défaut sur la distribution EndeavourOS</p>
|
|||
|
|
|||
|
<p>Création des partages utilisés par sshfs (facultatif)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir -p $HOME/vps/{borgbackup,lxc,vdb,xoyaz.xyz,xoyize.xyz}
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Exemple de montage manuel<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">sshfs -oIdentityFile=<clé privée> utilisateur@domaine.tld:<dossier distant> <dossier local> -C -p <port si dfférent de 22></code></p>
|
|||
|
|
|||
|
<h3 id="gestionnaire-de-fichiers">Gestionnaire de fichiers</h3>
|
|||
|
|
|||
|
<p><em>Double Commander est un gestionnaire de fichiers open source multiplateforme avec deux panneaux côte à côte. Il s’inspire de Total Commander</em></p>
|
|||
|
|
|||
|
<p>Application GTK</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S doublecmd-gtk2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les paramètres sont stockés dans le dossier <code class="language-plaintext highlighter-rouge">~/.config/doublecmd</code></p>
|
|||
|
|
|||
|
<h3 id="thunderbird">Thunderbird</h3>
|
|||
|
|
|||
|
<p>Lancer thunderbird à l’ouverture de session xfce<br />
|
|||
|
Paramètres → Session et démarrage → Démarrage automatique d’application<br />
|
|||
|
<img src="/images/thunderbird01a.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<p>Ajouter thunderbird aux favoris et lancer</p>
|
|||
|
|
|||
|
<h3 id="bashrc-alias">bashrc alias</h3>
|
|||
|
|
|||
|
<p>Dans le fichier ~/.bashrc</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>alias
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>alias ls='ls --color=auto'
|
|||
|
alias ll='ls -lav --ignore=..' # show long listing of all except ".."
|
|||
|
alias l='ls -lav --ignore=.?*' # show long listing but no hidden dotfiles except "."
|
|||
|
alias aide='xdg-open https://static.rnmkcy.eu/aide-jekyll-text-theme.html#autres-styles'
|
|||
|
alias android='/home/yann/virtuel/KVM/bliss.sh'
|
|||
|
alias audio='yt-dlp --extract-audio --audio-format m4a --audio-quality 0 --output "~/Musique/%(title)s.%(ext)s"'
|
|||
|
alias audiomp3='yt-dlp --extract-audio --audio-format mp3 --audio-quality 0 --output "~/Musique/%(title)s.%(ext)s"'
|
|||
|
alias borglist='/home/yann/scripts/borglist.sh'
|
|||
|
alias calibreraz='adb -s CNBT80D20191101145 shell -x rm /sdcard/Document/metadata.calibre'
|
|||
|
alias certok='/home/yann/scripts/ssl-cert-check'
|
|||
|
alias compress='/home/yann/scripts/compress'
|
|||
|
alias dnsleak='/home/yann/scripts/dnsleaktest.py'
|
|||
|
alias findh='cat /home/yann/scripts/findhelp.txt'
|
|||
|
alias homer="ssh bookvm@192.168.0.225 -p 55215 -i /home/yann/.ssh/vm-debian12 '/home/bookvm/homer/remoh.py'"
|
|||
|
alias iceyanwg="sh /mnt/sharenfs/pc1/scripts/wgiceyan.sh"
|
|||
|
alias ipleak='curl https://ipv4.ipleak.net/json/'
|
|||
|
alias l='ls -lav --ignore=.?*'
|
|||
|
alias ll='ls -lav --ignore=..'
|
|||
|
alias ls='ls --color=auto'
|
|||
|
alias mediasync='/home/yann/scripts/sav-yann-media.sh'
|
|||
|
alias mediajour='/usr/bin/journalctl --no-pager -t sauvegardes --since today'
|
|||
|
alias nmapl='sudo nmap -T4 -sP 192.168.0.0/24'
|
|||
|
alias odt2html='/home/yann/scripts/_odt2html+index'
|
|||
|
alias odtprivate='/home/yann/scripts/_odt2html+index_private'
|
|||
|
alias orphelin='sudo pacman -Rsn $(pacman -Qdtq)'
|
|||
|
alias otp='/home/yann/scripts/generer-code-2fa-vers-presse-papier-toutes-les-30s.sh'
|
|||
|
alias ovh="ssh leno@192.168.0.215 -p 55215 -i /home/yann/.ssh/lenovo-ed25519 'cd /home/leno/ovh_api/; /home/leno/ovh_api/ApiOvh/bin/python domain.py xoyize.xyz cinay.eu xoyaz.xyz ouestline.xyz rnmkcy.eu yanfi.net icevps.xyz xoyize.net iceyan.xyz; cd /home/leno'"
|
|||
|
alias rename='/home/yann/scripts/remplacer-les-espaces-accents-dans-une-expression.sh'
|
|||
|
alias service='systemctl --type=service'
|
|||
|
alias sshm='/home/yann/scripts/ssh-manager.sh'
|
|||
|
alias ssl='/home/yann/scripts/ssl-cert-check'
|
|||
|
alias static='cd /home/yann/media/yannstatic; /home/yann/.rbenv/shims/bundle exec jekyll build -d /home/yann/media/yannstatic/static; cd ~'
|
|||
|
alias status='/home/yann/scripts/status.sh'
|
|||
|
alias synchro='journalctl --user -u media_yannstatic_site.service --no-pager --since today'
|
|||
|
alias toc='/home/yann/scripts/toc/toc.sh'
|
|||
|
alias tocplus='/home/yann/scripts/toc/tocplus.sh'
|
|||
|
alias tracesgpx="ssh bookvm@192.168.0.225 -p 55215 -i /home/yann/.ssh/vm-debian12 'tracesgpxnew /home/bookvm/media/osm-new/file'"
|
|||
|
alias traduc='/usr/local/bin/trans'
|
|||
|
alias vncasus='sh /home/yann/scripts/vncasus.sh'
|
|||
|
alias vncdell='sh /home/yann/scripts/vncdell.sh'
|
|||
|
alias vncmarina='sh /home/yann/scripts/vncmarina.sh'
|
|||
|
alias wgiceyan='sh /home/yann/scripts/wgiceyan.sh'
|
|||
|
alias x96='adb connect 192.168.0.22:5555'
|
|||
|
alias youtube='yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" --output "~/Vidéos/%(title)s.%(ext)s" --ignore-errors'
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>nous rechargeons le fichier pour appliquer les modifications</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>source ~/.bashrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="imprimante-et-scanner">Imprimante et scanner</h3>
|
|||
|
|
|||
|
<p>Prérequis , paquets <strong>cups cups-filters cups-pdf system-config-printer hplip installés</strong> (Pilotes HP pour DeskJet, OfficeJet, Photosmart, Business Inkjet et quelques modèles de LaserJet aussi bien qu’un certain nombre d’imprimantes Brother)…</p>
|
|||
|
|
|||
|
<p>Installer graphiquement l’imprimante<br />
|
|||
|
<img src="/images/hp7510-00.png" alt="" width="300" /><br />
|
|||
|
<img src="/images/hp7510-01.png" alt="" /><br />
|
|||
|
<img src="/images/hp7510-02.png" alt="" /></p>
|
|||
|
|
|||
|
<p class="warning"><img src="/images/hp7510-03.png" alt="" width="300" /><br />
|
|||
|
Pour contourner le problème , éditer le fichier <code class="language-plaintext highlighter-rouge">/etc/nsswitch.conf</code><br />
|
|||
|
Ajouter <code class="language-plaintext highlighter-rouge">mdns_minimal [NOTFOUND=return]</code> avant <code class="language-plaintext highlighter-rouge">resolve</code> <br />
|
|||
|
<code class="language-plaintext highlighter-rouge">hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns</code></p>
|
|||
|
|
|||
|
<p>Après correctif<br />
|
|||
|
<img src="/images/hp7510-04.png" alt="" width="300" /></p>
|
|||
|
|
|||
|
<p>Avec cups : http://localhost:631/<br />
|
|||
|
<img src="/images/hp_cups.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Installation du scanner<br />
|
|||
|
Coté logiciel il vous faudra <strong>sane</strong> et son interface graphique <strong>xsane</strong>, ainsi qu’éventuellement xsane-gimp le plugin pour gimp.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S xsane xsane-gimp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier si le scaner est reconnu : <code class="language-plaintext highlighter-rouge">sudo scanimage -L</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>device `escl:https://192.168.0.24:443' is a HP OfficeJet 7510 series [C22036] platen,adf scanner
|
|||
|
device `hpaio:/net/officejet_7510_series?ip=192.168.0.24&queue=false' is a Hewlett-Packard officejet_7510_series all-in-one
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Test scan, placer un original pour photocopie</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>scanimage --device hpaio:/net/officejet_7510_series?ip=192.168.0.24 --format=png > test.png
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="navigateur-floorp">Navigateur Floorp</h3>
|
|||
|
|
|||
|
<p><em>Floorp est un navigateur basé sur Firefox qui bloque les traceurs malveillants, offre une mise en page flexible et personnalisable, et ne collecte pas les données des utilisateurs. Découvrez ses fonctionnalités, ses thèmes, ses mises à jour et son code source ouvert.</em></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S floorp-bin
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="application-mullvad">Application Mullvad</h3>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="/2024/09/14/Mullvad-2024.html#archlinux-mullvad">Archlinux Mullvad</a></li>
|
|||
|
<li><a href="/htmldoc/Utilisation application VPN Mullvad.html">Utilisation application VPN Mullvad</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<h3 id="générateur-site-statique">Générateur site statique</h3>
|
|||
|
|
|||
|
<p><em>Ensemble d’applications basé sur ruby et jekyll qui permet la génération de site statique à partir de fichiers markdown</em></p>
|
|||
|
|
|||
|
<p>Installation sur archlinux</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S ruby ruby-erb base-devel
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour ne pas installer les paquets RubyGems (appelés gems) en tant qu’utilisateur root. A la place, mettez en place un répertoire d’installation de gem pour votre compte utilisateur.</p>
|
|||
|
|
|||
|
<p>Les commandes suivantes ajoutent des variables d’environnement à votre fichier ~/.bashrc pour configurer le chemin d’installation des gems</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'# Install Ruby Gems to ~/gems'</span> <span class="o">>></span> ~/.bashrc
|
|||
|
<span class="nb">echo</span> <span class="s1">'export GEM_HOME="$HOME/gems"'</span> <span class="o">>></span> ~/.bashrc
|
|||
|
<span class="nb">echo</span> <span class="s1">'export PATH="$HOME/gems/bin:$PATH"'</span> <span class="o">>></span> ~/.bashrc
|
|||
|
<span class="nb">source</span> ~/.bashrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Puis, installer Jekyll et Bundler</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gem install jekyll bundler
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les versions installées<br />
|
|||
|
<img src="/images/version-ruby-jekyll.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Suite installation –> <a href="/2024/07/13/Archlinux_Ruby_Jekyll_site_statique.html#yannstatic">yannstatic - générateur site statique</a></p>
|
|||
|
|
|||
|
<h3 id="ntfy">Ntfy</h3>
|
|||
|
|
|||
|
<p><em>Ntfy, qui se prononce “notify”, est un service de notification ultra léger, permettant d’envoyer des messages vers un smartphone ou un ordinateur via de simples scripts, sans besoin de compte et totalement gratuitement !</em></p>
|
|||
|
|
|||
|
<p><a href="/2024/02/22/Ntfy.html">Ntfy service de notification</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S ntfy-bin
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="freetuxtv">FreeTuxTv</h3>
|
|||
|
|
|||
|
<p><em>FreetuxTV est une application qui permet de regarder et enregistrer facilement les chaînes de télévision sous GNU/Linux et les chaînes de télévision de votre fournisseur d’accès internet.</em></p>
|
|||
|
|
|||
|
<p>En mode su</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "192.168.0.254 mafreebox.freebox.fr" >> /etc/hosts
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S freetuxtv
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Paramétrage du parefeu firewalld (<a href="https://forums.fedora-fr.org/d/59161-configuration-de-firewalld-pour-le-multicast-vlc-freebox-de-chez-free">Configuration de firewalld pour le multicast VLC freebox</a>)</p>
|
|||
|
|
|||
|
<p>Créer les services <strong>/etc/firewalld/services//mafreebox.xml</strong> et <strong>/etc/firewalld/services//vlc.xml</strong> pour firewalld</p>
|
|||
|
|
|||
|
<p><strong>mafreebox.xml</strong></p>
|
|||
|
|
|||
|
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><?xml version="1.0" encoding="utf-8"?></span>
|
|||
|
<span class="nt"><service></span>
|
|||
|
<span class="nt"><short></span>mafreebox<span class="nt"></short></span>
|
|||
|
<span class="nt"><description></span>Permission pour mafreebox et vlc<span class="nt"></description></span>
|
|||
|
<span class="nt"><port</span> <span class="na">protocol=</span><span class="s">"udp"</span> <span class="na">port=</span><span class="s">""</span><span class="nt">/></span>
|
|||
|
<span class="nt"></service></span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>vlc.xml</strong></p>
|
|||
|
|
|||
|
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><?xml version="1.0" encoding="utf-8"?></span>
|
|||
|
<span class="nt"><service></span>
|
|||
|
<span class="nt"><short></span>vlc2<span class="nt"></short></span>
|
|||
|
<span class="nt"><description></span>Permission pour mafreebox et vlc<span class="nt"></description></span>
|
|||
|
<span class="nt"><port</span> <span class="na">protocol=</span><span class="s">"udp"</span> <span class="na">port=</span><span class="s">"15947"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><destination</span> <span class="na">ipv4=</span><span class="s">"228.67.43.91"</span><span class="nt">/></span>
|
|||
|
<span class="nt"></service></span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les ajouter à la <strong>zone public</strong> pour rendre ces règles permanentes</p>
|
|||
|
|
|||
|
<p>/etc/firewalld/zones/public.xml</p>
|
|||
|
|
|||
|
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><?xml version="1.0" encoding="utf-8"?></span>
|
|||
|
<span class="nt"><zone></span>
|
|||
|
<span class="nt"><short></span>Public<span class="nt"></short></span>
|
|||
|
<span class="nt"><description></span>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.<span class="nt"></description></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"ssh"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"dhcpv6-client"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"ipp-client"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"mdns"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"ipp"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"mafreebox"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><service</span> <span class="na">name=</span><span class="s">"vlc"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><forward/></span>
|
|||
|
<span class="nt"></zone></span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Recharger le parefeu</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>firewall-cmd --reload
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h2 id="virtuel-qemu-kvm-vmm">Virtuel QEMU KVM VMM</h2>
|
|||
|
|
|||
|
<h3 id="installation-virt-manager">Installation Virt-Manager</h3>
|
|||
|
|
|||
|
<ol>
|
|||
|
<li><a href="/2023/05/31/EndeavourOS-Virt-Manager_Complete_Edition.html#installation-simplifiée">Virt-Manager Complete Edition - Installation simplifiée</a></li>
|
|||
|
<li><a href="/2023/12/17/Installer_KVM_Kernel_Virtual_Machine_sur_un_serveur.html#accés-aux-machines-virtuelles-kvm-distantes-via-virt-manager">Accés aux machines virtuelles KVM distantes via virt-manager</a></li>
|
|||
|
<li><a href="/2023/05/31/EndeavourOS-Virt-Manager_Complete_Edition.html#pont-réseau-virtuel-host-bridge">Pont réseau virtuel “host-bridge”</a><br />
|
|||
|
<img src="/images/host-bridge-br0.png" alt="" width="400" /></li>
|
|||
|
<li>Gestionnaire de machine virtuelles, activer “xml editing”<br />
|
|||
|
<img src="/images/xml-editing.png" alt="" width="400" /></li>
|
|||
|
<li>Restaurer les configurations de VM<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">sudo cp ~/virtuel/etc-libvirt-qemu/*.xml /etc/libvirt/qemu/</code></li>
|
|||
|
</ol>
|
|||
|
|
|||
|
<p><strong>Déclarer le pont (bridge) à KVM</strong>
|
|||
|
Créer un fichier de définition de réseau au format XML : <code class="language-plaintext highlighter-rouge">nano router-tenda.xml</code></p>
|
|||
|
|
|||
|
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><network></span>
|
|||
|
<span class="nt"><name></span>router-tenda<span class="nt"></name></span>
|
|||
|
<span class="nt"><forward</span> <span class="na">mode=</span><span class="s">"bridge"</span><span class="nt">/></span>
|
|||
|
<span class="nt"><bridge</span> <span class="na">name=</span><span class="s">"bridge0"</span> <span class="nt">/></span>
|
|||
|
<span class="nt"></network></span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Appliquer la configuration :</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>virsh net-define router-tenda.xml <span class="c"># -> Réseau host-tenda défini depuis router-tenda.xml</span>
|
|||
|
<span class="nb">sudo </span>virsh net-start router-tenda <span class="c"># -> Réseau router-tenda démarré</span>
|
|||
|
<span class="nb">sudo </span>virsh net-autostart router-tenda <span class="c"># -> Réseau router-tenda marqué en démarrage automatique</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérification</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo virsh net-list --all
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> Nom État Démarrage automatique Persistant
|
|||
|
-------------------------------------------------------------
|
|||
|
router-tenda actif oui oui
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>La structure libvirt</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Les configurations xml
|
|||
|
[root@pc1 yann]# tree -L 2 /etc/libvirt/qemu
|
|||
|
/etc/libvirt/qemu
|
|||
|
├── autostart
|
|||
|
│ └── vm-debian12.xml -> /etc/libvirt/qemu/vm-debian12.xml
|
|||
|
├── EndeavourOS.xml
|
|||
|
├── networks
|
|||
|
│ ├── autostart
|
|||
|
│ ├── default.xml
|
|||
|
│ └── router-tenda.xml
|
|||
|
└── win11.xml
|
|||
|
|
|||
|
# les images sous KVM
|
|||
|
[yann@pc1 ~]$ tree -L 2 ~/virtuel/
|
|||
|
/home/yann/virtuel/
|
|||
|
├── eos
|
|||
|
│ └── eos-chiffre_luks_backup.bin
|
|||
|
├── KVM
|
|||
|
│ ├── eos-lvm-luks-1.qcow2
|
|||
|
│ └── wineleven.qcow2
|
|||
|
├── KVM_SAV
|
|||
|
│ ├── etc-libvirt-qemu
|
|||
|
│ └── images_qcow2
|
|||
|
└── nspawn
|
|||
|
└── nspbullseye
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h2 id="développement">Développement</h2>
|
|||
|
|
|||
|
<h3 id="wing-personal-python-ide">Wing personal python IDE</h3>
|
|||
|
|
|||
|
<p><strong>Wing personal python IDE</strong> → <a href="https://wingware.com/downloads/wing-personal">Téléchargement</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Décompression de la version téléchargée
|
|||
|
tar xjvf wing-personal-10.0.6.0-linux-x64.tar.bz2
|
|||
|
# Passage en root
|
|||
|
sudo -s
|
|||
|
# Lancement procédure installation
|
|||
|
cd wing-personal-10.0.6.0-linux-x64
|
|||
|
./wing-install.py
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Déroulement de la commande</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Where do you want to install the support files for Wing Personal (default
|
|||
|
= /usr/local/lib/wing-personal9)?
|
|||
|
/usr/local/lib/wing-personal9 does not exist, create it (y/N)? y
|
|||
|
Where do you want to install links to the Wing Personal startup scripts
|
|||
|
(default = /usr/local/bin)?
|
|||
|
[...]
|
|||
|
Writing file-list.txt
|
|||
|
Icon/menu install returned err=0
|
|||
|
Done installing. Make sure that /usr/local/bin is in your path and type
|
|||
|
"wing-personal9" to start Wing Personal.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Effacer les fichiers</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Suppression dossier et fichier
|
|||
|
cd ..
|
|||
|
rm -rf wing-personal*
|
|||
|
# sortie root
|
|||
|
exit
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="go-et-nodejs">Go et NodeJS</h3>
|
|||
|
|
|||
|
<p>Archlinux Go</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S go
|
|||
|
go version
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>go version go1.23.2 linux/amd64</em></p>
|
|||
|
|
|||
|
<p>Archlinux Node.js npm</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S nodejs npm
|
|||
|
node --version && npm --version
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>v22.9.0</em><br />
|
|||
|
<em>10.8.3</em></p>
|
|||
|
|
|||
|
<p>NVM, également appelé « Node Version Manager », est un outil utilisé pour installer et gérer plusieurs versions de Node.js sur le système.<br />
|
|||
|
Installer la dernière version de NVM à l’aide de la commande suivante</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
|
|||
|
source ~/.bashrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvm --version
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>0.39.2</em></p>
|
|||
|
|
|||
|
<p><strong>Installer Node.js avec NVM</strong><br />
|
|||
|
Pour lister toutes les versions disponibles Node.js</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvm list-remote
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vous obtiendrez une liste de toutes les versions</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> v20.17.0 (LTS: Iron)
|
|||
|
v20.18.0 (Latest LTS: Iron)
|
|||
|
v22.2.0
|
|||
|
v22.3.0
|
|||
|
v22.4.0
|
|||
|
v22.4.1
|
|||
|
v22.5.0
|
|||
|
v22.5.1
|
|||
|
v22.6.0
|
|||
|
v22.7.0
|
|||
|
v22.8.0
|
|||
|
v22.9.0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour installer la dernière version de Node.js<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">nvm install node</code></p>
|
|||
|
|
|||
|
<p>Pour installer la dernière version stable de Node.js<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">nvm install --lts</code></p>
|
|||
|
|
|||
|
<p>Pour installer une version spécifique de Node.js<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">nvm install 18.10.0</code></p>
|
|||
|
|
|||
|
<p>Pour lister toutes les versions installées de Node.js<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">nvm ls</code></p>
|
|||
|
|
|||
|
<p>Pour modifier la version Node.js par défaut à 19.0.0<br />
|
|||
|
<code class="language-plaintext highlighter-rouge">nvm utilisation 19.0.0</code></p>
|
|||
|
|
|||
|
<h3 id="dbeaver">Dbeaver</h3>
|
|||
|
|
|||
|
<p><em>DBeaver est basé sur le framework Eclipse, il est open source et il supporte plusieurs types de serveurs de bases de données comme : MySQL, SQLite, DB2, PostgreSQL, Oracle…</em></p>
|
|||
|
|
|||
|
<p>Version java si installé : <code class="language-plaintext highlighter-rouge">java --version</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>openjdk 22.0.2 2024-07-16
|
|||
|
OpenJDK Runtime Environment (build 22.0.2+9)
|
|||
|
OpenJDK 64-Bit Server VM (build 22.0.2+9, mixed mode, sharing)
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S dbeaver
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sync Explicit (1): dbeaver-24.2.1-1
|
|||
|
résolution des dépendances…
|
|||
|
:: Il y a 6 fournisseurs disponibles pour java-runtime>=17 :
|
|||
|
:: Dépôt extra
|
|||
|
1) jdk-openjdk 2) jdk17-openjdk 3) jdk21-openjdk 4) jre-openjdk 5) jre17-openjdk 6) jre21-openjdk
|
|||
|
|
|||
|
Entrer un nombre (par défaut, 1 est sélectionné): 4
|
|||
|
recherche des conflits entre paquets…
|
|||
|
:: jre-openjdk - 22.0.2.u9-1 et jre-openjdk-headless - 22.0.2.u9-1 sont en conflit. Supprimer jre-openjdk-headless ? [o/N] o
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="mariadb">MariaDB</h3>
|
|||
|
|
|||
|
<p><a href="/2019/02/09/MariaDB-sur-Debian-Stretch.html#archlinux">MariaDB archlinux</a></p>
|
|||
|
|
|||
|
<p>Résumé des commandes en mode su</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-S</span> mariadb
|
|||
|
mysql_install_db <span class="nt">--user</span><span class="o">=</span>mysql <span class="nt">--basedir</span><span class="o">=</span>/usr <span class="nt">--datadir</span><span class="o">=</span>/var/lib/mysql
|
|||
|
systemctl <span class="nb">enable </span>mariadb <span class="nt">--now</span>
|
|||
|
systemctl status <span class="nt">--no-pager</span> <span class="nt">--full</span> mariadb <span class="nt">--full</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sécuriser</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mysql_secure_installation
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="postgresql">PostgreSQL</h3>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="https://linuxgenie.net/install-postgresql-psql-arch-linux/">How to Install PostgreSQL (psql) on Arch Linux</a></li>
|
|||
|
<li><a href="https://www.postgresqltutorial.com/postgresql-cheat-sheet/">PostgreSQL Cheat Sheet</a></li>
|
|||
|
<li><a href="https://public.dalibo.com/exports/formation/manuels/modules/i1/i1.handout.html">Sauvegarde et restauration</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Installation sur archlinux
|
|||
|
yay -S postgresql</p>
|
|||
|
|
|||
|
<p>Relever version <code class="language-plaintext highlighter-rouge">postgres --version</code><br />
|
|||
|
<em>postgres (PostgreSQL) 16.3</em></p>
|
|||
|
|
|||
|
<p><strong>Configurer le serveur PostgreSQL</strong></p>
|
|||
|
|
|||
|
<p>Pour configurer le serveur PostgreSQL sur Arch Linux, vous devez installer le paquetage Postgresql. Ensuite, vous pouvez démarrer le service en initialisant le cluster de base de données. Vous pouvez définir un mot de passe pour le super-utilisateur et créer des bases de données et des tables.<br />
|
|||
|
Comme nous avons déjà installé PostgreSQL, nous devons maintenant le configurer. Pour cela, passez d’abord à l’utilisateur Postgres avec cette commande :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -iu postgres
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Prompt : <code class="language-plaintext highlighter-rouge">[postgres@pc1 ~]$</code></p>
|
|||
|
|
|||
|
<p>initialiser le répertoire pour les données.<br />
|
|||
|
PostgreSQL stockera ses données dans ce répertoire. Vous pouvez utiliser l’emplacement par défaut <code class="language-plaintext highlighter-rouge">/var/lib/postgres/data</code> ou en choisir un autre.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/'
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><img src="/images/postgresql01.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Démarrer et activer PostgreSQL</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable postgresql --now
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier : <code class="language-plaintext highlighter-rouge">systemctl status postgresql</code><br />
|
|||
|
<img src="/images/postgresql03.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Pour accéder</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>psql -U postgres
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour importer une base SQL</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Créer une base
|
|||
|
psql -U postgres -c "CREATE DATABASE ttrss"
|
|||
|
# Importer
|
|||
|
psql -U postgres ttrss < nom_fichier.sql
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>OPTIONS</strong><br />
|
|||
|
Vous pouvez également activer les sommes de contrôle des données pour renforcer l’intégrité des données en ajoutant l’argument <code class="language-plaintext highlighter-rouge">--data-checksums</code> à la commande précédente. Pour savoir si les sommes de contrôle des données sont activées, exécutez la commande suivante :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -iu postgres
|
|||
|
psql --tuples-only -c "SHOW data_checksums"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><img src="/images/postgresql02.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Pour initialiser le répertoire de données avec les sommes de contrôle activées</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data/' --data-checksums
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Cela créera un nouveau répertoire de données dans <code class="language-plaintext highlighter-rouge">/var/lib/postgres/data/</code> avec la locale et l’encodage spécifiés. De plus, il effectue une vérification de la somme de contrôle des données pour chaque page écrite sur le disque. Cela permet de détecter les corruptions de données causées par un matériel défectueux.</p>
|
|||
|
|
|||
|
<p>Vous pouvez également modifier les méthodes d’authentification pour les connexions locales et distantes en ajoutant l’argument ci-dessous à la commande précédente :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>--auth-local=peer --auth-host=scram-sha-256
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>La méthode par défaut est la confiance, ce qui signifie que n’importe qui sur l’hôte peut se connecter en tant qu’utilisateur de la base de données. Cette méthode n’étant pas très sûre, vous pouvez en utiliser une autre.</p>
|
|||
|
|
|||
|
<h2 id="maintenance">Maintenance</h2>
|
|||
|
|
|||
|
<h3 id="sauvegardes-locales">Sauvegardes locales</h3>
|
|||
|
|
|||
|
<p><a href="/2021/05/28/Sauvegardes_locales_avec_systemd_utilisateur_service_et_timer.html">Sauvegardes locales avec systemd utilisateur service et timer</a></p>
|
|||
|
|
|||
|
<p>La sauvegarde démarre 3 minutes après la mise sous tension de PC1</p>
|
|||
|
|
|||
|
<p>Les logs : <code class="language-plaintext highlighter-rouge">journalctl --user -u savyann.service</code><br />
|
|||
|
Liste des timers : <code class="language-plaintext highlighter-rouge">systemctl --user list-timers --all</code></p>
|
|||
|
|
|||
|
<h3 id="pacman-hooks">Pacman Hooks</h3>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="https://github.com/endeavouros-team/PKGBUILDS/tree/master/eos-hooks">Pacman hooks for setting up certain system identification files of EndeavourOS (eos-hooks)</a></li>
|
|||
|
<li><a href="https://github.com/Strykar/pacman-hooks">Pacman hooks</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p><strong>Liste paquets installés</strong><br />
|
|||
|
<em>Ce hook sauvegardera une liste de vos paquets natifs et étrangers (AUR) installés. Cela garantit que vous aurez toujours une liste à jour de tous vos paquets que vous pourrez réinstaller.</em></p>
|
|||
|
|
|||
|
<p>Prérequis pour la création du hook et des scripts, créez des sous-répertoires</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /etc/pacman.d/{hooks,hooks.bin}
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créez le hook</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/pacman.d/hooks/50-pacman-list.hook
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#/etc/pacman.d/hooks/50-pacman-list.hook
|
|||
|
[Trigger]
|
|||
|
Type = Package
|
|||
|
Operation = Install
|
|||
|
Operation = Upgrade
|
|||
|
Operation = Remove
|
|||
|
Target = *
|
|||
|
|
|||
|
[Action]
|
|||
|
Description = Création liste des paquets installés
|
|||
|
When = PostTransaction
|
|||
|
Exec = /bin/sh -c '/usr/bin/pacman -Qqe > /mnt/sharenfs/pc1/PC1_eos_pkg_list.txt'
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour installer des paquets depuis une sauvegarde antérieure de la liste des paquets, tout en ne réinstallant pas ceux qui sont déjà installés et à jour, lancer:</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S --needed - < PC1_eos_pkg_list.txt
|
|||
|
sudo pacman -S --needed $(comm -12 <(pacman -Slq | sort) <(sort pkglist.txt))
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="changer-nvme-ou-ssd-chiffré">Changer Nvme ou SSD chiffré</h3>
|
|||
|
|
|||
|
<p>Remplacer M.2 2280 NVMe 1To par une 2To<br />
|
|||
|
<img src="/images/ssd_Fikwot_FN501_Pro.png" alt="" /></p>
|
|||
|
|
|||
|
<p>Boot sur usb live EndeavourOS</p>
|
|||
|
|
|||
|
<p>Passer en mode su</p>
|
|||
|
|
|||
|
<p>Les partitions du disque chiffré nvme0n1</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvme0n1 259:0 0 931.5G 0 disk
|
|||
|
├─nvme0n1p1 259:1 0 512M 0 part
|
|||
|
├─nvme0n1p2 259:2 0 920G 0 part
|
|||
|
│ └─crypttemp 254:3 0 920G 0 crypt
|
|||
|
│ ├─vg0-lvroot 254:4 0 70G 0 lvm
|
|||
|
│ ├─vg0-lvhome 254:5 0 120G 0 lvm
|
|||
|
│ └─vg0-lvmedia 254:6 0 600G 0 lvm
|
|||
|
└─nvme0n1p3 259:3 0 11G 0 part
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Déchiffrer la partition nvme0n1p2</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksOpen /dev/nvme0n1p2 crypttemp
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer et monter le système à sauvegarder sur /media</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> <span class="nt">-p</span> /media
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /media/home
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /media/efi
|
|||
|
mount /dev/vg0/lvroot /media
|
|||
|
mount /dev/vg0/lvhome /media/home
|
|||
|
mount /dev/nvme0n1p1 /media/efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Monter le système qui va recevoir la sauvegarde</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/vg-nas-one/sav /mnt
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/pc1
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/pc1/efi
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/pc1/home
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sauvegarder le système actuel (racine,home et efi)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rsync -avA /media/ /mnt/pc1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Patienter plusieurs minutes, suivant la taille</p>
|
|||
|
|
|||
|
<p>Arrêter la machine PC1</p>
|
|||
|
|
|||
|
<p>Remplacer la carte SSD M2<br />
|
|||
|
Redémarrer la machine sur un USB Live EndeavourOS</p>
|
|||
|
|
|||
|
<p>Zapper le nouveau disque SSD M.2</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sgdisk --zap-all /dev/nvme0n1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Partitionnement du disque NVME 2To GPT + LVM</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gdisk /dev/nvme0n1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer 2 partitions<br />
|
|||
|
Partition 1 : 512M EFI (code ef00) système de fichier FAT32<br />
|
|||
|
Partition 2 : le reste LVM (code 8e00) système de fichier EXT4</p>
|
|||
|
|
|||
|
<p>Formater partition EFI</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.fat -F32 /dev/nvme0n1p1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Chiffrer la partition /dev/nvme0n1p2</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksFormat --type luks2 /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ouvrir la partition chiffrée</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksOpen /dev/nvme0n1p2 crypt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer LVM</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pvcreate /dev/mapper/crypt
|
|||
|
vgcreate vg0 /dev/mapper/crypt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer les volumes</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lvcreate <span class="nt">-L</span> 60G vg0 <span class="nt">-n</span> lvroot <span class="c"># Logical volume "lvroot" created.</span>
|
|||
|
lvcreate <span class="nt">-L</span> 120G vg0 <span class="nt">-n</span> lvhome <span class="c"># Logical volume "lvhome" created.</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Système de fichier</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.ext4 <span class="nt">-L</span> root /dev/mapper/vg0-lvroot
|
|||
|
mkfs.ext4 <span class="nt">-L</span> home /dev/mapper/vg0-lvhome
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Monter le nouveau système sur /mnt</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/mapper/vg0-lvroot /mnt
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/home
|
|||
|
mount /dev/mapper/vg0-lvhome /mnt/home
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/efi
|
|||
|
mount /dev/nvme0n1p1 /mnt/efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Monter la sauvegarde sur media</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/vg-nas-one/sav /media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Restaurer le système</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rsync -avA /media/pc1/ /mnt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Patienter plusieurs minutes, suivant la taille</p>
|
|||
|
|
|||
|
<p>Création volume logique LVM media et montage</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lvcreate <span class="nt">-L</span> 800G vg0 <span class="nt">-n</span> lvmedia
|
|||
|
mkfs.ext4 <span class="nt">-L</span> media /dev/mapper/vg0-lvmedia
|
|||
|
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/srv/media
|
|||
|
mount /dev/vg0/lvmedia /mnt/srv/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Restaurer la sauvegarde multimedia</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rsync -avA /media/pc1_20240201/media/srv/media/ /mnt/srv/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Démonter le système de sauvegarde</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>umount /media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajouter un fichier de clé existant LUKS</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksAddKey /dev/nvme0n1p2 /mnt/crypto_keyfile.bin
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Il faut saisir le phrase mot de passe</p>
|
|||
|
|
|||
|
<p>Configuration /etc/crypttab</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup luksUUID /dev/nvme0n1p2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Renvoie UUID ae37e59d-35f7-4920-8428-be8be8d15243</p>
|
|||
|
|
|||
|
<p>Modifier /mnt/etc/crypttab</p>
|
|||
|
|
|||
|
<p>Contenu</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># <name> <device> <password> <options>
|
|||
|
cryptlvm UUID=ae37e59d-35f7-4920-8428-be8be8d15243 /crypto_keyfile.bin luks
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Passer en chroot</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>arch-chroot /mnt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Relever les UUID</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid -s UUID -o value /dev/mapper/vg0-lvroot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie l’UUID du volume racine : 2a6cab35-6c52-4382-9aee-06a376a8acc0</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid -s UUID -o value /dev/mapper/vg0-lvhome
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie l’UUID du volume d’accueil : b4e52069-a8c9-459e-b39f-6ac1b682b0d6</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid -s UUID -o value /dev/mapper/vg0-lvmedia
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie l’UUID du volume media : 1ca4bfc7-3d31-4859-aeb3-656214fab490</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid -s UUID -o value /dev/nvme0n1p1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>renvoie l’UUID du volume media : E5E4-A4AE</p>
|
|||
|
|
|||
|
<p>Configurer /etc/fstab</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/fstab
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>UUID=E5E4-A4AE /efi vfat defaults,noatime 0 2
|
|||
|
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
|
|||
|
UUID=2a6cab35-6c52-4382-9aee-06a376a8acc0 / ext4 defaults,acl,noatime,discard 0 0
|
|||
|
UUID=b4e52069-a8c9-459e-b39f-6ac1b682b0d6 /home ext4 defaults,acl,noatime,discard 0 0
|
|||
|
/swapfile none swap defaults,pri=-2 0 0
|
|||
|
|
|||
|
# /dev/mapper/vg0-lvmedia
|
|||
|
UUID=86a7c58c-8f30-42e2-bd39-d1ae7464c837 /srv/media ext4 rw,relatime 0 2
|
|||
|
|
|||
|
# /dev/mapper/ssd--512-virtuel
|
|||
|
UUID=84bc1aa9-23ac-4530-b861-bc33171b7b42 /virtuel ext4 defaults 0 2
|
|||
|
|
|||
|
# /dev/mapper/vg--nas--one-sav
|
|||
|
UUID=c5b9eefc-1daa-4a0d-8a72-6169b3c8c91f /sauvegardes ext4 defaults 0 2
|
|||
|
|
|||
|
# /dev/vg-nas-one/iso - Volume logique 200G du disque 4To
|
|||
|
UUID=58f4b6c7-3811-41d5-9964-f47ac32375f6 /iso ext4 defaults 0 2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>options du noyau</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>blkid <span class="nt">-s</span> UUID <span class="nt">-o</span> value /dev/nvme0n1p2 <span class="c"># --> ae37e59d-35f7-4920-8428-be8be8d15243</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Modifier /etc/kernel/cmdline</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/kernel/cmdline
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nvme_load=YES nowatchdog rw rd.luks.uuid=ae37e59d-35f7-4920-8428-be8be8d15243 root=/dev/mapper/vg0-lvroot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Réinstaller noyau</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>reinstall-kernels
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sortie du chroot , retirer la clé USB Live et reboot de la machine</p>
|
|||
|
|
|||
|
<h3 id="mise-à-jour--si-erreur-de-paquet-ou-signature-pgp">Mise à jour , si erreur de paquet ou signature PGP</h3>
|
|||
|
|
|||
|
<p>En cas d’erreur de paquet ou signature PGP</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S endeavouros-keyring archlinux-keyring
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><code class="language-plaintext info highlighter-rouge">Redémarrer la machine</code></p>
|
|||
|
|
|||
|
<h3 id="etat-des-lieux">Etat des lieux</h3>
|
|||
|
|
|||
|
<p>Ajouter un alias dans le fichier <code class="language-plaintext highlighter-rouge">~/.bashrc</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>alias etat='$HOME/scripts/etat_des_lieux.sh'
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Recharger et exécuter</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>source ~/.bashrc
|
|||
|
etat
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="ajout-disque-lvm">Ajout disque LVM</h3>
|
|||
|
|
|||
|
<p>Exemple disque SSD 120Go</p>
|
|||
|
|
|||
|
<p>Disque sda</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lsblk
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
|||
|
sda 8:0 0 111,8G 0 disk
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>gdisk</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo gdisk /dev/sda
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>o : nouvelle partion dos<br />
|
|||
|
n : nouvelle partition typt LVM 8e00</p>
|
|||
|
|
|||
|
<p>Format fichier ext4</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkfs.ext4 /dev/sda1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>LVM</strong> (Logical Volume Manager, ou gestionnaire de volumes logiques en français) permet la création et la gestion de volumes logiques sous Linux. L’utilisation de volumes logiques remplace en quelque sorte le partitionnement des disques.</p>
|
|||
|
|
|||
|
<p>Volume physique : <code class="language-plaintext highlighter-rouge">sudo pvcreate /dev/sda1</code><br />
|
|||
|
GroupevVolumes : <code class="language-plaintext highlighter-rouge">sudo vgcreate ssd-120 /dev/sda1</code><br />
|
|||
|
Volume logique : <code class="language-plaintext highlighter-rouge">sudo lvcreate -n lv120 -l +100%FREE ssd-120</code><br />
|
|||
|
Fichier ext4 : <code class="language-plaintext highlighter-rouge">sudo mkfs.ext4 /dev/ssd-120/lv120</code></p>
|
|||
|
|
|||
|
<p>Relever UUID <code class="language-plaintext highlighter-rouge">sudo blkid |grep lv120</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/dev/mapper/ssd--120-lv120: UUID="6b48e98c-9b85-461b-9371-040765aae682" BLOCK_SIZE="4096" TYPE="ext4"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Création point de montage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /mnt/ssd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajouter les lignes suivantes au fichier <strong>/etc/fstab</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># /dev/mapper/ssd--120-lv120
|
|||
|
UUID=6b48e98c-9b85-461b-9371-040765aae682 /mnt/ssd ext4 defaults 0 2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rechargement et montage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
|
|||
|
sudo mount -a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérification : <code class="language-plaintext highlighter-rouge">df -h /mnt/ssd/</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
|
|||
|
/dev/mapper/ssd--120-lv120 110G 2,1M 104G 1% /mnt/ssd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Droits en écriture à l’utilisateur</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo chown $USER:$USER /mnt/ssd/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="synchro-serveurs">Synchro serveurs</h3>
|
|||
|
|
|||
|
<p><strong>Dossier “BiblioCalibre”</strong></p>
|
|||
|
|
|||
|
<p class="info">Le but est de synchroniser le dossier <strong>/srv/media/BiblioCalibre</strong> avec le(s) serveur(s) web distant(s)<br />
|
|||
|
Avec les unités de chemin, vous pouvez surveiller les fichiers et les répertoires pour certains événements. Si un événement spécifique se produit, une unité de service est exécutée, et elle porte généralement le même nom que l’unité de chemin</p>
|
|||
|
|
|||
|
<p>Nous allons surveiller dans le dossier <em>/srv/media/BiblioCalibre/</em> toute modification du fichier <strong>metadata.db</strong> qui entrainera l’exécution d’un script</p>
|
|||
|
|
|||
|
<p>Dans le répertoire systemd utilisateur nous créons une unité de cheminement <strong>media_BiblioCalibre_site.path</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano ~/.config/systemd/user/media_BiblioCalibre_site.path
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Unit]</span>
|
|||
|
<span class="py">Description</span><span class="p">=</span><span class="s">Surveiller metadata.db pour les changements</span>
|
|||
|
|
|||
|
<span class="nn">[Path]</span>
|
|||
|
<span class="py">PathChanged</span><span class="p">=</span><span class="s">/srv/media/BiblioCalibre/metadata.db</span>
|
|||
|
<span class="py">Unit</span><span class="p">=</span><span class="s">media_BiblioCalibre_site.service</span>
|
|||
|
|
|||
|
<span class="nn">[Install]</span>
|
|||
|
<span class="py">WantedBy</span><span class="p">=</span><span class="s">default.target</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Dans la section <code class="language-plaintext highlighter-rouge">[Path]</code>, <code class="language-plaintext highlighter-rouge">PathChanged=</code> indique le chemin absolu du fichier à surveiller, tandis que <code class="language-plaintext highlighter-rouge">Unit=</code> indique l’unité de service à exécuter si le fichier change. Cette unité (<strong>media_BiblioCalibre_site.path</strong>) doit être lancée lorsque le système est en mode multi-utilisateur.</p>
|
|||
|
|
|||
|
<p>Ensuite, nous créons l’unité de service correspondante, <strong>media_BiblioCalibre_site.service</strong>, dans le répertoire <code class="language-plaintext highlighter-rouge">~/.config/systemd/user/</code> <br />
|
|||
|
Si le fichier <strong>metadata.db</strong> change (c’est-à-dire qu’il est à la fois écrit et fermé), l’unité de service suivante sera appelée pour exécuter le script spécifié :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano ~/.config/systemd/user/media_BiblioCalibre_site.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Unit]</span>
|
|||
|
<span class="py">Description</span><span class="p">=</span><span class="s">"Exécute le script si metadata.db a été modifié."</span>
|
|||
|
|
|||
|
<span class="nn">[Service]</span>
|
|||
|
<span class="py">ExecStart</span><span class="p">=</span><span class="s">/mnt/sharenfs/scripts/media_BiblioCalibre_site.sh</span>
|
|||
|
|
|||
|
<span class="nn">[Install]</span>
|
|||
|
<span class="py">WantedBy</span><span class="p">=</span><span class="s">default.target</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Le script <code class="language-plaintext highlighter-rouge">media_BiblioCalibre_site.sh</code> lance une synchronisation locale distante via rsync ssh</p>
|
|||
|
<details>
|
|||
|
<summary><b>Etendre Réduire media_BiblioCalibre_site.sh</b></summary>
|
|||
|
|
|||
|
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c">#!/bin/bash</span>
|
|||
|
|
|||
|
<span class="c">#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span>
|
|||
|
<span class="c"># Modification mode rsync suivant serveur distant</span>
|
|||
|
<span class="c">#</span>
|
|||
|
<span class="c"># Chaque modification du fichier metadata.db dans le dossier local /srv/media/BiblioCalibre </span>
|
|||
|
<span class="c"># déclenche une synchronisation du dossier local avec le dossier distant '/sharenfs/multimedia/eBook/BiblioCalibre' </span>
|
|||
|
<span class="c"># des serveurs VPS Yunohost</span>
|
|||
|
<span class="c"># le dossier local est également sauvegardé dans le dossier 'backup/datayan/static' de la boîte de stockage</span>
|
|||
|
<span class="c">#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</span>
|
|||
|
|
|||
|
<span class="c"># Fonction pour tester si le serveur est présent</span>
|
|||
|
<span class="c"># Host=$1 et Port=$2</span>
|
|||
|
<span class="c"># Réponse $?=0 -> OK $?=1 -> NOK</span>
|
|||
|
host_ok <span class="o">()</span> <span class="o">{</span>
|
|||
|
nc <span class="nt">-4</span> <span class="nt">-d</span> <span class="nt">-z</span> <span class="nt">-w</span> 1 <span class="nv">$1</span> <span class="nv">$2</span> &> /dev/null
|
|||
|
<span class="o">}</span>
|
|||
|
|
|||
|
synchro <span class="o">()</span> <span class="o">{</span>
|
|||
|
<span class="c"># Synchronisation locale distante du dossier _site</span>
|
|||
|
host_ok <span class="nv">$SERVER</span> <span class="nv">$PORT</span>
|
|||
|
<span class="k">if</span> <span class="o">[[</span> <span class="nv">$?</span> <span class="o">==</span> 0 <span class="o">]]</span>
|
|||
|
<span class="k">then
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</span><span class="nb">echo</span> <span class="s1">'rsync -avz --progress --stats --human-readable --delete -e "ssh -p '</span><span class="nv">$PORT</span><span class="s1">' -i '</span><span class="nv">$PRIVKEY</span><span class="s1">'" '</span><span class="nv">$REPLOC</span><span class="s1">' '</span><span class="nv">$USERDIS</span><span class="s1">':'</span><span class="nv">$REPDIS</span><span class="s1">'/eBook/'</span>
|
|||
|
rsync <span class="nt">-avz</span> <span class="nt">--progress</span> <span class="nt">--stats</span> <span class="nt">--human-readable</span> <span class="nt">--delete</span> <span class="nt">--rsync-path</span><span class="o">=</span><span class="s2">"</span><span class="nv">$RSYNCMOD</span><span class="s2">"</span> <span class="nt">-e</span> <span class="s2">"ssh -p </span><span class="nv">$PORT</span><span class="s2"> -i </span><span class="nv">$PRIVKEY</span><span class="s2">"</span> <span class="nv">$REPLOC</span> <span class="nv">$USERDIS</span>:<span class="nv">$REPDIS</span>/eBook/ <span class="o">></span> /dev/null
|
|||
|
|
|||
|
<span class="c"># Analyse résultat de la commande rsync</span>
|
|||
|
<span class="k">if</span> <span class="o">[</span> <span class="o">!</span> <span class="nv">$?</span> <span class="nt">-eq</span> 0 <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
|
|||
|
<span class="c">#echo "Synchro $REPLOC avec $SERVER -> OK" | systemd-cat -t BiblioCalibre -p info </span>
|
|||
|
<span class="c">#echo "Synchro $REPLOC avec $SERVER -> OK"</span>
|
|||
|
<span class="c">#else </span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"Synchro </span><span class="nv">$REPLOC</span><span class="s2"> avec </span><span class="nv">$SERVER</span><span class="s2"> -> ERREUR"</span> | systemd-cat <span class="nt">-t</span> BiblioCalibre <span class="nt">-p</span> emerg
|
|||
|
<span class="c">#echo "Synchro $REPLOC avec $SERVER -> ERREUR"</span>
|
|||
|
<span class="k">fi
|
|||
|
else
|
|||
|
</span><span class="nb">echo</span> <span class="s2">"Site </span><span class="nv">$SERVER</span><span class="s2"> port </span><span class="nv">$PORT</span><span class="s2"> Inaccessible !"</span> | systemd-cat <span class="nt">-t</span> BiblioCalibre <span class="nt">-p</span> emerg
|
|||
|
<span class="c">#echo "Site $SERVER port $PORT Inaccessible !"</span>
|
|||
|
<span class="k">fi</span>
|
|||
|
|
|||
|
<span class="o">}</span>
|
|||
|
|
|||
|
<span class="c">#*******************************************************************</span>
|
|||
|
<span class="c">#</span>
|
|||
|
<span class="c"># DEPART SCRIPT</span>
|
|||
|
<span class="c">#</span>
|
|||
|
<span class="c">#*******************************************************************</span>
|
|||
|
|
|||
|
<span class="c"># Tester la présence du fichier des serveurs distants</span>
|
|||
|
<span class="k">if</span> <span class="o">[</span> <span class="o">!</span> <span class="nt">-f</span> /home/yann/scripts/serveurs.csv <span class="o">]</span><span class="p">;</span> <span class="k">then
|
|||
|
</span><span class="nb">echo</span> <span class="s2">"Fichier serveurs.csv inexistant!"</span> | systemd-cat <span class="nt">-t</span> BiblioCalibre <span class="nt">-p</span> emerg
|
|||
|
<span class="nb">exit </span>1
|
|||
|
<span class="k">fi</span>
|
|||
|
|
|||
|
<span class="c"># Mesure temps exécution</span>
|
|||
|
<span class="nv">begin</span><span class="o">=</span><span class="si">$(</span><span class="nb">date</span> +<span class="s2">"%s"</span><span class="si">)</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"***DEPART*** Exécution script </span><span class="nv">$0</span><span class="s2">"</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"***DEPART*** Exécution script </span><span class="nv">$0</span><span class="s2">"</span> | systemd-cat <span class="nt">-t</span> BiblioCalibre <span class="nt">-p</span> info
|
|||
|
<span class="c">#echo "Exécution script $0"</span>
|
|||
|
|
|||
|
<span class="c"># Dossier local</span>
|
|||
|
<span class="nv">REPLOC</span><span class="o">=</span><span class="s2">"/srv/media/BiblioCalibre"</span>
|
|||
|
|
|||
|
<span class="c"># Synchro serveurs</span>
|
|||
|
<span class="k">while </span><span class="nv">IFS</span><span class="o">=</span><span class="s2">","</span> <span class="nb">read</span> <span class="nt">-r</span> SERVER REPDIS USERDIS PORT PRIVKEY RSYNCMOD LOCAL
|
|||
|
<span class="k">do</span>
|
|||
|
<span class="c">#echo " $SERVER $REPDIS $USERDIS $PORT $PRIVKEY $RSYNCMOD $LOCAL"</span>
|
|||
|
|
|||
|
<span class="k">if</span> <span class="o">[[</span> <span class="s2">"</span><span class="nv">$SERVER</span><span class="s2">"</span> <span class="o">=</span> <span class="s2">"rnmkcy.eu"</span> <span class="o">]]</span><span class="p">;</span> <span class="k">then
|
|||
|
</span>synchro
|
|||
|
<span class="nb">echo</span> <span class="s2">"ssh </span><span class="nv">$USERDIS</span><span class="s2"> -p </span><span class="nv">$PORT</span><span class="s2"> -i </span><span class="nv">$PRIVKEY</span><span class="s2"> 'sudo systemctl restart calibreweb'"</span>
|
|||
|
ssh <span class="nv">$USERDIS</span> <span class="nt">-p</span> <span class="nv">$PORT</span> <span class="nt">-i</span> <span class="nv">$PRIVKEY</span> <span class="s1">'sudo systemctl restart calibreweb'</span>
|
|||
|
<span class="k">fi
|
|||
|
done</span> < <<span class="o">(</span><span class="nb">tail</span> <span class="nt">-n</span> +2 /home/yann/scripts/serveurs.csv<span class="o">)</span>
|
|||
|
|
|||
|
<span class="c"># Calcul et affichage temps exécution</span>
|
|||
|
<span class="nv">termin</span><span class="o">=</span><span class="si">$(</span><span class="nb">date</span> +<span class="s2">"%s"</span><span class="si">)</span>
|
|||
|
<span class="nv">difftimelps</span><span class="o">=</span><span class="k">$((</span><span class="nv">$termin</span><span class="o">-</span><span class="nv">$begin</span><span class="k">))</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"***FIN*** </span><span class="nv">$0</span><span class="s2"> exécuté en </span><span class="k">$((</span><span class="nv">$difftimelps</span> <span class="o">/</span> <span class="m">60</span><span class="k">))</span><span class="s2"> mn </span><span class="k">$((</span><span class="nv">$difftimelps</span> <span class="o">%</span> <span class="m">60</span><span class="k">))</span><span class="s2"> s"</span> | systemd-cat <span class="nt">-t</span> BiblioCalibre <span class="nt">-p</span> info
|
|||
|
<span class="nb">echo</span> <span class="s2">"***FIN*** </span><span class="nv">$0</span><span class="s2"> exécuté en </span><span class="k">$((</span><span class="nv">$difftimelps</span> <span class="o">/</span> <span class="m">60</span><span class="k">))</span><span class="s2"> mn </span><span class="k">$((</span><span class="nv">$difftimelps</span> <span class="o">%</span> <span class="m">60</span><span class="k">))</span><span class="s2"> s"</span>
|
|||
|
|
|||
|
<span class="nb">exit </span>0</code></pre></figure>
|
|||
|
|
|||
|
</details>
|
|||
|
|
|||
|
<p>Activer et lancer</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl --user enable media_BiblioCalibre_site.path --now
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Voir le fichier journal</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl --user -f -u media_BiblioCalibre_site.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>juin 06 09:39:32 yann-pc1 systemd[1537]: Started "Exécute le script si metadata.db a été modifié.".
|
|||
|
juin 06 09:39:32 yann-pc1 media_BiblioCalibre_site.sh[11100]: ***DEPART*** Exécution script /home/yann/scripts/media_BiblioCalibre_site.sh
|
|||
|
juin 06 09:39:32 yann-pc1 media_BiblioCalibre_site.sh[11100]: rsync -avz --progress --stats --human-readable --delete -e "ssh -p 55215 -i /home/yann/.ssh/lenovo-ed25519" /srv/media/BiblioCalibre leno@192.168.0.215:/sharenfs/multimedia/Divers/
|
|||
|
juin 06 09:39:33 yann-pc1 media_BiblioCalibre_site.sh[11100]: ***FIN*** /home/yann/scripts/media_BiblioCalibre_site.sh exécuté en 0 mn 1 s
|
|||
|
juin 06 09:44:40 yann-pc1 systemd[1537]: Started "Exécute le script si metadata.db a été modifié.".
|
|||
|
juin 06 09:44:40 yann-pc1 media_BiblioCalibre_site.sh[11278]: ***DEPART*** Exécution script /home/yann/scripts/media_BiblioCalibre_site.sh
|
|||
|
juin 06 09:44:40 yann-pc1 media_BiblioCalibre_site.sh[11278]: rsync -avz --progress --stats --human-readable --delete -e "ssh -p 55215 -i /home/yann/.ssh/lenovo-ed25519" /srv/media/BiblioCalibre leno@192.168.0.215:/sharenfs/multimedia/Divers/
|
|||
|
juin 06 09:44:41 yann-pc1 media_BiblioCalibre_site.sh[11278]: ssh leno@192.168.0.215 -p 55215 -i /home/yann/.ssh/lenovo-ed25519 'sudo systemctl restart calibreweb'
|
|||
|
juin 06 09:44:42 yann-pc1 media_BiblioCalibre_site.sh[11278]: ***FIN*** /home/yann/scripts/media_BiblioCalibre_site.sh exécuté en 0 mn 2 s
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On peut créer un accès graphique sur le poste archlinux</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>~/.local/share/applications/suivi_BiblioCalibre_site.desktop
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.1
|
|||
|
Type=Application
|
|||
|
Name=Synchro BiblioCalibre
|
|||
|
Comment=synchro site rnmkcy.eu
|
|||
|
Icon=xterm-color_48x48
|
|||
|
Exec=xterm -rv -geometry 250x30+10+50 -T suivi_BiblioCalibre_site -e 'journalctl --user -u media_BiblioCalibre_site.service --no-pager; read -p "Touche Entrée pour sortir..."'
|
|||
|
Actions=
|
|||
|
Categories=Utility;
|
|||
|
Path=
|
|||
|
Terminal=false
|
|||
|
StartupNotify=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="d-print-none"><footer class="article__footer"><meta itemprop="dateModified" content="2024-10-07T00:00:00+02:00"><!-- start custom article footer snippet -->
|
|||
|
|
|||
|
<!-- end custom article footer snippet -->
|
|||
|
<!--
|
|||
|
<div align="right"><a type="application/rss+xml" href="/feed.xml" title="S'abonner"><i class="fa fa-rss fa-2x"></i></a>
|
|||
|
|
|||
|
 </div>
|
|||
|
-->
|
|||
|
</footer>
|
|||
|
<div class="article__section-navigator clearfix"><div class="previous"><span>PRÉCÉDENT</span><a href="/2024/10/01/Visualisation_et_edition_des_traces_gpx_studio.html">Moteur de routage (BRouter) + Visualisation et édition traces gpx (gpx.studio)</a></div><div class="next"><span>SUIVANT</span><a href="/2024/10/14/OSM_Python.html">Cartographie</a></div></div></div>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<script>(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
$(function() {
|
|||
|
var $this ,$scroll;
|
|||
|
var $articleContent = $('.js-article-content');
|
|||
|
var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar');
|
|||
|
var scroll = hasSidebar ? '.js-page-main' : 'html, body';
|
|||
|
$scroll = $(scroll);
|
|||
|
|
|||
|
$articleContent.find('.highlight').each(function() {
|
|||
|
$this = $(this);
|
|||
|
$this.attr('data-lang', $this.find('code').attr('data-lang'));
|
|||
|
});
|
|||
|
$articleContent.find('h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]').each(function() {
|
|||
|
$this = $(this);
|
|||
|
$this.append($('<a class="anchor d-print-none" aria-hidden="true"></a>').html('<i class="fas fa-anchor"></i>'));
|
|||
|
});
|
|||
|
$articleContent.on('click', '.anchor', function() {
|
|||
|
$scroll.scrollToAnchor('#' + $(this).parent().attr('id'), 400);
|
|||
|
});
|
|||
|
});
|
|||
|
});
|
|||
|
})();
|
|||
|
</script>
|
|||
|
|
|||
|
</div><section class="page__comments d-print-none"></section></article><!-- start custom main bottom snippet -->
|
|||
|
<!-- end custom main bottom snippet -->
|
|||
|
</div>
|
|||
|
</div></div></div></div>
|
|||
|
</div><script>(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
var $body = $('body'), $window = $(window);
|
|||
|
var $pageRoot = $('.js-page-root'), $pageMain = $('.js-page-main');
|
|||
|
var activeCount = 0;
|
|||
|
function modal(options) {
|
|||
|
var $root = this, visible, onChange, hideWhenWindowScroll = false;
|
|||
|
var scrollTop;
|
|||
|
function setOptions(options) {
|
|||
|
var _options = options || {};
|
|||
|
visible = _options.initialVisible === undefined ? false : show;
|
|||
|
onChange = _options.onChange;
|
|||
|
hideWhenWindowScroll = _options.hideWhenWindowScroll;
|
|||
|
}
|
|||
|
function init() {
|
|||
|
setState(visible);
|
|||
|
}
|
|||
|
function setState(isShow) {
|
|||
|
if (isShow === visible) {
|
|||
|
return;
|
|||
|
}
|
|||
|
visible = isShow;
|
|||
|
if (visible) {
|
|||
|
activeCount++;
|
|||
|
scrollTop = $(window).scrollTop() || $pageMain.scrollTop();
|
|||
|
$root.addClass('modal--show');
|
|||
|
$pageMain.scrollTop(scrollTop);
|
|||
|
activeCount === 1 && ($pageRoot.addClass('show-modal'), $body.addClass('of-hidden'));
|
|||
|
hideWhenWindowScroll && window.hasEvent('touchstart') && $window.on('scroll', hide);
|
|||
|
$window.on('keyup', handleKeyup);
|
|||
|
} else {
|
|||
|
activeCount > 0 && activeCount--;
|
|||
|
$root.removeClass('modal--show');
|
|||
|
$window.scrollTop(scrollTop);
|
|||
|
activeCount === 0 && ($pageRoot.removeClass('show-modal'), $body.removeClass('of-hidden'));
|
|||
|
hideWhenWindowScroll && window.hasEvent('touchstart') && $window.off('scroll', hide);
|
|||
|
$window.off('keyup', handleKeyup);
|
|||
|
}
|
|||
|
onChange && onChange(visible);
|
|||
|
}
|
|||
|
function show() {
|
|||
|
setState(true);
|
|||
|
}
|
|||
|
function hide() {
|
|||
|
setState(false);
|
|||
|
}
|
|||
|
function handleKeyup(e) {
|
|||
|
// Char Code: 27 ESC
|
|||
|
if (e.which === 27) {
|
|||
|
hide();
|
|||
|
}
|
|||
|
}
|
|||
|
setOptions(options);
|
|||
|
init();
|
|||
|
return {
|
|||
|
show: show,
|
|||
|
hide: hide,
|
|||
|
$el: $root
|
|||
|
};
|
|||
|
}
|
|||
|
$.fn.modal = modal;
|
|||
|
});
|
|||
|
})();
|
|||
|
</script><div class="modal modal--overflow page__search-modal d-print-none js-page-search-modal"><script>
|
|||
|
(function () {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
// search panel
|
|||
|
var search = (window.search || (window.search = {}));
|
|||
|
var useDefaultSearchBox = window.useDefaultSearchBox === undefined ?
|
|||
|
true : window.useDefaultSearchBox ;
|
|||
|
|
|||
|
var $searchModal = $('.js-page-search-modal');
|
|||
|
var $searchToggle = $('.js-search-toggle');
|
|||
|
var searchModal = $searchModal.modal({ onChange: handleModalChange, hideWhenWindowScroll: true });
|
|||
|
var modalVisible = false;
|
|||
|
search.searchModal = searchModal;
|
|||
|
|
|||
|
var $searchBox = null;
|
|||
|
var $searchInput = null;
|
|||
|
var $searchClear = null;
|
|||
|
|
|||
|
function getModalVisible() {
|
|||
|
return modalVisible;
|
|||
|
}
|
|||
|
search.getModalVisible = getModalVisible;
|
|||
|
|
|||
|
function handleModalChange(visible) {
|
|||
|
modalVisible = visible;
|
|||
|
if (visible) {
|
|||
|
search.onShow && search.onShow();
|
|||
|
useDefaultSearchBox && $searchInput[0] && $searchInput[0].focus();
|
|||
|
} else {
|
|||
|
search.onShow && search.onHide();
|
|||
|
useDefaultSearchBox && $searchInput[0] && $searchInput[0].blur();
|
|||
|
setTimeout(function() {
|
|||
|
useDefaultSearchBox && ($searchInput.val(''), $searchBox.removeClass('not-empty'));
|
|||
|
search.clear && search.clear();
|
|||
|
window.pageAsideAffix && window.pageAsideAffix.refresh();
|
|||
|
}, 400);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
$searchToggle.on('click', function() {
|
|||
|
modalVisible ? searchModal.hide() : searchModal.show();
|
|||
|
});
|
|||
|
// Char Code: 83 S, 191 /
|
|||
|
$(window).on('keyup', function(e) {
|
|||
|
if (!modalVisible && !window.isFormElement(e.target || e.srcElement) && (e.which === 83 || e.which === 191)) {
|
|||
|
modalVisible || searchModal.show();
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
if (useDefaultSearchBox) {
|
|||
|
$searchBox = $('.js-search-box');
|
|||
|
$searchInput = $searchBox.children('input');
|
|||
|
$searchClear = $searchBox.children('.js-icon-clear');
|
|||
|
search.getSearchInput = function() {
|
|||
|
return $searchInput.get(0);
|
|||
|
};
|
|||
|
search.getVal = function() {
|
|||
|
return $searchInput.val();
|
|||
|
};
|
|||
|
search.setVal = function(val) {
|
|||
|
$searchInput.val(val);
|
|||
|
};
|
|||
|
|
|||
|
$searchInput.on('focus', function() {
|
|||
|
$(this).addClass('focus');
|
|||
|
});
|
|||
|
$searchInput.on('blur', function() {
|
|||
|
$(this).removeClass('focus');
|
|||
|
});
|
|||
|
$searchInput.on('input', window.throttle(function() {
|
|||
|
var val = $(this).val();
|
|||
|
if (val === '' || typeof val !== 'string') {
|
|||
|
search.clear && search.clear();
|
|||
|
} else {
|
|||
|
$searchBox.addClass('not-empty');
|
|||
|
search.onInputNotEmpty && search.onInputNotEmpty(val);
|
|||
|
}
|
|||
|
}, 400));
|
|||
|
$searchClear.on('click', function() {
|
|||
|
$searchInput.val(''); $searchBox.removeClass('not-empty');
|
|||
|
search.clear && search.clear();
|
|||
|
});
|
|||
|
}
|
|||
|
});
|
|||
|
})();
|
|||
|
</script><div class="search search--dark">
|
|||
|
<div class="main">
|
|||
|
<div class="search__header">Recherche</div>
|
|||
|
<div class="search-bar">
|
|||
|
<div class="search-box js-search-box">
|
|||
|
<div class="search-box__icon-search"><i class="fas fa-search"></i></div>
|
|||
|
<input id="search-input" type="text" />
|
|||
|
<div class="search-box__icon-clear js-icon-clear">
|
|||
|
<a><i class="fas fa-times"></i></a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<button class="button button--theme-dark button--pill search__cancel js-search-toggle">
|
|||
|
Annuler</button>
|
|||
|
</div>
|
|||
|
<div id="results-container" class="search-result js-search-result"></div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<!-- Script pointing to search-script.js -->
|
|||
|
<script>/*!
|
|||
|
* Simple-Jekyll-Search
|
|||
|
* Copyright 2015-2020, Christian Fei
|
|||
|
* Licensed under the MIT License.
|
|||
|
*/
|
|||
|
|
|||
|
(function(){
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$Templater_7 = {
|
|||
|
compile: compile,
|
|||
|
setOptions: setOptions
|
|||
|
}
|
|||
|
|
|||
|
const options = {}
|
|||
|
options.pattern = /\{(.*?)\}/g
|
|||
|
options.template = ''
|
|||
|
options.middleware = function () {}
|
|||
|
|
|||
|
function setOptions (_options) {
|
|||
|
options.pattern = _options.pattern || options.pattern
|
|||
|
options.template = _options.template || options.template
|
|||
|
if (typeof _options.middleware === 'function') {
|
|||
|
options.middleware = _options.middleware
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function compile (data) {
|
|||
|
return options.template.replace(options.pattern, function (match, prop) {
|
|||
|
const value = options.middleware(prop, data[prop], options.template)
|
|||
|
if (typeof value !== 'undefined') {
|
|||
|
return value
|
|||
|
}
|
|||
|
return data[prop] || match
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
'use strict';
|
|||
|
|
|||
|
function fuzzysearch (needle, haystack) {
|
|||
|
var tlen = haystack.length;
|
|||
|
var qlen = needle.length;
|
|||
|
if (qlen > tlen) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
if (qlen === tlen) {
|
|||
|
return needle === haystack;
|
|||
|
}
|
|||
|
outer: for (var i = 0, j = 0; i < qlen; i++) {
|
|||
|
var nch = needle.charCodeAt(i);
|
|||
|
while (j < tlen) {
|
|||
|
if (haystack.charCodeAt(j++) === nch) {
|
|||
|
continue outer;
|
|||
|
}
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
var _$fuzzysearch_1 = fuzzysearch;
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
/* removed: const _$fuzzysearch_1 = require('fuzzysearch') */;
|
|||
|
|
|||
|
var _$FuzzySearchStrategy_5 = new FuzzySearchStrategy()
|
|||
|
|
|||
|
function FuzzySearchStrategy () {
|
|||
|
this.matches = function (string, crit) {
|
|||
|
return _$fuzzysearch_1(crit.toLowerCase(), string.toLowerCase())
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$LiteralSearchStrategy_6 = new LiteralSearchStrategy()
|
|||
|
|
|||
|
function LiteralSearchStrategy () {
|
|||
|
this.matches = function (str, crit) {
|
|||
|
if (!str) return false
|
|||
|
|
|||
|
str = str.trim().toLowerCase()
|
|||
|
crit = crit.trim().toLowerCase()
|
|||
|
|
|||
|
return crit.split(' ').filter(function (word) {
|
|||
|
return str.indexOf(word) >= 0
|
|||
|
}).length === crit.split(' ').length
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$Repository_4 = {
|
|||
|
put: put,
|
|||
|
clear: clear,
|
|||
|
search: search,
|
|||
|
setOptions: __setOptions_4
|
|||
|
}
|
|||
|
|
|||
|
/* removed: const _$FuzzySearchStrategy_5 = require('./SearchStrategies/FuzzySearchStrategy') */;
|
|||
|
/* removed: const _$LiteralSearchStrategy_6 = require('./SearchStrategies/LiteralSearchStrategy') */;
|
|||
|
|
|||
|
function NoSort () {
|
|||
|
return 0
|
|||
|
}
|
|||
|
|
|||
|
const data = []
|
|||
|
let opt = {}
|
|||
|
|
|||
|
opt.fuzzy = false
|
|||
|
opt.limit = 10
|
|||
|
opt.searchStrategy = opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
|
|||
|
opt.sort = NoSort
|
|||
|
opt.exclude = []
|
|||
|
|
|||
|
function put (data) {
|
|||
|
if (isObject(data)) {
|
|||
|
return addObject(data)
|
|||
|
}
|
|||
|
if (isArray(data)) {
|
|||
|
return addArray(data)
|
|||
|
}
|
|||
|
return undefined
|
|||
|
}
|
|||
|
function clear () {
|
|||
|
data.length = 0
|
|||
|
return data
|
|||
|
}
|
|||
|
|
|||
|
function isObject (obj) {
|
|||
|
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Object]'
|
|||
|
}
|
|||
|
|
|||
|
function isArray (obj) {
|
|||
|
return Boolean(obj) && Object.prototype.toString.call(obj) === '[object Array]'
|
|||
|
}
|
|||
|
|
|||
|
function addObject (_data) {
|
|||
|
data.push(_data)
|
|||
|
return data
|
|||
|
}
|
|||
|
|
|||
|
function addArray (_data) {
|
|||
|
const added = []
|
|||
|
clear()
|
|||
|
for (let i = 0, len = _data.length; i < len; i++) {
|
|||
|
if (isObject(_data[i])) {
|
|||
|
added.push(addObject(_data[i]))
|
|||
|
}
|
|||
|
}
|
|||
|
return added
|
|||
|
}
|
|||
|
|
|||
|
function search (crit) {
|
|||
|
if (!crit) {
|
|||
|
return []
|
|||
|
}
|
|||
|
return findMatches(data, crit, opt.searchStrategy, opt).sort(opt.sort)
|
|||
|
}
|
|||
|
|
|||
|
function __setOptions_4 (_opt) {
|
|||
|
opt = _opt || {}
|
|||
|
|
|||
|
opt.fuzzy = _opt.fuzzy || false
|
|||
|
opt.limit = _opt.limit || 10
|
|||
|
opt.searchStrategy = _opt.fuzzy ? _$FuzzySearchStrategy_5 : _$LiteralSearchStrategy_6
|
|||
|
opt.sort = _opt.sort || NoSort
|
|||
|
opt.exclude = _opt.exclude || []
|
|||
|
}
|
|||
|
|
|||
|
function findMatches (data, crit, strategy, opt) {
|
|||
|
const matches = []
|
|||
|
for (let i = 0; i < data.length && matches.length < opt.limit; i++) {
|
|||
|
const match = findMatchesInObject(data[i], crit, strategy, opt)
|
|||
|
if (match) {
|
|||
|
matches.push(match)
|
|||
|
}
|
|||
|
}
|
|||
|
return matches
|
|||
|
}
|
|||
|
|
|||
|
function findMatchesInObject (obj, crit, strategy, opt) {
|
|||
|
for (const key in obj) {
|
|||
|
if (!isExcluded(obj[key], opt.exclude) && strategy.matches(obj[key], crit)) {
|
|||
|
return obj
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function isExcluded (term, excludedTerms) {
|
|||
|
for (let i = 0, len = excludedTerms.length; i < len; i++) {
|
|||
|
const excludedTerm = excludedTerms[i]
|
|||
|
if (new RegExp(excludedTerm).test(term)) {
|
|||
|
return true
|
|||
|
}
|
|||
|
}
|
|||
|
return false
|
|||
|
}
|
|||
|
|
|||
|
/* globals ActiveXObject:false */
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$JSONLoader_2 = {
|
|||
|
load: load
|
|||
|
}
|
|||
|
|
|||
|
function load (location, callback) {
|
|||
|
const xhr = getXHR()
|
|||
|
xhr.open('GET', location, true)
|
|||
|
xhr.onreadystatechange = createStateChangeListener(xhr, callback)
|
|||
|
xhr.send()
|
|||
|
}
|
|||
|
|
|||
|
function createStateChangeListener (xhr, callback) {
|
|||
|
return function () {
|
|||
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|||
|
try {
|
|||
|
callback(null, JSON.parse(xhr.responseText))
|
|||
|
} catch (err) {
|
|||
|
callback(err, null)
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function getXHR () {
|
|||
|
return window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP')
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$OptionsValidator_3 = function OptionsValidator (params) {
|
|||
|
if (!validateParams(params)) {
|
|||
|
throw new Error('-- OptionsValidator: required options missing')
|
|||
|
}
|
|||
|
|
|||
|
if (!(this instanceof OptionsValidator)) {
|
|||
|
return new OptionsValidator(params)
|
|||
|
}
|
|||
|
|
|||
|
const requiredOptions = params.required
|
|||
|
|
|||
|
this.getRequiredOptions = function () {
|
|||
|
return requiredOptions
|
|||
|
}
|
|||
|
|
|||
|
this.validate = function (parameters) {
|
|||
|
const errors = []
|
|||
|
requiredOptions.forEach(function (requiredOptionName) {
|
|||
|
if (typeof parameters[requiredOptionName] === 'undefined') {
|
|||
|
errors.push(requiredOptionName)
|
|||
|
}
|
|||
|
})
|
|||
|
return errors
|
|||
|
}
|
|||
|
|
|||
|
function validateParams (params) {
|
|||
|
if (!params) {
|
|||
|
return false
|
|||
|
}
|
|||
|
return typeof params.required !== 'undefined' && params.required instanceof Array
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
'use strict'
|
|||
|
|
|||
|
var _$utils_9 = {
|
|||
|
merge: merge,
|
|||
|
isJSON: isJSON
|
|||
|
}
|
|||
|
|
|||
|
function merge (defaultParams, mergeParams) {
|
|||
|
const mergedOptions = {}
|
|||
|
for (const option in defaultParams) {
|
|||
|
mergedOptions[option] = defaultParams[option]
|
|||
|
if (typeof mergeParams[option] !== 'undefined') {
|
|||
|
mergedOptions[option] = mergeParams[option]
|
|||
|
}
|
|||
|
}
|
|||
|
return mergedOptions
|
|||
|
}
|
|||
|
|
|||
|
function isJSON (json) {
|
|||
|
try {
|
|||
|
if (json instanceof Object && JSON.parse(JSON.stringify(json))) {
|
|||
|
return true
|
|||
|
}
|
|||
|
return false
|
|||
|
} catch (err) {
|
|||
|
return false
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var _$src_8 = {};
|
|||
|
(function (window) {
|
|||
|
'use strict'
|
|||
|
|
|||
|
let options = {
|
|||
|
searchInput: null,
|
|||
|
resultsContainer: null,
|
|||
|
json: [],
|
|||
|
success: Function.prototype,
|
|||
|
searchResultTemplate: '<li><a href="{url}" title="{desc}">{title}</a></li>',
|
|||
|
templateMiddleware: Function.prototype,
|
|||
|
sortMiddleware: function () {
|
|||
|
return 0
|
|||
|
},
|
|||
|
noResultsText: 'No results found',
|
|||
|
limit: 10,
|
|||
|
fuzzy: false,
|
|||
|
debounceTime: null,
|
|||
|
exclude: []
|
|||
|
}
|
|||
|
|
|||
|
let debounceTimerHandle
|
|||
|
const debounce = function (func, delayMillis) {
|
|||
|
if (delayMillis) {
|
|||
|
clearTimeout(debounceTimerHandle)
|
|||
|
debounceTimerHandle = setTimeout(func, delayMillis)
|
|||
|
} else {
|
|||
|
func.call()
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
const requiredOptions = ['searchInput', 'resultsContainer', 'json']
|
|||
|
|
|||
|
/* removed: const _$Templater_7 = require('./Templater') */;
|
|||
|
/* removed: const _$Repository_4 = require('./Repository') */;
|
|||
|
/* removed: const _$JSONLoader_2 = require('./JSONLoader') */;
|
|||
|
const optionsValidator = _$OptionsValidator_3({
|
|||
|
required: requiredOptions
|
|||
|
})
|
|||
|
/* removed: const _$utils_9 = require('./utils') */;
|
|||
|
|
|||
|
window.SimpleJekyllSearch = function (_options) {
|
|||
|
const errors = optionsValidator.validate(_options)
|
|||
|
if (errors.length > 0) {
|
|||
|
throwError('You must specify the following required options: ' + requiredOptions)
|
|||
|
}
|
|||
|
|
|||
|
options = _$utils_9.merge(options, _options)
|
|||
|
|
|||
|
_$Templater_7.setOptions({
|
|||
|
template: options.searchResultTemplate,
|
|||
|
middleware: options.templateMiddleware
|
|||
|
})
|
|||
|
|
|||
|
_$Repository_4.setOptions({
|
|||
|
fuzzy: options.fuzzy,
|
|||
|
limit: options.limit,
|
|||
|
sort: options.sortMiddleware,
|
|||
|
exclude: options.exclude
|
|||
|
})
|
|||
|
|
|||
|
if (_$utils_9.isJSON(options.json)) {
|
|||
|
initWithJSON(options.json)
|
|||
|
} else {
|
|||
|
initWithURL(options.json)
|
|||
|
}
|
|||
|
|
|||
|
const rv = {
|
|||
|
search: search
|
|||
|
}
|
|||
|
|
|||
|
typeof options.success === 'function' && options.success.call(rv)
|
|||
|
return rv
|
|||
|
}
|
|||
|
|
|||
|
function initWithJSON (json) {
|
|||
|
_$Repository_4.put(json)
|
|||
|
registerInput()
|
|||
|
}
|
|||
|
|
|||
|
function initWithURL (url) {
|
|||
|
_$JSONLoader_2.load(url, function (err, json) {
|
|||
|
if (err) {
|
|||
|
throwError('failed to get JSON (' + url + ')')
|
|||
|
}
|
|||
|
initWithJSON(json)
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
function emptyResultsContainer () {
|
|||
|
options.resultsContainer.innerHTML = ''
|
|||
|
}
|
|||
|
|
|||
|
function appendToResultsContainer (text) {
|
|||
|
options.resultsContainer.innerHTML += text
|
|||
|
}
|
|||
|
|
|||
|
function registerInput () {
|
|||
|
options.searchInput.addEventListener('input', function (e) {
|
|||
|
if (isWhitelistedKey(e.which)) {
|
|||
|
emptyResultsContainer()
|
|||
|
debounce(function () { search(e.target.value) }, options.debounceTime)
|
|||
|
}
|
|||
|
})
|
|||
|
}
|
|||
|
|
|||
|
function search (query) {
|
|||
|
if (isValidQuery(query)) {
|
|||
|
emptyResultsContainer()
|
|||
|
render(_$Repository_4.search(query), query)
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function render (results, query) {
|
|||
|
const len = results.length
|
|||
|
if (len === 0) {
|
|||
|
return appendToResultsContainer(options.noResultsText)
|
|||
|
}
|
|||
|
for (let i = 0; i < len; i++) {
|
|||
|
results[i].query = query
|
|||
|
appendToResultsContainer(_$Templater_7.compile(results[i]))
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function isValidQuery (query) {
|
|||
|
return query && query.length > 0
|
|||
|
}
|
|||
|
|
|||
|
function isWhitelistedKey (key) {
|
|||
|
return [13, 16, 20, 37, 38, 39, 40, 91].indexOf(key) === -1
|
|||
|
}
|
|||
|
|
|||
|
function throwError (message) {
|
|||
|
throw new Error('SimpleJekyllSearch --- ' + message)
|
|||
|
}
|
|||
|
})(window)
|
|||
|
|
|||
|
}());
|
|||
|
</script>
|
|||
|
|
|||
|
<!-- Configuration -->
|
|||
|
<script>
|
|||
|
SimpleJekyllSearch({
|
|||
|
searchInput: document.getElementById('search-input'),
|
|||
|
resultsContainer: document.getElementById('results-container'),
|
|||
|
noResultsText: '<p>Aucun résultat!</p>',
|
|||
|
json: '/search.json',
|
|||
|
searchResultTemplate: '<li><a href="{url}">{date} {title}</a> (Création {create})</li>'
|
|||
|
})
|
|||
|
</script>
|
|||
|
|
|||
|
</div></div>
|
|||
|
|
|||
|
|
|||
|
<script>(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
function scrollToAnchor(anchor, duration, callback) {
|
|||
|
var $root = this;
|
|||
|
$root.animate({ scrollTop: $(anchor).position().top }, duration, function() {
|
|||
|
window.history.replaceState(null, '', window.location.href.split('#')[0] + anchor);
|
|||
|
callback && callback();
|
|||
|
});
|
|||
|
}
|
|||
|
$.fn.scrollToAnchor = scrollToAnchor;
|
|||
|
});
|
|||
|
})();
|
|||
|
(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
function affix(options) {
|
|||
|
var $root = this, $window = $(window), $scrollTarget, $scroll,
|
|||
|
offsetBottom = 0, scrollTarget = window, scroll = window.document, disabled = false, isOverallScroller = true,
|
|||
|
rootTop, rootLeft, rootHeight, scrollBottom, rootBottomTop,
|
|||
|
hasInit = false, curState;
|
|||
|
|
|||
|
function setOptions(options) {
|
|||
|
var _options = options || {};
|
|||
|
_options.offsetBottom && (offsetBottom = _options.offsetBottom);
|
|||
|
_options.scrollTarget && (scrollTarget = _options.scrollTarget);
|
|||
|
_options.scroll && (scroll = _options.scroll);
|
|||
|
_options.disabled !== undefined && (disabled = _options.disabled);
|
|||
|
$scrollTarget = $(scrollTarget);
|
|||
|
isOverallScroller = window.isOverallScroller($scrollTarget[0]);
|
|||
|
$scroll = $(scroll);
|
|||
|
}
|
|||
|
function preCalc() {
|
|||
|
top();
|
|||
|
rootHeight = $root.outerHeight();
|
|||
|
rootTop = $root.offset().top + (isOverallScroller ? 0 : $scrollTarget.scrollTop());
|
|||
|
rootLeft = $root.offset().left;
|
|||
|
}
|
|||
|
function calc(needPreCalc) {
|
|||
|
needPreCalc && preCalc();
|
|||
|
scrollBottom = $scroll.outerHeight() - offsetBottom - rootHeight;
|
|||
|
rootBottomTop = scrollBottom - rootTop;
|
|||
|
}
|
|||
|
function top() {
|
|||
|
if (curState !== 'top') {
|
|||
|
$root.removeClass('fixed').css({
|
|||
|
left: 0,
|
|||
|
top: 0
|
|||
|
});
|
|||
|
curState = 'top';
|
|||
|
}
|
|||
|
}
|
|||
|
function fixed() {
|
|||
|
if (curState !== 'fixed') {
|
|||
|
$root.addClass('fixed').css({
|
|||
|
left: rootLeft + 'px',
|
|||
|
top: 0
|
|||
|
});
|
|||
|
curState = 'fixed';
|
|||
|
}
|
|||
|
}
|
|||
|
function bottom() {
|
|||
|
if (curState !== 'bottom') {
|
|||
|
$root.removeClass('fixed').css({
|
|||
|
left: 0,
|
|||
|
top: rootBottomTop + 'px'
|
|||
|
});
|
|||
|
curState = 'bottom';
|
|||
|
}
|
|||
|
}
|
|||
|
function setState() {
|
|||
|
var scrollTop = $scrollTarget.scrollTop();
|
|||
|
if (scrollTop >= rootTop && scrollTop <= scrollBottom) {
|
|||
|
fixed();
|
|||
|
} else if (scrollTop < rootTop) {
|
|||
|
top();
|
|||
|
} else {
|
|||
|
bottom();
|
|||
|
}
|
|||
|
}
|
|||
|
function init() {
|
|||
|
if(!hasInit) {
|
|||
|
var interval, timeout;
|
|||
|
calc(true); setState();
|
|||
|
// run calc every 100 millisecond
|
|||
|
interval = setInterval(function() {
|
|||
|
calc();
|
|||
|
}, 100);
|
|||
|
timeout = setTimeout(function() {
|
|||
|
clearInterval(interval);
|
|||
|
}, 45000);
|
|||
|
window.pageLoad.then(function() {
|
|||
|
setTimeout(function() {
|
|||
|
clearInterval(interval);
|
|||
|
clearTimeout(timeout);
|
|||
|
}, 3000);
|
|||
|
});
|
|||
|
$scrollTarget.on('scroll', function() {
|
|||
|
disabled || setState();
|
|||
|
});
|
|||
|
$window.on('resize', function() {
|
|||
|
disabled || (calc(true), setState());
|
|||
|
});
|
|||
|
hasInit = true;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
setOptions(options);
|
|||
|
if (!disabled) {
|
|||
|
init();
|
|||
|
}
|
|||
|
$window.on('resize', window.throttle(function() {
|
|||
|
init();
|
|||
|
}, 200));
|
|||
|
return {
|
|||
|
setOptions: setOptions,
|
|||
|
refresh: function() {
|
|||
|
calc(true, { animation: false }); setState();
|
|||
|
}
|
|||
|
};
|
|||
|
}
|
|||
|
$.fn.affix = affix;
|
|||
|
});
|
|||
|
})();
|
|||
|
(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
function toc(options) {
|
|||
|
var $root = this, $window = $(window), $scrollTarget, $scroller, $tocUl = $('<ul class="toc toc--ellipsis"></ul>'), $tocLi, $headings, $activeLast, $activeCur,
|
|||
|
selectors = 'h1,h2,h3', container = 'body', scrollTarget = window, scroller = 'html, body', disabled = false,
|
|||
|
headingsPos, scrolling = false, hasRendered = false, hasInit = false;
|
|||
|
|
|||
|
function setOptions(options) {
|
|||
|
var _options = options || {};
|
|||
|
_options.selectors && (selectors = _options.selectors);
|
|||
|
_options.container && (container = _options.container);
|
|||
|
_options.scrollTarget && (scrollTarget = _options.scrollTarget);
|
|||
|
_options.scroller && (scroller = _options.scroller);
|
|||
|
_options.disabled !== undefined && (disabled = _options.disabled);
|
|||
|
$headings = $(container).find(selectors).filter('[id]');
|
|||
|
$scrollTarget = $(scrollTarget);
|
|||
|
$scroller = $(scroller);
|
|||
|
}
|
|||
|
function calc() {
|
|||
|
headingsPos = [];
|
|||
|
$headings.each(function() {
|
|||
|
headingsPos.push(Math.floor($(this).position().top));
|
|||
|
});
|
|||
|
}
|
|||
|
function setState(element, disabled) {
|
|||
|
var scrollTop = $scrollTarget.scrollTop(), i;
|
|||
|
if (disabled || !headingsPos || headingsPos.length < 1) { return; }
|
|||
|
if (element) {
|
|||
|
$activeCur = element;
|
|||
|
} else {
|
|||
|
for (i = 0; i < headingsPos.length; i++) {
|
|||
|
if (scrollTop >= headingsPos[i]) {
|
|||
|
$activeCur = $tocLi.eq(i);
|
|||
|
} else {
|
|||
|
$activeCur || ($activeCur = $tocLi.eq(i));
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
$activeLast && $activeLast.removeClass('active');
|
|||
|
($activeLast = $activeCur).addClass('active');
|
|||
|
}
|
|||
|
function render() {
|
|||
|
if(!hasRendered) {
|
|||
|
$root.append($tocUl);
|
|||
|
$headings.each(function() {
|
|||
|
var $this = $(this);
|
|||
|
$tocUl.append($('<li></li>').addClass('toc-' + $this.prop('tagName').toLowerCase())
|
|||
|
.append($('<a></a>').text($this.text()).attr('href', '#' + $this.prop('id'))));
|
|||
|
});
|
|||
|
$tocLi = $tocUl.children('li');
|
|||
|
$tocUl.on('click', 'a', function(e) {
|
|||
|
e.preventDefault();
|
|||
|
var $this = $(this);
|
|||
|
scrolling = true;
|
|||
|
setState($this.parent());
|
|||
|
$scroller.scrollToAnchor($this.attr('href'), 400, function() {
|
|||
|
scrolling = false;
|
|||
|
});
|
|||
|
});
|
|||
|
}
|
|||
|
hasRendered = true;
|
|||
|
}
|
|||
|
function init() {
|
|||
|
var interval, timeout;
|
|||
|
if(!hasInit) {
|
|||
|
render(); calc(); setState(null, scrolling);
|
|||
|
// run calc every 100 millisecond
|
|||
|
interval = setInterval(function() {
|
|||
|
calc();
|
|||
|
}, 100);
|
|||
|
timeout = setTimeout(function() {
|
|||
|
clearInterval(interval);
|
|||
|
}, 45000);
|
|||
|
window.pageLoad.then(function() {
|
|||
|
setTimeout(function() {
|
|||
|
clearInterval(interval);
|
|||
|
clearTimeout(timeout);
|
|||
|
}, 3000);
|
|||
|
});
|
|||
|
$scrollTarget.on('scroll', function() {
|
|||
|
disabled || setState(null, scrolling);
|
|||
|
});
|
|||
|
$window.on('resize', window.throttle(function() {
|
|||
|
if (!disabled) {
|
|||
|
render(); calc(); setState(null, scrolling);
|
|||
|
}
|
|||
|
}, 100));
|
|||
|
}
|
|||
|
hasInit = true;
|
|||
|
}
|
|||
|
|
|||
|
setOptions(options);
|
|||
|
if (!disabled) {
|
|||
|
init();
|
|||
|
}
|
|||
|
$window.on('resize', window.throttle(function() {
|
|||
|
init();
|
|||
|
}, 200));
|
|||
|
return {
|
|||
|
setOptions: setOptions
|
|||
|
};
|
|||
|
}
|
|||
|
$.fn.toc = toc;
|
|||
|
});
|
|||
|
})();
|
|||
|
/*(function () {
|
|||
|
|
|||
|
})();*/
|
|||
|
</script><script>
|
|||
|
/* toc must before affix, since affix need to konw toc' height. */(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
var TOC_SELECTOR = window.TEXT_VARIABLES.site.toc.selectors;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
var $window = $(window);
|
|||
|
var $articleContent = $('.js-article-content');
|
|||
|
var $tocRoot = $('.js-toc-root'), $col2 = $('.js-col-aside');
|
|||
|
var toc;
|
|||
|
var tocDisabled = false;
|
|||
|
var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar');
|
|||
|
var hasToc = $articleContent.find(TOC_SELECTOR).length > 0;
|
|||
|
|
|||
|
function disabled() {
|
|||
|
return $col2.css('display') === 'none' || !hasToc;
|
|||
|
}
|
|||
|
|
|||
|
tocDisabled = disabled();
|
|||
|
|
|||
|
toc = $tocRoot.toc({
|
|||
|
selectors: TOC_SELECTOR,
|
|||
|
container: $articleContent,
|
|||
|
scrollTarget: hasSidebar ? '.js-page-main' : null,
|
|||
|
scroller: hasSidebar ? '.js-page-main' : null,
|
|||
|
disabled: tocDisabled
|
|||
|
});
|
|||
|
|
|||
|
$window.on('resize', window.throttle(function() {
|
|||
|
tocDisabled = disabled();
|
|||
|
toc && toc.setOptions({
|
|||
|
disabled: tocDisabled
|
|||
|
});
|
|||
|
}, 100));
|
|||
|
|
|||
|
});
|
|||
|
})();
|
|||
|
(function() {
|
|||
|
var SOURCES = window.TEXT_VARIABLES.sources;
|
|||
|
window.Lazyload.js(SOURCES.jquery, function() {
|
|||
|
var $window = $(window), $pageFooter = $('.js-page-footer');
|
|||
|
var $pageAside = $('.js-page-aside');
|
|||
|
var affix;
|
|||
|
var tocDisabled = false;
|
|||
|
var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar');
|
|||
|
|
|||
|
affix = $pageAside.affix({
|
|||
|
offsetBottom: $pageFooter.outerHeight(),
|
|||
|
scrollTarget: hasSidebar ? '.js-page-main' : null,
|
|||
|
scroller: hasSidebar ? '.js-page-main' : null,
|
|||
|
scroll: hasSidebar ? $('.js-page-main').children() : null,
|
|||
|
disabled: tocDisabled
|
|||
|
});
|
|||
|
|
|||
|
$window.on('resize', window.throttle(function() {
|
|||
|
affix && affix.setOptions({
|
|||
|
disabled: tocDisabled
|
|||
|
});
|
|||
|
}, 100));
|
|||
|
|
|||
|
window.pageAsideAffix = affix;
|
|||
|
});
|
|||
|
})();
|
|||
|
</script><!---->
|
|||
|
|
|||
|
</div>
|
|||
|
<script>(function () {
|
|||
|
var $root = document.getElementsByClassName('root')[0];
|
|||
|
if (window.hasEvent('touchstart')) {
|
|||
|
$root.dataset.isTouch = true;
|
|||
|
document.addEventListener('touchstart', function(){}, false);
|
|||
|
}
|
|||
|
})();
|
|||
|
</script>
|
|||
|
</body>
|
|||
|
</html>
|
|||
|
|