From 61030087158f843bd93186ad2c6ba8a9eccee2d6 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Thu, 7 May 2020 13:43:00 +0200 Subject: [PATCH] 07-05-2020 -La section Distributions regroupe Solus, Mint et Debian -Section Windows --- docs/{ => Distributions}/Mint/Mint.md | 0 docs/{ => Distributions}/Mint/applications.md | 0 docs/{ => Distributions}/Mint/backup.md | 0 docs/{ => Distributions}/Mint/grub.md | 0 docs/{ => Distributions}/Mint/index.md | 0 docs/{ => Distributions}/Mint/info_sys.md | 0 docs/{ => Distributions}/Mint/outdated.md | 0 docs/{ => Distributions}/Mint/recovery.md | 0 docs/{ => Distributions}/Mint/samba.md | 0 docs/{ => Distributions}/Mint/systemctl.md | 0 docs/{ => Distributions}/Mint/vsftpd.md | 0 docs/{ => Distributions}/Mint/webserver.md | 0 docs/{Divers => Distributions}/debian.md | 40 ++++ docs/Distributions/index.md | 10 + docs/{ => Distributions}/solus/apache.md | 0 docs/{ => Distributions}/solus/index.md | 0 docs/{ => Distributions}/solus/mysql.md | 0 docs/{ => Distributions}/solus/php.md | 0 docs/Divers/Vagrant/creer_une_vagrant_box.md | 2 +- docs/Divers/git/git-ftp.md | 101 ++++++++ docs/Divers/git/git.md | 6 + docs/Divers/nextcloud.md | 6 + docs/Linux/index.md | 2 + docs/Plesk/nextcloud.md | 19 +- docs/Synology/nextcloud.md | 10 +- docs/Windows/Chocolatey.md | 224 ++++++++++++++++++ docs/Windows/PowerShell/ExecutionPolicies.md | 164 +++++++++++++ docs/Windows/PowerShell/commands.md | 175 ++++++++++++++ docs/Windows/PowerShell/env.md | 68 ++++++ docs/Windows/PowerShell/index.md | 14 ++ docs/Windows/Terminal.md | 60 +++++ docs/Windows/index.md | 8 + docs/Windows/systeminfo.md | 88 +++++++ docs/Windows/wsl.md | 115 ++++++--- docs/index.md | 2 + docs/macos/webserver/apache.md | 26 ++ docs/mkdocs.md | 6 +- mkdocs.yml | 53 +++-- mkdocs_backup.yml | 58 ++++- 39 files changed, 1198 insertions(+), 59 deletions(-) rename docs/{ => Distributions}/Mint/Mint.md (100%) rename docs/{ => Distributions}/Mint/applications.md (100%) rename docs/{ => Distributions}/Mint/backup.md (100%) rename docs/{ => Distributions}/Mint/grub.md (100%) rename docs/{ => Distributions}/Mint/index.md (100%) rename docs/{ => Distributions}/Mint/info_sys.md (100%) rename docs/{ => Distributions}/Mint/outdated.md (100%) rename docs/{ => Distributions}/Mint/recovery.md (100%) rename docs/{ => Distributions}/Mint/samba.md (100%) rename docs/{ => Distributions}/Mint/systemctl.md (100%) rename docs/{ => Distributions}/Mint/vsftpd.md (100%) rename docs/{ => Distributions}/Mint/webserver.md (100%) rename docs/{Divers => Distributions}/debian.md (50%) create mode 100644 docs/Distributions/index.md rename docs/{ => Distributions}/solus/apache.md (100%) rename docs/{ => Distributions}/solus/index.md (100%) rename docs/{ => Distributions}/solus/mysql.md (100%) rename docs/{ => Distributions}/solus/php.md (100%) create mode 100644 docs/Divers/git/git-ftp.md create mode 100644 docs/Windows/Chocolatey.md create mode 100644 docs/Windows/PowerShell/ExecutionPolicies.md create mode 100644 docs/Windows/PowerShell/commands.md create mode 100644 docs/Windows/PowerShell/env.md create mode 100644 docs/Windows/PowerShell/index.md create mode 100644 docs/Windows/Terminal.md create mode 100644 docs/Windows/systeminfo.md diff --git a/docs/Mint/Mint.md b/docs/Distributions/Mint/Mint.md similarity index 100% rename from docs/Mint/Mint.md rename to docs/Distributions/Mint/Mint.md diff --git a/docs/Mint/applications.md b/docs/Distributions/Mint/applications.md similarity index 100% rename from docs/Mint/applications.md rename to docs/Distributions/Mint/applications.md diff --git a/docs/Mint/backup.md b/docs/Distributions/Mint/backup.md similarity index 100% rename from docs/Mint/backup.md rename to docs/Distributions/Mint/backup.md diff --git a/docs/Mint/grub.md b/docs/Distributions/Mint/grub.md similarity index 100% rename from docs/Mint/grub.md rename to docs/Distributions/Mint/grub.md diff --git a/docs/Mint/index.md b/docs/Distributions/Mint/index.md similarity index 100% rename from docs/Mint/index.md rename to docs/Distributions/Mint/index.md diff --git a/docs/Mint/info_sys.md b/docs/Distributions/Mint/info_sys.md similarity index 100% rename from docs/Mint/info_sys.md rename to docs/Distributions/Mint/info_sys.md diff --git a/docs/Mint/outdated.md b/docs/Distributions/Mint/outdated.md similarity index 100% rename from docs/Mint/outdated.md rename to docs/Distributions/Mint/outdated.md diff --git a/docs/Mint/recovery.md b/docs/Distributions/Mint/recovery.md similarity index 100% rename from docs/Mint/recovery.md rename to docs/Distributions/Mint/recovery.md diff --git a/docs/Mint/samba.md b/docs/Distributions/Mint/samba.md similarity index 100% rename from docs/Mint/samba.md rename to docs/Distributions/Mint/samba.md diff --git a/docs/Mint/systemctl.md b/docs/Distributions/Mint/systemctl.md similarity index 100% rename from docs/Mint/systemctl.md rename to docs/Distributions/Mint/systemctl.md diff --git a/docs/Mint/vsftpd.md b/docs/Distributions/Mint/vsftpd.md similarity index 100% rename from docs/Mint/vsftpd.md rename to docs/Distributions/Mint/vsftpd.md diff --git a/docs/Mint/webserver.md b/docs/Distributions/Mint/webserver.md similarity index 100% rename from docs/Mint/webserver.md rename to docs/Distributions/Mint/webserver.md diff --git a/docs/Divers/debian.md b/docs/Distributions/debian.md similarity index 50% rename from docs/Divers/debian.md rename to docs/Distributions/debian.md index be870d6..81b2180 100644 --- a/docs/Divers/debian.md +++ b/docs/Distributions/debian.md @@ -116,3 +116,43 @@ Redémarrer la VM: shutdown -r now ``` + + + + +#### command not found: ifconfig + +ifconfig est remplacée par ip addr: + +```bash +❯ ip addr +1: lo: 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: bond0: mtu 1500 qdisc noop state DOWN group default qlen 1000 + link/ether 6a:b6:bd:e0:a2:8f brd ff:ff:ff:ff:ff:ff +3: dummy0: mtu 1500 qdisc noop state DOWN group default qlen 1000 + link/ether c2:50:7f:07:c7:86 brd ff:ff:ff:ff:ff:ff +4: sit0@NONE: mtu 1480 qdisc noop state DOWN group default qlen 1000 + link/sit 0.0.0.0 brd 0.0.0.0 +5: eth0: mtu 1500 qdisc mq state UP group default qlen 1000 + link/ether 00:15:5d:9f:5c:af brd ff:ff:ff:ff:ff:ff + inet 172.30.30.129/20 brd 172.30.31.255 scope global eth0 + valid_lft forever preferred_lft forever + inet6 fe80::215:5dff:fe9f:5caf/64 scope link + valid_lft forever preferred_lft forever +``` + +En fait, la commande ifconfig est incluse dans le paquet "net-tools" qui contient aussi d'autres commandes intéressantes, parmi lesquelles : arp, netstat, nameif ou encore route. + +> sudo apt-get install net-tools + +Sinon, on peut créer un alias dans son `.zshrc`: + +```bash +alias ifconfig='ip addr' +``` + diff --git a/docs/Distributions/index.md b/docs/Distributions/index.md new file mode 100644 index 0000000..b98142c --- /dev/null +++ b/docs/Distributions/index.md @@ -0,0 +1,10 @@ +# Distributions Linux + + + +[Debian](debian.md) + +[Mint](Mint/index.md) + +[Solus](solus/index.md) + diff --git a/docs/solus/apache.md b/docs/Distributions/solus/apache.md similarity index 100% rename from docs/solus/apache.md rename to docs/Distributions/solus/apache.md diff --git a/docs/solus/index.md b/docs/Distributions/solus/index.md similarity index 100% rename from docs/solus/index.md rename to docs/Distributions/solus/index.md diff --git a/docs/solus/mysql.md b/docs/Distributions/solus/mysql.md similarity index 100% rename from docs/solus/mysql.md rename to docs/Distributions/solus/mysql.md diff --git a/docs/solus/php.md b/docs/Distributions/solus/php.md similarity index 100% rename from docs/solus/php.md rename to docs/Distributions/solus/php.md diff --git a/docs/Divers/Vagrant/creer_une_vagrant_box.md b/docs/Divers/Vagrant/creer_une_vagrant_box.md index d714ae7..33c118f 100644 --- a/docs/Divers/Vagrant/creer_une_vagrant_box.md +++ b/docs/Divers/Vagrant/creer_une_vagrant_box.md @@ -57,7 +57,7 @@ https://www.ceos3c.com/open-source/install-linux-mint-19-virtualbox/ - Tester: `sudo pwd` - Pour Debian, voir [ici](../debian.md) + Pour Debian, voir [ici](../../Distributions/debian.md) 5. #### Mettre à jour l'OS: diff --git a/docs/Divers/git/git-ftp.md b/docs/Divers/git/git-ftp.md new file mode 100644 index 0000000..96a8f6d --- /dev/null +++ b/docs/Divers/git/git-ftp.md @@ -0,0 +1,101 @@ +# Git-ftp + +https://github.com/git-ftp/git-ftp/blob/master/man/git-ftp.1.md + + + +#### Configuration: + +```bash +$ git config git-ftp.url "sftp://ftp.sur-le-sentier.fr:22/~/httpdocs/blog/wp-content/themes/yuzu-child" + +$ git config git-ftp.user sentier + +$ git config git-ftp.key $HOME/.ssh/id_rsa + +$ git config git-ftp.insecure 0 + +# $ git config git-ftp.password '#my$fancy!secret' +``` + +```bash +$ git config --list +git-ftp.url=sftp://ftp.sur-le-sentier.fr:22/~/httpdocs/blog/wp-content/themes/yuzu-child +git-ftp.user=sentier +git-ftp.key=/Users/bruno/.ssh/id_rsa +git-ftp.insecure=0 +``` + +```bash +$ git config --list +git-ftp.url=sftp://ftp.cluster011.hosting.ovh.net/~/www/wordpress/wp-content/themes/toppic-child/ +git-ftp.user=funnymac +git-ftp.key=/Users/bruno/.ssh/id_rsa +git-ftp.insecure=1 +``` + +Supprimer une clé: + +```bash +$ git config --unset git-ftp.url +``` + + + +#### Initialisation: + +```bash +~/Sites/wordpress/wp-content/themes/yuzu-child master +❯ git ftp init -u sentier --key "$HOME/.ssh/id_rsa" "sftp://ftp.sur-le-sentier.fr/~/httpdocs/blog/wp-content/themes/yuzu-child/" + +# !!! Le dossier yuzu-child doit exister +``` + +ou + +```bash +~/Sites/wordpress/wp-content/themes/toppic-child +❯ git ftp init +12 files to sync: +[1 of 12] Buffered for upload 'formats/single-post/post-meta.php'. +[2 of 12] Buffered for upload 'functions.php'. +[3 of 12] Buffered for upload 'header.php'. +[4 of 12] Buffered for upload 'languages/fr_FR.mo'. +[5 of 12] Buffered for upload 'languages/fr_FR.po'. +[6 of 12] Buffered for upload 'languages/toppic-child.pot'. +[7 of 12] Buffered for upload 'page-ce-mois-ci.php'. +[8 of 12] Buffered for upload 'page-livre.php'. +[9 of 12] Buffered for upload 'screenshot.png'. +[10 of 12] Buffered for upload 'single-post.php'. +[11 of 12] Buffered for upload 'style 2.css'. +[12 of 12] Buffered for upload 'style.css'. +Uploading ... +Last deployment changed from to 35086dbd0ad8f13b34ac4c0c9499299a74ae69e2. +``` + + + +#### Envoyer les nouveaux commits: + +```bash +~/Sites/wordpress/wp-content/themes/yuzu-child master +❯ git ftp push -u sentier --key "$HOME/.ssh/id_rsa" "sftp://ftp.sur-le-sentier.fr/~/httpdocs/blog/wp-content/themes/yuzu-child/" +No changed files for ftp.sur-le-sentier.fr/~/httpdocs/blog/wp-content/themes/yuzu-child/. Everything up-to-date. + +``` + + + +#### Fichiers à ignorer: + +```bash +$ nano .git-ftp-ignore + +.gitignore +*/.gitignore # ignore files in sub directories +*/.gitkeep +.git-ftp-ignore +.git-ftp-include +.gitlab-ci.yml +``` + diff --git a/docs/Divers/git/git.md b/docs/Divers/git/git.md index 45cbf43..ffa3f9f 100644 --- a/docs/Divers/git/git.md +++ b/docs/Divers/git/git.md @@ -10,7 +10,13 @@ dsm916> cd /volume1/Repositories/ dsm916> git init –-bare wp2012.git ``` +```bash +bruno@DS916:/volume1/Repositories $ mkdir wp_yuzu-child.git +bruno@DS916:/volume1/Repositories $ cd wp_yuzu-child.git/ +bruno@DS916:/volume1/Repositories/wp_yuzu-child.git $ git --bare init +Initialized empty Git repository in /volume1/Repositories/wp_yuzu-child.git/ +``` Sur le client (Mac), se mettre dans le dossier source: diff --git a/docs/Divers/nextcloud.md b/docs/Divers/nextcloud.md index baf5c38..a571348 100644 --- a/docs/Divers/nextcloud.md +++ b/docs/Divers/nextcloud.md @@ -98,3 +98,9 @@ The hint "Limitations for Android-User: change to “ssl_ecdh_curve prime256v1; /usr/local/etc/apache22/sites-enabled $ sudo nano httpd-vhost.conf ``` + + + [Nextcloud sur NAS Synology](../Synology/nextcloud.md) + + [Nextcloud sur VPS/Plesk](../Plesk/nextcloud.md) + diff --git a/docs/Linux/index.md b/docs/Linux/index.md index 09c404c..74956c9 100644 --- a/docs/Linux/index.md +++ b/docs/Linux/index.md @@ -14,6 +14,8 @@ [Commandes apt-get & apt-cache](../Raspberry/apt-get.md) +[Distributions Linux](../Distributions/index.md) + [Editeurs](index.md) (vi, nano…) [Shells](shell.md) diff --git a/docs/Plesk/nextcloud.md b/docs/Plesk/nextcloud.md index 49ad321..49f93cb 100644 --- a/docs/Plesk/nextcloud.md +++ b/docs/Plesk/nextcloud.md @@ -1,4 +1,4 @@ -# Nextcloud: +# Nextcloud sur VPS/Plesk: @@ -6,12 +6,22 @@ https://docs.nextcloud.com/server/18/admin_manual/index.html +Se mettre dans le répertoire de Nextcloud: + +```bash +~$ cd ~/httpdocs/nextcloud +``` + +Activer le mode maintenance: + ```bash ~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ maintenance:mode --on The current PHP memory limit is below the recommended value of 512MB. Maintenance mode enabled ``` +Lance une réparation: + ```bash ~/httpdocs/nextcloud$ sudo -u bruno /opt/plesk/php/7.3/bin/php occ maintenance:repair ``` @@ -67,3 +77,10 @@ drwxr-xr-x 5 bruno psacln 16384 Apr 12 12:55 .Joplin drwxr-xr-x 2 bruno psacln 4096 Apr 11 19:15 Photos ``` + + + + + [Nextcloud sur NAS Synology](../Synology/nextcloud.md) + + [Installer Nextcloud en ligne de commande](../Divers/nextcloud.md) \ No newline at end of file diff --git a/docs/Synology/nextcloud.md b/docs/Synology/nextcloud.md index bb09d65..26ff658 100644 --- a/docs/Synology/nextcloud.md +++ b/docs/Synology/nextcloud.md @@ -1,4 +1,4 @@ -# Nextcloud +# Nextcloud sur NAS Synology @@ -220,3 +220,11 @@ Tester la tache dans le terminal: sudo -u http /usr/local/bin/php73 -f /volume1/web/nextcloud/cron.php ``` + + + + + [Installer Nextcloud en ligne de commande](../Divers/nextcloud.md) + + [Nextcloud sur VPS/Plesk](../Plesk/nextcloud.md) + diff --git a/docs/Windows/Chocolatey.md b/docs/Windows/Chocolatey.md new file mode 100644 index 0000000..f0dfbd0 --- /dev/null +++ b/docs/Windows/Chocolatey.md @@ -0,0 +1,224 @@ +# Chocolatey + + + +### [Installation](https://chocolatey.org/install) + +Chocolatey nécessite PowerShell avec droits Administrateur. + +Lancer: +```powershell +PS Get-ExecutionPolicy +RemoteSigned +``` +Si la réponse est `Restricted`, lancez: +```powershell +PS Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process. +``` + +Puis lancez la commande suivante: +```powershell +PS Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) +``` + +Si il n'y a pas d'erreur, lancer Choco +```powershell +PS choco +Chocolatey v0.10.15 +Please run 'choco -?' or 'choco -?' for help menu. +``` + + + +### [Commandes](https://chocolatey.org/docs/commands-reference) + + + +### [Packages](https://chocolatey.org/packages) + +#### [:octicons-link:](https://chocolatey.org/docs/commands-install) Installer un paquet `choco install` (`cinst`): + +```powershell +PS choco install chocolateygui +Chocolatey v0.10.15 +Installing the following packages: +chocolateygui +By installing you accept licenses for the packages. +Progress: Downloading ChocolateyGUI 0.17.0... 100% +Progress: Downloading DotNet4.5.2 4.5.2.20140902... 100% + +DotNet4.5.2 v4.5.2.20140902 [Approved] +dotnet4.5.2 package files install completed. Performing other installation steps. +The package DotNet4.5.2 wants to run 'ChocolateyInstall.ps1'. +Note: If you don't run this script, the installation will fail. +Note: To confirm automatically next time, use '-y' or consider: +choco feature enable -n allowGlobalConfirmation +Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): Y +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-uninstall) Désinstaller un paquet `choco uninstall` (`cuninst`): + +```powershell +PS choco uninstall vcxsrv +Chocolatey v0.10.15 +Uninstalling the following packages: +vcxsrv + +vcxsrv v1.20.8.1 +The package vcxsrv wants to run 'chocolateyuninstall.ps1'. +Note: If you don't run this script, the installation will fail. +Note: To confirm automatically next time, use '-y' or consider: +choco feature enable -n allowGlobalConfirmation +Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): A +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-list) Liste des paquets installés `choco list` (`clist`): + +```powershell +# Applications installées par Chocolatey + +PS choco list --local-only +Chocolatey v0.10.15 +chocolatey 0.10.15 +chocolatey-core.extension 1.3.5.1 +chocolateygui 0.17.0 +DotNet4.5.2 4.5.2.20140902 +git.install 2.26.2 +vscode 1.44.2 +vscode.install 1.44.2 + +# Applications installées par Chocolatey et toutes les autres. +PS choco list -lai +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-search) Rechercher un paquet `choco search` (`clist`): + +```powershell +# Chercher les paquets relatifs à Git + +PS choco search git +# PS clist git +Chocolatey v0.10.15 +git 2.26.2 [Approved] +git-helper 1.5 - Possibly broken +Git-TF 2.0.3.20131219 [Approved] +git-it 4.4.0 [Approved] +EthanBrown.GitAliases 0.0.5 +git-lfx 0.1.0 [Approved] +git-interactive-rebase-tool 1.1.0 [Approved] Downloads cached for licensed users +git.portable 2.26.2 [Approved] + +# Plus d'infos + +PS choco search git --detailed +.../... +vscodium.install 1.44.2 [Approved] + Title: VSCodium (Install) | Published: 21/04/2020 + Package approved by Pauby on avr. 21 2020 12:26:11. + Package testing status: Passing on avr. 21 2020 10:27:25. + Number of Downloads: 5624 | Downloads for this version: 1259 + Package url + Chocolatey Package Source: https://github.com/Thilas/chocolatey-packages/tree/master/vscodium.install + Package Checksum: 'tsygmUY9Krl1xcp+Z/rk1tShITJQ4X5KTM+lh/cR+WtxOELWfZO8MY/ndDzgJmUZuhDiFQVCGLb5s9P0/5bLng==' (SHA512) + Tags: vscodium admin foss cross-platform microsoft visualstudiocode vscode development editor ide javascript typescript + Software Site: https://github.com/VSCodium/vscodium + Software License: https://github.com/VSCodium/vscodium/blob/master/LICENSE + Software Source: https://github.com/VSCodium/vscodium + Documentation: https://code.visualstudio.com/docs + Issues: https://github.com/VSCodium/vscodium/issues + Summary: VSCodium (Install) + Description: Free/Libre Open Source Software binaries of [Visual Studio Code](https://chocolatey.org/packages/vscode). + + Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity). +.../... + +# Chercher exactement 'Git' + +PS choco search git --exact +Chocolatey v0.10.15 +git 2.26.2 [Approved] +1 packages found. +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-info) Info sur un paquet `choco info`: + +```powershell +PS choco info git +Chocolatey v0.10.15 +git 2.26.2 [Approved] + Title: Git | Published: 20/04/2020 + Package approved by AdmiringWorm on avr. 21 2020 12:07:36. + Package testing status: Passing on avr. 20 2020 18:46:36. + Number of Downloads: 3756434 | Downloads for this version: 52727 + Package url + Chocolatey Package Source: https://github.com/chocolatey-community/chocolatey-coreteampackages/tree/master/automatic/git + +# Synonyme à choco search --exact --detailed +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-outdated) Paquets non à jour `choco outdated`: + +```powershell +PS choco outdated +Chocolatey v0.10.15 +Outdated Packages + Output is package name | current version | available version | pinned? + + +Chocolatey has determined 0 package(s) are outdated. +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-upgrade) Mettre à jour un/des paquets `choco upgrade` (`cup`): + +```powershell +# Mettre à jour un ou plusieurs paquets +PS choco upgrade + +# Mettre à jour tous les paquets +PS choco upgrade all +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-pin) Empêcher de mettre à jour un paquet `choco pin`: + +```powershell +# Bloquer les maj de chocolateygui + +PS choco pin add -n=chocolateygui +Chocolatey v0.10.15 +Trying to add a pin for chocolateygui +Successfully added a pin for chocolateygui v0.17.0. + +# Liste des paquets 'pinned' + +PS choco pin list +Chocolatey v0.10.15 +chocolateygui|0.17.0 + +# Débloquer les maj de chocolateygui + +PS choco pin remove --name chocolateygui +Chocolatey v0.10.15 +Trying to remove a pin for chocolateygui +Successfully removed a pin for chocolateygui v0.17.0. +``` + +#### [:octicons-link:](https://chocolatey.org/docs/commands-config) Configuration de chocolatey `choco config`: + +```powershell +PS choco config list +Chocolatey v0.10.15 +Settings +cacheLocation = | Cache location if not TEMP folder. Replaces `$env:TEMP` value for choco.exe process. It is highly recommended this be set to make Chocolatey more deterministic in cleanup. +.../... + +Sources +chocolatey - https://chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False. + +NOTE: Use choco source to interact with sources. + +Features +[x] checksumFiles - Checksum files when pulled in from internet (based on package). +[x] autoUninstaller - Uninstall from programs and features without requiring an explicit uninstall script. +.../... +``` + diff --git a/docs/Windows/PowerShell/ExecutionPolicies.md b/docs/Windows/PowerShell/ExecutionPolicies.md new file mode 100644 index 0000000..8a3a08a --- /dev/null +++ b/docs/Windows/PowerShell/ExecutionPolicies.md @@ -0,0 +1,164 @@ + + +# Stratégies d'exécution PowerShell: + +https://docs.microsoft.com/fr-fr/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7 + + + +#### AllSigned + +- Les scripts peuvent s'exécuter. +- Nécessite que tous les scripts et fichiers de configuration soient signés par un éditeur approuvé, y compris les scripts que vous écrivez sur l'ordinateur local. +- Vous invite à exécuter des scripts d'éditeurs que vous n'avez pas encore classés comme fiables ou non fiables. +- Risques liés à l'exécution de scripts signés mais malveillants. + +#### ByPass + +- Rien n'est bloqué et il n'y a aucun avertissement ou invite. +- Cette stratégie d'exécution est conçue pour les configurations dans lesquelles un script PowerShell est intégré à une application plus grande ou pour les configurations dans lesquelles PowerShell est la base d'un programme qui possède son propre modèle de sécurité. + +#### Default + +- Définit la stratégie d'exécution par défaut. +- **Restricted** aux clients Windows. +- **RemoteSigned** pour les serveurs Windows. + +#### RemoteSigned + +- La stratégie d'exécution par défaut pour les ordinateurs serveurs Windows. +- Les scripts peuvent s'exécuter. +- Nécessite une signature numérique d'un éditeur de confiance sur les scripts et les fichiers de configuration téléchargés sur Internet, qui incluent des programmes de messagerie électronique et de messagerie instantanée. +- Ne nécessite pas des signatures numériques sur des scripts écrits sur l'ordinateur local et non téléchargés sur Internet. +- Exécute des scripts téléchargés sur Internet et non signés, si les scripts sont débloqués, par exemple en utilisant l'applet de commande `Unblock-File`. +- Risque d'exécuter des scripts non signés à partir de sources autres qu'Internet et des scripts signés qui pourraient être malveillants. + +#### Restricted + +- La stratégie d'exécution par défaut pour les ordinateurs clients Windows. +- Autorise les commandes individuelles, mais n'autorise pas les scripts. +- Empêche l'exécution de tous les fichiers de script, y compris les fichiers de formatage et de configuration (.ps1xml), les fichiers de script de module (.psm1) et les profils PowerShell (.ps1). + +#### Undefined + +- Aucune stratégie d'exécution n'est définie dans la portée actuelle. +- Si la politique d'exécution dans toutes les étendues est **Undefined**, la politique d'exécution effective est **Restricted**, qui est la politique d'exécution par défaut. + +#### Unrestricted + +- La stratégie d'exécution par défaut pour les ordinateurs non Windows et ne peut pas être modifiée. +- Des scripts non signés peuvent s'exécuter. Il existe un risque d'exécuter des scripts malveillants. +- Avertit l'utilisateur avant d'exécuter des scripts et des fichiers de configuration qui ne proviennent pas de la zone intranet locale. + + + +### Portée de la politique d'exécution: + +#### MachinePolicy + +Défini par une stratégie de groupe pour tous les utilisateurs de l'ordinateur. + +#### UserPolicy + +Défini par une stratégie de groupe pour l'utilisateur actuel de l'ordinateur. + +#### Process + +L'étendue du processus affecte uniquement la session PowerShell en cours. La stratégie d'exécution est enregistrée dans la variable d'environnement `$ env: PSExecutionPolicyPreference`, plutôt que dans le registre. Lorsque la session PowerShell est fermée, la variable et la valeur sont supprimées. + +#### CurrentUser + +La stratégie d'exécution affecte uniquement l'utilisateur actuel. Il est stocké dans la sous-clé de registre `HKEY_CURRENT_USER`. + +#### LocalMachine + +La stratégie d'exécution affecte tous les utilisateurs de l'ordinateur actuel. Il est stocké dans la sous-clé de registre `HKEY_LOCAL_MACHINE`. + + + +### Obtenir la politique d'exécution: + +```powershell +# Obtenir la politique d'exécution courante + +PS C:\Users\bruno> Get-ExecutionPolicy +Restricted + +# Obtenir toutes les politiques d'exécution qui affectent la session en cours et les afficher dans l'ordre de priorité: + +PS C:\Users\bruno> Get-ExecutionPolicy -List + +Scope ExecutionPolicy +----- --------------- +MachinePolicy Undefined +UserPolicy Undefined +Process Undefined +CurrentUser Undefined +LocalMachine Undefined + +# Obtenir la stratégie d'exécution pour la portée CurrentUser: + +PS C:\Users\bruno> Get-ExecutionPolicy -Scope CurrentUser +Undefined + +``` + + + +### Modifier la politique d'exécution: + +```powershell +# Modifier la politique d'exécution courante +# - nécessite d'ouvrir PowerShell en tant qu'administrateur + +PS Set-ExecutionPolicy -ExecutionPolicy RemoteSigned + + +PS Get-ExecutionPolicy -List + +Scope ExecutionPolicy +----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser Undefined LocalMachine RemoteSigned < + +# Modifier la politique d'exécution courante pour CurrentUser + +PS Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +PS C:\WINDOWS\system32> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser RemoteSigned < LocalMachine Undefined + +``` + + + +### Supprimer la politique d'exécution: + +Cela revient à la déclarer `Undefined` + +```powershell +PS Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine + +PS Get-ExecutionPolicy -List + +Scope. ExecutionPolicy +----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser Undefined LocalMachine Undefined < + +``` + + + +### Modifier la politique d'exécution pour une session: + +```powershell +PS pwsh.exe -ExecutionPolicy AllSigned +``` + + + +### Priorités de politique d'exécution: + +Lors de la détermination de la stratégie d'exécution effective pour une session, PowerShell évalue les stratégies d'exécution dans l'ordre de priorité suivant: + +- Group Policy: MachinePolicy +- Group Policy: UserPolicy +- Execution Policy: Process (or `pwsh.exe -ExecutionPolicy`) +- Execution Policy: CurrentUser +- Execution Policy: LocalMachine \ No newline at end of file diff --git a/docs/Windows/PowerShell/commands.md b/docs/Windows/PowerShell/commands.md new file mode 100644 index 0000000..afc7568 --- /dev/null +++ b/docs/Windows/PowerShell/commands.md @@ -0,0 +1,175 @@ +# Commandes PowerShell + + + +#### Afficher le contenu du répertoire: + +```powershell +PS Get-ChildItem + + + Répertoire : C:\Users\enzo2 + + +Mode LastWriteTime Length Name +d----- 12/04/2020 11:53 .config +d----- 04/04/2020 09:38 .dotnet +d----- 27/03/2020 21:12 .PyCharm2019.3 +d +``` + +#### Changer de répertoire: + +```powershell +PS Set-Location "C:\" + +PS ls + + Répertoire : C:\ +``` + +```powershell +PS Set-Location "C:\WINDOWS\system32" +``` + +```powershell +PS D: + +PS ls + + Répertoire : D:\ +``` + + + +#### Piper une commande vers wsl: + +```powershell +PS Get-ChildItem | wsl grep .g* +-a---- 02/04/2020 12:13 318 .gitconfig +``` + +```powershell +PS ipconfig | wsl grep IPv4 + Adresse IPv4. . . . . . . . . . . . . .: 172.18.96.1 + Adresse IPv4. . . . . . . . . . . . . .: 192.168.1.17 + Adresse IPv4. . . . . . . . . . . . . .: 192.168.32.1 + Adresse IPv4. . . . . . . . . . . . . .: 192.168.61.1 + Adresse IPv4. . . . . . . . . . . . . .: 172.27.144.1 +``` + +#### Piper une commande depuis wsl: + +```powershell +PS wsl ls -la | Select-Object -First 5 +total 1645992 +drwxrwxrwx 1 enzo2 enzo2 512 Apr 13 15:08 . +drwxrwxrwx 1 enzo2 enzo2 512 Mar 28 17:59 .. +drwxrwxrwx 1 enzo2 enzo2 512 Mar 28 18:09 3D Objects +drwxrwxrwx 1 enzo2 enzo2 512 Mar 28 18:07 AppData +``` + + + +#### Liste des commandes: + +```powershell +PS Get-Command + +CommandType Name Version Source +----------- ---- ------- ------ +Alias Add-AppPackage 2.0.1.0 Appx +Alias Add-AppPackageVolume 2.0.1.0 Appx +.../... +``` + +```powershell +PS Get-Command -Name *IP* + +CommandType Name Version Source +----------- ---- ------- ------ +Alias gip -> 1.0.0.0 NetTCPIP +Alias ipal -> Import-Alias +``` + + + +#### Obtenir de l'aide: + +```powershell +PS Get-Help -Name Get-Process + +NOM + Get-Process + +SYNTAXE + Get-Process [[-Name] ] [] + Get-Process [[-Name] ] [] + Get-Process [] + Get-Process [] + Get-Process [] + Get-Process [] + +ALIAS + gps + ps +``` + + + +#### Liste de Services: + +```powershell +PS Get-Service + +Status Name DisplayName +------ ---- ----------- +Stopped AarSvc_6e14a Agent Activation Runtime_6e14a +Running AdobeARMservice Adobe Acrobat Update Service +Stopped AJRouter Service de routeur AllJoyn +Stopped ALG Service de la passerelle de la couc... +Running AMD External Ev... AMD External Events Utility +``` + +#### Uniquement les Services actifs: + +```powershell +PS Get-Service | Where-Object {$_.Status -eq "Running"} + +Status Name DisplayName +------ ---- ----------- +Running AdobeARMservice Adobe Acrobat Update Service +Running AMD External Ev... AMD External Events Utility +Running Appinfo Informations d’application +``` + + + +#### Sortie HTML: + +```powershell +PS Get-Service | Where-Object {$_.Status -eq "Running"} | ConvertTo-Html | Out-File Services.html +``` + +#### Sortie .csv: + +```powershell +PS Get-Service | Where-Object {$_.Status -eq "Running"} | Select-Object Name, Status | Export-CSV Service.csv +``` + + + +#### Voir les erreurs dans les logs event: + +```powershell +PS Get-EventLog -LogName System -EntryType Error + + Index Time EntryType Source InstanceID Message + ----- ---- --------- ------ ---------- ------- + 11071 mai 01 09:40 Error volsnap 3221618724 Les clichés instantanés du volume C: ont été an... + 10981 avr. 29 19:55 Error volsnap 3221618724 Les clichés instantanés du volume C: ont été an... + 10833 avr. 28 07:30 Error volsnap 3221618724 Les clichés instantanés du volume C: ont été an... + 10774 avr. 28 07:25 Error bowser 3221233475 Le maître explorateur a reçu une annonce de ser... + 10766 avr. 28 07:22 Error Schannel 36871 Une erreur irrécupérable s'est produite lors de... +``` + diff --git a/docs/Windows/PowerShell/env.md b/docs/Windows/PowerShell/env.md new file mode 100644 index 0000000..f05ee30 --- /dev/null +++ b/docs/Windows/PowerShell/env.md @@ -0,0 +1,68 @@ +# Variables d'environnement + +DESKTOP-FL5F1S2 + +`Get-Item -Path Env:*` + +```powershell +PS Get-Item -Path Env:* Name Value ---- ----- COMPUTERNAME DESKTOP-FL5F1S2 USERPROFILE C:\Users\bruno HOMEPATH \Users\bruno LOCALAPPDATA C:\Users\bruno\AppData\Local PSModulePath C:\Users\bruno\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell... PROCESSOR_ARCHITECTURE AMD64 Path C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\Program Files (x86)\... CommonProgramFiles(x86) C:\Program Files (x86)\Common Files ProgramFiles(x86) C:\Program Files (x86) PROCESSOR_LEVEL 6 LOGONSERVER \\DESKTOP-FL5F1S2 PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL HOMEDRIVE C: SystemRoot C:\WINDOWS ALLUSERSPROFILE C:\ProgramData DriverData C:\Windows\System32\Drivers\DriverData APPDATA C:\Users\bruno\AppData\Roaming PROCESSOR_REVISION 5e03 USERNAME bruno CommonProgramW6432 C:\Program Files\Common Files OneDrive C:\Users\bruno\OneDrive CommonProgramFiles C:\Program Files\Common Files OS Windows_NT USERDOMAIN_ROAMINGPROFILE DESKTOP-FL5F1S2 PROCESSOR_IDENTIFIER Intel64 Family 6 Model 94 Stepping 3, GenuineIntel OneDriveConsumer C:\Users\bruno\OneDrive AppsRoot D SystemDrive C: TEMP C:\Users\bruno\AppData\Local\Temp ProgramFiles C:\Program Files NUMBER_OF_PROCESSORS 2 ComSpec C:\WINDOWS\system32\cmd.exe TMP C:\Users\bruno\AppData\Local\Temp ProgramData C:\ProgramData ProgramW6432 C:\Program Files windir C:\WINDOWS USERDOMAIN DESKTOP-FL5F1S2 PUBLIC C:\Users\Public +``` + +Win10 + +`Get-ChildItem -Path Env:*` + +```powershell +PS Get-ChildItem -Path Env:* + +Name Value + +---- ----- + +SystemDrive C: +ProgramFiles(x86) C:\Program Files (x86) +ProgramW6432 C:\Program Files +ChocolateyInstall C:\ProgramData\chocolatey +PROCESSOR_IDENTIFIER Intel64 Family 6 Model 60 Stepping 3, GenuineIntel +TMP C:\Users\enzo2\AppData\Local\Temp +PROCESSOR_ARCHITECTURE AMD64 +Path C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program F... +WSLENV WT_SESSION::WT_PROFILE_ID +PROCESSOR_REVISION 3c03 +TEMP C:\Users\enzo2\AppData\Local\Temp +USERPROFILE C:\Users\enzo2 +LOGONSERVER \\WIN10 +WT_SESSION a9307fc2-a6d2-4543-8843-896181a31614 +USERNAME enzo2 +SystemRoot C:\WINDOWS +OneDrive C:\Users\enzo2\OneDrive +CommonProgramFiles(x86) C:\Program Files (x86)\Common Files +ProgramData C:\ProgramData +HOMEPATH \Users\enzo2 +OneDriveConsumer C:\Users\enzo2\OneDrive +COMPUTERNAME WIN10 +ALLUSERSPROFILE C:\ProgramData +CommonProgramW6432 C:\Program Files\Common Files +WT_PROFILE_ID {61c54bbd-c2c6-5271-96e7-009a87ff44bf} +DriverData C:\Windows\System32\Drivers\DriverData +HOMEDRIVE C: +windir C:\WINDOWS +NUMBER_OF_PROCESSORS 8 +OS Windows_NT +ProgramFiles C:\Program Files +ComSpec C:\WINDOWS\system32\cmd.exe +PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL +HOME C:\Users\enzo2 +JD2_HOME C:\Users\enzo2\AppData\Local\JDownloader 2.0 +PSModulePath C:\Users\enzo2\OneDrive\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsP... +APPDATA C:\Users\enzo2\AppData\Roaming +USERDOMAIN WIN10 +PROCESSOR_LEVEL 6 +asl.log Destination=file +LOCALAPPDATA C:\Users\enzo2\AppData\Local +ChocolateyLastPathUpdate 132328701361148322 +USERDOMAIN_ROAMINGPROFILE WIN10 +PUBLIC C:\Users\Public +CommonProgramFiles C:\Program Files\Common Files +``` + diff --git a/docs/Windows/PowerShell/index.md b/docs/Windows/PowerShell/index.md new file mode 100644 index 0000000..be5f7c1 --- /dev/null +++ b/docs/Windows/PowerShell/index.md @@ -0,0 +1,14 @@ +# PowerShell + + + +Pour éditer votre profile PowerShell, exécuter `notepad.exe $PROFILE` + +Editeur de scripts PowerShell: **Windows PowerShell ISE** (à ouvrir en administrateur). + + + +- [Stratégies d'exécution PowerShell](ExecutionPolicies.md) +- [Commandes](commands.md) +- [Variables d'environnement](env.md) + diff --git a/docs/Windows/Terminal.md b/docs/Windows/Terminal.md new file mode 100644 index 0000000..5ffe154 --- /dev/null +++ b/docs/Windows/Terminal.md @@ -0,0 +1,60 @@ +# Windows Terminal + +[Docs](https://github.com/microsoft/terminal/tree/master/doc/user-docs) + + + +### Installation: + +Aller sur le Microsoft Store et installer Windows Terminal Preview. + + + +### Ouvrir WT en Administrateur: + +Clic-droit sur l'icone dans la barre des taches +Mettre en sur-brillance Windows Terminal +Appuyer sur Ctrl+Shift+Enter. + +WT ouvert en mode normal: il n'est pas possible d'ouvrir un nouvel onglet en Admin. + + + +### Copier /coller: + +#### Pour sélectionner: + +- mode ligne: clic gauche puis déplacer le curseur +- mode bloc: alt + clic gauche puis déplacer le curseur + +#### Pour copier: + +- clic droit + +#### Pour coller: + +- Ctrl +V +- clic droit + +Réglage global `copyOnSelect`: la sélection est copié immédiatement dans le presse-papier. + + + +### Raccourcis: + +| Fonction | Touches | +| ---------------------------------------------- | ---------------- | +| ouvrir un nouvel onglet | Ctrl + Shift + 1 | +| effacer l'écran | Ctrl + L | +| effacer la ligne | Ctrl + U | +| déplacer le curseur au début de la ligne | Ctrl + A | +| déplacer le curseur en fin de la ligne | Ctrl + E | +| supprimer tous les carratères après le curseur | Ctrl + K | + + + +### Divers: + +#### Ouvrir WT dans le répertoire courant (depuis l'explorer): + +Taper `wt -d .` dans la barre d'adresse. \ No newline at end of file diff --git a/docs/Windows/index.md b/docs/Windows/index.md index 143489d..2f87579 100644 --- a/docs/Windows/index.md +++ b/docs/Windows/index.md @@ -2,8 +2,16 @@ +[Chocolatey](Chocolatey.md) + [Créer des clés ssh (pour Windows et WSL)](cles-ssh.md) +[PowerShell](PowerShell/index.md) + +[systeminfo](systeminfo.md) + +[Windows Terminal](Terminal.md) + [WSL (Windows Sub Linux)](wsl.md) [Trucs](trucs.md) diff --git a/docs/Windows/systeminfo.md b/docs/Windows/systeminfo.md new file mode 100644 index 0000000..b22aea6 --- /dev/null +++ b/docs/Windows/systeminfo.md @@ -0,0 +1,88 @@ +# systeminfo (W10) + + + +#### Obtenir des informations sur la machine et le système : + +```batch +C:\Users\enzo2>systeminfo + + +Nom de l’hôte: WIN10 +Nom du système d’exploitation: Microsoft Windows 10 Professionnel +Version du système: 10.0.19041 N/A version 19041 +Fabricant du système d’exploitation: Microsoft Corporation +Configuration du système d’exploitation: Station de travail autonome +Type de version du système d’exploitation: Multiprocessor Free +Propriétaire enregistré: xxxx@hotmail.fr +Organisation enregistrée: +Identificateur de produit: 00330-80000-00000-AA345 +Date d’installation originale: 28/03/2020, 19:09:41 +Heure de démarrage du système: 23/04/2020, 09:10:38 +Fabricant du système: Gigabyte Technology Co., Ltd. +Modèle du système: Z97X-UD3H +Type du système: x64-based PC +Processeur(s): 1 processeur(s) installé(s). + [01] : Intel64 Family 6 Model 60 Stepping 3 GenuineIntel ~4001 MHz +Version du BIOS: American Megatrends Inc. F9, 18/09/2015 +Répertoire Windows: C:\WINDOWS +Répertoire système: C:\WINDOWS\system32 +Périphérique d’amorçage: \Device\HarddiskVolume3 +Option régionale du système: fr;Français (France) +Paramètres régionaux d’entrée: fr;Français (France) +Fuseau horaire: (UTC+01:00) Bruxelles, Copenhague, Madrid, Paris +Mémoire physique totale: 16 245 Mo +Mémoire physique disponible: 8 129 Mo +Mémoire virtuelle : taille maximale: 18 677 Mo +Mémoire virtuelle : disponible: 5 445 Mo +Mémoire virtuelle : en cours d’utilisation: 13 232 Mo +Emplacements des fichiers d’échange: C:\pagefile.sys +Domaine: WORKGROUP +Serveur d’ouverture de session: \\WIN10 +Correctif(s): 4 Corrections installées. + [01]: KB4534170 + [02]: KB4537759 + [03]: KB4545706 + [04]: KB4550936 +Carte(s) réseau: 7 carte(s) réseau installée(s). + [01]: TAP-Windows Adapter V9 + Nom de la connexion : Ethernet 2 + État : Support déconnecté + [02]: Hyper-V Virtual Ethernet Adapter + Nom de la connexion : vEthernet (Default Switch) + DHCP activé : Non + Adresse(s) IP + [01]: 172.18.96.1 + [02]: fe80::8481:3e13:4002:db13 + [03]: Intel(R) Ethernet Connection I217-V + Nom de la connexion : Ethernet + DHCP activé : Oui + Serveur DHCP : 192.168.1.1 + Adresse(s) IP + [01]: 192.168.1.17 + [02]: fe80::187b:4f31:8e4:17f5 + [03]: 2a01:cb10:851b:de00:cddd:efad:f244:ef67 + [04]: 2a01:cb10:851b:de00:187b:4f31:8e4:17f5 + [04]: VMware Virtual Ethernet Adapter for VMnet1 + Nom de la connexion : VMware Network Adapter VMnet1 + DHCP activé : Oui + Serveur DHCP : 192.168.32.254 + Adresse(s) IP + [01]: 192.168.32.1 + [05]: VMware Virtual Ethernet Adapter for VMnet8 + Nom de la connexion : VMware Network Adapter VMnet8 + DHCP activé : Oui + Serveur DHCP : 192.168.61.254 + Adresse(s) IP + [01]: 192.168.61.1 + [06]: Hyper-V Virtual Ethernet Adapter + Nom de la connexion : vEthernet (WSL) + DHCP activé : Non + Adresse(s) IP + [01]: 172.27.144.1 + [02]: fe80::e513:572c:1cbc:29cd + [07]: Kaspersky Security Data Escort Adapter + Nom de la connexion : Ethernet 3 + État : Support déconnecté +Configuration requise pour Hyper-V: Un hyperviseur a été détecté. Les fonctionnalités nécessaires à Hyper-V ne seront pas affichées. +``` \ No newline at end of file diff --git a/docs/Windows/wsl.md b/docs/Windows/wsl.md index 68b6baa..530f645 100644 --- a/docs/Windows/wsl.md +++ b/docs/Windows/wsl.md @@ -2,13 +2,15 @@ -### WSL 2 +### WSL 2 (installation) Nécessite une insider build (31/03/2020) Aller à Fonctionnalités de Windows: -- -installer Plateforme d'ordinateur virtuel (Virtual Machine Platform) -- -installer Sous-système Windows pour Linux (Windows Subsystem for Linux) +- installer Plateforme d'ordinateur virtuel (Virtual Machine Platform) +- installer Sous-système Windows pour Linux (Windows Subsystem for Linux) + +Pour Parallels Desktop, aller dans Configuration -> Matériel -> CPU et mémoire -> Paramètres avancés, et cocher Activer la virtualisation imbriquée. Aller sur le Microsoft Store et installer une distrib Linux. @@ -32,26 +34,29 @@ Distributions du sous-système Windows pour Linux : Debian (par défaut) ``` -Les distros sont visibles en tapant \\wsl$ dans la barre de l'explorer. -Même en quittant la distro ($ exit), elle y reste dispo. +Les distros sont visibles en tapant `\\wsl$` dans la barre de l'explorer. +Même en quittant la distro (`$ exit`), elle y reste dispo. -Quitter une distro: +#### Quitter une distro: -``` -wsl --terminate Debian -wsl -t Debian +> ``` +> wsl --terminate Debian +> wsl -t Debian +> +> C:\Users\enzo2>wsl --list --running +> Il n'y a aucune distribution en cours d'exécution. +> ``` +> -C:\Users\enzo2>wsl --list --running -Il n'y a aucune distribution en cours d'exécution. -``` -Pour passer à wsl 2: + +#### Pour passer à wsl 2: ``` wsl --set-version Debian 2 ``` -Pour démarrer la distro: +#### Pour démarrer la distro: ```bash wsl --distribution Debian @@ -68,7 +73,9 @@ NAME STATE VERSION Différences entre wsl 1 et 2: https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes -Backup wsl: + + +#### Backup wsl: ```bash wsl --export Debian debian.tar @@ -88,15 +95,70 @@ C:\Users\enzo2>debian clean C:\Users\enzo2>debian --help ``` -Aller sur le Microsoft Store et installer Windows Terminal Preview. -quelques raccourcis: -Ctrl+L effacer l'écran -Ctrl+U effacer la ligne -Ctrl+A déplacer le curseur au début de la ligne -Ctrl+E déplacer le curseur en fin de la ligne -Ctrl+K supprimer tous les carratères après le curseur -Navigation dans les dossiers/fichiers: + +#### Réglages WSL: + +https://docs.microsoft.com/en-us/windows/wsl/wsl-config#set-wsl-launch-settings + + + +#### Installer une GUI: + +Installer xfce4: + +```bash +sudo apt-get -y install xfce4 +``` + +Installer xRDP server + +```bash +sudo apt-get -y install xrdp +echo xfce4-session > ~/.xsession +sudo service xrdp restart + +sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak +# changer le port +sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini +# changer les réglages de qualité +sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini +sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini +# redémarrer le serveur +sudo service xrdp restart +``` + +Trouver l'adresse IP de la distrib WSL + +```bash +ifconfig | grep inet (ip addr | grep inet) +Les IP de ipconfig.exe ne sont pas les bonnes. +``` + +Ouvrir une session xRDP +> mstsc.exe +> puis fournir l'adresse IP + +```bash +mstsc.exe 127.0.0.1:3390 +``` + +Ajouter un alias au .zshrc + +```bash +# cd /mnt/c/Users/enzo2/OneDrive/Documents/wsl + +alias xfce='mstsc.exe "C:\Users/enzo2/OneDrive/Documents/wsl/debian-xfce-pass.rdp"' +``` + +https://dev.to/darksmile92/linux-on-windows-wsl-with-desktop-environment-via-rdp-522g + +https://korben.info/linux-wsl-gui-interface-graphique-windows-10.html + + + +#### Navigation dans les dossiers/fichiers: + Dans WSL: Chemin du bureau Windows: `/mnt/C/Users/enzo2/OneDrive/Bureau/ => C:\Users\enzo2\OneDrive\Desktop` @@ -134,6 +196,8 @@ Copier dans le presse-papier: cat ~/.ssh/id_rsa.pub | clip.exe ``` + + ### VScode et wsl: Afficher la palette de commande (Ctrl+Maj+P) et entrer Remote-WSL: New Window @@ -157,16 +221,13 @@ C:\Users\enzo2>wsl ls -la "/mnt/c/Program Files" - - ###Changer les couleurs pour **ls**: ``` LS_COLORS="ow=01;36;40" && export LS_COLORS ``` +cd utilise les couleurs ls. - -###cd utilise les couleurs ls. ```bash zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" autoload -Uz compinit diff --git a/docs/index.md b/docs/index.md index f09d120..d5c85d7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,6 +2,8 @@ +[Distributions Linux](Distributions/index.md) + [macos](macos/index.md) [Linux](Linux/index.md) diff --git a/docs/macos/webserver/apache.md b/docs/macos/webserver/apache.md index 41cb976..7c5dc5d 100644 --- a/docs/macos/webserver/apache.md +++ b/docs/macos/webserver/apache.md @@ -179,6 +179,32 @@ $ sudo apachectl -k restart +### Warning: getimagesize(): SSL operation failed with code 1. + +Erreur dans Worpdress: + +``` +Warning: getimagesize(): SSL operation failed with code 1. +OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in +/Users/bruno/Sites/wordpress/wp-content/themes/CreatorThemeRes-child/functions.php on line 1611 +``` + +Il faut rajouter les lignes suivantes au PHP.ini + +```ini +[openssl] +openssl.cafile="/usr/local/etc/httpd/server.crt" + +# D'après SSLCertificateFile "/usr/local/etc/httpd/server.crt" du httpd-ssl.conf + +``` + +https://stackoverflow.com/questions/51532963/tcpdf-getimagesize-ssl-operation-failed-with-code-1-error1416f086ssl-routi + +Mais ça donne une erreur pour les MàJ PECL: `Connection to ssl://pecl.php.net:443' failed: ` + + + ### Messages d'erreur personnalisés: Dans un fichier .htaccess, ajouter: diff --git a/docs/mkdocs.md b/docs/mkdocs.md index bcccea8..4ee0950 100644 --- a/docs/mkdocs.md +++ b/docs/mkdocs.md @@ -154,11 +154,11 @@ $ pip install --upgrade mkdocs-material -[:fa-link: MkDocs-Themes](https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes) +[:octicons-link: MkDocs-Themes](https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes) -[:fa-link: Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) +[:octicons-link: Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) -[:fa-link: MkDocs+](http://bwmarrin.github.io/MkDocsPlus/) +[:octicons-link: MkDocs+](http://bwmarrin.github.io/MkDocsPlus/) diff --git a/mkdocs.yml b/mkdocs.yml index 0537a7b..1288264 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,19 +45,27 @@ nav: - SSH: Linux/ssh.md - Tail / Head: Linux/tail-head.md - Divers: Linux/divers.md - - Linux Mint: - - Index: Mint/index.md - - Mint: Mint/Mint.md - - Applications: Mint/applications.md - - Backup: Mint/backup.md - - Grub: Mint/grub.md - - Info Système: Mint/info_sys.md - - Mises-à-jour: Mint/outdated.md - - Recovery: Mint/recovery.md - - Samba: Mint/samba.md - - Systemctl: Mint/systemctl.md - - Serveur ftp: Mint/vsftpd.md - - Serveur web: Mint/webserver.md + - Distributions: + - Index: Distributions/index.md + - Debian: Distributions/debian.md + - Linux Mint: + - Index: Distributions/Mint/index.md + - Mint: Distributions/Mint/Mint.md + - Applications: Distributions/Mint/applications.md + - Backup: Distributions/Mint/backup.md + - Grub: Distributions/Mint/grub.md + - Info Système: Distributions/Mint/info_sys.md + - Mises-à-jour: Distributions/Mint/outdated.md + - Recovery: Distributions/Mint/recovery.md + - Samba: Distributions/Mint/samba.md + - Systemctl: Distributions/Mint/systemctl.md + - Serveur ftp: Distributions/Mint/vsftpd.md + - Serveur web: Distributions/Mint/webserver.md + - Solus: + - Index: Distributions/solus/index.md + - Apache: Distributions/solus/apache.md + - MySQL: Distributions/solus/mysql.md + - PHP: Distributions/solus/php.md - macos: - Index: macos/index.md - Divers: @@ -124,6 +132,7 @@ nav: - Plesk Onyx: - Index: Plesk/index.md - Ghost: Plesk/Ghost.md + - Nextcloud: Plesk/nextcloud.md - Programmation: -Python: - Index: Programmation/Python/index.md @@ -177,15 +186,18 @@ nav: - ownCloud (DSM6): Synology/owncloud.md - Python 3: Synology/python.md - Scripts: Synology/scripts.md - - Solus: - - Index: solus/index.md - - Apache: solus/apache.md - - MySQL: solus/mysql.md - - PHP: solus/php.md - Windows: - Index: Windows/index.md - Astuces: Windows/trucs.md + - Chocolatey: Windows/Chocolatey.md - Clés ssh: Windows/cles-ssh.md + - PowerShell: + - Index: Windows/PowerShell/index.md + - Stratégies d'exécution: Windows/PowerShell/ExecutionPolicies.md + - Commandes: Windows/PowerShell/commands.md + - Environnements: Windows/PowerShell/env.md + - systeminfo: Windows/systeminfo.md + - Windows Terminal: Windows/Terminal.md - WSL: Windows/wsl.md - Divers: - Index: Divers/index.md @@ -199,12 +211,12 @@ nav: - Commades DOS (2): Divers/batch/Commandes_DOS_2.md - Changer de shell: Divers/Changer_shell.md - Chromium: Divers/Chromium.md - - Debian: Divers/debian.md - git: - Index: Divers/git/index.md - git: Divers/git/git.md - Session de travail avec git: Divers/git/git-session.md - gitea: Divers/git/gitea.md + - git-ftp: Divers/git/git-ftp.md - go: Divers/go.md - Markdown: Divers/markdown.md - Nextcloud: Divers/nextcloud.md @@ -269,6 +281,9 @@ markdown_extensions: - codehilite - pymdownx.magiclink - pymdownx.mark + - pymdownx.emoji: + #emoji_index: !!python/name:materialx.emoji.twemoji + #emoji_generator: !!python/name:materialx.emoji.to_svg - admonition - fontawesome_markdown - footnotes diff --git a/mkdocs_backup.yml b/mkdocs_backup.yml index ffc3da3..fb942d6 100644 --- a/mkdocs_backup.yml +++ b/mkdocs_backup.yml @@ -1,7 +1,7 @@ site_name: Documentations site_description: Project documentation with Markdown. site_author: bruno@clicclac.info - +site_url: https://clicclac.synology.me/central_docs/ #nav: 1 espace après le tiret #mettre des titres aux pages évite une majuscules auto dans les menus formés à #partir des noms de fichiers (sauf si camelCase?) @@ -11,6 +11,10 @@ nav: - Linux: - Index: Linux/index.md - ack: Linux/ack.md + - Apps: + - AppImage: Linux/Apps/AppImage.md + - flatpak: Linux/Apps/flatpak.md + - snap: Linux/Apps/snap.md - Archiver / compresser: Linux/archiver.md - apt-get: Raspberry/apt-get.md - aptitude: Raspberry/aptitude.md @@ -56,9 +60,16 @@ nav: - Serveur web: Mint/webserver.md - macos: - Index: macos/index.md + - Divers: + - AllToMP3: macos/Divers/AllToMP3.md + - DeezloaderRemix: macos/Divers/DeezloaderRemix.md + - Divers: macos/Divers/Divers.md + - weasyprint: macos/Divers/weasyprint.md + - Hackintosh: macos/Divers/Hackintosh.md - Homebrew: - homebrew: macos/homebrew/brew.md - homebrew-cask: macos/homebrew/brew-cask.md + - Logs: macos/logs.md - Mail: macos/Mail.md - Node.js: - Index: macos/node/index.md @@ -102,7 +113,6 @@ nav: - PHP 7.2: macos/webserver/php72.md - PHP 7.3: macos/webserver/php73.md - Xhprof: macos/webserver/Xhprof.md - - Divers: macos/Divers.md - Liens: macos/liens.md - MySQL: - Index: MySQL/index.md @@ -114,6 +124,7 @@ nav: - Plesk Onyx: - Index: Plesk/index.md - Ghost: Plesk/Ghost.md + - Nextcloud: Plesk/nextcloud.md - Programmation: -Python: - Index: Programmation/Python/index.md @@ -158,6 +169,8 @@ nav: - bash: Synology/bash.md - DSM 6: Synology/dsm6.md - eadir: Synology/eadir.md + - Gitea: Synology/gitea.md + - Nextcloud: Synology/nextcloud.md - oPKG: - iPKG (DSM5): Synology/opkg/iPKG5.md - iPKG (DSM6): Synology/opkg/iPKG6.md @@ -170,11 +183,17 @@ nav: - Apache: solus/apache.md - MySQL: solus/mysql.md - PHP: solus/php.md + - Windows: + - Index: Windows/index.md + - Astuces: Windows/trucs.md + - Clés ssh: Windows/cles-ssh.md + - WSL: Windows/wsl.md - Divers: - Index: Divers/index.md - bash: - Exemples: Divers/bash/bash_exemples.md - Programmation: Divers/bash/programmation.md + - Strings: Divers/bash/strings.md - Tableaux: Divers/bash/tableaux.md - batch: - Commades DOS (1): Divers/batch/Commandes_DOS.md @@ -186,6 +205,8 @@ nav: - Index: Divers/git/index.md - git: Divers/git/git.md - Session de travail avec git: Divers/git/git-session.md + - gitea: Divers/git/gitea.md + - git-ftp: Divers/git/git-ftp.md - go: Divers/go.md - Markdown: Divers/markdown.md - Nextcloud: Divers/nextcloud.md @@ -223,22 +244,45 @@ nav: - MkDocs: mkdocs.md theme: - #name: bootstrap - name: material - language: fr - + name: 'material' + language: 'fr' + features: + # v4 + #tabs: true + # v5 + -tabs + -instant +plugins: + - search: + # v4 + #lang: 'fr' + # v5 + lang: + - fr + - pdf-export: + media_type: print + enabled_if_env: ENABLE_PDF_EXPORT + - git-revision-date-localized extra_css: - stylesheets/fontawesome-all.css - + - stylesheets/second_extra.css + markdown_extensions: - codehilite - pymdownx.magiclink - pymdownx.mark + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg - admonition - fontawesome_markdown - footnotes - toc: permalink: true +extra: + manifest: 'manifest.json' + site_dir: central_docs +dev_addr: '127.0.0.1:8001'