5014 lines
346 KiB
HTML
5014 lines
346 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 Ordinateur Bureau ArchLinux xfce - NVME 1To - YannStatic</title>
|
|||
|
|
|||
|
<meta name="description" content="Description matériel mini tour PC1">
|
|||
|
<link rel="canonical" href="https://static.rnmkcy.eu/2021/03/08/PC1-ArchLinux-XFCE-ASUS_H110M_A-nvme_1To.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.516 C 137.230 220.679,138.000 221.92
|
|||
|
" 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 Ordinateur Bureau ArchLinux xfce - NVME 1To</h1></header></div>
|
|||
|
<meta itemprop="headline" content="PC1 Ordinateur Bureau ArchLinux xfce - NVME 1To">
|
|||
|
<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></ul>
|
|||
|
<ul class="right-col menu"><li>
|
|||
|
<i class="far fa-calendar-alt"></i> <span title="Création" style="color:#FF00FF"> 8 mars 2021</span>
|
|||
|
|
|||
|
<span title="Modification" style="color:#00FF7F"> 6 mai 2023</span>
|
|||
|
</li></ul>
|
|||
|
</div>
|
|||
|
<meta itemprop="datePublished" content="2023-05-06T00:00:00+02:00">
|
|||
|
<meta itemprop="keywords" content="archlinux">
|
|||
|
<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><a href="/2023/01/20/Description_materiel_minitour_PC1.html">Description matériel mini tour PC1</a></p>
|
|||
|
|
|||
|
<h2 id="archlinux-base">ArchLinux Base</h2>
|
|||
|
|
|||
|
<p><img src="/images/archlinux-logo-white-90dpi.3a3e8fd083d2.png" alt="" height="50"> <img src="/images/EndeavourOS_Logo.png" alt="" width="80"></p>
|
|||
|
|
|||
|
<p>Boot sur clé USB en UEFI contenant image ISO archlinux (format <strong>aaaa.mm.jj-dual.iso</strong>)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>loadkeys fr # en est en qwerty , il faut saisir 'loqdkeys'
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>NOTE : Il est possible de se connecter en ssh pour la suite de l’installation:</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Modifier le mot de passe root : <code class="language-plaintext highlighter-rouge">passwd</code>
|
|||
|
</li>
|
|||
|
<li>Relever l’adresse IP :<code class="language-plaintext highlighter-rouge">ip addr</code>
|
|||
|
</li>
|
|||
|
<li>Lancer sshd : <code class="language-plaintext highlighter-rouge">systemctl start sshd</code>
|
|||
|
</li>
|
|||
|
<li>Depuis le poste distant : <code class="language-plaintext highlighter-rouge">ssh root@adresseIP</code>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>On se connecte</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh root@192.168.0.43
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="partitionnement-du-disque">Partitionnement du disque</h3>
|
|||
|
|
|||
|
<p>Partitionnement du disque NVME 1To GPT + LVM</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gdisk /dev/nvme0n1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On passe en mode expert : x<br>
|
|||
|
On efface tout : z</p>
|
|||
|
|
|||
|
<p>Après partitionnement</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>gdisk -l /dev/nvme0n1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GPT fdisk (gdisk) version 1.0.5
|
|||
|
|
|||
|
Partition table scan:
|
|||
|
MBR: protective
|
|||
|
BSD: not present
|
|||
|
APM: not present
|
|||
|
GPT: present
|
|||
|
|
|||
|
Found valid GPT with protective MBR; using GPT.
|
|||
|
Disk /dev/nvme0n1: 234441648 sectors, 111.8 GiB
|
|||
|
Model: nvme1tb300SSD1
|
|||
|
Sector size (logical/physical): 512/4096 bytes
|
|||
|
Disk identifier (GUID): 2E7D3E67-A473-499C-9193-414E47C07873
|
|||
|
Partition table holds up to 128 entries
|
|||
|
Main partition table begins at sector 2 and ends at sector 33
|
|||
|
First usable sector is 34, last usable sector is 234441614
|
|||
|
Partitions will be aligned on 2048-sector boundaries
|
|||
|
Total free space is 2925 sectors (1.4 MiB)
|
|||
|
|
|||
|
Number Start (sector) End (sector) Size Code Name
|
|||
|
1 2048 1050623 512.0 MiB EF00 efi
|
|||
|
2 1050624 1638399 287.0 MiB 8300 boot
|
|||
|
3 1638400 234440703 111.0 GiB 8300 lvm-partition
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les partitions logiques lvm</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> rootnvme nvme1tb -wi-a----- 60.00g
|
|||
|
homenvme nvme1tb -wi-a----- 100.00g
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On utilise le volume physique nvme1tb pour le home</p>
|
|||
|
|
|||
|
<h3 id="système-de-fichiers">Système de fichiers</h3>
|
|||
|
|
|||
|
<p>Type de fichier <strong>ext4</strong> pour les autres partitions</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.fat -F32 /dev/nvme0n1p1
|
|||
|
mkfs.ext4 /dev/nvme0n1p2
|
|||
|
mkfs.ext4 /dev/nvme1tb/rootnvme
|
|||
|
mkfs.ext4 /dev/nvme1tb/homenvme
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="installer-les--bases">Installer les bases</h3>
|
|||
|
|
|||
|
<p>Points de montage</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/nvme1tb/rootnvme /mnt
|
|||
|
<span class="nb">mkdir</span> /mnt/home
|
|||
|
mount /dev/nvme1tb/homenvme /mnt/home
|
|||
|
<span class="nb">mkdir</span> <span class="nt">-p</span> /mnt/boot/efi
|
|||
|
mount /dev/nvme0n1p2 /mnt/boot
|
|||
|
mount /dev/nvme0n1p1 /mnt/boot/efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>create: 2021-03-08
|
|||
|
modifier le fichier <strong>/etc/pacman.d/mirrorlist</strong> pour ne garder qu’un seul miroir (facultatif)<br>
|
|||
|
passer la commande suivante avant la première ligne pacstrap :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>export LANG=C
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacstrap /mnt base base-devel linux linux-firmware nano dhcpcd lvm2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>générer le fichier <strong>/etc/fstab</strong> qui liste les partitions présentes avec les UUID des partitions</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>genfstab -U -p /mnt >> /mnt/etc/fstab
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="passage-en-chroot">Passage en chroot</h3>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>arch-chroot /mnt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Fuseau horaire Europe/Paris</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>timedatectl set-timezone Europe/Paris
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activer la synchronisation ntp</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>timedatectl set-ntp true
|
|||
|
timedatectl
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> Local time: jeu. 2020-12-17 11:09:44 CET
|
|||
|
Universal time: jeu. 2020-12-17 10:09:44 UTC
|
|||
|
RTC time: jeu. 2020-12-17 10:09:44
|
|||
|
Time zone: Europe/Paris (CET, +0100)
|
|||
|
System clock synchronized: yes
|
|||
|
NTP service: active
|
|||
|
RTC in local TZ: no
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Clavier en mode texte, créer le fichier /etc/vconsole.conf.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "KEYMAP=fr" > /etc/vconsole.conf
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>localisation française, le fichier /etc/locale.conf doit contenir la bonne valeur pour LANG</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/locale.conf
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajouter</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>LANG=fr_FR.UTF-8
|
|||
|
LC_COLLATE=C
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Il faut supprimer le <strong>#</strong> au début de la ligne fr_FR.UTF-8 UTF-8 dans le fichier <strong>/etc/locale.gen</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/locale.gen
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>puis exécuter:</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>locale-gen
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>spécifier la locale pour la session courante</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>export LANG=fr_FR.UTF-8
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>on a une machine en mono-démarrage sur Archlinux, et on peut demander à ce que l’heure appliquée soit UTC</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hwclock --systohc --utc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>create: 2021-03-08
|
|||
|
modifier le fichier <em>/etc/mkinitcpio.conf</em></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/mkinitcpio.conf
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>ajouter <code class="language-plaintext highlighter-rouge">lvm2</code> entre <code class="language-plaintext highlighter-rouge">block</code> et <code class="language-plaintext highlighter-rouge">filesystems</code> dans les <strong>HOOKS</strong><br>
|
|||
|
puis exécuter <strong>mkinitcpio</strong> qui est un script shell utilisé pour créer un environnement qui se chargé en premier en mémoire :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkinitcpio -p linux # linux-lts si vous voulez le noyau lts
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>nom de la machine /etc/hostname</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "archyan" > /etc/hostname
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer fichier hosts</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/hosts
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>127.0.0.1 localhost
|
|||
|
::1 localhost
|
|||
|
127.0.1.1 archyan
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>mot de passe root</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>passwd root
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Assurez-vous que vous utilisez toujours de la racine arch. Installez les paquets nécessaires :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S grub efibootmgr # os-prober
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>GRUB: acronyme signifiant en anglais Grand Unified Bootloader, c’est un programme d’amorçage de micro-ordinateur qui s’exécute donc à la mise sous tension de l’ordinateur, après les séquences de contrôle du BIOS et avant le système d’exploitation proprement dit car son rôle est justement d’en organiser le chargement. Lorsque l’ordinateur comporte plusieurs systèmes (multi-boot), il permet à l’utilisateur de choisir quel système démarrer.</li>
|
|||
|
<li>Os-prober (facultatif): détecte les autre OS installés sur la machine et les propose directement au démarrage, sans avoir à les renseigner manuellement</li>
|
|||
|
<li>Efibootmgr: EFI Boot Manager est un utilitaire utilisable en ligne de commande permettant de gérer le chargeur de démarrage EFI. Il permet aussi de modifier l’ordre de démarrage des OS disponibles, etc.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Créez le répertoire si inexistant où la partition EFI sera montée :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir -p /boot/efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Maintenant, vérifiez ou montez la partition ESP</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/nvme0n1p1 /boot/efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Installez grub comme ceci :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>grub-install --target=x86_64-efi --bootloader-id=arch-eos --efi-directory=/boot/efi --recheck
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Une commande supplémentaire mais facultative qui permet de s’assurer que l’on arrivera bien à redémarrer en UEFI:</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir -p /boot/efi/EFI/boot
|
|||
|
cp /boot/efi/EFI/arch-eos/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Modifier l’écran grub (FACULTATIF)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Fond écran grub
|
|||
|
#GRUB_BACKGROUND="/path/to/wallpaper"
|
|||
|
# Thème EndeavourOS
|
|||
|
GRUB_THEME="/boot/grub/themes/EndeavourOS/theme.txt"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Un dernier pas :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>grub-mkconfig -o /boot/grub/grub.cfg
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activer le réseau par dhcpcd</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl enable dhcpcd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="réseau-netctl-ou-networkmanager">Réseau netctl ou NetworkManager</h4>
|
|||
|
|
|||
|
<h5 id="netctl">Netctl</h5>
|
|||
|
|
|||
|
<p>Passer de dhcpcd à <a href="https://wiki.archlinux.fr/netctl">Netctl</a></p>
|
|||
|
|
|||
|
<p>Arrêter et désactiver dhcpcd</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl stop dhcpcd && systemctl disable dhcpcd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><a href="https://computerz.solutions/archlinux-ip-fixe/">Mettre un adressage IP fixe et une route avec netctl</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S netctl
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>résolution des dépendances…
|
|||
|
:: Il y a 2 fournisseurs disponibles pour resolvconf :
|
|||
|
:: Dépôt core
|
|||
|
1) openresolv 2) systemd-resolvconf
|
|||
|
|
|||
|
Entrer un nombre (par défaut, 1 est sélectionné):
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Réseau Lan statique</strong><br>
|
|||
|
Copier le profil ip lan statique</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cp /etc/netctl/examples/ethernet-static /etc/netctl/lan-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Configurer le profil</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano /etc/netctl/lan-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Description='A basic static ethernet connection'
|
|||
|
Interface=enp0s31f6
|
|||
|
Connection=ethernet
|
|||
|
IP=static
|
|||
|
Address=('192.168.0.42/24')
|
|||
|
Gateway='192.168.0.254'
|
|||
|
DNS=('192.168.0.254')
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vous pouvez dès à présent lancer netctl et utiliser votre profil</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netctl start lan-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activation profil</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netctl enable lan-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h5 id="networkmanager">NetworkManager</h5>
|
|||
|
|
|||
|
<p class="warning"><strong>Important</strong> : Pour éviter des problèmes de conflit, pensez à bien désactiver tout autre service réseau en action (dhcpcd.service, netctl.service, wicd.service) avant d’utiliser NetworkManager sur une interface réseau donnée.</p>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S networkmanager
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rajouter le service NetworkManager.service :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl enable NetworkManager
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="sortie-chroot-et-redémarrage">Sortie chroot et redémarrage</h3>
|
|||
|
|
|||
|
<p>On peut maintenant quitter tout, démonter proprement les partitions et redémarrer.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>exit
|
|||
|
umount -R /mnt
|
|||
|
reboot # Redémarrage
|
|||
|
# oter la clé USB
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="première-connexion">Première connexion</h3>
|
|||
|
|
|||
|
<p>Connexion en root</p>
|
|||
|
|
|||
|
<h4 id="créer-un-utilisateur">Créer un utilisateur</h4>
|
|||
|
|
|||
|
<p>Créer un utilisateur ‘yann’ avec la commande suivante</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>useradd -m -g users -G power,storage,wheel -s /bin/bash yann
|
|||
|
passwd yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer le groupe yann</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>groupadd -g 1000 yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajouter l’utilisateur au groupe users et yann</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>usermod -G users,yann yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérification</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>id yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>uid=1000(yann) gid=985(users) groupes=985(users),1000(yann)</p>
|
|||
|
|
|||
|
<p>Modifier sudoers pour accès sudo sans mot de passe à l’utilisateur</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "yann ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="openssh">Openssh</h4>
|
|||
|
|
|||
|
<p><img src="/images/ssh_logo1.png" alt=""></p>
|
|||
|
|
|||
|
<p>Installation et lancement</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S openssh
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Paramétrage pour un accès via “root” : <code class="language-plaintext highlighter-rouge">echo "PermitRootLogin yes" >> /etc/ssh/sshd_config</code></p>
|
|||
|
|
|||
|
<p>Validation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl enable sshd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Lancement SSH</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl start sshd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On peut se connecter en root avec un poste sur le réseau</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh root@192.168.0.43
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="installer-yay">Installer yay</h4>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>pacman <span class="nt">-S</span> <span class="nt">--needed</span> git base-devel
|
|||
|
git clone https://aur.archlinux.org/yay.git
|
|||
|
<span class="nb">cd </span>yay
|
|||
|
makepkg <span class="nt">-si</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="modification-fstab--création-des-liens">Modification fstab , création des liens</h4>
|
|||
|
|
|||
|
<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/nvme1tb/medianvme
|
|||
|
UUID=c0449742-9e72-42fb-b9b7-231d9cc29953 /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><strong>Liens sur les autres unités</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /srv/media
|
|||
|
sudo ln -s /srv/media $HOME/media
|
|||
|
sudo ln -s /virtuel $HOME/virtuel
|
|||
|
sudo ln -s /iso $HOME/iso
|
|||
|
sudo ln -s /sauvegardes $HOME/sav
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On monte les unités</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mount -a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="images-fond-décran--logos-connexion-et-grub">Images (fond d’écran + logos, connexion et grub)</h4>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo cp /srv/media/dplus/images/yannick/plouzane-nb.jpg /usr/share/backgrounds/xfce/ # écran 2
|
|||
|
sudo cp /srv/media/dplus/images/yannick/Linux-Arch-1920x1080.jpg /usr/share/backgrounds/xfce/ # écran 1
|
|||
|
sudo cp /srv/media/dplus/images/yannick/yannick-green.png /usr/share/pixmaps/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>les images de fond d’écran <strong>/usr/share/backgrounds/xfce</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo cp /srv/media/dplus/images/Fonds/Linux-Arch-1920x1080.jpg /usr/share/backgrounds/xfce/
|
|||
|
sudo cp /srv/media/dplus/images/yannick/yannick-green.png /usr/share/pixmaps/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ecran et logo pour lightdm de la page de connexion</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo cp /srv/media/dplus/images/Fonds/archlinux-lightdm.png /usr/share/backgrounds/
|
|||
|
sudo cp /srv/media/dplus/images/yannick/yannick53x64.png /usr/share/pixmaps/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="pacman-hooks">Pacman Hooks</h4>
|
|||
|
|
|||
|
<p>Script qui s’exécute lors d’une mise à jour ou suppression des paquets archlinux installés</p>
|
|||
|
|
|||
|
<p>Réduire le cache des paquets installés à une version : <code class="language-plaintext highlighter-rouge">/etc/pacman.d/hooks/10-paccache.hook</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Trigger]
|
|||
|
Operation = Upgrade
|
|||
|
Operation = Install
|
|||
|
Operation = Remove
|
|||
|
Type = Package
|
|||
|
Target = *
|
|||
|
[Action]
|
|||
|
Description = Cleaning pacman cache...
|
|||
|
When = PostTransaction
|
|||
|
Exec = /usr/bin/paccache -rk1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sauvegarder la liste des paquets installés “natif” et “aur” : <code class="language-plaintext highlighter-rouge">/etc/pacman.d/hooks/50-pacman-list.hook</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Trigger]
|
|||
|
Type = Package
|
|||
|
Operation = Install
|
|||
|
Operation = Upgrade
|
|||
|
Operation = Remove
|
|||
|
Target = *
|
|||
|
|
|||
|
[Action]
|
|||
|
Description = Create backup list of all installed packages
|
|||
|
When = PreTransaction
|
|||
|
Exec = /bin/sh -c 'pacman -Qqen > "/sauvegardes/$(date +%Y-%m-%d@%H:%M)_package_natif.log"; pacman -Qqem > "/sauvegardes/$(date +%Y-%m-%d@%H:%M)_package_aur.txt"; exit'
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h2 id="xfce">XFCE</h2>
|
|||
|
|
|||
|
<p><img src="/images/X.Org_Logo.svg" alt="" width="100"></p>
|
|||
|
|
|||
|
<h3 id="dépôts-endeavouros-option">Dépôts EndeavourOS (OPTION)</h3>
|
|||
|
|
|||
|
<p>Bénéficier de la configuration xfce4 EndeavourOS</p>
|
|||
|
|
|||
|
<p>Ajouter ce qui suit en fin de fichier <code class="language-plaintext highlighter-rouge">/etc/pacman.conf</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[endeavouros]
|
|||
|
SigLevel = PackageRequired
|
|||
|
Include = /etc/pacman.d/endeavouros-mirrorlist
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer la liste des dépôts <code class="language-plaintext highlighter-rouge">/etc/pacman.d/endeavouros-mirrorlist</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>######################################################
|
|||
|
#### ####
|
|||
|
### EndeavourOS Repository Mirrorlist ###
|
|||
|
#### ####
|
|||
|
######################################################
|
|||
|
#### Entry in file /etc/pacman.conf:
|
|||
|
### [endeavouros]
|
|||
|
### SigLevel = PackageRequired
|
|||
|
### Include = /etc/pacman.d/endeavouros-mirrorlist
|
|||
|
######################################################
|
|||
|
### Tip: Use the 'eos-rankmirrors' program to rank
|
|||
|
### these mirrors or re-order them manually.
|
|||
|
######################################################
|
|||
|
|
|||
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|||
|
# EndeavourOS mirrorlist:
|
|||
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|||
|
Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://fastmirror.pp.ua/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
|
|||
|
Server = https://endeavour.remi.lu/repo/$repo/$arch
|
|||
|
Server = https://mirror.linux.pizza/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://mirror.funami.tech/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://mirror.freedif.org/EndeavourOS/repo/$repo/$arch
|
|||
|
Server = https://mirrors.42tm.tech/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://mirror.archlinux.tw/EndeavourOS/repo/$repo/$arch
|
|||
|
Server = https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch
|
|||
|
Server = https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch
|
|||
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Importer les clés</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman-key --keyserver keyserver.ubuntu.com -r 003DB8B0CB23504F
|
|||
|
sudo pacman-key --lsign 003DB8B0CB23504F
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rafraîchir la base de données des paquets</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -Syy
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="installer-xorg-et-xfce4">Installer Xorg et Xfce4</h3>
|
|||
|
|
|||
|
<p>Installation de <strong>Xorg</strong>.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S xorg
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><img src="/images/Xfce_logo.png" alt="" width="100"></p>
|
|||
|
|
|||
|
<p>Installation <strong>xfce</strong></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># sudo pacman -S xfce4 xfce4-goodies</span>
|
|||
|
<span class="c"># Détail , on remplace xfce4-screensaver par xscreensaver</span>
|
|||
|
<span class="nb">sudo </span>pacman <span class="nt">-Sfile-roller</span> galculator gvfs gvfs-afc gvfs-gphoto2 gvfs-mtp gvfs-nfs gvfs-smb lightdm lightdm-slick-greeter network-manager-applet parole ristretto thunar-archive-plugin thunar-media-tags-plugin xdg-user-dirs-gtk xed xfce4 xfce4-battery-plugin xfce4-datetime-plugin xfce4-mount-plugin xfce4-netload-plugin xfce4-notifyd xfce4-pulseaudio-plugin xfce4-screenshooter xfce4-taskmanager xfce4-wavelan-plugin xfce4-weather-plugin xfce4-whiskermenu-plugin xfce4-xkb-plugin xscreensaver
|
|||
|
|
|||
|
<span class="c"># Avec les dépôts EndeavourOS</span>
|
|||
|
<span class="nb">sudo </span>pacman <span class="nt">-S</span> arc-gtk-theme-eos eos-lightdm-slick-theme eos-qogir-icons endeavouros-skel-xfce4 endeavouros-xfce4-terminal-colors
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Valider tout par défaut</p>
|
|||
|
|
|||
|
<h3 id="xdg-répertoires-dutilisateurs">XDG Répertoires d’utilisateurs</h3>
|
|||
|
|
|||
|
<p>xdg-user-dirs est un outil pour aider à gérer les répertoires d’utilisateurs “bien connus” comme le dossier de bureau et le dossier de musique. Il gère également la localisation (c’est-à-dire la traduction) des noms de fichiers.</p>
|
|||
|
|
|||
|
<p>Installez xdg-user-dirs</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S xdg-user-dirs
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les fichiers de configuration locaux <code class="language-plaintext highlighter-rouge">~/.config/user-dirs.dirs</code> et globaux /<code class="language-plaintext highlighter-rouge">etc/xdg/user-dirs.defaults</code> utilisent le format de variable d’environnement suivant pour pointer vers les répertoires des utilisateurs : <code class="language-plaintext highlighter-rouge">XDG_DIRNAME_DIR="$HOME/directory_name"</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.config/user-dirs.dirs
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># This file is written by xdg-user-dirs-update
|
|||
|
# If you want to change or add directories, just edit the line you're
|
|||
|
# interested in. All local changes will be retained on the next run.
|
|||
|
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
|
|||
|
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
|
|||
|
# absolute path. No other format is supported.
|
|||
|
#
|
|||
|
XDG_DESKTOP_DIR="$HOME/Bureau"
|
|||
|
XDG_DOWNLOAD_DIR="$HOME/Téléchargements"
|
|||
|
XDG_TEMPLATES_DIR="$HOME/Modèles"
|
|||
|
XDG_PUBLICSHARE_DIR="$HOME/Public"
|
|||
|
XDG_DOCUMENTS_DIR="$HOME/Documents"
|
|||
|
XDG_MUSIC_DIR="$HOME/Musique"
|
|||
|
XDG_PICTURES_DIR="$HOME/Images"
|
|||
|
XDG_VIDEOS_DIR="$HOME/Vidéos"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="gestionnaire-connexion---lightdm">Gestionnaire connexion - lightdm</h3>
|
|||
|
|
|||
|
<p>Installation <strong>lightdm</strong> et du gestionnaire graphique</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S lightdm-gtk-greeter-settings # Installation de lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour avoir le bon agencement clavier dès la saisie du premier caractère du mot de passe, il faut entrer la commande suivant avant de lancer pour la première fois lightdm :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo localectl set-x11-keymap fr
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour lancer Xfce, il faut entrer dans un premier temps :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl start lightdm # A saisir sur l'ordinateur ,pas sur la console SSH
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Sélectionner l’utilisateur et saisir son mot de passe, et si tout se passe bien, on peut valider :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable lightdm
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Dans le cas d’une configuration multi écran, il faut sélectionnner un écran sur lequel s’affichera la fenêtre de “login”<br>
|
|||
|
Ouvrir le fichier <code class="language-plaintext highlighter-rouge">/etc/lightdm/lightdm-gtk-greeter.conf</code> et ajouter <code class="language-plaintext highlighter-rouge">active-monitor=0</code> sous <code class="language-plaintext highlighter-rouge">[greeter]</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[greeter]
|
|||
|
active-monitor=0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Modifier la page de connexion</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo cp /srv/media/dplus/images/yannick/archlinux-endeavouros-wallpaper.jpg /usr/share/endeavouros/backgrounds/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Modifier 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=/usr/share/endeavouros/backgrounds/endeavouros-wallpaper.png
|
|||
|
background=/usr/share/endeavouros/backgrounds/archlinux-endeavouros-wallpaper.jpg
|
|||
|
draw-user-backgrounds=false
|
|||
|
draw-grid=true
|
|||
|
theme-name=Arc-Dark
|
|||
|
icon-theme-name=Qogir
|
|||
|
show-a11y=false
|
|||
|
show-power=false
|
|||
|
background-color=#ffffff
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Modifier la zone de saisie par création d’un fichier <code class="language-plaintext highlighter-rouge">/etc/lightdm/lightdm.conf.d/50-my-custom-config.conf</code><br>
|
|||
|
<em>Il faut saisir le nom de l’utilisateur et son mot de passe</em></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[SeatDefaults]
|
|||
|
greeter-hide-users=true
|
|||
|
greeter-show-manual-login=true
|
|||
|
allow-guest=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="outils-et-applications">Outils et applications</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. Webkigtk2 étant indispensable pour la lecture de l’aide en ligne de Gimp. outil rsync, Retext éditeur markdown, firefox fr, thunderbird, libreoffice, gdisk</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S cups system-config-printer gimp hplip rsync firefox-i18n-fr git libreoffice-fresh-fr thunderbird-i18n-fr wget jq figlet bind-tools
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Gérer des périphériques utilisant MTP</strong> (tablettes sous android par exemple), il vous faut rajouter les deux paquets gvfs-mtp et mtpfs (<strong>facultatif</strong>) : <code class="language-plaintext highlighter-rouge">sudo pacman -S gvfs-{afc,goa,google,gphoto2,mtp,nfs,smb}</code></p>
|
|||
|
|
|||
|
<p><strong>Installer suite Xfce</strong> avec vlc (vidéo), pulseaudio, etc…</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S gvfs mtpfs vlc xarchiver galculator evince ffmpegthumbnailer xscreensaver pavucontrol pulseaudio pulseaudio-alsa
|
|||
|
sudo pacman -S gedit keepassxc terminator filezilla nmap minicom zenity tmux
|
|||
|
yay -S menulibre-git
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>ATTENTION : NE PAS INSTALLER le paquet <strong>xfce4-screensaver</strong> , pour vérifier si présent <code class="language-plaintext highlighter-rouge">pacman -Q xfce4-screensaver</code> et <code class="language-plaintext highlighter-rouge">sudo pacman -R xfce4-screensaver</code> pour l’éliminer</p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<h3 id="configuration-xfce">Configuration xfce</h3>
|
|||
|
|
|||
|
<h4 id="thème">Thème</h4>
|
|||
|
|
|||
|
<p><a href="https://wiki.archlinux.org/title/GTK">https://wiki.archlinux.org/title/GTK</a></p>
|
|||
|
|
|||
|
<p>Arc - Un thème plat avec un look moderne et des éléments transparents. Comprend : Arc, Arc-Dark, Arc-Darker.<br>
|
|||
|
https://github.com/jnsh/arc-theme || avec transparence : arc-gtk-theme, sans transparence : arc-solid-gtk-theme</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S arc-gtk-theme arc-icon-theme
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Paramètres → Apparence</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Style : Arc-Darker</li>
|
|||
|
<li>Icônes : Arc</li>
|
|||
|
<li>Polices : Cantarell Regular 10</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Paramètres → Gestionnaire de fenêtres</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Style : Arc-Darker</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<h4 id="tableau-de-bord">Tableau de bord</h4>
|
|||
|
|
|||
|
<p>Modification du <strong>tableau de bord</strong> , clic-droit → Tableau de bord → Préférences de tableau de bord<br>
|
|||
|
<strong>Tableau de bord 1</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Onglet <em>Eléments</em>
|
|||
|
<ul>
|
|||
|
<li>Ajouter des éléments (+) –> <strong>Menu whisker</strong> (icône <em>yannick-green.png</em>) ,<strong>Mise à jour météo</strong> ,<strong>Greffon PulseAudio</strong> ,<strong>Afficher le bureau</strong>, <strong>Captures d’écran</strong>
|
|||
|
</li>
|
|||
|
<li>Supprimer Menu des applications</li>
|
|||
|
<li>
|
|||
|
<strong>Horloge</strong> Affichage date et heure, <em>format personnalisé</em> : %e %b %Y %R</li>
|
|||
|
<li>
|
|||
|
<strong>Changeur d’espace de travail</strong> ,<em>Paramètres des espaces de travail</em> à 2 , décocher <em>Changer d’espace…</em>
|
|||
|
</li>
|
|||
|
<li>
|
|||
|
<strong>Boutons d’action</strong> idem dans apparence , actions <code class="language-plaintext highlighter-rouge">Déconnexion</code>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>Onglet <em>Affichage</em>
|
|||
|
<ul>
|
|||
|
<li>Verrouiller tableau de bord</li>
|
|||
|
<li>Masquer automatiquement le tableau de bord <strong>Jamais</strong>
|
|||
|
</li>
|
|||
|
<li>Taille d’une ligne (pixels) <strong>25</strong>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Choix <em>Icônes et thème “numix”</em></p>
|
|||
|
|
|||
|
<p><strong>Tableau de bord 2</strong><br>
|
|||
|
Pour le déplacer le <em>Tableau de bord 2</em> vers écran Essential <strong>1.___72</strong> , décocher <em>Verrouiller tableau de bord</em></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Onglet <em>Affichage</em>
|
|||
|
<ul>
|
|||
|
<li>Verrouiller tableau de bord</li>
|
|||
|
<li>Masquer automatiquement le tableau de bord <strong>Toujours</strong>
|
|||
|
</li>
|
|||
|
<li>Taille d’une ligne (pixels) <strong>40</strong>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li>Onglet <em>Eléments</em> tableau de bord 2
|
|||
|
<ul>
|
|||
|
<li>Emulateur de Terminal : /usr/bin/terminator , icône <em>terminator</em>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p><img src="/images/xfce-tableau-bord2.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<h4 id="alimentation-écran-apparence-fenêtres-applications-favorites-et-bureau">Alimentation, écran, apparence, fenêtres, applications favorites et bureau</h4>
|
|||
|
|
|||
|
<p><a href="https://github.com/NicoHood/NicoHood.github.io/wiki/Xfce4-Desktop-Environment-Customization">Xfce4 Desktop Environment Customization</a></p>
|
|||
|
|
|||
|
<p>Menu → Paramètres → Gestionnaire d’alimentation</p>
|
|||
|
|
|||
|
<p><img src="/images/ga1.png" alt="image" width="300px"> <img src="/images/ga2.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<p><img src="/images/ga3.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<p>Menu → Paramètres → Affichage , Double écran , Sharp à droite de Samsung</p>
|
|||
|
|
|||
|
<p><img src="/images/double-ecran.png" alt="image"> <img src="/images/double-ecran-1.png" alt="image"></p>
|
|||
|
|
|||
|
<p>Menu → Paramètres → Apparence</p>
|
|||
|
|
|||
|
<p><img src="/images/xfce-apparence1.png" alt="" width="300px"><br>
|
|||
|
<img src="/images/xfce-apparence2.png" alt="" width="300px"><br>
|
|||
|
<img src="/images/xfce-apparence3.png" alt="" width="300px"></p>
|
|||
|
|
|||
|
<p>Menu Paramètres → Gestionnaire de fenêtres</p>
|
|||
|
|
|||
|
<p><img src="/images/xfce-fenetres1.png" alt="" width="300px"></p>
|
|||
|
|
|||
|
<p>Après validation tableau de bord, clic droit sur icône capture écran puis Propriétés -> Zone à capturer : Sélectionner une zone</p>
|
|||
|
|
|||
|
<p><img src="/images/xfce-tableau-bord1.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<p>Menu → Paramètres → Applications favorites</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Utilitaires -> Emulateur de terminal : <strong>/usr/bin/terminator “%s”</strong>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Menu Paramètres –> Bureau</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Fonds d’écran image <strong>/usr/share/backgrounds/xfce</strong>
|
|||
|
</li>
|
|||
|
<li>Onglet <em>Icônes</em>
|
|||
|
<ul>
|
|||
|
<li>Tout décocher dans <strong>Icônes par défaut</strong>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<h4 id="veille-écran---xscreensaver">Veille écran - xscreensaver</h4>
|
|||
|
|
|||
|
<p>Installer par défaut sur archlinux (xscreensaver) <br>
|
|||
|
Si l’application <strong>xfce4-screensaver</strong> est installée</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -Ss screensaver
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>extra/xscreensaver 6.04-1 (9.6 MiB 35.9 MiB) (Installé)
|
|||
|
Screen saver and locker for the X Window System
|
|||
|
extra/xfce4-screensaver 4.16.0-1 (256.4 KiB 1.1 MiB) [xfce4-goodies] (Installé)
|
|||
|
Xfce Screensaver
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On remplace l’application <strong>xfce4-screensaver</strong> (goodies) par <strong>xscreensaver</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -R xfce4-screensaver
|
|||
|
sudo pacman -S xscreensaver
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Création d’un script pour <strong>Activer/Désactiver</strong> le programme de mise en veille <strong>xscreensaver</strong><br>
|
|||
|
Prérequis : <strong>zenity</strong> <br>
|
|||
|
Le script <strong>~/scripts/veille.sh</strong></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
|
|||
|
<span class="c"># veille.sh</span>
|
|||
|
|
|||
|
|
|||
|
<span class="c"># Détecter si xscreensaver est actif</span>
|
|||
|
<span class="k">if</span> <span class="o">[</span> <span class="s2">"</span><span class="si">$(</span>pidof <span class="nt">-s</span> xscreensaver<span class="si">)</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
|
|||
|
</span><span class="nv">arret</span><span class="o">=</span><span class="nb">false
|
|||
|
</span>zenity <span class="nt">--question</span> <span class="nt">--title</span> <span class="s2">"veille"</span> <span class="nt">--ok-label</span><span class="o">=</span><span class="s2">"Oui"</span> <span class="nt">--cancel-label</span><span class="o">=</span><span class="s2">"Non"</span> <span class="nt">--text</span> <span class="s2">"Economiseur Ecran ACTIF</span><span class="se">\n\n</span><span class="s2"> DESACTIVER ?"</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="s2">"ARRET daemon xscreensaver ..."</span>
|
|||
|
xscreensaver-command <span class="nt">-exit</span>
|
|||
|
<span class="nb">sleep </span>3
|
|||
|
<span class="k">fi
|
|||
|
else
|
|||
|
</span><span class="nv">arret</span><span class="o">=</span><span class="nb">true
|
|||
|
</span>zenity <span class="nt">--question</span> <span class="nt">--title</span> <span class="s2">"veille"</span> <span class="nt">--ok-label</span><span class="o">=</span><span class="s2">"Oui"</span> <span class="nt">--cancel-label</span><span class="o">=</span><span class="s2">"Non"</span> <span class="nt">--text</span> <span class="s2">"Economiseur Ecran NON ACTIF</span><span class="se">\n\n</span><span class="s2"> ACTIVER ?"</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="s2">"DEPART daemon xscreensaver ..."</span>
|
|||
|
xscreensaver <span class="nt">-nosplash</span> &
|
|||
|
<span class="nb">sleep </span>3
|
|||
|
<span class="k">fi
|
|||
|
fi</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Création lanceur XFCE en utilisant <strong>Editeur de menus</strong> (si “menulibre” installé ou manuellement :</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> <span class="nt">-p</span> ~/.local/share/applications/ <span class="c">#création dossier **applications** si inexistant</span>
|
|||
|
nano ~/.local/share/applications/menulibre-veille-ecran.desktop
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Contenu :</p>
|
|||
|
|
|||
|
<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Desktop Entry]</span>
|
|||
|
<span class="py">Version</span><span class="p">=</span><span class="s">1.0</span>
|
|||
|
<span class="py">Type</span><span class="p">=</span><span class="s">Application</span>
|
|||
|
<span class="py">Name</span><span class="p">=</span><span class="s">Activer/Désactiver veille écran</span>
|
|||
|
<span class="py">Comment</span><span class="p">=</span><span class="s">Veille active ou pas par simple clic</span>
|
|||
|
<span class="py">Icon</span><span class="p">=</span><span class="s">preferences-desktop-screensaver</span>
|
|||
|
<span class="py">Exec</span><span class="p">=</span><span class="s">sh /home/yann/scripts/veille.sh</span>
|
|||
|
<span class="py">Path</span><span class="p">=</span><span class="s">/home/yann/scripts</span>
|
|||
|
<span class="py">NoDisplay</span><span class="p">=</span><span class="s">false</span>
|
|||
|
<span class="py">Categories</span><span class="p">=</span><span class="s">Utility;X-XFCE;X-Xfce-Toplevel;</span>
|
|||
|
<span class="py">StartupNotify</span><span class="p">=</span><span class="s">false</span>
|
|||
|
<span class="py">Terminal</span><span class="p">=</span><span class="s">false</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>Les icônes sont situés sous /usr/share/icons , il suffit de mettre le nom de l’icône choisi sans extension ni chemin pour le paramètre <strong>Icon</strong></p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<h4 id="ecran-connexion-lightdm">Ecran connexion (lightDM)</h4>
|
|||
|
|
|||
|
<p>Ecran et logo pour <strong>lightdm</strong> de la page de connexion <br>
|
|||
|
Accès aux paramètres lightDM en mode graphique (mot de passe root)</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Menu –> Paramètres –> LightDM GTK+ Paramètres d’Apparence</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p><img src="/images/lightdm1.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<h4 id="ecran-de-boot-grub">Ecran de boot (grub)</h4>
|
|||
|
|
|||
|
<p>Ecran de la page de démarrage <strong>grub</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo cp ~/media/dplus/images/Fonds/wp2618243.jpg /usr/share/backgrounds/xfce/
|
|||
|
sudo nano /etc/default/grub
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GRUB_BACKGROUND="/usr/share/backgrounds/xfce/wp2618243.jpg"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Reconfigurer grub pour la prise en charge de l’image</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo grub-mkconfig -o /boot/grub/grub.cfg
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="applets-réseau">Applets Réseau</h3>
|
|||
|
|
|||
|
<h4 id="netctl-1">Netctl</h4>
|
|||
|
|
|||
|
<p>Il existe une applet écrit en rust <a href="https://opensourcelibs.com/lib/netctl-tray">https://opensourcelibs.com/lib/netctl-tray</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S netctl-tray
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>You have to be in groups wheel and network for it to work properly.
|
|||
|
To add an user to them, use:
|
|||
|
|
|||
|
# usermod -a -G wheel,network <user>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="networkmanager-1">NetworkManager</h4>
|
|||
|
|
|||
|
<p>Pour un environnement GTK, vous pouvez installer l’applet</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S network-manager-applet
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Afin de sauvegarder les détails d’authentification</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman -S gnome-keyring
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="son-pulseaudio--gstreamer">Son Pulseaudio + gstreamer</h4>
|
|||
|
|
|||
|
<p>Lancement</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pulseaudio --start
|
|||
|
sudo usermod -aG audio $USER
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ouvrir pavucontrol<br>
|
|||
|
Audio interne DigitalStéréo (HDMI)<br>
|
|||
|
Port : HDMI/DisplayPort (plugged in)</p>
|
|||
|
|
|||
|
<p><img src="/images/pavucontrol.png" alt="image" width="300px"> <img src="/images/pav1.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<p><img src="/images/pav2.png" alt="image" width="300px"> <img src="/images/pav3.png" alt="image" width="300px"></p>
|
|||
|
|
|||
|
<p>Commuter la sortie audio entre HDMI et analogique par un clic, chercher l’expression “sortie audio hdmi” dans le champ recherche du site</p>
|
|||
|
|
|||
|
<p><strong>gstreamer</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S gstreamer gst-libav gst-plugins-bad gst-plugins-base gst-plugins-good gst-plugins-ugly
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>alsa-utils</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S alsa-utils
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour avoir le son casque en face avant de PC1 <br>
|
|||
|
<img src="/images/pav4.png" alt="image"></p>
|
|||
|
|
|||
|
<p>Pour avoir le son casque en face arrière de PC1 <br>
|
|||
|
<img src="/images/pav5.png" alt="image"></p>
|
|||
|
|
|||
|
<h3 id="applications">Applications</h3>
|
|||
|
|
|||
|
<h4 id="client-nextcloud">Client Nextcloud</h4>
|
|||
|
|
|||
|
<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>
|
|||
|
|
|||
|
<h4 id="thunderbird">Thunderbird</h4>
|
|||
|
|
|||
|
<ol>
|
|||
|
<li><a href="https://telecharger.tomsguide.fr/Thunderbird-Mozilla,0301-2723.html">Télécharger Mozilla Thunderbird 102.0</a></li>
|
|||
|
<li><a href="https://mzl.la/3Mm3SHQ">Installation manuelle sous linux</a></li>
|
|||
|
<li><a href="https://proton.me/support/protonmail-bridge-clients-windows-thunderbird">Comment paramétrer Mozilla Thunderbird pour ProtonMail Bridge</a></li>
|
|||
|
</ol>
|
|||
|
|
|||
|
<h4 id="retext">Retext</h4>
|
|||
|
|
|||
|
<p><strong><a href="https://github.com/retext-project/retext">Retext</a> , éditeur markdown</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S retext qt5-webkit
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="keepassxc">keepassxc</h4>
|
|||
|
|
|||
|
<p>Créer le dossier <code class="language-plaintext highlighter-rouge">mkdir -p $HOME/{.keepassx}</code> , Home/.keepassx –> ~/.keepassx<br>
|
|||
|
Ouvrir menu xfce et lancer <strong>KeePassXC</strong><br>
|
|||
|
Base ~/.keepassx/yannick_xc.kdbx<br>
|
|||
|
Clé ~/.ssh/yannick_keepassxc.key</p>
|
|||
|
|
|||
|
<h4 id="calibre">Calibre</h4>
|
|||
|
|
|||
|
<p><em>Calibre facilite la gestion de votre bibliothèque de livres électroniques. Ce programme intuitif et complet vous permet de visionner vos ebooks, de les trier selon différents critères, de les convertir (individuellement ou par lot), d’éditer leurs méta-données et de récupérer des informations à partir d’Internet.</em></p>
|
|||
|
|
|||
|
<p>Installation <a href="https://calibre-ebook.com/download_linux">https://calibre-ebook.com/download_linux</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Premier lancement ,bibliothèques sous <strong>~/media/BiblioCalibre</strong> et <strong>~/media/CalibreTechnique</strong></p>
|
|||
|
|
|||
|
<p>Désinstaller calibre : <code class="language-plaintext highlighter-rouge">sudo calibre-uninstall</code></p>
|
|||
|
|
|||
|
<h4 id="flameshot">Flameshot</h4>
|
|||
|
|
|||
|
<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>sudo pacman -S flameshot
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Paramétrage “tableau de bord”<br>
|
|||
|
<img src="/images/flameshot.png" alt="Texte alternatif" width="600"></p>
|
|||
|
|
|||
|
<h4 id="emulation-android---scrcpy">Emulation android - scrcpy</h4>
|
|||
|
|
|||
|
<p><strong>Applications…</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S scrcpy-git
|
|||
|
|
|||
|
|
|||
|
sudo pacman -S android-tools
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>scrcpy</strong> <a href="https://github.com/Genymobile/scrcpy/">https://github.com/Genymobile/scrcpy/</a><br>
|
|||
|
Bureau <code class="language-plaintext highlighter-rouge">/home/yann/.local/share/applications/menulibre-scrcpy-(android).desktop</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.1
|
|||
|
Type=Application
|
|||
|
Name=ScrCpy (Android)
|
|||
|
Comment=Votre smartphone sur le bureau
|
|||
|
Icon=smartphone-connected
|
|||
|
Exec=/usr/bin/scrcpy
|
|||
|
Path=/home/yann
|
|||
|
Actions=
|
|||
|
Categories=Utility;X-XFCE;X-Xfce-Toplevel;
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="radio-menulibre-et-firefox-nightly-fr">Radio, menulibre et firefox-nightly-fr</h4>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>radiotray menulibre # tutanota-desktop-bin
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>firefox-nightly-fr</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/firefox-85.0a1.fr.linux-x86_64.tar.bz2
|
|||
|
sudo tar -xvf firefox-85.0a1.fr.linux-x86_64.tar.bz2
|
|||
|
sudo mv firefox /opt/firefox-nightly
|
|||
|
rm firefox-85.0a1.fr.linux-x86_64.tar.bz2
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Desktop /home/yann/.local/share/applications/firefox-nightly.desktop</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.0
|
|||
|
Name=Firefox Nightly
|
|||
|
GenericName=Web Browser
|
|||
|
GenericName[fr]=Navigateur web
|
|||
|
Comment=Browse the Web
|
|||
|
Comment[fr]=Naviguer sur le Web
|
|||
|
Exec=/opt/firefox-nightly/firefox %u
|
|||
|
Icon=firefox-nightly
|
|||
|
Terminal=false
|
|||
|
Type=Application
|
|||
|
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
|
|||
|
StartupNotify=true
|
|||
|
StartupWMClass=Nightly
|
|||
|
Categories=Network;WebBrowser;
|
|||
|
Keywords=web;browser;internet;
|
|||
|
Actions=new-window;new-private-window;
|
|||
|
|
|||
|
[Desktop Action new-window]
|
|||
|
Name=New Window
|
|||
|
Name[fr]=Nouvelle fenêtre
|
|||
|
Exec=/opt/firefox-nightly/firefox --new-window %u
|
|||
|
|
|||
|
[Desktop Action new-private-window]
|
|||
|
Name=New Private Window
|
|||
|
Name[fr]=Nouvelle fenêtre de navigation privée
|
|||
|
Exec=/opt/firefox-nightly/firefox --private-window %u
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="tor">Tor</h4>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Tor est fréquemment utilisé pour accéder au Dark web, qui est une partie d’internet non référencée par les moteurs de recherche classiques. Évitez absolument d’utiliser Tor à cette fin, parce que votre navigation ne sera d’une part pas sécurisée et pourrait d’autre part être considérée comme illégale par les autorités de la région où vous opérez.</li>
|
|||
|
<li>En utilisant Tor, n’oubliez pas de prendre en considération les points énumérés ci-après.
|
|||
|
* Tor ne permet pas immédiatement une navigation anonyme après son installation. Seul le trafic de Firefox sera anonymisé et les autres applications devront être configurées avec des proxys avant de pouvoir accéder au réseau Tor.
|
|||
|
* Le bouton de Tor ajouté à Firefox a pour fonction de bloquer les technologies pouvant présenter des risques de fuites d’identité. Ces technologies à risque incluent Java, ActiveX, RealPlayer, QuickTime et les greffons d’Adobe. Les fichiers de configuration devront être modifiés pour pouvoir utiliser ces applications avec Tor.
|
|||
|
* Les cookies existant avant l’installation de Tor laisseront toujours filtrer l’identité de l’utilisateur. Il sera nécessaire de tous les effacer avant d’installer Tor pour vous assurer d’une navigation complètement anonyme.
|
|||
|
* Le réseau Tor crypte toutes les données transmises jusqu’à ce que le routeur permettant d’y accéder sorte du réseau. Les utilisateurs devront utiliser un protocole d’encryptage de confiance, comme HTTPS ou autres.</li>
|
|||
|
<li>Prenez soin de toujours vérifier l’intégrité des applications téléchargées avec Tor. Celles-ci pourraient poser des problèmes si la sécurité d’un routeur accédant au réseau de Tor était compromise.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Lien pour le téléchargement <a href="https://www.torproject.org/fr/download/">https://www.torproject.org/fr/download/</a></p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://www.torproject.org/dist/torbrowser/11.5.8/tor-browser-linux64-11.5.8_fr.tar.xz
|
|||
|
<span class="nb">tar </span>xvf tor-browser-linux64-11.5.8_fr.tar.xz
|
|||
|
<span class="nb">sudo mv </span>tor-browser_fr /opt/
|
|||
|
<span class="nb">cd</span> /opt/tor-browser_fr/
|
|||
|
./start-tor-browser.desktop
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><img src="/images/tor-browser-fra.png" alt=""></p>
|
|||
|
|
|||
|
<p>Le .desktop <code class="language-plaintext highlighter-rouge">~/.local/share/applications/start-tor-browser.desktop</code> est créé</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>#!/usr/bin/env ./Browser/execdesktop
|
|||
|
#
|
|||
|
# Ce fichier est un fichier .desktop auto-modifiant qui peut être exécuté depuis le shell.
|
|||
|
# Il préserve les arguments et l'environnement pour le script start-tor-browser.
|
|||
|
#
|
|||
|
# Exécutez './start-tor-browser.desktop --help' pour afficher l'ensemble des options.
|
|||
|
#
|
|||
|
# Lorsqu'il est invoqué depuis le shell, ce fichier doit toujours être dans le répertoire racine du navigateur Tor.
|
|||
|
# répertoire racine du navigateur Tor. Lorsqu'il est exécuté depuis le gestionnaire de fichiers ou l'interface graphique du bureau, il est déplaçable.
|
|||
|
#
|
|||
|
# Après la première invocation, il se mettra à jour avec le chemin absolu vers l'emplacement # actuel de TBB, afin de supporter les déplacements.
|
|||
|
# l'emplacement actuel de TBB, afin de supporter la relocalisation de ce fichier .desktop pour l'interface graphique
|
|||
|
# l'invocation de l'interface graphique. Vous pouvez également ajouter Tor Browser au menu des applications de votre bureau
|
|||
|
# en exécutant './start-tor-browser.desktop --register-app'.
|
|||
|
#
|
|||
|
# Si vous utilisez --register-app, et que vous déplacez ensuite votre répertoire TBB, le navigateur Tor
|
|||
|
# ne se lancera plus depuis le lanceur d'application/dock de votre bureau. Cependant, si vous
|
|||
|
# ré-exécutez --register-app à partir de ce nouveau répertoire, le script
|
|||
|
# corrigera les chemins absolus et se ré-enregistrera lui-même.
|
|||
|
#
|
|||
|
# Ce fichier fonctionnera également si le chemin d'accès change lorsque TBB est utilisé en tant que
|
|||
|
# application portable, tant qu'il est exécuté directement depuis ce nouveau répertoire, que ce soit
|
|||
|
# via le shell ou via le gestionnaire de fichiers.
|
|||
|
|
|||
|
[Desktop Entry]
|
|||
|
Type=Application
|
|||
|
Name=Tor Browser
|
|||
|
GenericName=Web Browser
|
|||
|
Comment=Tor Browser is +1 for privacy and −1 for mass surveillance
|
|||
|
Categories=Network;WebBrowser;Security;
|
|||
|
Exec=sh -c '"/opt/tor-browser_fr/Browser/start-tor-browser" --detach || ([ ! -x "/opt/tor-browser_fr/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k
|
|||
|
X-TorBrowser-ExecShell=./Browser/start-tor-browser --detach
|
|||
|
Icon=/opt/tor-browser_fr/Browser/browser/chrome/icons/default/default128.png
|
|||
|
StartupWMClass=Tor Browser
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="wing-personal-python-ide">Wing Personal Python IDE</h4>
|
|||
|
|
|||
|
<p><strong><a href="https://wingware.com/downloads/wing-personal">Wing Personal Python IDE</a></strong> <br>
|
|||
|
Wing Personal - Version 8.1.3 - Released 2022-02-01</p>
|
|||
|
|
|||
|
<p>1- Télécharger la version linux <code class="language-plaintext highlighter-rouge">wget https://wingware.com/get&prod=wing-personal&target=pub/wing-personal/8.1.3.0/wing-personal-8.1.3.0-linux-x64.tar.bz2</code><br>
|
|||
|
2- décompresser <code class="language-plaintext highlighter-rouge">tar -zxvf wing-personal-8.1.3.0-linux-x64.tar.bz2</code><br>
|
|||
|
3- En mode su , <code class="language-plaintext highlighter-rouge">cd wing-personal-8.1.3.0-linux-x64.tar.bz2</code> , <code class="language-plaintext highlighter-rouge">./wing-install.py --winghome /opt/wing-personal --bin-dir /usr/local/bin</code></p>
|
|||
|
|
|||
|
<h4 id="xournal">Xournal</h4>
|
|||
|
|
|||
|
<p><strong>Xournal</strong> https://github.com/xournalpp/xournalpp : <code class="language-plaintext highlighter-rouge">yay -S xournal</code><br>
|
|||
|
<em>Xournal++ est un logiciel de prise de notes manuscrites, surtout destiné à prendre des notes sur des documents PDF et à les annoter</em></p>
|
|||
|
|
|||
|
<p><strong><a href="/2019/02/17/QR-Code-barres-definition-encodage-decodage.html">QR Code (code-barres) définition, encodage et décodage</a> (NON INSTALLE)</strong><br>
|
|||
|
<em>La première chose à faire va être d’installer deux petites applications, à savoir QRencode pour la partie création, et ZBar pour la partie scan/lecture</em><br>
|
|||
|
Sur Archlinux</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S qrencode zbar
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="kicad-non-installe">KiCad (NON INSTALLE)</h4>
|
|||
|
|
|||
|
<p><strong>KiCad (NON INSTALLE)</strong> est une suite logicielle libre de conception pour l’électronique pour le dessin de schémas électroniques et la conception de circuits imprimés. KiCad est publié sous licence GNU GPL: <code class="language-plaintext highlighter-rouge">sudo pacman -S kicad</code></p>
|
|||
|
|
|||
|
<h4 id="qbittorent-non-installe">qbittorent (NON INSTALLE)</h4>
|
|||
|
|
|||
|
<p><strong>qbittorent (NON INSTALLE)</strong> <code class="language-plaintext highlighter-rouge">sudo pacman -S qbittorrent</code></p>
|
|||
|
|
|||
|
<h3 id="paramétrage">Paramétrage</h3>
|
|||
|
|
|||
|
<h4 id="alias-fichier-bashrc">Alias fichier .bashrc</h4>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano ~/.bashrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#</span>
|
|||
|
<span class="c"># ~/.bashrc</span>
|
|||
|
<span class="c">#</span>
|
|||
|
|
|||
|
<span class="c"># If not running interactively, don't do anything</span>
|
|||
|
<span class="o">[[</span> <span class="nv">$-</span> <span class="o">!=</span> <span class="k">*</span>i<span class="k">*</span> <span class="o">]]</span> <span class="o">&&</span> <span class="k">return
|
|||
|
|
|||
|
</span><span class="nb">alias ls</span><span class="o">=</span><span class="s1">'ls --color=auto'</span>
|
|||
|
<span class="nv">PS1</span><span class="o">=</span><span class="s1">'[\u@\h \W]\$ '</span>
|
|||
|
|
|||
|
<span class="nb">alias </span><span class="nv">findh</span><span class="o">=</span><span class="s2">"cat </span><span class="nv">$HOME</span><span class="s2">/scripts/findhelp.txt"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">youtube</span><span class="o">=</span><span class="s1">'yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" --output "~/Vidéos/%(title)s.%(ext)s" --ignore-errors'</span>
|
|||
|
<span class="nb">alias </span><span class="nv">audio</span><span class="o">=</span><span class="s1">'yt-dlp --extract-audio --audio-format m4a --audio-quality 0 --output "~/Musique/%(title)s.%(ext)s"'</span>
|
|||
|
<span class="nb">alias </span><span class="nv">audiomp3</span><span class="o">=</span><span class="s1">'yt-dlp --extract-audio --audio-format mp3 --audio-quality 0 --output "~/Musique/%(title)s.%(ext)s"'</span>
|
|||
|
<span class="nb">alias </span>cryfs-autostart<span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/cryfs-autostart"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">dnsleak</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/dnsleaktest.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">toc</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/toc.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">nmapl</span><span class="o">=</span><span class="s2">"sudo nmap -T4 -sP 192.168.0.0/24"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">odt2html</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/_odt2html+index"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">off2htm</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/office2html.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">otp</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/generer-code-2fa-vers-presse-papier-toutes-les-30s.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">posturl</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/posturl"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">rename</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/remplacer-les-espaces-accents-dans-une-expression.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">sshm</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/ssh-manager.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">sshsyn</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/synchro-ssh-xoyize.xyz.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">sslxc</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/sslxc"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">ssvbox</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/ssvbox"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">tmuxssh</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/tmux-ssd.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">tmuxlxc</span><span class="o">=</span><span class="s2">"xterm -rv -geometry 100x30+100+350 -T yannstatic -e '/home/yann/scripts/tmux-lxc.sh'"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">vnc</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/sshvnc.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">traduc</span><span class="o">=</span><span class="s2">"/usr/local/bin/trans"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">wgkey</span><span class="o">=</span><span class="s2">"</span><span class="nv">$HOME</span><span class="s2">/scripts/generer_jeu_cle_wireguard.sh"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">tmuxvdb</span><span class="o">=</span><span class="s2">"xterm -geometry 100x30+100+350 -T yannstatic -e '/home/yann/scripts/tmux-vdb.sh'"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">service</span><span class="o">=</span><span class="s2">"systemctl --type=service"</span>
|
|||
|
<span class="c">#alias static="sshm vdb exe 'sudo systemctl restart yannstatic.service'"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">static</span><span class="o">=</span><span class="s2">"sshm lxcdeb exe 'cd ~/yannstatic; /home/lxcdeb/.rbenv/shims/jekyll build'"</span>
|
|||
|
<span class="nb">alias </span><span class="nv">statich</span><span class="o">=</span><span class="s2">"/usr/bin/brave --incognito https://static.xoyaz.xyz/aide-jekyll-text-theme.html"</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="liens-scripts-usr-local-bin">Liens scripts usr local bin”</h4>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># NE PAS CREER LES LIENS !!!!!!!!!!!!!!!!</span>
|
|||
|
<span class="c"># ----------------------------------------</span>
|
|||
|
<span class="c">#Créer des liens sur /usr/local/bin pour les scripts </span>
|
|||
|
|
|||
|
<span class="nv">$HOME</span>/scripts/compress /usr/local/bin/pdfdim
|
|||
|
<span class="nv">$HOME</span>/scripts/all-synchro.sh /usr/local/bin/allsync
|
|||
|
<span class="nv">$HOME</span>/scripts/borglist /usr/local/bin/borglist
|
|||
|
/opt/Postman/Postman /usr/local/bin/postman
|
|||
|
|
|||
|
<span class="nb">sudo ln</span> <span class="nt">-s</span> <span class="nv">$HOME</span>/scripts/tmux-ssd.sh /usr/local/bin/tmuxssh
|
|||
|
<span class="nb">sudo ln</span> <span class="nt">-s</span> <span class="nv">$HOME</span>/scripts/generer-code-2fa-vers-presse-papier-toutes-les-30s.sh /usr/local/bin/otp
|
|||
|
<span class="c">#sudo ln -s $HOME/scripts/virtuel /usr/local/bin/virtuel</span>
|
|||
|
<span class="c">#droits en exécution</span>
|
|||
|
<span class="c">#chmod +x $HOME/scripts/{ssh-manager.sh,savlog.sh,tmux-ssd.sh,virtuel}</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="liens-statique-et-notes">Liens “statique” et “Notes”</h4>
|
|||
|
|
|||
|
<p>les liens pour la rédaction des posts</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo ln -s $HOME/media/statique/images /images
|
|||
|
sudo ln -s $HOME/media/statique/files /files
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>les liens pour les images de Nextcloud Notes</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir /div
|
|||
|
sudo ln -s $HOME/media/img /div/img
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="partages-sshfs-vps">Partages SSHFS (vps)</h4>
|
|||
|
|
|||
|
<p>sshfs ,FUSE client based on the SSH File Transfer Protocol</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S sshfs
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Création des partages utilisés par sshfs</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir -p ~/vps/{cx21,cx11,xoyaz.xyz,autre,lxc,xoyize.xyz}
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="minicom">minicom</h4>
|
|||
|
|
|||
|
<p>Paramétrage de l’application terminale</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>
|
|||
|
A - Port série : <strong>/dev/ttyUSB0</strong> <br>
|
|||
|
F - Contrôle de flux matériel : <strong>Non</strong><br>
|
|||
|
Echap<br>
|
|||
|
Enregistrer config. sous dfl<br>
|
|||
|
Sortir de Minicom</p>
|
|||
|
|
|||
|
<h4 id="nano-comme-éditeur-par-défaut">Nano comme éditeur par défaut</h4>
|
|||
|
|
|||
|
<p>Attribution immédiate</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>export EDITOR=/usr/bin/nano
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Attribution permanente</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "export EDITOR=/usr/bin/nano" >> ~/.bashrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><a href="https://gitea.xoyaz.xyz/yann/nanorc">Pour le paramétrage highlight</a></p>
|
|||
|
|
|||
|
<h4 id="imprimante-et-scanner">Imprimante et scanner</h4>
|
|||
|
|
|||
|
<p>Prérequis , paquets cups, system-config-printer, et hplip installés (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>On démarre le service cups</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl start cups.service # lancement cups
|
|||
|
sudo systemctl enable cups.service # activation cups
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier le fonctionnement du service : http://localhost:631/</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>Paramétrage imprimante HP (su)
|
|||
|
Lancer “HP Device Manager” : <code class="language-plaintext highlighter-rouge">hp-setup</code></p>
|
|||
|
|
|||
|
<p><img src="/images/hp1.png" alt="image" width="400px"></p>
|
|||
|
|
|||
|
<p><img src="/images/hp2.png" alt="image" width="400px"></p>
|
|||
|
|
|||
|
<p><img src="/images/hp3.png" alt="image" width="400px"></p>
|
|||
|
|
|||
|
<p><img src="/images/hp4.png" alt="image" width="400px"></p>
|
|||
|
|
|||
|
<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 `hpaio:/net/OfficeJet_7510_series?ip=192.168.0.39' is a Hewlett-Packard OfficeJet_7510_series all-in-one
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Test</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.39 --format=png > test.png
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="journalctl">Journalctl</h4>
|
|||
|
|
|||
|
<p>Ajout utilisateur courant au groupe systemd-journal et adm</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo gpasswd -a $USER systemd-journal
|
|||
|
sudo gpasswd -a $USER adm
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Lignes non tronquées ,ajouter au fichier <strong>~/.bashrc</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo "export SYSTEMD_LESS=FRXMK journalctl" >> /home/$USER/.bashrc
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Prise en compte après déconnexion/reconnexion</p>
|
|||
|
|
|||
|
<p>Modifier le paramétrage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/journald.conf
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Rendre persistant journalctl (FACULTATIF)</strong><br>
|
|||
|
Par défaut <code class="language-plaintext highlighter-rouge">journalctl</code> affiche les logs du dernier boot. En cas de freeze de votre serveur, il peut être intéressant de comprendre ce qui s’est passé juste avant le plantage…Du coup nous allons rendre journalctl persistant.</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Oter le commentaire (#) à la ligne Storage=auto et remplacer <em>auto</em> par <em>persistent</em>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir /var/log/journal
|
|||
|
sudo systemd-tmpfiles --create --prefix /var/log/journal
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Limiter la taille stockage des logs à 250M</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>SystemMaxUse=250M</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Réinitialiser le journal</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl restart systemd-journald
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vous pouvez voir les différents boots</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl --list-boots
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> -3 1f6ad9d2c1694a7291b734dbf0336ac2 Fri 2022-06-10 16:03:09 CEST Fri 2022-06-10 17:57:08 CEST
|
|||
|
-2 8ff3c75bd4354e94b5dbf4c71b07421a Sat 2022-06-11 07:52:50 CEST Sat 2022-06-11 09:17:32 CEST
|
|||
|
-1 c8005fd3788a4921b26d184624b16e39 Sat 2022-06-11 09:40:04 CEST Sat 2022-06-11 10:35:22 CEST
|
|||
|
0 16f01117e2304439aceb0cb91b88087a Sat 2022-06-11 13:54:02 CEST Sat 2022-06-11 16:58:34 CEST
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="openjdk---jre">Openjdk - jre</h4>
|
|||
|
|
|||
|
<p>Runtime java</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S jre-openjdk
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="wireguard">Wireguard</h3>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S wireguard-tools openresolv
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Dossier /etc /wireguard <br>
|
|||
|
Configuration serveur wireguard wg.ouestline.xyz (cx11)<br>
|
|||
|
Lancement configuration</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
|
|||
|
cd /etc/wireguard
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour démarrer un tunnel avec un fichier de configuration</p>
|
|||
|
|
|||
|
<h4 id="wg-quick">wg-quick</h4>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="c"># wg-quick up <nom de l'interface></span>
|
|||
|
wg-quick up wg0 <span class="c"># lancement</span>
|
|||
|
|
|||
|
<span class="o">[</span><span class="c">#] ip link add wg0 type wireguard</span>
|
|||
|
<span class="o">[</span><span class="c">#] wg setconf wg0 /dev/fd/63</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -6 address add fd18:2941:ae9:7d96::3/128 dev wg0</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -4 address add 10.14.94.3/32 dev wg0</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip link set mtu 1420 up dev wg0</span>
|
|||
|
<span class="o">[</span><span class="c">#] resolvconf -a wg0 -m 0 -x</span>
|
|||
|
<span class="o">[</span><span class="c">#] wg set wg0 fwmark 51820</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -6 route add ::/0 dev wg0 table 51820</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -6 rule add not fwmark 51820 table 51820</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -6 rule add table main suppress_prefixlength 0</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip6tables-restore -n</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -4 rule add not fwmark 51820 table 51820</span>
|
|||
|
<span class="o">[</span><span class="c">#] ip -4 rule add table main suppress_prefixlength 0</span>
|
|||
|
<span class="o">[</span><span class="c">#] sysctl -q net.ipv4.conf.all.src_valid_mark=1</span>
|
|||
|
<span class="o">[</span><span class="c">#] iptables-restore -n</span>
|
|||
|
|
|||
|
wg-quick down wg0 <span class="c"># arrêt</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="service-systemd">service systemd</h4>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="c">#wg-quick@interfacename.service </span>
|
|||
|
systemctl start wg-quick@wg0.service
|
|||
|
systemctl status wg-quick@wg0.service
|
|||
|
|
|||
|
● wg-quick@wg0.service - WireGuard via wg-quick<span class="o">(</span>8<span class="o">)</span> <span class="k">for </span>wg0
|
|||
|
Loaded: loaded <span class="o">(</span>/usr/lib/systemd/system/wg-quick@.service<span class="p">;</span> disabled<span class="p">;</span> vendor preset: disabled<span class="o">)</span>
|
|||
|
Active: active <span class="o">(</span>exited<span class="o">)</span> since Tue 2020-11-24 20:54:09 CET<span class="p">;</span> 8s ago
|
|||
|
Docs: man:wg-quick<span class="o">(</span>8<span class="o">)</span>
|
|||
|
man:wg<span class="o">(</span>8<span class="o">)</span>
|
|||
|
https://www.wireguard.com/
|
|||
|
https://www.wireguard.com/quickstart/
|
|||
|
https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
|
|||
|
https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
|
|||
|
Process: 36391 <span class="nv">ExecStart</span><span class="o">=</span>/usr/bin/wg-quick up wg0 <span class="o">(</span><span class="nv">code</span><span class="o">=</span>exited, <span class="nv">status</span><span class="o">=</span>0/SUCCESS<span class="o">)</span>
|
|||
|
Main PID: 36391 <span class="o">(</span><span class="nv">code</span><span class="o">=</span>exited, <span class="nv">status</span><span class="o">=</span>0/SUCCESS<span class="o">)</span>
|
|||
|
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] ip -6 route add ::/0 dev wg0 table 51820</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] ip -6 rule add not fwmark 51820 table 51820</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] ip -6 rule add table main suppress_prefixlength 0</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36483]: <span class="o">[</span><span class="c">#] ip6tables-restore -n</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] ip -4 rule add not fwmark 51820 table 51820</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] ip -4 rule add table main suppress_prefixlength 0</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36391]: <span class="o">[</span><span class="c">#] sysctl -q net.ipv4.conf.all.src_valid_mark=1</span>
|
|||
|
nov. 24 20:54:09 archyan wg-quick[36493]: <span class="o">[</span><span class="c">#] iptables-restore -n</span>
|
|||
|
nov. 24 20:54:09 archyan systemd[1]: Finished WireGuard via wg-quick<span class="o">(</span>8<span class="o">)</span> <span class="k">for </span>wg0.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérification</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
|
|||
|
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
|||
|
inet 127.0.0.1/8 scope host lo
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
inet6 ::1/128 scope host
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
|
|||
|
link/ether 38:d5:47:7c:a0:6c brd ff:ff:ff:ff:ff:ff
|
|||
|
inet 192.168.0.43/24 brd 192.168.0.255 scope global dynamic noprefixroute enp0s31f6
|
|||
|
valid_lft 27798sec preferred_lft 22398sec
|
|||
|
inet6 2a01:e34:eebf:df0:b968:86b6:a0a9:79f7/64 scope global dynamic mngtmpaddr noprefixroute
|
|||
|
valid_lft 86183sec preferred_lft 86183sec
|
|||
|
inet6 fe80::8ece:7e8c:f571:b48b/64 scope link
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
4: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
|
|||
|
link/none
|
|||
|
inet 10.14.94.3/32 scope global wg0
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
inet6 fd18:2941:ae9:7d96::3/128 scope global
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>GtkWg</strong></p>
|
|||
|
|
|||
|
<p>Dossier : <code class="language-plaintext highlighter-rouge">sudo mkdir -p /usr/local/share/gtkwg</code><br>
|
|||
|
Droits <code class="language-plaintext highlighter-rouge">sudo chown $USER.users -R /usr/local/share/gtkwg/</code><br>
|
|||
|
Librairie : <code class="language-plaintext highlighter-rouge">yay -S libappindicator-gtk3</code><br>
|
|||
|
Les configurations mullvad <code class="language-plaintext highlighter-rouge">/usr/local/share/gtkwg/mullvad_config_linux_all/</code></p>
|
|||
|
|
|||
|
<p>Ajout configuration wireguard serveur <strong>cx11</strong> (wg.ouestline.xyz)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo cp wg0-archlinux-pc1.conf /usr/local/share/gtkwg/mullvad_config_linux_all/mullvad-frcx11.conf
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Le fichier <strong>desktop</strong> dans <code class="language-plaintext highlighter-rouge">~/.local/share/applications/menulibre-gtkwg.desktop</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.0
|
|||
|
Type=Application
|
|||
|
Name=Wireguard
|
|||
|
Comment=IconTray/Configuration
|
|||
|
Icon=/usr/local/share/gtkwg/wireguard_icon.png
|
|||
|
Exec=/usr/bin/sh /usr/local/share/gtkwg/GtkWgTray.sh
|
|||
|
Path=/usr/local/share/gtkwg/
|
|||
|
NoDisplay=false
|
|||
|
Categories=Utility;
|
|||
|
StartupNotify=false
|
|||
|
Terminal=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>xfce: “Menu -> Paramètres -> Session et démarrage”, Démarrage automatique d’applications<br>
|
|||
|
<img src="/images/sup-wireguard.png" alt="" width="400"></p>
|
|||
|
|
|||
|
<h2 id="sauvegardes">Sauvegardes</h2>
|
|||
|
|
|||
|
<p>3 options pour lancer la sauvegarde</p>
|
|||
|
|
|||
|
<h3 id="locales-systemd-timer-commande-ssh-systemd-user">Locales (systemd timer, commande ssh, systemd user)</h3>
|
|||
|
|
|||
|
<ol>
|
|||
|
<li>
|
|||
|
<a href="/2021/05/28/Sauvegardes_locales_avec_systemd_utilisateur_service_et_timer.html">Sauvegardes locales avec systemd utilisateur service et timer</a><br>
|
|||
|
Création d’un timer (~/.config/systemd/user/savyann.timer) et d’un service utilisateur (~/.config/systemd/user/savyann.service)<br>
|
|||
|
Le service, qui lance le script ‘/home/yann/scripts/sav-yann-media.sh’, est exécuté 15 minutes près le démarrage de l’ordinateur<br>
|
|||
|
Ce retard de 15 minutes est justifié pour être certain que l’ordinateur distant lenovo est bien démarré</li>
|
|||
|
<li>C’est l’ordinateur distant lenovo qui lance, lorsqu’il est prêt, le script de sauvegarde ‘/home/yann/scripts/sav-yann-media.sh’ via une commande SSH</li>
|
|||
|
<li>
|
|||
|
<p>systemd user <code class="language-plaintext highlighter-rouge">~/.config/systemd/user/savyann.service</code> , activation <code class="language-plaintext highlighter-rouge">systemctl enable --user savyann.service</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge">
|
|||
|
<div class="highlight"><pre class="highlight"><code> [Unit]
|
|||
|
Description=Sauvegarde jour
|
|||
|
|
|||
|
[Service]
|
|||
|
ExecStart=/bin/bash /home/yann/scripts/sav-yann-media.sh
|
|||
|
|
|||
|
[Install]
|
|||
|
WantedBy=default.target
|
|||
|
</code></pre></div> </div>
|
|||
|
</li>
|
|||
|
</ol>
|
|||
|
|
|||
|
<p class="info">L’option 3 , script de sauvegarde ‘/home/yann/scripts/sav-yann-media.sh’ est celle par défaut</p>
|
|||
|
|
|||
|
<h2 id="borg-sauvegarde-home-pc1">Borg sauvegarde home PC1</h2>
|
|||
|
|
|||
|
<p><img src="/images/borg-logo.png" alt=""></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="https://wiki.archlinux.org/title/Borg_backup_(Fran%C3%A7ais)">Archlinux Borg backup (Français)</a></li>
|
|||
|
<li><a href="https://wiki.archlinux.fr/Sauvegarde_des_donn%C3%A9es_avec_BORG">Archlinux : Sauvegarde des données avec BORG</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S borgbackup
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="borgbackup---serveur-lenovo">borgbackup -> Serveur lenovo</h3>
|
|||
|
|
|||
|
<p><a href="/2022/02/23/Serveur_debian_Lenovo_Thinkcentre_M700_Tiny_M2280-SSD500Go.html#borgbackup-serveur-lenovo">Opérations sur le serveur lenovo</a></p>
|
|||
|
|
|||
|
<p><strong><u>Créer un jeu de clé sur machine à sauvegarder (rnmkcy.eu)</u></strong></p>
|
|||
|
|
|||
|
<p>Générer un jeu de clé ssh pour borg</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-keygen -t ed25519 -o -a 100 -f ~/.ssh/borg_lenovo
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Ajout clé publique au serveur backup rnmkcy.eu</strong></p>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>Pour une connexion via ssh vous devez ajouter la clé publique <em>rnmkcy.eu_ed25519.pub</em> du <strong>serveur client rnmkcy.eu</strong> au fichier <em>~/.ssh/authorized_keys</em> du <strong>serveur backup rnmkcy.eu</strong></p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<p>Se connecter au <strong>serveur backup rnmkcy.eu</strong> depuis un terminal autorisé</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh leno@192.168.0.145 -p 55145 -i /home/yann/.ssh/lenovo-ed25519 # connexion SSH serveur backup depuis PC1
|
|||
|
sudo -s # passer en super utilisateur
|
|||
|
cat >> /mnt/sauvegardes/borgbackup/.ssh/authorized_keys
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Copier/coller le contenu du fichier du fichier de clef publique (fichier <strong>~/.ssh/borg_lenovo.pub</strong> de la machine à sauvegarder <strong>PC1</strong> ) dans ce terminal, et presser <strong>[Ctrl]+[D]</strong> pour valider.</p>
|
|||
|
|
|||
|
<p>Test depuis le serveur client <strong>PC1</strong> (c’est lui qui possède la clé privée).<br>
|
|||
|
<em>Si parefeu avec les sorties bloquées sur <strong>rnmkcy.eu</strong> , il faut ouvrir en sortie le port TCP 55145.</em></p>
|
|||
|
|
|||
|
<p><strong>AU PREMIER passage une question est posée , saisir oui ou yes</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo -s
|
|||
|
ssh -p 55145 -i ~/.ssh/borg_lenovo borg@rnmkcy.eu
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN8bMXcvg9Fdw5Hdu8TOTVN8ElNs39tq3iuH+E2BMHOu yann@archyan
|
|||
|
[yann@archyan ~]$ ssh -p 55145 -i ~/.ssh/borg_lenovo borg@rnmkcy.eu
|
|||
|
Linux think 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64
|
|||
|
_ __ __ ____ __ __
|
|||
|
| | ___ _ _ ___ __ __ ___ | \/ ||__ |/ \ / \
|
|||
|
| |__ / -_)| ' \ / _ \\ V // _ \ | |\/| | / /| () || () |
|
|||
|
|____|\___||_||_|\___/ \_/ \___/ |_| |_| /_/ \__/ \__/
|
|||
|
_ ___ ___ _ __ ___ __ _ _ _ ___
|
|||
|
/ |/ _ \|_ ) / | / / ( _ ) / \ / || | | | __|
|
|||
|
| |\_, / / / _ | |/ _ \/ _ \ _| () |_ | ||_ _||__ \
|
|||
|
|_| /_/ /___|(_)|_|\___/\___/(_)\__/(_)|_| |_| |___/
|
|||
|
$ id
|
|||
|
uid=1003(borg) gid=1003(borg) groupes=1003(borg)
|
|||
|
$ pwd
|
|||
|
/mnt/sauvegardes/borgbackup
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>saisir <code class="language-plaintext highlighter-rouge">exit</code> pour sortir</p>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>NOTE : <strong>/mnt/sauvegardes/borgbackup</strong> est le home de l’utilisateur <em>borg</em> sur le serveur backup <em>rnmkcy.eu</em></p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<p>Création d’un fichier <strong>exclusions</strong> qui contient toutes les exclusions de dossiers et fichiers , une exclusion par ligne</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkdir /home/yann/.borg
|
|||
|
nano /home/yann/.borg/exclusions
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/home/yann/.cache
|
|||
|
/home/yann/Partage
|
|||
|
/home/yann/iso
|
|||
|
/home/yann/lenovo
|
|||
|
/home/yann/media
|
|||
|
/home/yann/Téléchargements
|
|||
|
/home/yann/Vidéos
|
|||
|
/home/yann/temp
|
|||
|
/home/yann/vps
|
|||
|
/home/yann/sav
|
|||
|
/home/yann/virtuel
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Création du dépôt distant ‘archyan’ sur le serveur backup rnmkcy.eu (A FAIRE UNE SEULE FOIS)</strong></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">export </span><span class="nv">BORG_RSH</span><span class="o">=</span><span class="s1">'ssh -i /home/yann/Private/.borg/lenovo.borgssh'</span>
|
|||
|
<span class="nb">export </span><span class="nv">BORG_PASSPHRASE</span><span class="o">=</span><span class="si">$(</span><span class="nb">cat</span> /home/yann/Private/.borg/lenovo.passphrase<span class="si">)</span>
|
|||
|
borg init <span class="nt">--encryption</span><span class="o">=</span>repokey ssh://borg@rnmkcy.eu:55145/mnt/sauvegardes/borgbackup/archyan
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vous obtenez une réponse de ce type</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>By default repositories initialized with this version will produce security
|
|||
|
errors if written to with an older version (up to and including Borg 1.0.8).
|
|||
|
|
|||
|
If you want to use these older versions, you can disable the check by running:
|
|||
|
borg upgrade --disable-tam ssh://borg@rnmkcy.eu:55145/mnt/sauvegardes/borgbackup/archyan
|
|||
|
|
|||
|
See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
|
|||
|
|
|||
|
IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
|
|||
|
If you used a repokey mode, the key is stored in the repo, but you should back it up separately.
|
|||
|
Use "borg key export" to export the key, optionally in printable format.
|
|||
|
Write down the passphrase. Store both at safe place(s).
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Création du dépôt distant ‘media’ sur le serveur backup rnmkcy.eu (A FAIRE UNE SEULE FOIS)</strong></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">export </span><span class="nv">BORG_RSH</span><span class="o">=</span><span class="s1">'ssh -i /home/yann/Private/.borg/lenovo.borgssh'</span>
|
|||
|
<span class="nb">export </span><span class="nv">BORG_PASSPHRASE</span><span class="o">=</span><span class="si">$(</span><span class="nb">cat</span> /home/yann/Private/.borg/lenovo.passphrase<span class="si">)</span>
|
|||
|
borg init <span class="nt">--encryption</span><span class="o">=</span>repokey ssh://borg@rnmkcy.eu:55145/mnt/sauvegardes/borgbackup/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><a href="https://static.xoyaz.xyz/files/borg-backup-media.sh">script de sauvegarde ‘borg-backup-media.sh’</a></p>
|
|||
|
|
|||
|
<p><strong>Sauvegarde 1 fois par jour</strong></p>
|
|||
|
|
|||
|
<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><a href="https://static.xoyaz.xyz/files/sav-yann-media.sh">script de sauvegarde ‘sav-yann-media.sh’</a></p>
|
|||
|
|
|||
|
<h2 id="erreurs">Erreurs</h2>
|
|||
|
|
|||
|
<p><strong>terminator</strong> <em>No module named ‘validate’</em></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-S</span> devtools git <span class="c">#install devtools used to build in a clean chroot and git needed to obtain source</span>
|
|||
|
git clone git://git.archlinux.org/svntogit/community.git <span class="nt">--single-branch</span> <span class="nt">--branch</span> <span class="s2">"packages/python-configobj"</span> <span class="c">#clone package source</span>
|
|||
|
<span class="nb">chmod </span>777 <span class="nt">-R</span> community/trunk
|
|||
|
<span class="nb">cd </span>community/trunk
|
|||
|
curl <span class="nt">-o</span> PKGBUILD.diff http://ix.io/2J4c <span class="c">#download patch</span>
|
|||
|
git apply PKGBUILD.diff
|
|||
|
extra-x86_64-build <span class="c">#build package in a clean chroot</span>
|
|||
|
pacman <span class="nt">-U</span> python-configobj-5.0.6-10-any.pkg.tar.zst <span class="c">#install built package</span>
|
|||
|
<span class="nb">cd</span> ../..
|
|||
|
<span class="nb">rm</span> <span class="nt">-r</span> community/
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Firefox - OCSP</strong><br>
|
|||
|
<em>HTTPS connection fails with “MOZILLA_PKIX_ERROR_REQUIRED_TLS_FEATURE_MISSING”</em></p>
|
|||
|
|
|||
|
<p>Impossible de charger un site, message d’erreur semble signifier qu’il y a un problème avec la réponse OCSP du serveur : <em>*L’“agrafage” OCSP - inclusion de la vérification de la non-révocation du certificat du serveur - est requis mais non fourni.</em></p>
|
|||
|
|
|||
|
<p>(1) Dans un nouvel onglet, tapez ou collez <code class="language-plaintext highlighter-rouge">about:config</code> dans la barre d’adresse et appuyez sur <strong>Entrée/Retour</strong>. <br>
|
|||
|
<em>Cliquez sur le bouton en promettant d’être prudent.</em></p>
|
|||
|
|
|||
|
<p>(2) Dans la boîte de recherche située au-dessus de la liste, tapez ou collez <strong>ocsp</strong> pour filtrer</p>
|
|||
|
|
|||
|
<p>(3) Double-cliquez sur la préférence <strong>security.ssl.enable_ocsp_must_staple</strong> pour faire passer la valeur de <strong>true</strong> à <strong>false</strong></p>
|
|||
|
|
|||
|
<p>Essayez ensuite à nouveau le site, en contournant le cache (par exemple, Ctrl+Maj+r lorsque vous rechargez)</p>
|
|||
|
|
|||
|
<h2 id="acl---dossiers-locaux-multimédia">ACL - Dossiers locaux multimédia</h2>
|
|||
|
|
|||
|
<p><a href="/2020/11/12/Les-ACL-(Access-Control-Lists)-sous-Linux.html">Les ACL (Access Control Lists) sous Linux</a></p>
|
|||
|
|
|||
|
<p>Structure des dossiers multimédia</p>
|
|||
|
|
|||
|
<p>Il ya un lien ~/media -> /srv/media<br>
|
|||
|
Les dossiers concernés</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/srv/media/
|
|||
|
├── BiblioCalibre
|
|||
|
├── CalibreTechnique
|
|||
|
├── music
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les applications web pour les livres et la musique ont un propriétaire spécifique :<br>
|
|||
|
<strong>calibreweb</strong> pour l’application calibre-web<br>
|
|||
|
<strong>navidrome</strong> pour l’application navidrome</p>
|
|||
|
|
|||
|
<h4 id="local---music">Local - music</h4>
|
|||
|
|
|||
|
<p>Le dossier music a pour propriétaire <strong>navidrome</strong><br>
|
|||
|
Créer un utilisateur <strong>navidrome</strong> sans home</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo useradd -M navidrome
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérification</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>id navidrome
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>uid=1003(navidrome) gid=10000(navidrome) groupes=10000(navidrome)</em><br>
|
|||
|
Changement de propriétaire des dossiers</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo chown </span>navidrome:navidrome <span class="nt">-R</span> /srv/media/music
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Permissions ACL</strong><br>
|
|||
|
Visualiser les permissions ACLs du dossier existant</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl /srv/media/music
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl : suppression du premier « / » des noms de chemins absolus
|
|||
|
# file: srv/media/music
|
|||
|
# owner: navidrome
|
|||
|
# group: navidrome
|
|||
|
user::rwx
|
|||
|
group::rwx
|
|||
|
other::r-x
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les ACLs par défaut permettent de donner des permissions ACL en héritage pour tout sous-répertoire ou fichier créé dans un répertoire. Toutefois, ces ACLs par défaut ne s’appliquent pas aux objets déjà présents dans le répertoire.</p>
|
|||
|
|
|||
|
<p>Modifier l’ACL des fichiers existants</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> sudo setfacl -R -m u:yann:rwx /srv/media/music
|
|||
|
getfacl /srv/media/music
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl : suppression du premier « / » des noms de chemins absolus
|
|||
|
# file: srv/media/music
|
|||
|
# owner: navidrome
|
|||
|
# group: navidrome
|
|||
|
user::rwx
|
|||
|
user:yann:rwx
|
|||
|
group::rwx
|
|||
|
mask::rwx
|
|||
|
other::r-x
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Appliquer un ACL par défaut</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> sudo setfacl -m d:u:yann:rwx /srv/media/music
|
|||
|
getfacl /srv/media/music
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl : suppression du premier « / » des noms de chemins absolus
|
|||
|
# file: srv/media/music
|
|||
|
# owner: navidrome
|
|||
|
# group: navidrome
|
|||
|
user::rwx
|
|||
|
user:yann:rwx
|
|||
|
group::rwx
|
|||
|
mask::rwx
|
|||
|
other::r-x
|
|||
|
default:user::rwx
|
|||
|
default:user:yann:rwx
|
|||
|
default:group::rwx
|
|||
|
default:mask::rwx
|
|||
|
default:other::r-x
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Par exemple pour empêcher tous les autres (other) en termes de permissions pour tout nouveau fichier ou sous-répertoire créé :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo setfacl -m d:o::- /srv/media/music
|
|||
|
getfacl /srv/media/music
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl : suppression du premier « / » des noms de chemins absolus
|
|||
|
# file: srv/media/music
|
|||
|
# owner: navidrome
|
|||
|
# group: navidrome
|
|||
|
user::rwx
|
|||
|
user:yann:rwx
|
|||
|
group::rwx
|
|||
|
mask::rwx
|
|||
|
other::r-x
|
|||
|
default:user::rwx
|
|||
|
default:user:yann:rwx
|
|||
|
default:group::rwx
|
|||
|
default:mask::rwx
|
|||
|
default:other::---
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="local---bibliocalibre-et-calibretechnique">Local - BiblioCalibre et CalibreTechnique</h4>
|
|||
|
|
|||
|
<p>Les dossiers BiblioCalibre et CalibreTechnique ont pour propriétaire <strong>calibreweb</strong><br>
|
|||
|
Créer un utilisateur <strong>calibreweb</strong> sans home</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo useradd -M calibreweb
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérification</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>id calibreweb
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><em>uid=1002(calibreweb) gid=1002(calibreweb) groupes=1002(calibreweb)</em></p>
|
|||
|
|
|||
|
<p>Changement de propriétaire des dossiers</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo chown </span>calibreweb:calibreweb <span class="nt">-R</span> /srv/media/BiblioCalibre
|
|||
|
<span class="nb">sudo chown </span>calibreweb:calibreweb <span class="nt">-R</span> /srv/media/CalibreTechnique
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Permissions ACL</strong><br>
|
|||
|
Appliquer les procédures précédentes pour les dossiers BiblioCalibre et CalibreTechnique</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl /srv/media/BiblioCalibre && getfacl /srv/media/CalibreTechnique
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>getfacl : suppression du premier « / » des noms de chemins absolus
|
|||
|
# file: srv/media/BiblioCalibre
|
|||
|
# owner: calibreweb
|
|||
|
# group: calibreweb
|
|||
|
user::rwx
|
|||
|
user:yann:rwx
|
|||
|
group::rwx
|
|||
|
mask::rwx
|
|||
|
other::r-x
|
|||
|
default:user::rwx
|
|||
|
default:user:yann:rwx
|
|||
|
default:group::rwx
|
|||
|
default:mask::rwx
|
|||
|
default:other::---
|
|||
|
|
|||
|
getfacl : suppression du premier « / » des noms de chemins absolus
|
|||
|
# file: srv/media/CalibreTechnique
|
|||
|
# owner: calibreweb
|
|||
|
# group: calibreweb
|
|||
|
user::rwx
|
|||
|
user:yann:rwx
|
|||
|
group::rwx
|
|||
|
mask::rwx
|
|||
|
other::r-x
|
|||
|
default:user::rwx
|
|||
|
default:user:yann:rwx
|
|||
|
default:group::rwx
|
|||
|
default:mask::rwx
|
|||
|
default:other::---
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="distants">Distants</h4>
|
|||
|
|
|||
|
<p>Pour pouvoir effectuer une synchronisation locale → distante via rsync ou unison, il faut une autorisation en lecture/écriture sur les dossiers multimédia distants pour l’utilisateur de connexion “admin”</p>
|
|||
|
|
|||
|
<p><strong>Yunohost avec les applications calibre-web et navidrome installées</strong><br>
|
|||
|
On ajoute l’utilisateur “admin” aux groupes calibreweb et navidrome</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>gpasswd <span class="nt">-a</span> admin calibreweb
|
|||
|
<span class="nb">sudo </span>gpasswd <span class="nt">-a</span> admin navidrome
|
|||
|
<span class="nb">id </span>admin
|
|||
|
<span class="c"># --> uid=1007(admin) gid=1007(admin) groups=1007(admin),128(libvirt),64055(libvirt-qemu),997(calibreweb),996(navidrome),4001(admins)</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les dossiers BiblioCalibre et CalibreTechnique</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>admin@ouestyan:~$ ls -la /home/yunohost.multimedia/share/eBook/
|
|||
|
total 384
|
|||
|
drwxrwxr-x+ 4 calibreweb calibreweb 4096 Jan 2 10:51 .
|
|||
|
drwxrwxr-x+ 7 root root 4096 Jan 4 17:32 ..
|
|||
|
drwxrwxr-x+ 796 calibreweb calibreweb 36864 Jan 3 13:25 BiblioCalibre
|
|||
|
drwxrwxr-x+ 106 calibreweb calibreweb 4096 Jan 3 14:02 CalibreTechnique
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour le reste on ajoute l’utilisateur admin au groupe multimedia puis créer un dossier “Divers”</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>gpasswd <span class="nt">-a</span> admin multimedia
|
|||
|
<span class="nb">sudo mkdir</span> /home/yunohost.multimedia/share/Divers
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les dossiers</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>admin@xoyaz:~$ ls -la /home/yunohost.multimedia/share/Divers/
|
|||
|
total 28
|
|||
|
drwxrwxr-x+ 5 root root 4096 Jan 4 18:47 .
|
|||
|
drwxrwxr-x+ 7 root root 4096 Jan 4 18:26 ..
|
|||
|
drwxrwsr-x+ 5 yann users 4096 Oct 1 2020 diceware
|
|||
|
drwxr-xr-x+ 2 yann users 12288 Nov 29 07:55 img
|
|||
|
drwxrwsr-x+ 7 yann users 4096 Jan 4 18:52 osm-new
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour une prise en compte ,une reconnection admin est nécessaire</p>
|
|||
|
|
|||
|
<h2 id="nfs---non-utilise">NFS - NON UTILISE</h2>
|
|||
|
|
|||
|
<h3 id="nfs-utils">nfs-utils</h3>
|
|||
|
|
|||
|
<p><a href="https://doc.fedora-fr.org/wiki/Partage_de_disques_en_r%C3%A9seau_avec_NFS">Partage de disques en réseau avec NFS</a></p>
|
|||
|
|
|||
|
<p>Installer nfs-utils avec la commande</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S nfs-utils # archlinux
|
|||
|
sudo apt install nfs-common # debian
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>NFS - Serveur sur PC1</strong></p>
|
|||
|
|
|||
|
<p>Adresse IP PC1 : 192.168.0.42<br>
|
|||
|
Le fichier <code class="language-plaintext highlighter-rouge">/etc/exports</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Use `exportfs -arv` to reload.
|
|||
|
/srv/media/dplus/android-apk/Galaxy-S8_SM-G950F 192.168.0.0/24(rw,no_subtree_check)
|
|||
|
/mnt/partage 192.168.0.0/24(rw,sync,no_subtree_check,no_root_squash)
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Maintenant que le serveur NFS est configuré avec le point de montage NFS de base <code class="language-plaintext highlighter-rouge">/mnt/partage</code>, nous devons configurer SetGID dans ce répertoire</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo chmod 2770 /mnt/partage
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer un groupe appelé ‘local’ et associer l’utilisateur</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo groupadd -g 9999 local
|
|||
|
sudo usermod -a -G local $USER
|
|||
|
sudo chgrp local /mnt/partage
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Se déconnecter puis se connecter pour la prise en charge</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>id
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>uid=1000(yann) gid=985(users) groupes=985(users),98(power),972(libvirt),988(storage),992(kvm),998(wheel),9999(local)
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vous pouvez maintenant démarrer le serveur avec la commande suivante</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl start nfs-server.service
|
|||
|
sudo systemctl status nfs-server.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>● nfs-server.service - NFS server and services
|
|||
|
Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disa>
|
|||
|
Drop-In: /run/systemd/generator/nfs-server.service.d
|
|||
|
└─order-with-mounts.conf
|
|||
|
Active: active (exited) since Sat 2022-06-11 16:10:16 CEST; 9s ago
|
|||
|
Process: 6825 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
|
|||
|
Process: 6826 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS)
|
|||
|
Main PID: 6826 (code=exited, status=0/SUCCESS)
|
|||
|
CPU: 7ms
|
|||
|
|
|||
|
juin 11 16:10:16 archyan systemd[1]: Starting NFS server and services...
|
|||
|
juin 11 16:10:16 archyan systemd[1]: Finished NFS server and services.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activation nfs</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable nfs-server.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="nfs---client-debian">NFS - Client (debian)</h3>
|
|||
|
|
|||
|
<p>Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt install nfs-common -y
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo rpcinfo
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> program version netid address service owner
|
|||
|
100000 4 tcp6 ::.0.111 portmapper superuser
|
|||
|
100000 3 tcp6 ::.0.111 portmapper superuser
|
|||
|
100000 4 udp6 ::.0.111 portmapper superuser
|
|||
|
100000 3 udp6 ::.0.111 portmapper superuser
|
|||
|
100000 4 tcp 0.0.0.0.0.111 portmapper superuser
|
|||
|
100000 3 tcp 0.0.0.0.0.111 portmapper superuser
|
|||
|
100000 2 tcp 0.0.0.0.0.111 portmapper superuser
|
|||
|
100000 4 udp 0.0.0.0.0.111 portmapper superuser
|
|||
|
100000 3 udp 0.0.0.0.0.111 portmapper superuser
|
|||
|
100000 2 udp 0.0.0.0.0.111 portmapper superuser
|
|||
|
100000 4 local /run/rpcbind.sock portmapper superuser
|
|||
|
100000 3 local /run/rpcbind.sock portmapper superuser
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer un point de montage NFS</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mkdir -p /srv/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Tester manuellement le montage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mount -t nfs 192.168.0.42:/srv/media /srv/media
|
|||
|
sudo umount /srv/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Montage automatique à la demande avec timeout via fstab et x-systemd</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/fstab
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># montage nfs
|
|||
|
192.168.0.42:/srv/media /srv/media nfs defaults,timeo=900,retrans=5,_netdev 0 0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Montage manuel</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo mount -a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Désactiver NFS client</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl stop nfs-service
|
|||
|
sudo systemctl disable nfs-service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Démonter le point</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo umount /srv/media
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Modifier le fichier /etc/fstab</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># montage nfs
|
|||
|
# 192.168.0.42:/srv/media /srv/media nfs defaults,timeo=900,retrans=5,_netdev 0 0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h2 id="container-vm-et-vps">Container, VM et VPS</h2>
|
|||
|
|
|||
|
<h3 id="pont-bridge">Pont (Bridge)</h3>
|
|||
|
|
|||
|
<p>Pour un réseau en pont (bridge - adresse IP container dans le même réseau que l’hôte) : <a href="/2020/11/26/Archlinux-KVM_QEMU-VMM.html">Archlinux KVM/QEMU - Virtual Machine Manager - Réseau (network)</a></p>
|
|||
|
|
|||
|
<p>Ordinateur hôte PC1 en mode bridge<br>
|
|||
|
Désactiver le réseau “lan-yann” : <code class="language-plaintext highlighter-rouge">sudo netctl disable lan-yann</code></p>
|
|||
|
|
|||
|
<p>La configuration “pont statique”</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/netctl/bridge-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Description="Static Bridge connection"
|
|||
|
Interface=br0
|
|||
|
Connection=bridge
|
|||
|
BindsToInterfaces=(enp0s31f6)
|
|||
|
IP=static
|
|||
|
Address=('192.168.0.42/24')
|
|||
|
Gateway='192.168.0.254'
|
|||
|
DNS=('192.168.0.254')
|
|||
|
## Ignore (R)STP and immediately activate the bridge
|
|||
|
SkipForwardingDelay=yes
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Lancer et activer</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netctl start bridge-yann
|
|||
|
netctl enable bridge-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip a
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
|
|||
|
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
|||
|
inet 127.0.0.1/8 scope host lo
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
inet6 ::1/128 scope host
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
2: enp0s31f6: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
|
|||
|
link/ether 38:d5:47:7c:a0:6c brd ff:ff:ff:ff:ff:ff
|
|||
|
inet6 fe80::3ad5:47ff:fe7c:a06c/64 scope link
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
|
|||
|
link/ether 9a:87:46:a3:88:b9 brd ff:ff:ff:ff:ff:ff
|
|||
|
inet 192.168.0.42/24 brd 192.168.0.255 scope global br0
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
inet6 fdc4:62ff:57c6:0:9887:46ff:fea3:88b9/64 scope global dynamic mngtmpaddr
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
inet6 2a01:e0a:2de:2c70:9887:46ff:fea3:88b9/64 scope global dynamic mngtmpaddr
|
|||
|
valid_lft 86148sec preferred_lft 86148sec
|
|||
|
inet6 fe80::9887:46ff:fea3:88b9/64 scope link
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="lxc">LXC</h3>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>
|
|||
|
<a href="/2020/12/24/Archlinux_conteneur_LXC_debian_10_(buster).html">Archlinux container LXC debian 10 (buster) + Jekyll</a> <br>
|
|||
|
<em>Container LXC actif au démarrage de PC1, notamment utilisé pour la gestion du serveur statique</em>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p><strong>mount bind</strong> :un montage lié prend une arborescence de répertoires existante et la réplique sous un point différent. Les répertoires et les fichiers du montage lié sont les mêmes que ceux d’origine. <br>
|
|||
|
<em>Toute modification d’un côté est immédiatement répercutée de l’autre côté, car les deux vues affichent les mêmes données.</em><br>
|
|||
|
Par exemple, après avoir lancé la commande Linux</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount --bind /some/where /else/where
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>les répertoires /some/whereet /else/where ont le même contenu.</p>
|
|||
|
|
|||
|
<p>Les dossiers “bind” dans le fichier <code class="language-plaintext highlighter-rouge">/etc/fstab</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># LXC dossiers partagés
|
|||
|
/srv/media /var/lib/lxc/lxcbuster/rootfs/home/lxcdeb/media none bind 0 0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="tmuxlxc">tmuxlxc</h3>
|
|||
|
|
|||
|
<p>Visualisation en terminal synchro lxc avec xoyaz
|
|||
|
Le script : <code class="language-plaintext highlighter-rouge">/home/yann/scripts/tmux-lxc.sh</code><br>
|
|||
|
Le .desktop : <code class="language-plaintext highlighter-rouge">/home/yann/.local/share/applications/menulibre-tmuxlxc.desktop </code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.1
|
|||
|
Type=Application
|
|||
|
Name=Static-synchro
|
|||
|
Comment=multi fenêtres
|
|||
|
Icon=final-term
|
|||
|
Exec=xterm -rv -geometry 100x30+100+350 -T yannstatic -e '/home/yann/scripts/tmux-lxc.sh'
|
|||
|
Actions=
|
|||
|
Categories=Utility;
|
|||
|
Path=
|
|||
|
Terminal=false
|
|||
|
StartupNotify=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><img src="/images/tmuxlxc.png" alt=""></p>
|
|||
|
|
|||
|
<h3 id="qemukvm">QEMU/KVM</h3>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li><a href="/2022/10/25/Archlinux-KVM_QEMU-VMM.html">Archlinux Installer KVM QEMU + VMM + Pont réseau</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<h4 id="yunohost-virtuel-yunobulls">Yunohost virtuel (yunobulls)</h4>
|
|||
|
|
|||
|
<p>Créer une machine virtuelle debian 11 nommée yunobulls → <a href="/2021/12/22/Executer_Debian_sur_KVM_en_utilisant_l-image_de_nuage_Qcow2.html">Qemu/KVM - Serveur ouestyan.xyz debian 11 virtuel avec image cloud Qcow2 sur archlinux</a><br>
|
|||
|
La machine est gérée par “Virtual Machine Manager”</p>
|
|||
|
|
|||
|
<h3 id="tmuxssd">tmuxssd</h3>
|
|||
|
|
|||
|
<p>Configuration par défaut de tmux <code class="language-plaintext highlighter-rouge">$HOME/.tmux.conf</code></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#Configuration de tmux</span>
|
|||
|
<span class="c">#Origine : http://denisrosenkranz.com</span>
|
|||
|
<span class="c">#Yannick juin 2017</span>
|
|||
|
<span class="c"># Copier/Coller par la souris se fait avec la touche "Shift" appuyée</span>
|
|||
|
|
|||
|
<span class="c">##################################</span>
|
|||
|
<span class="c">#Changements des raccourcis claviers</span>
|
|||
|
<span class="c">##################################</span>
|
|||
|
<span class="c">#On change Control +b par Control +x</span>
|
|||
|
<span class="c">#set -g prefix C-x</span>
|
|||
|
<span class="c">#unbind C-b</span>
|
|||
|
<span class="c">#bind C-x send-prefix</span>
|
|||
|
|
|||
|
<span class="c">#On utilise control + flèches pour naviguer entre les terminaux</span>
|
|||
|
bind-key <span class="nt">-n</span> C-right next
|
|||
|
bind-key <span class="nt">-n</span> C-left prev
|
|||
|
|
|||
|
<span class="c">#on utilise alt + flèches our naviguer entre les panels</span>
|
|||
|
bind-key <span class="nt">-n</span> M-left <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-L</span>
|
|||
|
bind-key <span class="nt">-n</span> M-right <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-R</span>
|
|||
|
bind-key <span class="nt">-n</span> M-up <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-U</span>
|
|||
|
bind-key <span class="nt">-n</span> M-down <span class="k">select</span><span class="nt">-pane</span> <span class="nt">-D</span>
|
|||
|
|
|||
|
<span class="c">#On change les raccourcis pour faire du split vertical et horizontal</span>
|
|||
|
<span class="c">#On utilise la touche "|" (pipe) pour faire un split vertical</span>
|
|||
|
<span class="nb">bind</span> | split-window <span class="nt">-h</span>
|
|||
|
<span class="c">#Et la touche "-" pour faire un split horizontal</span>
|
|||
|
<span class="nb">bind</span> - split-window <span class="nt">-v</span>
|
|||
|
|
|||
|
<span class="c">##################################</span>
|
|||
|
<span class="c">#Changements pratiques</span>
|
|||
|
<span class="c">##################################</span>
|
|||
|
<span class="c">#On permet l'utilisation de la souris pour changer de terminal et de panel</span>
|
|||
|
<span class="nb">set</span> <span class="nt">-g</span> mouse on
|
|||
|
|
|||
|
<span class="c"># Sélection zone par clic gauche souris (texte sélectionné sur fond jaune)</span>
|
|||
|
<span class="c"># Après relachement du clic , le texte sélectionné est copié dans le presse-papier </span>
|
|||
|
<span class="c"># Le fond jaune disparaît</span>
|
|||
|
set-option <span class="nt">-s</span> set-clipboard off
|
|||
|
<span class="c"># For emacs copy mode bindings</span>
|
|||
|
<span class="c"># Il faut installer l'utilitaire 'xclip' (sudo pacman -S xclip)</span>
|
|||
|
bind-key <span class="nt">-T</span> copy-mode MouseDragEnd1Pane send-keys <span class="nt">-X</span> copy-pipe-and-cancel <span class="s2">"xclip -selection clipboard -i"</span>
|
|||
|
|
|||
|
<span class="c">#Les fenêtres commencent par 1 et non par 0</span>
|
|||
|
<span class="nb">set</span> <span class="nt">-g</span> base-index 1
|
|||
|
|
|||
|
<span class="c">##################################</span>
|
|||
|
<span class="c">#Changements visuels</span>
|
|||
|
<span class="c">##################################</span>
|
|||
|
<span class="c">#On met les panneaux non actif en gris</span>
|
|||
|
<span class="c">#set -g pane-border-fg colour244</span>
|
|||
|
<span class="c">#set -g pane-border-bg default</span>
|
|||
|
|
|||
|
<span class="c">#On met le panneau actif en rouge</span>
|
|||
|
<span class="c">#set -g pane-active-border-fg colour124</span>
|
|||
|
<span class="c">#set -g pane-active-border-bg default</span>
|
|||
|
|
|||
|
<span class="c">#On met la barre de status en gris</span>
|
|||
|
<span class="nb">set</span> <span class="nt">-g</span> status-fg colour235
|
|||
|
<span class="nb">set</span> <span class="nt">-g</span> status-bg colour250
|
|||
|
<span class="c">#set -g status-attr dim</span>
|
|||
|
|
|||
|
<span class="c"># On surligne les fenêtres actives dans la barre de status en gris foncés</span>
|
|||
|
<span class="c">#set-window-option -g window-status-current-fg colour15</span>
|
|||
|
<span class="c">#set-window-option -g window-status-current-bg colour0</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Visualisation en terminal des VPS avec terminator et tmux<br>
|
|||
|
Le script : <code class="language-plaintext highlighter-rouge">/home/yann/scripts/tmux-ssd-a.sh</code><br>
|
|||
|
Le .desktop : <code class="language-plaintext highlighter-rouge">/home/yann/.local/share/applications/menulibre-tmuxssd-a.desktop</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.1
|
|||
|
Type=Application
|
|||
|
Name=A - Serveurs VPS
|
|||
|
Comment=multi fenêtres
|
|||
|
Icon=final-term
|
|||
|
Exec=terminator --geometry=1900x1000+20+100 -e '/home/yann/scripts/tmux-ssd-a.sh'
|
|||
|
Actions=
|
|||
|
Categories=Utility;
|
|||
|
Path=
|
|||
|
Terminal=false
|
|||
|
StartupNotify=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><img src="/images/tmuxssd.png" alt=""></p>
|
|||
|
|
|||
|
<p>Le script : <code class="language-plaintext highlighter-rouge">/home/yann/scripts/tmux-ssd-b.sh</code><br>
|
|||
|
Le .desktop : <code class="language-plaintext highlighter-rouge">/home/yann/.local/share/applications/menulibre-tmuxssd-b.desktop</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.1
|
|||
|
Type=Application
|
|||
|
Name=B - Serveurs VPS
|
|||
|
Comment=multi fenêtres
|
|||
|
Icon=final-term
|
|||
|
Exec=terminator --geometry=1900x900+20+100 -e '/home/yann/scripts/tmux-ssd-b.sh'
|
|||
|
Actions=
|
|||
|
Categories=Utility;
|
|||
|
Path=
|
|||
|
Terminal=false
|
|||
|
StartupNotify=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="tmuxvdb">tmuxvdb</h3>
|
|||
|
|
|||
|
<p>Surveillance construction site statique et synchronisation avec le serveur xoyaz sur la machine virtuelle debian</p>
|
|||
|
|
|||
|
<p>Le bash <code class="language-plaintext highlighter-rouge">/home/yann/scripts/tmux-vdb.sh</code></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash </span>
|
|||
|
|
|||
|
<span class="c"># COLUMNSxROWS+X+Y -> xterm -geometry 400x200+100+350</span>
|
|||
|
<span class="c"># xterm -geometry 100x30+100+350 -T yannstatic -e '/home/yannick/scripts/tmux-lxc.sh'</span>
|
|||
|
<span class="c"># On supprime la session "vdbSess" si existante </span>
|
|||
|
|
|||
|
<span class="k">if</span> <span class="o">[[</span> <span class="sb">`</span>tmux list-sessions | <span class="nb">grep</span> <span class="s1">'vdbSess'</span> | <span class="nb">wc</span> <span class="nt">-l</span><span class="sb">`</span> <span class="o">!=</span> 0 <span class="o">]]</span>
|
|||
|
<span class="k">then</span>
|
|||
|
<span class="c"># On ferme la session active</span>
|
|||
|
tmux kill-session <span class="nt">-t</span> vdbSess
|
|||
|
<span class="k">fi</span>
|
|||
|
|
|||
|
|
|||
|
<span class="c"># Créer une bannière dans /etc/motd sur chaque serveur</span>
|
|||
|
<span class="c"># Nom du domaine en ascii voir lien http://patorjk.com/software/taag/#p=display&h=1&f=Small</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"fin fi"</span>
|
|||
|
<span class="c"># Créer session + terminal </span>
|
|||
|
tmux new <span class="nt">-d</span> <span class="nt">-s</span> vdbSess <span class="nt">-n</span> vdbTerm
|
|||
|
<span class="c"># Séparation horizontale en 2 du terminal</span>
|
|||
|
tmux split-window <span class="nt">-v</span> <span class="nt">-p</span> 50
|
|||
|
<span class="c"># | 0 |</span>
|
|||
|
<span class="c"># | |</span>
|
|||
|
<span class="c"># |-----------|</span>
|
|||
|
<span class="c"># | 1 |</span>
|
|||
|
<span class="c"># | |</span>
|
|||
|
<span class="c"># Sélection terminal HAUT</span>
|
|||
|
tmux selectp <span class="nt">-t</span> 0
|
|||
|
<span class="c"># </span>
|
|||
|
tmux send-keys <span class="nt">-t</span> vdbSess <span class="s1">'static'</span> C-m
|
|||
|
<span class="c"># Sélection terminal BAS</span>
|
|||
|
tmux selectp <span class="nt">-t</span> 1
|
|||
|
<span class="c"># </span>
|
|||
|
tmux send-keys <span class="nt">-t</span> vdbSess <span class="s2">"synchro"</span> C-m
|
|||
|
|
|||
|
<span class="c"># Afficher la session </span>
|
|||
|
tmux a <span class="nt">-t</span> vdbSess
|
|||
|
<span class="c">#</span>
|
|||
|
<span class="c"># Tuer la session</span>
|
|||
|
<span class="c"># tmux kill-session -t vdbSess</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Le desktop</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Version=1.1
|
|||
|
Type=Application
|
|||
|
Name=Static-synchro
|
|||
|
Comment=multi fenêtres
|
|||
|
Icon=final-term
|
|||
|
Exec=xterm -geometry 100x30+100+350 -T yannstatic -e '/home/yann/scripts/tmux-vdb.sh'
|
|||
|
Actions=
|
|||
|
Categories=Utility;
|
|||
|
Path=
|
|||
|
Terminal=false
|
|||
|
StartupNotify=false
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h2 id="maintenance">Maintenance</h2>
|
|||
|
|
|||
|
<h3 id="utilisateur---id-et-groupes">Utilisateur - Id et Groupes</h3>
|
|||
|
|
|||
|
<p>Vérifier id</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>id $USER
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>uid=1000(yann) gid=985(users) groupes=985(users),90(network),98(power),998(wheel),995(audio),992(kvm),988(storage),972(libvirt),9999(local),1000(yann)
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>En cas d’absence d’un ou plusieurs groupes</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo usermod -a -G users,yann,wheel,network,audio,local,power,storage,kvm,libvirt $USER
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<blockquote>
|
|||
|
<p>Dans cette commande je renouvelle toutes les appartenances aux groupes de l’utilisateur</p>
|
|||
|
</blockquote>
|
|||
|
|
|||
|
<h3 id="erreur-lancement-wing-personal-8">Erreur lancement “Wing Personal 8”</h3>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/local/lib/wing-personal8/bin/__os__/linux-x64/runtime-python3.9/bin/python3.9: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Le fichier libcrypt.so.1 est introuvable</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>yann@archyan ~]<span class="nv">$ </span><span class="nb">ls</span> /usr/lib/libcry<span class="k">*</span>
|
|||
|
/usr/lib/libcrypt.so /usr/lib/libcrypto.so /usr/lib/libcryptopp.so.8 /usr/lib/libcryptsetup.so.12
|
|||
|
/usr/lib/libcrypt.so.2 /usr/lib/libcrypto.so.1.1 /usr/lib/libcryptopp.so.8.6.0 /usr/lib/libcryptsetup.so.12.7.0
|
|||
|
/usr/lib/libcrypt.so.2.0.0 /usr/lib/libcryptopp.so /usr/lib/libcryptsetup.so
|
|||
|
|
|||
|
<span class="o">[</span>yann@archyan ~]<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-la</span> /usr/lib/libcry<span class="k">*</span>
|
|||
|
lrwxrwxrwx 1 root root 17 2 févr. 08:12 /usr/lib/libcrypt.so -> libcrypt.so.2.0.0
|
|||
|
lrwxrwxrwx 1 root root 17 2 févr. 08:12 /usr/lib/libcrypt.so.2 -> libcrypt.so.2.0.0
|
|||
|
<span class="nt">-rwxr-xr-x</span> 1 root root 165824 2 févr. 08:12 /usr/lib/libcrypt.so.2.0.0
|
|||
|
lrwxrwxrwx 1 root root 16 18 déc. 11:31 /usr/lib/libcrypto.so -> libcrypto.so.1.1
|
|||
|
<span class="nt">-rwxr-xr-x</span> 1 root root 2999144 18 déc. 11:31 /usr/lib/libcrypto.so.1.1
|
|||
|
lrwxrwxrwx 1 root root 20 10 janv. 16:55 /usr/lib/libcryptopp.so -> libcryptopp.so.8.6.0
|
|||
|
lrwxrwxrwx 1 root root 20 10 janv. 16:55 /usr/lib/libcryptopp.so.8 -> libcryptopp.so.8.6.0
|
|||
|
<span class="nt">-rwxr-xr-x</span> 1 root root 5066744 10 janv. 16:55 /usr/lib/libcryptopp.so.8.6.0
|
|||
|
lrwxrwxrwx 1 root root 23 3 févr. 12:16 /usr/lib/libcryptsetup.so -> libcryptsetup.so.12.7.0
|
|||
|
lrwxrwxrwx 1 root root 23 3 févr. 12:16 /usr/lib/libcryptsetup.so.12 -> libcryptsetup.so.12.7.0
|
|||
|
<span class="nt">-rwxr-xr-x</span> 1 root root 484192 3 févr. 12:16 /usr/lib/libcryptsetup.so.12.7.0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Création lien sur existant</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo ln -s /usr/lib/libcrypt.so /usr/lib/libcrypt.so.1
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="réseau-netctl---networkmanager">Réseau netctl -> NetworkManager</h3>
|
|||
|
|
|||
|
<h4 id="basculer-de-netctl-vers-networkmanager">Basculer de netctl vers NetworkManager</h4>
|
|||
|
|
|||
|
<p><a href="https://www.golinuxcloud.com/configure-network-bridge-nmcli-static-dhcp/">How to create and configure network bridge using nmcli (static & dhcp)</a> <br>
|
|||
|
<a href="https://www.cyberciti.biz/faq/how-to-add-network-bridge-with-nmcli-networkmanager-on-linux/">How to add network bridge with nmcli (NetworkManager) on Linux</a></p>
|
|||
|
|
|||
|
<p><strong>Netctl</strong><br>
|
|||
|
Configuration netctl <code class="language-plaintext highlighter-rouge">/etc/netctl/bridge-yann</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Description="Static Bridge connection"
|
|||
|
Interface=br0
|
|||
|
Connection=bridge
|
|||
|
BindsToInterfaces=(enp0s31f6)
|
|||
|
IP=static
|
|||
|
Address=('192.168.0.42/24')
|
|||
|
Gateway='192.168.0.254'
|
|||
|
DNS=('192.168.0.254')
|
|||
|
## Ignore (R)STP and immediately activate the bridge
|
|||
|
SkipForwardingDelay=yes
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les réseaux actifs</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netctl list
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> wlan-yann
|
|||
|
lan-enp3s0f1
|
|||
|
lan-yann
|
|||
|
bridge-dhcp
|
|||
|
* bridge-yann
|
|||
|
lan-enp3s0f0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Désactivation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>netctl disable bridge-yann
|
|||
|
netctl stop bridge-yann
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="networkmanagernmcli---créer-un-pont">NetworkManager(nmcli) - créer un pont</h4>
|
|||
|
|
|||
|
<p>Installer l’applet</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S network-manager-applet
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activation NetworkManager</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl enable NetworkManager
|
|||
|
systemctl start NetworkManager
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Informations</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con show
|
|||
|
nmcli con show --active
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME UUID TYPE DEVICE
|
|||
|
Connexion filaire 1 9e0f38b9-6434-3fbd-ba7f-39654812362a ethernet enp0s31f6
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Créer un pont avec STP désactivé (pour éviter que le pont soit annoncé sur le réseau)</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con add ifname br0 type bridge con-name br0 stp no
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Faire de l’interface <em>enp0s31f6</em> un interface du pont :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con add type bridge-slave ifname enp0s31f6 master br0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Définir la connexion existante comme étant hors service (vous pouvez l’obtenir avec nmcli connection show –active) :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection show
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME UUID TYPE DEVICE
|
|||
|
br0 371da233-615f-4cb6-9c07-6fd4ea23a133 bridge br0
|
|||
|
Connexion filaire 1 9e0f38b9-6434-3fbd-ba7f-39654812362a ethernet enp0s31f6
|
|||
|
bridge-slave-enp0s31f6 a0b2dcb5-4a75-4154-b844-653392cd23f6 ethernet --
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour activer l’interface bridge, désactiver “Connexion filaire 1” et activer “br0”</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con down "Connexion filaire 1"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Configurer le nouveau pont comme up</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con up br0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Il existe diverses options configurables avec l’interface de pont réseau, que vous pouvez modifier à l’aide de nmcli. Par exemple, le protocole Spanning tree (STP) est activé par défaut. Les valeurs utilisées sont issues de la norme IEEE 802.1D-1998. Pour désactiver le STP pour ce pont, émettez une commande comme suit en tant que racine :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con modify br0 bridge.stp no
|
|||
|
nmcli -f bridge con show br0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bridge.mac-address: --
|
|||
|
bridge.stp: non
|
|||
|
bridge.priority: 32768
|
|||
|
bridge.forward-delay: 15
|
|||
|
bridge.hello-time: 2
|
|||
|
bridge.max-age: 20
|
|||
|
bridge.ageing-time: 300
|
|||
|
bridge.group-forward-mask: 0
|
|||
|
bridge.multicast-snooping: oui
|
|||
|
bridge.vlan-filtering: non
|
|||
|
bridge.vlan-default-pvid: 1
|
|||
|
bridge.vlans: --
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajout adresse ip statique</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli con modify br0 ipv4.method manual ipv4.address "192.168.0.42/24" ipv4.gateway "192.168.0.254"
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Appliquer les changements</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection up br0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Vérifier la configuration du pont réseau</strong></p>
|
|||
|
|
|||
|
<p>si l’adresse IP br0 a été attribuée.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ip addr show dev br0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>8: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
|
|||
|
link/ether 9a:87:46:a3:88:b9 brd ff:ff:ff:ff:ff:ff
|
|||
|
inet 192.168.0.42/24 brd 192.168.0.255 scope global dynamic noprefixroute br0
|
|||
|
valid_lft 42062sec preferred_lft 42062sec
|
|||
|
inet6 2a01:e0a:2de:2c70:5acb:69d6:8e37:5775/64 scope global dynamic noprefixroute
|
|||
|
valid_lft 85888sec preferred_lft 85888sec
|
|||
|
inet6 fe80::be39:416e:4ed7:d565/64 scope link noprefixroute
|
|||
|
valid_lft forever preferred_lft forever
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ensuite, essayez d’envoyer un ping à la passerelle de l’interface du pont et assurez-vous qu’elle est accessible.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ping -c3 192.168.0.254
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PING 192.168.0.254 (192.168.0.254) 56(84) octets de données.
|
|||
|
64 octets de 192.168.0.254 : icmp_seq=1 ttl=64 temps=0.368 ms
|
|||
|
64 octets de 192.168.0.254 : icmp_seq=2 ttl=64 temps=0.324 ms
|
|||
|
64 octets de 192.168.0.254 : icmp_seq=3 ttl=64 temps=0.293 ms
|
|||
|
|
|||
|
--- statistiques ping 192.168.0.254 ---
|
|||
|
3 paquets transmis, 3 reçus, 0% packet loss, time 2037ms
|
|||
|
rtt min/avg/max/mdev = 0.293/0.328/0.368/0.030 ms
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Étant donné que nmcli apporte des modifications persistantes à la configuration du réseau, vous pouvez également vérifier les fichiers de configuration du réseau créés par nmcli.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/NetworkManager/system-connections/br0.nmconnection
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[connection]
|
|||
|
id=br0
|
|||
|
uuid=371da233-615f-4cb6-9c07-6fd4ea23a133
|
|||
|
type=bridge
|
|||
|
interface-name=br0
|
|||
|
permissions=
|
|||
|
timestamp=1635945825
|
|||
|
|
|||
|
[bridge]
|
|||
|
stp=false
|
|||
|
|
|||
|
[ipv4]
|
|||
|
address1=192.168.0.42/24,192.168.0.254
|
|||
|
dns-search=
|
|||
|
method=manual
|
|||
|
|
|||
|
[ipv6]
|
|||
|
addr-gen-mode=stable-privacy
|
|||
|
dns-search=
|
|||
|
method=auto
|
|||
|
|
|||
|
[proxy]
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>De même, vérifiez le fichier de configuration de l’interface esclave du pont réseau.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/NetworkManager/system-connections/bridge-slave-enp0s31f6.nmconnection
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[connection]
|
|||
|
id=bridge-slave-enp0s31f6
|
|||
|
uuid=a0b2dcb5-4a75-4154-b844-653392cd23f6
|
|||
|
type=ethernet
|
|||
|
interface-name=enp0s31f6
|
|||
|
master=br0
|
|||
|
permissions=
|
|||
|
slave-type=bridge
|
|||
|
|
|||
|
[ethernet]
|
|||
|
mac-address-blacklist=
|
|||
|
|
|||
|
[bridge-port]
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifiez votre passerelle par défaut</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 br0 proto dhcp metric 425
|
|||
|
192.168.0.0/24 dev br0 proto kernel scope link src 192.168.0.42 metric 425
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Il faut les connexions “pont” en connection auto<br>
|
|||
|
<img src="/images/pc1-003.png" alt=""><br>
|
|||
|
<img src="/images/pc1-004.png" alt=""><br>
|
|||
|
<img src="/images/pc1-005.png" alt=""><br>
|
|||
|
<img src="/images/pc1-006.png" alt=""></p>
|
|||
|
|
|||
|
<p><strong>En cas d’erreur réseau</strong></p>
|
|||
|
|
|||
|
<p><img src="/images/pc1-002.png" alt=""></p>
|
|||
|
|
|||
|
<h4 id="networkmanager-ajout-connexion-routeur-4g">NetworkManager ajout connexion routeur 4G</h4>
|
|||
|
|
|||
|
<p>Dans le cas d’une utilisation d’un routeur 4G connecté sur l’interface réseau enp3s0f0<br>
|
|||
|
Le routeur est DHCP sur le réseau 192.168.8.0/24<br>
|
|||
|
DNS sur 192.168.8.1</p>
|
|||
|
|
|||
|
<p><img src="/images/pc1-007.png" alt=""><br>
|
|||
|
<img src="/images/pc1-008.png" alt=""></p>
|
|||
|
|
|||
|
<h4 id="résumé-réseau">Résumé réseau</h4>
|
|||
|
|
|||
|
<p>On est connecté sur le réseau Box 192.168.0.0/24 et le réseau routeur 4G 192.168.8.0/24<br>
|
|||
|
Wireguard mullvad est actif<br>
|
|||
|
<img src="/images/pc1-009.png" alt=""></p>
|
|||
|
|
|||
|
<h3 id="sshd-configuration">SSHD configuration</h3>
|
|||
|
|
|||
|
<p>Pour un accès sur l’ordinateur PC1 depuis un autre poste qui est sur le même réseau <code class="language-plaintext highlighter-rouge">192.168.0.0/24</code><br>
|
|||
|
Modifier la ligne (si existante) <code class="language-plaintext highlighter-rouge">PermitRootLogin yes</code> par <code class="language-plaintext highlighter-rouge">PermitRootLogin no</code> <br>
|
|||
|
puis les lignes suivantes :</p>
|
|||
|
|
|||
|
<p><u>pour un accès avec mot de passe</u></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PasswordAuthentication yes # les mots de passe en clair sont autorisés
|
|||
|
AllowUsers *@192.168.0.* # accès uniquement sur le réseau local
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><u>pour un accès avec clé</u></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PasswordAuthentication no # les mots de passe en clair ne sont pas autorisés
|
|||
|
AllowUsers *@192.168.0.* # accès uniquement sur le réseau local
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Redémarrer ssh</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl restart sshd
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="neofetch">Neofetch</h3>
|
|||
|
|
|||
|
<p>pour visualiser les informations du système</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S neofetch
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour avoir les informations saisir <code class="language-plaintext highlighter-rouge">neofetch</code></p>
|
|||
|
|
|||
|
<p><img src="/images/neofetch_pc1.png" alt=""></p>
|
|||
|
|
|||
|
<h3 id="les-liens-dans-home">Les liens dans home</h3>
|
|||
|
|
|||
|
<p>Les liens après montage</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>yann@archyan ~]<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-l</span> |grep ^l
|
|||
|
lrwxrwxrwx 1 yann <span class="nb">users </span>12 20 oct. 2021 Partage -> /mnt/partage
|
|||
|
lrwxrwxrwx 1 root root 8 6 mars 2021 iso -> /srv/iso
|
|||
|
lrwxrwxrwx 1 root root 11 2 janv. 07:41 lenovo -> /mnt/lenovo
|
|||
|
lrwxrwxrwx 1 root root 10 6 mars 2021 media -> /srv/media
|
|||
|
lrwxrwxrwx 1 root root 12 6 mai 07:39 sav -> /sauvegardes
|
|||
|
lrwxrwxrwx 1 root root 8 6 mai 07:52 virtuel -> /virtuel
|
|||
|
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="chiffrer-dossier-private">Chiffrer dossier Private</h3>
|
|||
|
|
|||
|
<p><a href="/2017/07/21/chiffrement-ecryptfs.html">Chiffrement (eCryptfs)</a></p>
|
|||
|
|
|||
|
<h3 id="gérer-presse-papier">Gérer Presse Papier</h3>
|
|||
|
|
|||
|
<p><em><a href="https://blog.madrzejewski.com/presse-papier-ligne-commande-cli-linux-xclip/">Gérer le presse-papier en ligne de commande sous Linux avec xclip</a></em></p>
|
|||
|
|
|||
|
<p><u>Copier des données dans le presse papier</u></p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s2">"Du texte en presse papier"</span> | xclip
|
|||
|
<span class="c"># L'option -i pour "in", pas forcément nécessaire</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"Du texte en presse papier"</span> | xclip <span class="nt">-i</span>
|
|||
|
<span class="c"># Fonctionne aussi avec des commandes</span>
|
|||
|
<span class="nb">uptime</span> | xclip
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>placer le contenu d’un fichier dans le presse papier</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s2">"Du texte"</span> <span class="o">></span> mon_fichier.txt
|
|||
|
xclip < mon_fichiers.txt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>On peut également manipuler deux presses papiers. Si vous ne le saviez pas, il existe (au moins) deux presses papiers sur Linux :</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Celui accessible avec la sélection et le clic-molette de la souris. Pour xclip, c’est le presse papier primary</li>
|
|||
|
<li>Celui accessible avec les raccourcis CTRL + C et CTLR + V (ou clic droit copier/coller). C’est le presse papierclipboard.</li>
|
|||
|
<li>Dans le manuel de xclip, il est mentionné une troisième optionsecondary mais dans mes tests, cela ne semble pas fonctionner. En faisant quelques recherches, la distinction semble être expliquée sur un article à propos de X et la gestion du presse papier. L’article ne parle pas de secondary donc pour moi, secondary n’existe pas dans X, <u>c’est **clipboard** qu’il faut utiliser</u>. En résumé, on oublie secondary.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Par défaut, <strong>xclip</strong> place les données dans le presse papier principal, c’est-à-dire celui accessible avec le <strong>clic-molette</strong>. Cela peut se changer avec l’option <code class="language-plaintext highlighter-rouge">-selection</code> :</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># On enregistre la date dans le presse papier 'clipboard', on utilise CTRL + V ou clic droit/coller pour l'utiliser</span>
|
|||
|
<span class="nb">date</span> | xclip <span class="nt">-selection</span> clipboard
|
|||
|
<span class="c"># On enregistre la date dans le presse papier 'secondary', on utilise le clic molette pour l'utiliser</span>
|
|||
|
<span class="nb">date</span> | xclip <span class="nt">-selection</span> primary
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><u>Coller des données</u></p>
|
|||
|
|
|||
|
<p>Pour coller des données, on peut utiliser le <strong>clic molette</strong> pour le presse papier primary ou** CTRL + V** et clic droit/coller pour le presse papier clipboard (voire même SHIFT + INSERT, mais c’est moins connu).</p>
|
|||
|
|
|||
|
<p>On peut également utiliser xclip pour coller des données, ce qui permet de gérer cela en ligne de commande ou dans un script. Pour cela, il suffit de lancer xclip avec l’option -o (pour out). L’option -selection est toujours supportée, elle permet de choisir à partir de quel presse papier il faut récupérer les données</p>
|
|||
|
|
|||
|
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># On place des données dans le presse papier primaire, les deux commandes sont équivalentes</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"primary"</span> | xclip
|
|||
|
<span class="nb">echo</span> <span class="s2">"primary"</span> | xclip <span class="nt">-selection</span> primary
|
|||
|
<span class="c"># On affiche les données du presse papier primaire, les deux commandes sont équivalentes</span>
|
|||
|
xclip <span class="nt">-o</span>
|
|||
|
xclip <span class="nt">-o</span> <span class="nt">-selection</span> primary
|
|||
|
<span class="c"># On place les données dans un fichier</span>
|
|||
|
xclip <span class="nt">-o</span> <span class="nt">-selection</span> primary <span class="o">></span> mon_fichier.txt
|
|||
|
<span class="c"># On place des données dans le presse papier secondaire</span>
|
|||
|
<span class="nb">echo</span> <span class="s2">"clipboard"</span> | xclip <span class="nt">-selection</span> clipboard
|
|||
|
<span class="c"># On affiche les données du presse papier secondaire</span>
|
|||
|
xclip <span class="nt">-o</span> <span class="nt">-selection</span> clipboard
|
|||
|
<span class="c"># On place les données du presse papier secondaire dans un fichier</span>
|
|||
|
xclip <span class="nt">-o</span> <span class="nt">-selection</span> clipboard <span class="o">></span> mon_fichier.txt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="diagramme-réseau">Diagramme réseau</h3>
|
|||
|
|
|||
|
<p><img src="/images/yannick-reseau.png" alt=""></p>
|
|||
|
|
|||
|
<h2 id="démarrer-eteindre-une-machine-sur-le-réseau">Démarrer-Eteindre une machine sur le réseau</h2>
|
|||
|
|
|||
|
<p><em>On veut démarrer ou éteindre une machine distante sur le réseau via ssh et “wake on lan”</em></p>
|
|||
|
|
|||
|
<h3 id="wake-on-lan">Wake on Lan</h3>
|
|||
|
|
|||
|
<p><a href="https://www.cyberciti.biz/tips/linux-send-wake-on-lan-wol-magic-packets.html">How To Wake Up Computers Using Linux Command [ Wake-on-LAN ( WOL ) ] By Sending Magic Packets</a><br>
|
|||
|
wake-on-LAN (WOL) est une norme de réseau Ethernet qui permet d’allumer un serveur par un message réseau. Vous devez envoyer des “paquets magiques” aux adaptateurs Ethernet et aux cartes mères compatibles avec le WOL pour allumer les systèmes concernés. Assurez-vous de connecter la carte réseau (eth0 ou eth1) à la carte mère et d’activer la fonction WOL du BIOS. Voici un guide rapide pour activer la fonction WOL sous RHEL / Fedora / CentOS / Debian / Ubuntu Linux.</p>
|
|||
|
|
|||
|
<p>Dans le bios du lenovo M700, le paramètre “wake on lan” est sur automatique.<br>
|
|||
|
Lorsque le Lenovo M700 eest éteint, on peut le rallumer avec un outil logiciel et l’adresse mac de la machine</p>
|
|||
|
|
|||
|
<p>Il faut utiliser un logiciel client pour envoyer les “paquets magiques” WoL (Wake-on-LAN) au système cible. Vous trouverez divers outils pour tous les systèmes d’exploitation modernes, notamment MS-Windows 8/10, Apple macOS & OS X, toutes les distros Linux modernes, FreeBSD, OpenBSD, NetBSD et de nombreux smartphones.Il existe également un script Perl pour réveiller les ordinateurs. Nous pouvons l’installer comme suit</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt install wakeonlan # Debian/Ubuntu
|
|||
|
yay -S wakeonlan # archlinux
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vous pouvez obtenir l’adresse MAC en combinant la commande ping et la commande arp.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ping -c 4 rnmkcy.eu && arp -n
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>PING rnmkcy (192.168.0.145) 56(84) octets de données.
|
|||
|
64 octets de rnmkcy (192.168.0.145) : icmp_seq=1 ttl=64 temps=0.587 ms
|
|||
|
64 octets de rnmkcy (192.168.0.145) : icmp_seq=2 ttl=64 temps=0.520 ms
|
|||
|
64 octets de rnmkcy (192.168.0.145) : icmp_seq=3 ttl=64 temps=0.562 ms
|
|||
|
64 octets de rnmkcy (192.168.0.145) : icmp_seq=4 ttl=64 temps=0.559 ms
|
|||
|
|
|||
|
--- statistiques ping rnmkcy ---
|
|||
|
4 paquets transmis, 4 reçus, 0% packet loss, time 3031ms
|
|||
|
rtt min/avg/max/mdev = 0.520/0.557/0.587/0.023 ms
|
|||
|
Address HWtype HWaddress Flags Mask Iface
|
|||
|
192.168.0.145 ether 00:23:24:c9:06:86 C br0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Utilisation d’une adresse de diffusion de sous-réseau :</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wakeonlan -i 192.168.0.255 00:23:24:c9:06:86
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Sending magic packet to 192.168.0.255:9 with payload 00:23:24:c9:06:86
|
|||
|
Hardware addresses: <total=1, valid=1, invalid=0>
|
|||
|
Magic packets: <sent=1>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Patienter 2 à 3 minutes avant d’accéder à la machine…</p>
|
|||
|
|
|||
|
<h3 id="pc1---script-au-démarrage">PC1 - Script au démarrage</h3>
|
|||
|
|
|||
|
<p><em>On veut démarrer la machine distante Lenovo 192.168.0.145 via le réseau</em></p>
|
|||
|
|
|||
|
<h4 id="option-a---exécution-commande-au-démarrage-quand-réseau-accessible">Option A - Exécution commande au démarrage quand réseau accessible</h4>
|
|||
|
|
|||
|
<p>Exécuter la commande au démarrage avec systemd après que le réseau soit devenu accessible.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/system/run-at-startup.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
|
|||
|
Description=Run script at startup after network becomes reachable
|
|||
|
After=network.target
|
|||
|
|
|||
|
[Service]
|
|||
|
Type=simple
|
|||
|
RemainAfterExit=yes
|
|||
|
ExecStart=/usr/bin/wakeonlan -i 192.168.0.255 00:23:24:c9:06:86
|
|||
|
TimeoutStartSec=0
|
|||
|
|
|||
|
[Install]
|
|||
|
WantedBy=default.target
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rafraîchir les fichiers de configuration de systemd et activer le service</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
|
|||
|
sudo systemctl enable run-at-startup.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier la bonne exécution</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl -u run-at-startup.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>févr. 23 19:57:12 archyan systemd[1]: Started Run script at startup after network becomes reachable.
|
|||
|
févr. 23 19:57:12 archyan startup_script.sh[462]: Sending magic packet to 192.168.0.255:9 with payload 00:23:24:c9:06:86
|
|||
|
févr. 23 19:57:12 archyan startup_script.sh[462]: Hardware addresses: <total=1, valid=1, invalid=0>
|
|||
|
févr. 23 19:57:12 archyan startup_script.sh[462]: Magic packets: <sent=1>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="option-b---exécution-commande-au-démarrage-après-un-temps-défini-active">Option B - Exécution commande au démarrage après un temps défini ACTIVE</h4>
|
|||
|
|
|||
|
<p><strong>Fichier service systemd pour exécuter un script N minutes après le démarrage</strong><br>
|
|||
|
Nous devons créer un fichier de <strong>service systemd unit</strong> et un <strong>fichier timer systemd</strong> unit correspondant pour exécuter le script N minutes après le démarrage. <br>
|
|||
|
Nous pouvons utiliser <code class="language-plaintext highlighter-rouge">OnBootSec=</code> ou <code class="language-plaintext highlighter-rouge">OnStartupSec=</code> pour exécuter le script avec un délai après le démarrage sous Linux.</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>
|
|||
|
<code class="language-plaintext highlighter-rouge">OnBootSec=</code> Définit un délai relatif au moment où la machine a été démarrée. Dans les conteneurs, pour l’instance du gestionnaire de système, cela correspond à OnStartupSec=, ce qui rend les deux équivalents.</li>
|
|||
|
<li>
|
|||
|
<code class="language-plaintext highlighter-rouge">OnStartupSec=</code> Définit une minuterie relative au moment où le gestionnaire de services a été démarré pour la première fois. Pour les unités de temporisation du système, cela est très similaire à OnBootSec= car le gestionnaire de services du système est généralement démarré très tôt au démarrage. Il est principalement utile lorsqu’il est configuré dans des unités fonctionnant dans le gestionnaire de services par utilisateur, car le gestionnaire de services utilisateur est généralement démarré à la première connexion seulement, et pas déjà au démarrage.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/systemd/system/run-script-with-delay.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
|
|||
|
Description=Run script at startup
|
|||
|
|
|||
|
[Service]
|
|||
|
Type=oneshot
|
|||
|
ExecStart=/usr/bin/wakeonlan -i 192.168.0.255 00:23:24:c9:06:86
|
|||
|
TimeoutStartSec=0
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>fichier de temporisation de l’unité systemd pour exécuter un script N minutes après le démarrage</strong><br>
|
|||
|
<code class="language-plaintext highlighter-rouge">timer</code> est un fichier de configuration d’unité dont le nom se termine par <strong>“.timer”</strong> encode des informations sur un timer contrôlé et supervisé par systemd, pour une activation basée sur un timer.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/systemd/system/run-script-with-delay.timer
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
|
|||
|
Description="Run script after 2 minutes of boot"
|
|||
|
|
|||
|
[Timer]
|
|||
|
OnBootSec=2min
|
|||
|
|
|||
|
[Install]
|
|||
|
WantedBy=default.target
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>L’unité à activer lorsque cette minuterie s’écoule est fournie en utilisant <code class="language-plaintext highlighter-rouge">Unit=</code> sous <code class="language-plaintext highlighter-rouge">[Timer]</code>. Ici, puisque notre service systemd et notre fichier de temporisation portent le même nom, c’est-à-dire <code class="language-plaintext highlighter-rouge">run-script-with-delay</code>, nous n’avons pas défini d’<code class="language-plaintext highlighter-rouge">Unit=</code> dans le fichier d’unité de la temporisation. Si les noms de votre service unitaire et de votre fichier timer sont différents, fournissez le nom du fichier de service mappé avec <code class="language-plaintext highlighter-rouge">Unit=</code> dans le fichier .timer sous <code class="language-plaintext highlighter-rouge">[Timer]</code><br>
|
|||
|
Ici pour <strong>OnBootSec</strong> ou <strong>OnStartupSec</strong></p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Les arguments des directives sont des intervalles de temps configurés en secondes. Exemple : <code class="language-plaintext highlighter-rouge">OnBootSec=50</code> signifie 50s après le démarrage.</li>
|
|||
|
<li>L’argument peut également inclure des unités de temps. Exemple : <code class="language-plaintext highlighter-rouge">OnBootSec=5h 30min</code> signifie 5 heures et 30 minutes après le démarrage.</li>
|
|||
|
<li>Pour plus de détails sur la syntaxe des intervalles de temps pris en charge par <code class="language-plaintext highlighter-rouge">OnBootSec=</code> ou <code class="language-plaintext highlighter-rouge">OnStartupSec=</code>, consultez la <a href="https://www.freedesktop.org/software/systemd/man/systemd.time.html#">page de manuel de systemd.timer</a>.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Rafraîchir les fichiers de configuration de systemd</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Désactivez le fichier de service systemd unit car il ne devrait pas démarrer automatiquement, ce qui est l’idée derrière cet article. Nous voulons que ce service exécute un script après N minutes de démarrage en fonction de la valeur de la minuterie.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl disable run-script-with-delay.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activez ensuite le fichier de temporisation de l’unité systemd afin qu’il soit exécuté après le démarrage et déclenche ensuite le fichier de service de l’unité systemd mappé en fonction de la valeur de la temporisation.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl enable run-script-with-delay.timer
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Vérifier la configuration du fichier d’unité systemd</strong><br>
|
|||
|
Après le redémarrage, lorsque nous vérifions l’état de <code class="language-plaintext highlighter-rouge">run-script-with-delay.timer</code>, observez ici la section en surbrillance où il montre le prochain déclenchement qui est prévu après 2 minutes que nous avons configuré avec <code class="language-plaintext highlighter-rouge">OnBootSec</code> dans le fichier unité timer.<br>
|
|||
|
<img src="/images/pc1-010.png" alt=""><br>
|
|||
|
Une fois que l’heure de déclenchement est atteinte, le service va exécuter sa tâche définie qui, ici, est d’exécuter la commande après 5 minutes de démarrage. Comme vous le voyez maintenant, le déclencheur affiche “non applicable” pour l’unité de temporisation.
|
|||
|
<img src="/images/pc1-011.png" alt=""></p>
|
|||
|
|
|||
|
<h3 id="pc1---script-à-larrêt">PC1 - Script à l’arrêt</h3>
|
|||
|
|
|||
|
<p><em>On veut arrêter la machine distante Lenovo 192.168.0.145 via ssh lors de l’extinction de PC1</em></p>
|
|||
|
|
|||
|
<h4 id="option-a---exécuter-une-commande-systemd-juste-avant-larrêt">Option A - Exécuter une commande systemd juste avant l’arrêt</h4>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/system/stop_script.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Unit]
|
|||
|
Description=Run my custom task at shutdown
|
|||
|
DefaultDependencies=no
|
|||
|
Before=shutdown.target
|
|||
|
|
|||
|
[Service]
|
|||
|
Type=oneshot
|
|||
|
ExecStart=/usr/bin/ssh leno@192.168.0.145 -p 55145 -i /usr/local/bin/lenovo-ed25519 'sudo systemctl poweroff'
|
|||
|
TimeoutStartSec=0
|
|||
|
|
|||
|
[Install]
|
|||
|
WantedBy=shutdown.target
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rafraîchir les fichiers de configuration de systemd et activer le service</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
|
|||
|
sudo systemctl enable stop_script.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier la bonne exécution</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>journalctl -u stop_script.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>févr. 23 19:49:09 archyan systemd[1]: Starting Run my custom task at shutdown...
|
|||
|
févr. 23 19:49:09 archyan systemd[1]: stop_script.service: Deactivated successfully.
|
|||
|
févr. 23 19:49:09 archyan systemd[1]: Finished Run my custom task at shutdown.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h4 id="option-b---comment-lancer-un-script-systemd-à-larrêt-seulement-et-pas-au-redémarrage">Option B - Comment lancer un script systemd à l’arrêt seulement et pas au redémarrage</h4>
|
|||
|
|
|||
|
<p>1 - Créer un script type</p>
|
|||
|
|
|||
|
<p>Pour exécuter un script à l’arrêt uniquement avec systemd, nous avons besoin d’un script. Voici un script fictif qui nous aidera à reconnaître si notre script est appelé à <code class="language-plaintext highlighter-rouge">reboot.target</code> ou <code class="language-plaintext highlighter-rouge">shutdown.target</code>. Avec <code class="language-plaintext highlighter-rouge">systemctl list-jobs</code> nous connaissons la cible actuellement active et en cours d’exécution. Le script ne devrait donc fonctionner que sur <code class="language-plaintext highlighter-rouge">shutdown.target</code> ou <code class="language-plaintext highlighter-rouge">reboot.target</code>.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/home/admuser/script.sh
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
|
|||
|
<span class="c"># Run script with systemd at shutdown only </span>
|
|||
|
|
|||
|
<span class="k">case</span> <span class="nv">$1</span> <span class="k">in
|
|||
|
</span>start<span class="p">)</span>
|
|||
|
systemctl list-jobs | egrep <span class="nt">-q</span> <span class="s1">'reboot.target.*start'</span> <span class="o">&&</span> <span class="nb">echo</span> <span class="s2">"starting reboot"</span> <span class="o">>></span> /home/admuser/file
|
|||
|
systemctl list-jobs | egrep <span class="nt">-q</span> <span class="s1">'shutdown.target.*start'</span> <span class="o">&&</span> <span class="nb">echo</span> <span class="s2">"starting shutdown"</span> <span class="o">>></span> /home/admuser/file
|
|||
|
<span class="p">;;</span>
|
|||
|
|
|||
|
stop<span class="p">)</span>
|
|||
|
systemctl list-jobs | egrep <span class="nt">-q</span> <span class="s1">'reboot.target.*start'</span> <span class="o">||</span> <span class="nb">echo</span> <span class="s2">"stopping"</span> <span class="o">>></span> /home/admuser/file
|
|||
|
<span class="p">;;</span>
|
|||
|
|
|||
|
<span class="k">esac</span>
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>J’ai également écrit une fonction stop qui ne sera de toute façon pas appelée, mais juste pour prouver ce fait, cette fonction est nécessaire. Dans ce cas, seul <code class="language-plaintext highlighter-rouge">ExecStart</code> sera appelé pour exécuter le script avec systemd à l’arrêt seulement et non au redémarrage.</p>
|
|||
|
|
|||
|
<p>2 - Créer un fichier d’unité pour exécuter le script avec systemd à l’arrêt seulement.</p>
|
|||
|
|
|||
|
<p>Nous allons créer notre fichier unitaire systemd sous <code class="language-plaintext highlighter-rouge">/etc/systemd/system</code> avec le nom <code class="language-plaintext highlighter-rouge">myscript.service</code>.</p>
|
|||
|
|
|||
|
<p>Voici notre fichier d’unité systemd que nous utiliserons pour exécuter un script avec systemd à l’arrêt uniquement (pas au redémarrage).</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/etc/systemd/system/myscript.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>Unit]
|
|||
|
<span class="nv">Description</span><span class="o">=</span>Run my custom task at shutdown only
|
|||
|
<span class="nv">DefaultDependencies</span><span class="o">=</span>no
|
|||
|
<span class="nv">Conflicts</span><span class="o">=</span>reboot.target
|
|||
|
<span class="nv">Before</span><span class="o">=</span>poweroff.target halt.target shutdown.target
|
|||
|
<span class="nv">Requires</span><span class="o">=</span>poweroff.target
|
|||
|
|
|||
|
<span class="o">[</span>Service]
|
|||
|
<span class="nv">Type</span><span class="o">=</span>oneshot
|
|||
|
<span class="nv">ExecStart</span><span class="o">=</span>/home/admuser/script.sh start
|
|||
|
<span class="nv">RemainAfterExit</span><span class="o">=</span><span class="nb">yes</span>
|
|||
|
|
|||
|
<span class="o">[</span>Install]
|
|||
|
<span class="nv">WantedBy</span><span class="o">=</span>shutdown.target
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Voici la page de manuel de systemd.unit et systemd.service.</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>
|
|||
|
<strong>Conflicts</strong> Si une unité a un paramètre <code class="language-plaintext highlighter-rouge">Conflits=</code> sur une autre unité, le démarrage de la première arrêtera la seconde et vice versa.</li>
|
|||
|
<li>
|
|||
|
<strong>Before=</strong> Ils configurent les dépendances d’ordre entre les unités.</li>
|
|||
|
<li>
|
|||
|
<strong>Requires</strong> Configure les dépendances d’exigence sur d’autres unités. Si cette unité est activée, les unités listées ici seront également activées.</li>
|
|||
|
<li>
|
|||
|
<strong>Type</strong> Configure le type de démarrage du processus pour cette unité de service. Un des types suivants : simple, forking, oneshot, dbus, notify ou idle.</li>
|
|||
|
<li>
|
|||
|
<strong>ExecStart</strong> Commandes avec leurs arguments qui sont exécutées lorsque ce service est démarré.</li>
|
|||
|
<li>
|
|||
|
<strong>RemainAfterExit</strong> Prend une valeur booléenne qui spécifie si le service doit être considéré comme actif même lorsque tous ses processus ont quitté. La valeur par défaut est no.</li>
|
|||
|
</ul>
|
|||
|
|
|||
|
<p>Rafraîchir les fichiers de configuration de systemd</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl daemon-reload
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Activer le script pour qu’il démarre automatiquement au prochain démarrage</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl enable myscript
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Created symlink /etc/systemd/system/shutdown.target.wants/myscript.service → /etc/systemd/system/myscript.service.
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>3 - Vérifier la configuration du fichier unité systemd</p>
|
|||
|
|
|||
|
<p>Vérifions notre fichier unitaire systemd. Nous allons effectuer un arrêt de mon Linux pour vérifier s’il exécute le script avec systemd à l’arrêt seulement et non au redémarrage.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl poweroff
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Après le réveil du nœud, nous vérifions le contenu de notre fichier /home/admuser/file où nous avons écrit le contenu de notre script factice.</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>login as: root
|
|||
|
root@127.0.0.1<span class="s1">'s password:
|
|||
|
Last login: Tue Jan 14 22:41:22 2020 from 10.0.2.2
|
|||
|
|
|||
|
[root@centos-8 ~]# cat /home/admuser/file
|
|||
|
starting shutdown
|
|||
|
</span></code></pre></div></div>
|
|||
|
|
|||
|
<p>Comme prévu, le script a été appelé à l’arrêt.</p>
|
|||
|
|
|||
|
<p>Maintenant, nous allons faire un reboot et vérifier la même chose.<br>
|
|||
|
Avant de redémarrer, je vais nettoyer le contenu de /home/admuser/file.</p>
|
|||
|
|
|||
|
<p>Comme prévu, le contenu de /home/admuser/file est vide et le script n’a pas été appelé au redémarrage.</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>root@centos-8 ~]# <span class="nb">cat</span> /home/admuser/file
|
|||
|
<span class="o">[</span>root@centos-8 ~]#
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Les différents cas</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/bin/systemctl list-jobs | egrep -q 'shutdown.target.*start' && echo "shutting down" >> /home/admuser/test.txt || echo "not shutting down" >> /home/admuser/test.txt
|
|||
|
/usr/bin/systemctl list-jobs | egrep -q 'reboot.target.*start' && echo "-> rebooting" >> /home/admuser/test.txt || echo "-> not rebooting" >> /home/admuser/test.txt
|
|||
|
/usr/bin/systemctl list-jobs | egrep -q 'halt.target.*start' && echo "-> halting" >> /home/admuser/test.txt || echo "-> not halting" >> /home/admuser/test.txt
|
|||
|
/usr/bin/systemctl list-jobs | egrep -q 'poweroff.target.*start' && echo "-> powering down" >> /home/admuser/test.txt || echo "-> not powering down" >> /home/admuser/test.txt
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p><strong>Mise en oeuvre sur PC1</strong></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo nano /etc/systemd/system/stop_script.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>Unit]
|
|||
|
<span class="nv">Description</span><span class="o">=</span>Run my custom task at shutdown only
|
|||
|
<span class="nv">DefaultDependencies</span><span class="o">=</span>no
|
|||
|
<span class="nv">Conflicts</span><span class="o">=</span>reboot.target
|
|||
|
<span class="nv">Before</span><span class="o">=</span>poweroff.target halt.target shutdown.target
|
|||
|
<span class="nv">Requires</span><span class="o">=</span>poweroff.target
|
|||
|
|
|||
|
<span class="o">[</span>Service]
|
|||
|
<span class="nv">Type</span><span class="o">=</span>oneshot
|
|||
|
<span class="nv">ExecStart</span><span class="o">=</span>/usr/bin/ssh leno@192.168.0.145 <span class="nt">-p</span> 55145 <span class="nt">-i</span> /usr/local/bin/lenovo-ed25519 <span class="s1">'sudo systemctl poweroff'</span>
|
|||
|
<span class="nv">RemainAfterExit</span><span class="o">=</span><span class="nb">yes</span>
|
|||
|
|
|||
|
<span class="o">[</span>Install]
|
|||
|
<span class="nv">WantedBy</span><span class="o">=</span>shutdown.target
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Rafraîchir les fichiers de configuration de systemd et activer le service</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo systemctl daemon-reload
|
|||
|
sudo systemctl enable stop_script.service
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h2 id="annexe">Annexe</h2>
|
|||
|
|
|||
|
<h3 id="flatpak-facultatif">Flatpak (FACULTATIF)</h3>
|
|||
|
|
|||
|
<p><img src="/images/Flatpak_logo.png" alt="Texte alternatif">
|
|||
|
Par Matthias Clasen — <a rel="nofollow" class="external free" href="https://github.com/flatpak/flatpak/blob/master/flatpak.png">https://github.com/flatpak/flatpak/blob/master/flatpak.png</a>, <a href="https://creativecommons.org/licenses/by-sa/4.0" title="Creative Commons Attribution-Share Alike 4.0">CC BY-SA 4.0</a>, <a href="https://commons.wikimedia.org/w/index.php?curid=49741329">Lien</a><br>
|
|||
|
<em>Flatpak (anciennement xdg-app) est un système de virtualisation d’application pour les distributions GNU/Linux de bureau.</em></p>
|
|||
|
|
|||
|
<p><a href="https://wiki.archlinux.org/index.php/Flatpak">Flatpak (archlinux)</a><br>
|
|||
|
Installation</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo pacman -S flatpak
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Ajout du dépôt officiel, <a href="https://flathub.org/">Flathub repository</a></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Liste des dépôts</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>flatpak remotes
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Name Options
|
|||
|
flathub system
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Pour effacer un dépôt : <code class="language-plaintext highlighter-rouge">flatpak remote-delete name</code></p>
|
|||
|
|
|||
|
<p>Recherche</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>flatpak update # mise à jour dépôt
|
|||
|
flatpak search signal
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Name Description Application ID Version Branch Remotes
|
|||
|
Signal Desktop Private messenger org.signal.Signal 1.38.2 stable flathub
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Installer un runtime ou une application : <code class="language-plaintext highlighter-rouge">flatpak install remote name</code><br>
|
|||
|
où <em>remote</em> est le nom du dépôt distant, et <em>name</em> est le nom de l’application ou du runtime à installer.</p>
|
|||
|
|
|||
|
<p>Installer signal</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>flatpak install flathub signal
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Le fichier <code class="language-plaintext highlighter-rouge">~/.local/share/applications/signal-desktop.desktop</code></p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
|
|||
|
Type=Application
|
|||
|
Name=Signal
|
|||
|
Comment=Signal Private Messenger for Linux
|
|||
|
Icon=signal-desktop
|
|||
|
Exec=/usr/bin/flatpak run signal
|
|||
|
Terminal=false
|
|||
|
Categories=Network;InstantMessaging;
|
|||
|
StartupWMClass=Signal
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="pamac-gestionnaire-de-paquets-facultatif">pamac gestionnaire de paquets (FACULTATIF)</h3>
|
|||
|
|
|||
|
<p>Un frontal Gtk3, un gestionnaire de paquets basé sur libalpm avec un support AUR et Appstream.</p>
|
|||
|
|
|||
|
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yay -S pamac-aur
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<h3 id="unison">Unison</h3>
|
|||
|
|
|||
|
<p><em>Unison est un outil de synchronisation de fichiers gratuit, open source, multi-plateforme et bidirectionnel. Il est utilisé pour stocker deux répliques de fichiers et de répertoires sur deux systèmes différents ou des disques différents sur le même système. Les répliques de fichiers et de répertoires sont modifiées séparément, puis mises à jour en propageant les modifications de chaque réplique à l’autre. Pour faire simple, toutes les modifications apportées à un emplacement seront répliquées vers un autre emplacement et vice versa.</em></p>
|
|||
|
|
|||
|
<p><code class="language-plaintext info highlighter-rouge">Il faut utiliser une version unison IDENTIQUE entre client serveur</code></p>
|
|||
|
|
|||
|
<p>serveur debian 11 (bullseye) : <code class="language-plaintext highlighter-rouge">unison -version</code> → <strong>unison version 2.51.3 (ocaml 4.11.1)</strong></p>
|
|||
|
|
|||
|
<p>archlinux : <strong>unison version 2.53.0 (ocaml 4.14.0)</strong><br>
|
|||
|
Pour avoir une version identique, on va consulter les <a href="https://archive.archlinux.org/packages/u/unison/">archives des paquets unison</a> et télécharger puis installer la version identique à debian</p>
|
|||
|
|
|||
|
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://archive.archlinux.org/packages/u/unison/unison-2.51.3-1-x86_64.pkg.tar.zst
|
|||
|
yay <span class="nt">-U</span> unison-2.51.3-1-x86_64.pkg.tar.zst
|
|||
|
</code></pre></div></div>
|
|||
|
|
|||
|
<p>Vérifier la version installée : <code class="language-plaintext highlighter-rouge">unison -version</code> → <strong>unison version 2.51.3 (ocaml 4.11.1)</strong></p>
|
|||
|
|
|||
|
<p class="warning">Pour éviter une mise à jour de ce paquet il faut ajouter cette ligne <code class="language-plaintext highlighter-rouge">IgnorePkg = unison</code> au fichier <code class="language-plaintext highlighter-rouge">/etc/pacman.conf</code></p>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<div class="d-print-none">
|
|||
|
<footer class="article__footer"><meta itemprop="dateModified" content="2021-03-08T00:00:00+01: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="/2021/02/25/NETGEAR-Repeteur-WiFi-Dual-Band-AC1200-Model-EX6120.html">NETGEAR Répéteur WiFi Dual Band AC1200 Modèle EX6120</a>
|
|||
|
</div>
|
|||
|
<div class="next">
|
|||
|
<span>SUIVANT</span><a href="/2021/03/17/PHP_Authentification_2FA(RobThree).html">PHP Authentification RobThree/TwoFactorAuth</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>
|
|||
|
|