From f9ae910168bbb9cb9601f656ec0400d49c1c762b Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Sat, 7 Mar 2020 08:26:20 +0100 Subject: [PATCH] 07-03-2020 --- docs/Linux/Apps/AppImage.md | 2 + docs/Linux/Apps/flatpak.md | 1 + docs/Linux/Apps/snap.md | 1 + docs/Linux/redirections.md | 115 ++++++++++++++++++++++++++++++++--- docs/Mint/outdated.md | 20 +++--- docs/Synology/opkg/oPKG.md | 2 + docs/Synology/python.md | 10 +++ docs/macos/homebrew/brew.md | 28 +++++++++ docs/macos/perl/installer.md | 2 +- docs/macos/python/python3.md | 53 +++++++++++++--- docs/mkdocs.md | 23 +++++-- mkdocs.yml | 8 ++- mkdocs_backup.yml | 26 +++++--- 13 files changed, 248 insertions(+), 43 deletions(-) create mode 100644 docs/Linux/Apps/AppImage.md create mode 100644 docs/Linux/Apps/flatpak.md create mode 100644 docs/Linux/Apps/snap.md diff --git a/docs/Linux/Apps/AppImage.md b/docs/Linux/Apps/AppImage.md new file mode 100644 index 0000000..96b8099 --- /dev/null +++ b/docs/Linux/Apps/AppImage.md @@ -0,0 +1,2 @@ +# AppImage + diff --git a/docs/Linux/Apps/flatpak.md b/docs/Linux/Apps/flatpak.md new file mode 100644 index 0000000..49ceb5a --- /dev/null +++ b/docs/Linux/Apps/flatpak.md @@ -0,0 +1 @@ +# flatpak \ No newline at end of file diff --git a/docs/Linux/Apps/snap.md b/docs/Linux/Apps/snap.md new file mode 100644 index 0000000..ee1e040 --- /dev/null +++ b/docs/Linux/Apps/snap.md @@ -0,0 +1 @@ +# snap \ No newline at end of file diff --git a/docs/Linux/redirections.md b/docs/Linux/redirections.md index 47de94c..41165a4 100644 --- a/docs/Linux/redirections.md +++ b/docs/Linux/redirections.md @@ -1,24 +1,40 @@ # I/O Redirections -#### Standard Output -Redirige la sortie standart vers un nouveau fichier: + + + +| | Descripteur | Identifiant | +| --------------- | ----------- | ----------- | +| Entrée standard | stdin | 0 | +| Sortie standard | stdout | 1 | +| Sortie erreur | stderr | 2 | + + + +#### Redirection de sortie: `>` + +Redirige la sortie standart vers un nouveau fichier: ```bash $ ls > liste.txt ``` - - -Redirige la sortie standart vers un fichier (ajoute à la suite): +Redirige la sortie standart vers un fichier (ajoute à la suite): ```bash $ ls >> liste.txt ``` +Redirige la sortie erreur vers un fichier: + +```bash +>2 erreur.log +``` -#### Standard Input + +#### Redirection d'entrée: `<` Considère liste.txt comme entrée standart (au lieu du clavier): @@ -26,6 +42,30 @@ Considère liste.txt comme entrée standart (au lieu du clavier): $ sort < liste.txt ``` +Envoyer un contenu à une commande avec votre clavier. + +```bash +$ sort -n << FIN +heredoc… ❯ 45 +heredoc… ❯ 23 +heredoc… ❯ 12 +heredoc… ❯ 78 +heredoc… ❯ 45 +heredoc… ❯ 9 +heredoc… ❯ FIN +9 +12 +23 +45 +45 +78 + +$ wc -m << STOP +heredoc… ❯ Combien de caracteres ? +heredoc… ❯ STOP + 24 +``` + #### On peut combiner les 2 @@ -36,23 +76,78 @@ $ sort < liste.txt > liste_triee.txt +#### Rediriger vers un autre descripteur: `>&` + +Rediriger la sortie standard sur la sortie d'erreur: + +```bash +$ echo "Error" 1>&2 +$ echo "Error" >&2 +``` + + + +#### Le trou noir: `/dev/null` + +- si on affiche son contenu, on n'obtient rien. +- si on écrit quelque chose dedans, il disparait. + +```bash +$ echo "Bonjour" +Bonjour + +$ echo "Bonjour" >/dev/null + +``` + + + +#### Connecter 2 processus: `|` + +La sortie d'un programme est utilisée comme entrée d'un autre. + +```bash +$ echo "Hello!" | tr "[:lower:]" "[:upper:]" +HELLO! +``` + + + #### Erreurs -Rediriger les erreurs vers un fichier: +Rediriger les erreurs vers un fichier: ```bash -$ UneCommande & > fichier-erreurs.txt +$ UneCommande 2> fichier-erreurs.txt ``` -Rediriger les erreurs vers un fichier (ajoute à la suite):: +Rediriger les erreurs vers un fichier (ajouter à la suite):: ```bash -$ UneCommande & > fichier-erreurs.txt +$ UneCommande 2>> erreurs.log ``` +Rediriger la sortie standart et les erreurs vers un fichier: + +```bash +$ UneCommande 2> erreurs.log +``` + + + Rediriger la sortie et les erreurs vers un fichier: ```bash $ UneCommande 2>&1 | tee fichier.txt ``` + + +#### Fusionner les sorties + +Il est possible de fusionner les sorties (standart et erreur) dans un seul et même fichier. + +```bash +$ bad_command >>filename 2>&1 +``` + diff --git a/docs/Mint/outdated.md b/docs/Mint/outdated.md index 6444da6..baa57e5 100644 --- a/docs/Mint/outdated.md +++ b/docs/Mint/outdated.md @@ -37,7 +37,7 @@ Conf python-pip-whl (9.0.1-2.3~ubuntu1.18.04.1 Ubuntu:18.04/bionic-updates [all] **aptitude search '~U' | wc -l** ```bash -aptitude search '~U'  ✔  528  09:00:01 +aptitude search '~U' i A python-pip-whl - Python package installer i python3-pip - Python package installer ``` @@ -45,7 +45,7 @@ i python3-pip - Python package instal **apt list --upgradable** ```bash -apt list --upgradable  SIGINT(2) ↵  530  12:38:06 +apt list --upgradable En train de lister... Fait python-pip-whl/bionic-updates,bionic-updates 9.0.1-2.3~ubuntu1.18.04.1 all [pouvant être mis à jour depuis : 9.0.1-2.3~ubuntu1] python3-pip/bionic-updates,bionic-updates 9.0.1-2.3~ubuntu1.18.04.1 all [pouvant être mis à jour depuis : 9.0.1-2.3~ubuntu1] @@ -54,7 +54,7 @@ python3-pip/bionic-updates,bionic-updates 9.0.1-2.3~ubuntu1.18.04.1 all [pouvant **apt-get -s dist-upgrade | awk '/^Inst/ { print $2 }'** ```bash -apt-get -s dist-upgrade | awk '/^Inst/ { print $2 }'  ✔  532  12:41:41 +apt-get -s dist-upgrade | awk '/^Inst/ { print $2 }' python3-pip python-pip-whl ``` @@ -62,7 +62,7 @@ python-pip-whl **sudo apt-get -V -u upgrade** ```bash -sudo apt-get -V -u upgrade  100 ↵  534  12:47:00 +sudo apt-get -V -u upgrade [sudo] password for bruno: Lecture des listes de paquets... Fait Construction de l'arbre des dépendances @@ -86,7 +86,7 @@ Souhaitez-vous continuer ? [O/n] **sudo apt-get -s -V -u upgrade** ```bash -sudo apt-get -s -V -u upgrade  1 ↵  539  13:14:22 +sudo apt-get -s -V -u upgrade Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait @@ -118,7 +118,7 @@ Inst python-pip-whl [9.0.1-2.3~ubuntu1] (9.0.1-2.3~ubuntu1.18.04.1 Ubuntu:18.04/ **apt-get dist-upgrade ** ```bash -apt-cache show gcc-8-base  ✔  559  15:04:05 +apt-cache show gcc-8-base Package: gcc-8-base Architecture: amd64 Version: 8.3.0-6ubuntu1~18.04.1 diff --git a/docs/Synology/opkg/oPKG.md b/docs/Synology/opkg/oPKG.md index 2f622f0..c7b3838 100644 --- a/docs/Synology/opkg/oPKG.md +++ b/docs/Synology/opkg/oPKG.md @@ -212,6 +212,8 @@ Installed-Time: 1536489744 https://wiki.openwrt.org/doc/techref/opkg +[Using GCC for native compilation](https://github.com/Entware/Entware/wiki/Using-GCC-for-native-compilation) + ### Ne plus rentrer de mot-de-passe pour opkg: diff --git a/docs/Synology/python.md b/docs/Synology/python.md index 8565582..8a5049b 100644 --- a/docs/Synology/python.md +++ b/docs/Synology/python.md @@ -62,3 +62,13 @@ L'applicatif est installé ici: $ pip3 install --user --upgrade setuptools ``` + + + + +```bash +$ grep 'ssh' /var/log/messages + +$ tail -n100 /var/log/auth.log +``` + diff --git a/docs/macos/homebrew/brew.md b/docs/macos/homebrew/brew.md index fec6caf..74dc2a0 100644 --- a/docs/macos/homebrew/brew.md +++ b/docs/macos/homebrew/brew.md @@ -636,6 +636,32 @@ $ brew tap $ brew untap ``` +#### Configuration de Homebrew: + +```bash +$ brew config +HOMEBREW_VERSION: 2.2.4-6-g7fcae58 +ORIGIN: https://github.com/Homebrew/brew +HEAD: 7fcae58af70da20b3be04327ebeebdf236333d27 +Last commit: 19 hours ago +Core tap ORIGIN: https://github.com/Homebrew/homebrew-core +Core tap HEAD: 91f4df97adc4fcb9459b1a8dbd026c9fa1e45c31 +Core tap last commit: 73 minutes ago +HOMEBREW_PREFIX: /usr/local +HOMEBREW_DEV_CMD_RUN: 1 +HOMEBREW_NO_AUTO_UPDATE: 1 +CPU: octa-core 64-bit skylake +Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby +Clang: 11.0 build 1100 +Git: 2.25.0 => /usr/local/bin/git +Curl: 7.64.1 => /usr/bin/curl +Java: 13.0.1 +macOS: 10.15.2-x86_64 +CLT: N/A +Xcode: 11.3.1 +XQuartz: 2.7.11 => /opt/X11 +``` + ### Commandes externes: @@ -688,6 +714,8 @@ To use the assemblies from other formulae you need to set: - `HOMEBREW_VERBOSE`: If set, Homebrew always assumes `--verbose` when running commands. +- `HOMEBREW_NO_INSTALL_CLEANUP`: Si n'est pas mis, `brew cleanup` est lancé tous les 30 jours. + ### coreutils (GNU Tools) diff --git a/docs/macos/perl/installer.md b/docs/macos/perl/installer.md index e9e7ad3..3f6329e 100644 --- a/docs/macos/perl/installer.md +++ b/docs/macos/perl/installer.md @@ -1,4 +1,4 @@ -# Installer Perl +# Installer Perl diff --git a/docs/macos/python/python3.md b/docs/macos/python/python3.md index 4664df3..a00180c 100644 --- a/docs/macos/python/python3.md +++ b/docs/macos/python/python3.md @@ -8,7 +8,7 @@ Python 3 peut s'installer avec Homebrew: $ brew install python3 ``` -Les extensions Python 3 s'installent dans `/usr/local/lib/python3.6/site-packages/` +Les extensions Python 3 s'installent dans `/usr/local/lib/python3.7/site-packages/` Pour lancer un script Python 3: @@ -29,8 +29,8 @@ export PATH=/usr/local/opt/python/libexec/bin:$PATH Pip est installé d'origine avec Python 3. On le lance avec la commande **pip3**: ```bash -$ pip3 list --outdated --format=columns -$ pip3 install mkdocs +$ pip list --outdated --format=columns +$ pip install mkdocs ``` @@ -39,7 +39,7 @@ Installation utilisateur: ```bash $ python3 -m site --user-base -/Users/bruno/Library/Python/3.6 +/Users/bruno/Library/Python/3.7 ``` [Pipenv](https://docs.pipenv.org) @@ -76,7 +76,7 @@ $ brew reinstall python3 --with-tcl-tk Installer: ```bash -$ pip3 install jupyter +$ pip install jupyter ``` Démarrer: @@ -89,15 +89,52 @@ $ jupyter notebook ### Modules: +#### Global + +```bash +$ pip install +``` + +Les modules s'installent dans `/usr/local/lib/python3.7/site-packages` : + +Liste des modules: + +```bash +$ pip freeze +appnope==0.1.0 +asgiref==3.2.3 +backcall==0.1.0 +``` + + + +#### Local + +```bash +$ pip install --user +``` + +Les modules s'installent dans `/Users/bruno/Library/Python/3.7/lib/python/site-packages/` : + +Liste des modules: + +```bash +$ pip freeze --user +Click==7.0 +tornado==6.0.3 +``` + + + #### Mkdocs Il faut installer Mkdocs avec pip dans --user ```bash -$ pip3 install --user mkdocs +$ pip install --user mkdocs ``` -Mkdocs s'installe dans `'/Users/bruno/Library/Python/3.7/bin'` : +Mkdocs s'installe dans `/Users/bruno/Library/Python/3.7/bin` : ```bash ~/Library/Python/3.7/bin$ ./mkdocs --version @@ -115,7 +152,7 @@ export PATH=/Users/bruno/Library/Python/3.7/bin:$PATH On installe de la même manière le thème [Material](https://squidfunk.github.io/mkdocs-material/getting-started/): ```bash -$ pip3 install --user mkdocs-material +$ pip install --user mkdocs-material ``` diff --git a/docs/mkdocs.md b/docs/mkdocs.md index 9f0f721..bcccea8 100644 --- a/docs/mkdocs.md +++ b/docs/mkdocs.md @@ -2,14 +2,27 @@ For full documentation visit [mkdocs.org](http://mkdocs.org). -## Commands + + +## Installation: + +```bash +$ pip install mkdocs +``` + + + +## Commandes: * `mkdocs new [dir-name]` - Create a new project. * `mkdocs serve` - Start the live-reloading docs server. * `mkdocs build` - Build the documentation site. * `mkdocs help` - Print this help message. +* `gh-deploy` - Deploy your documentation to GitHub Pages. -## Project layout + + +## Project layout: ```bash mkdocs.yml # The configuration file. @@ -62,7 +75,7 @@ INFO - Cleaning site directory -## Copier les docs sur le serveur +## Copier les docs sur le serveur: ```bash $ cd /Users/bruno/project @@ -128,7 +141,7 @@ scp -P42666 -r ./central_docs bruno@192.168.xxx.xxx:/volume1/web ### Installer un thème: ```bash -$ pip install --user mkdocs-cinder +$ pip install mkdocs-cinder ``` @@ -136,7 +149,7 @@ $ pip install --user mkdocs-cinder ### Mettre à jour un thème: ```bash -$ pip install --user --upgrade mkdocs-material +$ pip install --upgrade mkdocs-material ``` diff --git a/mkdocs.yml b/mkdocs.yml index ffc3da3..14246b0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -224,8 +224,12 @@ nav: theme: #name: bootstrap - name: material - language: fr + name: 'material' + language: 'fr' + +plugins: + - search + - pdf-export extra_css: - stylesheets/fontawesome-all.css diff --git a/mkdocs_backup.yml b/mkdocs_backup.yml index a2ee11b..ffc3da3 100644 --- a/mkdocs_backup.yml +++ b/mkdocs_backup.yml @@ -40,7 +40,6 @@ nav: - Shells: Linux/shell.md - SSH: Linux/ssh.md - Tail / Head: Linux/tail-head.md - - Variables: Linux/variables.md - Divers: Linux/divers.md - Linux Mint: - Index: Mint/index.md @@ -57,30 +56,39 @@ nav: - Serveur web: Mint/webserver.md - macos: - Index: macos/index.md - - Bash (exemples): macos/bash_exemples.md - - chflags: macos/chflags.md - - Exécuter un script Bash: macos/executer_shell_script.md - - getfileinfo - setfile: macos/getfileinfo_setfile.md - Homebrew: - homebrew: macos/homebrew/brew.md - homebrew-cask: macos/homebrew/brew-cask.md - Mail: macos/Mail.md - - md5: macos/md5.md - Node.js: - Index: macos/node/index.md - Ghost: macos/node/ghost.md - node-js: macos/node/node-js.md - nvm: macos/node/nvm.md + - Perl: + - Installation: macos/perl/installer.md + - Perl: macos/perl/perl.md - Python: - Index: macos/python/index.md + - Conda: macos/python/conda.md - Django: macos/python/Django.md - pip: macos/python/pip.md - Python 3: macos/python/python3.md - Environnement virtuel: macos/python/virtuel.md + - Ruby: macos/ruby.md - Sécurité (Gatekeeper): macos/securite.md - ssh: - SSH: macos/ssh/ssh.md - passwordless: macos/ssh/ssh-passwordless.md + - Terminal: + - chflags: macos/terminal/chflags.md + - Exécuter un script Bash: macos/terminal/executer_shell_script.md + - getfileinfo - setfile: macos/terminal/getfileinfo_setfile.md + - md5: macos/terminal/md5.md + - open: macos/terminal/open.md + - Shebang: macos/terminal/shebang.md + - Terminal: macos/terminal/terminal.md + - you have mail: macos/terminal/youhavemail.md - Touch ID: macos/TouchID.md - WebServer: - Index: macos/webserver/index.md @@ -94,7 +102,6 @@ nav: - PHP 7.2: macos/webserver/php72.md - PHP 7.3: macos/webserver/php73.md - Xhprof: macos/webserver/Xhprof.md - - you have mail: macos/youhavemail.md - Divers: macos/Divers.md - Liens: macos/liens.md - MySQL: @@ -165,6 +172,10 @@ nav: - PHP: solus/php.md - Divers: - Index: Divers/index.md + - bash: + - Exemples: Divers/bash/bash_exemples.md + - Programmation: Divers/bash/programmation.md + - Tableaux: Divers/bash/tableaux.md - batch: - Commades DOS (1): Divers/batch/Commandes_DOS.md - Commades DOS (2): Divers/batch/Commandes_DOS_2.md @@ -208,6 +219,7 @@ nav: - zsh: - Antibody: Divers/zsh/antibody.md - zsh: Divers/zsh/zsh.md + - zsh2: Divers/zsh/zsh2.md - MkDocs: mkdocs.md theme: