From f7db49b554c0b4430b86022de4e14b6ab3a2178a Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 20 Apr 2021 20:56:58 +0200 Subject: [PATCH] correct markdown syntax --- Checklist/rando.md | 2 +- Checklist/velo_travail.md | 9 +++--- Cuisine/idee cuisine.md | 9 ++++-- Divers/index.md | 4 ++- IT/Soft_util.md | 6 ++-- IT/ansible.md | 12 ++++---- IT/fail2ban.md | 50 ++++++++++++++++----------------- IT/hugo.md | 10 +++---- IT/install_nextcloud.md | 40 +++++++++++++++++--------- IT/migration_server_reminder.md | 4 ++- IT/motorola.md | 11 +++----- IT/patron de conception.md | 2 ++ IT/raspberry.md | 5 ++-- IT/regex.md | 4 ++- IT/ssh.md | 9 ++++-- IT/synologyTips.md | 6 ++-- IT/tmux.md | 6 +--- IT/vim.md | 10 +++---- IT/virsh.md | 17 +++++++---- IT/yaml.md | 2 ++ 20 files changed, 123 insertions(+), 95 deletions(-) diff --git a/Checklist/rando.md b/Checklist/rando.md index b17f25a..439e035 100644 --- a/Checklist/rando.md +++ b/Checklist/rando.md @@ -35,4 +35,4 @@ - briquet - baton - cart d'identité -- liquide \ No newline at end of file +- liquide diff --git a/Checklist/velo_travail.md b/Checklist/velo_travail.md index 7bc347b..af96103 100644 --- a/Checklist/velo_travail.md +++ b/Checklist/velo_travail.md @@ -1,9 +1,13 @@ +# velo travail + ## voiture + - vélo dans la voiture - huile - casque velo ## affaire travail + - haut - pantalon - callecon @@ -17,6 +21,7 @@ - ceinture ## affaire velo + - sous vetement haut - deuxiéme couche - kway @@ -28,7 +33,3 @@ - chaussure - chausette - écouteur - - - - diff --git a/Cuisine/idee cuisine.md b/Cuisine/idee cuisine.md index c6aab15..23ac497 100644 --- a/Cuisine/idee cuisine.md +++ b/Cuisine/idee cuisine.md @@ -1,6 +1,7 @@ # Idee Cuisine ## quotidien + - Pâte bolo - Pâte carbo - Pâte au saumon chaud @@ -37,8 +38,8 @@ - fondu savoyarde - lentille saucisse - ## sauce + - bechamel - vinaigrette - sauce au poivre @@ -46,6 +47,7 @@ - sauce a l'oseille ## preparer + - Casoulet - Chilicon carne - filet mignon @@ -53,12 +55,13 @@ - carbonnade - joue de porc - roti orloff -- dos de cabillaud au chorizo +- dos de cabillaud au chorizo - pavé de saumon epinard ## desert + - clafoutie au pomme -- mouse de fraise +- mouse de fraise - Mousse au chocolat - crêpes - gauffre diff --git a/Divers/index.md b/Divers/index.md index 7ff54bd..6a7afa2 100644 --- a/Divers/index.md +++ b/Divers/index.md @@ -1,3 +1,5 @@ +# Divers + [site permettant d'avoir les prox d'achat de masion ou terrain](https://app.dvf.etalab.gouv.fr) -[liste api public](https://github.com/public-apis/public-apis) \ No newline at end of file +[liste api public](https://github.com/public-apis/public-apis) diff --git a/IT/Soft_util.md b/IT/Soft_util.md index d9469e0..4d0b626 100644 --- a/IT/Soft_util.md +++ b/IT/Soft_util.md @@ -1,22 +1,22 @@ # Soft util + ![IT](img/IT.jpg) + ## tunelling [chisel](https://github.com/jpillora/chisel) permet de mettre en place un tunel TCP sur du http - ## site [devhind (cheatsheet)](https://devhints.io/) [Lean X in Y minutes](https://learnxinyminutes.com/) - [online Json editor](https://jsoneditoronline.org/) [compression d'image](https://squoosh.app/) -## goaccess +## goaccess permet d'analyser les log d'accés d'un server web diff --git a/IT/ansible.md b/IT/ansible.md index a0156b8..9ad85a5 100644 --- a/IT/ansible.md +++ b/IT/ansible.md @@ -1,21 +1,23 @@ # ansible + ![ansible](img/ansible.png) + ## commande ansible ***launch playbook on staging*** `ansible-playbook -i staging site.yml --vault-password-file=.vaultpassword` ***init new role architecture*** -`ansible-galaxy user_config init ` - +`ansible-galaxy user_config init` ***launch ansible bootstrap*** -` ansible-playbook -i nas, bootstrap.yml -u root --ask-pass` +`ansible-playbook -i nas, bootstrap.yml -u root --ask-pass` ***encrypt string*** `ansible-vault encrypt_string` -## ignore know host file on ansible -``` +## ignore know host file on ansible + +```bash export ANSIBLE_HOST_KEY_CHECKING=False --ssh-extra-args='-o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null' ``` diff --git a/IT/fail2ban.md b/IT/fail2ban.md index 7d30332..a85e121 100644 --- a/IT/fail2ban.md +++ b/IT/fail2ban.md @@ -1,8 +1,7 @@ +# Fail2Ban - -1. [Les réglages](#Les-reglages) -2. [Fail2Ban cli](#Fail2Ban-cli) - +1. [Les réglages](#Les-reglages) +2. [Fail2Ban cli](#Fail2Ban-cli) ## [](#Les-reglages "Les réglages")Les réglages @@ -12,7 +11,7 @@ Le fichier de configuration global `/etc/fail2ban/fail2ban.conf` ne contient pas Dans sa configuration la plus simple, on se contente d’activer les _jails_ proposées par défaut. Voici par exemple une configuration minimaliste mais fonctionnelle. -``` +```ini [DEFAULT] destemail = mon-email@mail.fr @@ -31,8 +30,7 @@ enabled = true On peut néanmoins y ajouer encore quelques détails. De plus sachez que pour chaque _jail_ ainsi que pour `[DEFAULT]`, vous pouvez préciser `ignoreip`, qui permet, comme son nom l’indique, de ne pas considérer certaines ip ou blocs d’ip. Pratique pour ne pas se retrouver à la porte de son propre serveur. -``` - +```ini [DEFAULT] destemail = mon-email@mail.fr @@ -52,13 +50,13 @@ Vous voyez par exemple que j’ai ici aussi ajouté `apache`. Si vous avez un se Ce n’est pas tout, d’autres options courantes sont à connaître : -* `port` permet de préciser les ports à bloquer, -* `logpath` indique le fichier de log à analyser, -* `maxretry` le nombre d’occurences dans le fichier de log avant que l’action ne soit déclenchée, -* `findtime` permet de spécifier le laps de temps pendant lequel on considère les occurences (au dela de findtime, on repart à zéro), -* `bantime` définit le temps que l’ip restera bloquée via Fail2Ban. +*`port` permet de préciser les ports à bloquer, +*`logpath` indique le fichier de log à analyser, +*`maxretry` le nombre d’occurences dans le fichier de log avant que l’action ne soit déclenchée, +*`findtime` permet de spécifier le laps de temps pendant lequel on considère les occurences (au dela de findtime, on repart à zéro), +*`bantime` définit le temps que l’ip restera bloquée via Fail2Ban. -``` +```ini […] @@ -75,11 +73,11 @@ Si vous parcourez `/etc/fail2ban/jail.conf`, vous pourrez voir les autres option Enfin, vous pouvez également définir `backend`. Il s’agit de la méthode de _surveillance_ des logs. Quatre méthodes sont proposées : -* `pyinotify` : un module Python permettant de monitorer les modifications sur un fichier. -* `gamin` : même usage que le précédent, mais il s’agit d’un module du projet Gnome. -* `polling` : le fichier est simplement vérifier à intervales régulièrs afin de vérifier s’il y a eu des écritures. -* `systemd` : ici, Fail2Ban se greffe sur SystemD afin d’être alerté de nouveaux logs. -* `auto` : mode automatique, qui va tenter toutes les solutions sus-mentionnées, dans cet ordre. +*`pyinotify` : un module Python permettant de monitorer les modifications sur un fichier. +*`gamin` : même usage que le précédent, mais il s’agit d’un module du projet Gnome. +*`polling` : le fichier est simplement vérifier à intervales régulièrs afin de vérifier s’il y a eu des écritures. +*`systemd` : ici, Fail2Ban se greffe sur SystemD afin d’être alerté de nouveaux logs. +*`auto` : mode automatique, qui va tenter toutes les solutions sus-mentionnées, dans cet ordre. On peut donc dans la plupart des cas laisser `auto`. Sachez qu’il est toutefois possible de définir le `backend` au cas par cas au niveau de chaque jail. @@ -89,14 +87,14 @@ Ce qui est génial avec Fail2Ban, c’est qu’il est possible d’ajouter autan Nous commençons par créer un filtre afin de détecter les tentatives de connexion infructueuses. Dans un tel cas, notre applicatif devrait renvoyer une erreur 401. Voici un exemple de log que nous allons matcher : -``` +```log 80.214.431.42 - - [14/Oct/2018:21:27:32 +0200] "POST /users/login HTTP/2.0" 401 30 "https://app.buzeo.me/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:63.0) Gecko/20100101 Firefox/63.0" "-" ``` Voici à quoi ressemble notre filtre (`/etc/fail2ban/filter.d/nginx-unauthorized`). -``` +```ini @@ -110,7 +108,7 @@ C’est aussi simple que ça ! ``, vous l’aurez deviné, permet à Fail2 Modifions maintenant notre configuration dans `/etc/fail2ban/jail.d/defaults-debian.conf` pour activer notre nouveau filtre. -``` +```ini […] @@ -130,7 +128,7 @@ bantime = 300 Fail2Ban possède plusieurs clients fort pratiques. `fail2ban-regex` permet de valider vos filtres et `fail2ban-client` permet de gérer tous les autres aspects du logiciel, de la vérification du contenu d’une jail au redémarrage de l’outil. Commençons par un rapide aperçu de l’outil regex. -``` +```bash fail2ban-regex [ banip @@ -329,4 +327,4 @@ fail2ban-client set unbanip Il ne s’agit pas d’une liste exhaustive des possibilités offertes pas la ligne de commande Fail2Ban. De nombreux paramètres habituellement configurés via les fichiers de configuration sont également paramétrables via la CLI. Pour connaître toutes les possibilités, il suffit d’utiliser la commande `help`. -Sachez cependant que Fail2Ban a encore d’autres tours dans son sac. En cas de match, il peut accomplir n’importe quel comportement (envoyer un email, rediriger vers une autre ip…). Pour en savoir plus je vous invite à lire la partie concernant les [actions de cet article](https://www.it-connect.fr/filtres-et-actions-personnalises-dans-fail2ban/#IV_Creation_dune_action_personnalisee) et [celui-ci en anglais](https://www.digitalocean.com/community/tutorials/how-fail2ban-works-to-protect-services-on-a-linux-server#examining-the-action-file). \ No newline at end of file +Sachez cependant que Fail2Ban a encore d’autres tours dans son sac. En cas de match, il peut accomplir n’importe quel comportement (envoyer un email, rediriger vers une autre ip…). Pour en savoir plus je vous invite à lire la partie concernant les [actions de cet article](https://www.it-connect.fr/filtres-et-actions-personnalises-dans-fail2ban/#IV_Creation_dune_action_personnalisee) et [celui-ci en anglais](https://www.digitalocean.com/community/tutorials/how-fail2ban-works-to-protect-services-on-a-linux-server#examining-the-action-file). diff --git a/IT/hugo.md b/IT/hugo.md index d69faa3..820884e 100644 --- a/IT/hugo.md +++ b/IT/hugo.md @@ -1,12 +1,12 @@ -## hugo +# hugo hugo is a static website generator ## Usefull command - `hugo server -b localhost/starter` launch a test server on your local machine - - -b is for baseURL option depend to configuration - - you can add -t with theme name if you have few theme installed -- `hugo new site .` create a new site skeleton -- `hugo new test.md ` create a new file in content folder +- -b is for baseURL option depend to configuration +- you can add -t with theme name if you have few theme installed +- `hugo new site .` create a new site skeleton +- `hugo new test.md` create a new file in content folder - `hugo` compile site diff --git a/IT/install_nextcloud.md b/IT/install_nextcloud.md index f6266e2..8d56262 100644 --- a/IT/install_nextcloud.md +++ b/IT/install_nextcloud.md @@ -1,7 +1,10 @@ # instalation NExt cloud + ## hook pacman + - /etc/pacman.d/hooks/nextcloud.hook -``` + +```ini [Trigger] Operation = Install Operation = Upgrade @@ -16,22 +19,27 @@ Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ ``` ## php + - owner http /usr/share/webapps/nextcloud -- Install PHP#gd and php-intl as additional modules. Configure OPcache as recommended by the documentation. Some apps (News for example) require the iconv extension, if you wish to use these apps, uncomment the extension in /etc/php/php.ini. +- Install PHP#gd and php-intl as additional modules. Configure OPcache as recommended by the documentation. Some apps (News for example) require the iconv extension, if you wish to use these apps, uncomment the extension in /etc/php/php.ini. in php.ini -``` + +```ini change memory_limit = 256M ``` -- cree repertoire data -``` +- cree repertoire data + +```ini mkdir /var/nextcloud chown http:http /var/nextcloud chmod 750 /var/nextcloud ``` -- overide php-fpm -``` + +- overide php-fpm + +```ini [Service] ReadWritePaths = /usr/share/webapps/nextcloud/apps ReadWritePaths = /etc/webapps/nextcloud/config @@ -39,10 +47,9 @@ ReadWritePaths = /var/nextcloud ReadWritePaths = /mnt/diskstation ``` +## config NGINX dédier - -## config NGINX dédier: -``` +```nginx upstream php-handler { # server 127.0.0.1:9000; server unix:/var/run/php-fpm/php-fpm.sock; @@ -169,21 +176,26 @@ server { access_log off; } } + ``` + - pour ssl [voir](https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html ) ## gestion database ## share + - reconfigurer les share serveur en NFS pour que http est accé en lecture (analize a faire pour l'inpact sur les autre service) -# fichier de config +## fichier de config + +## other -# other - mettre en place cron de scan de fichier: -``` + +```bash php /usr/share/webapps/nextcloud/occ files:scan --all ``` -- Configurer fail2ban +- Configurer fail2ban diff --git a/IT/migration_server_reminder.md b/IT/migration_server_reminder.md index 84a15d2..4a42251 100644 --- a/IT/migration_server_reminder.md +++ b/IT/migration_server_reminder.md @@ -1,3 +1,5 @@ +# Migration server procédure + - modifier le nat de la box - modifier le Cname www sur dns - ajouter le nouveau serveur au autorisation de réplication DNS si serveur DNS Slave @@ -5,4 +7,4 @@ - recréer partage syncthing - changer dns secondaire - rediriger backup -- remettre le cron check server && dump SQL \ No newline at end of file +- remettre le cron check server && dump SQL diff --git a/IT/motorola.md b/IT/motorola.md index 1cf4bf8..153084f 100644 --- a/IT/motorola.md +++ b/IT/motorola.md @@ -1,28 +1,25 @@ -#Motorola +# Motorola [tuto root](https://forum.xda-developers.com/motorola-one-pro/development/root-twrp-3-4-0-android-10-t4156037 ) - ## root without twrp -firmware stock:https://mirrors.lolinet.com/firmware/moto/parker/official/RETEU/ +firmware stock: [https://mirrors.lolinet.com/firmware/moto/parker/official/RETEU/] - recover boot.img in firmaware sotck image - install magisk Manager on your smartphone [apk here]([https://link](https://github.com/topjohnwu/Magisk/releases/)) - put boot.img on your smartphone - in magisk click pn install and select your boot.img - magisk_patched.img will be store in your DATA folder recopy this file on your desktop -- enter in fastboot by holding power button +- enter in fastboot by holding power button - on your computer enter `fastboot devices` to check if you see your device - following enter `fastboot flash boot magisk_patched.img` to flash - and `fastboot reboot` to reboot - + ## OTA update with root - in magisk restore old image **don't reboot** - launch your OTA update - in magisk patch in inactive slot - reboot your phone - - diff --git a/IT/patron de conception.md b/IT/patron de conception.md index b3dde0a..899d73b 100644 --- a/IT/patron de conception.md +++ b/IT/patron de conception.md @@ -1 +1,3 @@ +# Patrons de conception + [patron de conception](https://fr.m.wikibooks.org/wiki/Patrons_de_conception/) diff --git a/IT/raspberry.md b/IT/raspberry.md index d2bfbd4..20ae0fb 100644 --- a/IT/raspberry.md +++ b/IT/raspberry.md @@ -1,9 +1,10 @@ -#raspberry.md +# raspberry.md ## activer sortie audio jack /boot/config.txt -``` + +```ini device_tree_param=audio=on audio_pwm_mode=2 ``` diff --git a/IT/regex.md b/IT/regex.md index 41ad3ef..721778d 100644 --- a/IT/regex.md +++ b/IT/regex.md @@ -1,3 +1,5 @@ +# Regex + [regex prefaite](https://ihateregex.io/?q=) -[regex101](https://regex101.com/) \ No newline at end of file +[regex101](https://regex101.com/) diff --git a/IT/ssh.md b/IT/ssh.md index 850fd04..23e3b10 100644 --- a/IT/ssh.md +++ b/IT/ssh.md @@ -1,17 +1,20 @@ # ssh + ![ssh](img/ssh.png) + ## port forwarding -``` + +```bash Ssh -L 2000:toto:80 Vincent@tata ``` + Redirigé le port local 2000 vers le port 80 de toto en passant par un tunnel via tata -f pour laisser la commande en arrière plan -R pour forwarder un port distant ici avec -R le port 2000 de tata sera rediriger vers le 80 de toto en passant par le client - ## ingore know host file -``` +```bash ssh -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null ``` diff --git a/IT/synologyTips.md b/IT/synologyTips.md index b04afaf..41c1524 100644 --- a/IT/synologyTips.md +++ b/IT/synologyTips.md @@ -1,8 +1,8 @@ -## Tips on synology NAS +# Tips on synology NAS + +## debug the ssl certificate renew on synology -### debug the ssl certificate renew on synology in case of error in the renewal of synology certificate with let's encrypt proceed like this: - connect to synology with SSH - enter command ```sudo /usr/syno/sbin/syno-letsencrypt renew-all -v``` - diff --git a/IT/tmux.md b/IT/tmux.md index ec9abbd..98f5f16 100644 --- a/IT/tmux.md +++ b/IT/tmux.md @@ -8,7 +8,6 @@ personal config [Here](https://git.ducamps.win/vincent/conf2/src/branch/master/t shift+select to use remote selection clipboard - ## command command | comportment @@ -16,7 +15,6 @@ command | comportment ls | print running session attach -t 0 | connect to session pass in parameter - ## keyboard shortcut - master key: ctrl-b @@ -24,7 +22,7 @@ attach -t 0 | connect to session pass in parameter key|comportment ---|----------- ? | print all shortcut -- | split vertical panel +\- | split vertical panel \| | split horizontal panel z | full screen panel c | create window @@ -36,5 +34,3 @@ s | list session ## move into pane Use atl with directional arrow or vim mode key jklm - - diff --git a/IT/vim.md b/IT/vim.md index 3cd263d..d20c20c 100644 --- a/IT/vim.md +++ b/IT/vim.md @@ -1,10 +1,11 @@ -# Vim +# Vim ![neovim](img/neovim.png) [tuto config](https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/) ## config + I use NVIM instead vim config [Here](https://git.ducamps.win/vincent/conf2/src/branch/master/nvim/.config/nvim/init.vim) @@ -22,8 +23,8 @@ Utiliser en tant que manager de plugin - update vim-plug: ```:PlugUpgrade``` - ## Les raccourcis clavier de Vim (tous mode confondu) + -------------------------------------------------- > Les raccourcis clavier de Vim (tous mode confondu) Vim est un éditeur de texte intégré hautement configurable permettant d’édition des textes efficacement. Ce est une version améliorée de l&#… @@ -33,7 +34,8 @@ Vim est un éditeur de texte intégré hautement configurable permettant d’éd Voici une liste des raccourcis clavier de Vim. ### custom config -leader: space + +leader: space |conb|action| |----|------| @@ -133,5 +135,3 @@ Ces raccourcis permettent de faire d’exécuter des commandes ou d’exécuter | Ctrl+o | Basculer en mode normal pour la prochaine commande | | Ctrl+a | Incrémente le nombre | | Ctrl+x | Décrémente le nombre | - - diff --git a/IT/virsh.md b/IT/virsh.md index 474979e..d2899c6 100644 --- a/IT/virsh.md +++ b/IT/virsh.md @@ -1,5 +1,7 @@ +# Virsh ## virsh usefull command + ### standart - recover configuration xml from VM: `virsh dumpxml windows7> windows7.xml` @@ -10,9 +12,10 @@ - create with xml file:`create --file debian8.xml` - force shutdown:`virsh destroy win7` -### snapshot: +### snapshot + - list for domain `virsh snapshot-list --domain nas` -- create snapshot `virsh snapshot-create-as --domain {VM-NAME} --name {SNAPSHOT-NAME} --live ` +- create snapshot `virsh snapshot-create-as --domain {VM-NAME} --name {SNAPSHOT-NAME} --live` - info snapshot: ` virsh snapshot-info --domain nas --snapshotname "ansible ping OK" ` - appliquer une snapshot: `virsh snapshot-revert --domain --snapshotname "ansible ping OK" --running` - delete snapshot: `virsh snapshot-delete --domain freebsd --snapshotname 5Sep2016_S2` @@ -20,16 +23,18 @@ ## share folder with host - add a filesystem device to your host: - ``` + + ```xml
``` + - on guest mount the filesystem: - - with mount cmd :`mount -t 9p -o trans=virtio,version=9p2000.L mount_tag /path/to/mount_point/on/guest` - - in your fstab:`mount_tag /path/to/mount_point/on/guest 9p trans=virtio,version=9p2000.L 0 0` +- with mount cmd :`mount -t 9p -o trans=virtio,version=9p2000.L mount_tag /path/to/mount_point/on/guest` +- in your fstab:`mount_tag/path/to/mount_point/on/guest 9p trans=virtio,version=9p2000.L 0 0` - add in **9pnet_virtio** to **/etc/modules-load.d/9pnet_virtio.conf** ## enabling guest function on arch @@ -37,6 +42,6 @@ - install `spice-vdagent` - add in etc/mkinitcpio.conf -``` +```ini MODULES=(virtio virtio_blk virtio_pci virtio_net) ``` diff --git a/IT/yaml.md b/IT/yaml.md index 7fdf901..967d791 100644 --- a/IT/yaml.md +++ b/IT/yaml.md @@ -1,3 +1,5 @@ +# YAML + [YAML](https://en.wikipedia.org/wiki/YAML) (a recursive acronym for "YAML Ain't Markup Language") is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being