MaJ du 22-10-2020
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
|
||||
##### Concaténer une chaine:
|
||||
#### Concaténer une chaine:
|
||||
|
||||
```bash
|
||||
upd+="$name "
|
||||
@@ -10,7 +10,7 @@ upd+="$name "
|
||||
|
||||
|
||||
|
||||
##### Trim une chaine:
|
||||
#### Trim une chaine:
|
||||
|
||||
1. sed
|
||||
|
||||
@@ -77,7 +77,7 @@ $ echo " Une chaine entourée d'espaces " | xargs -0
|
||||
|
||||
|
||||
|
||||
##### Longueur d'une chaine:
|
||||
#### Longueur d'une chaine:
|
||||
|
||||
```bash
|
||||
$ echo -n "Longueur de la chaine:" | wc -c
|
||||
@@ -93,11 +93,14 @@ $ echo ${#var}
|
||||
|
||||
|
||||
|
||||
##### Sous-chaine:
|
||||
#### Sous-chaine:
|
||||
|
||||
```bash
|
||||
$ string=abcABC123ABCabc
|
||||
|
||||
|
||||
# ${string:position:length}
|
||||
|
||||
$ echo ${string:0}
|
||||
abcABC123ABCabc
|
||||
|
||||
@@ -110,6 +113,13 @@ $ echo ${string:7}
|
||||
$ echo ${string:7:3}
|
||||
23A
|
||||
|
||||
# Obtenir les 2 premieres caractères:
|
||||
$ echo ${string:0:2}
|
||||
ab
|
||||
echo "$string" | awk '{print substr($0,0,2)}'
|
||||
ab
|
||||
|
||||
# Obtenir les 4 derniers caractères:
|
||||
$ echo ${stringZ: -4} # Notez l'espace
|
||||
Cabc
|
||||
|
||||
@@ -119,7 +129,7 @@ Cabc
|
||||
|
||||
|
||||
|
||||
Remplacement de sous-chaine:
|
||||
#### Remplacement de sous-chaine:
|
||||
|
||||
```bash
|
||||
$ string=abcABC123ABCabc
|
||||
|
||||
352
docs/Divers/reseau.md
Normal file
352
docs/Divers/reseau.md
Normal file
@@ -0,0 +1,352 @@
|
||||
# Réseaux
|
||||
|
||||
|
||||
|
||||
### Connaitre les IP d'un réseau:
|
||||
|
||||
```bash
|
||||
$ arp -a
|
||||
livebox.home (192.168.1.1) at 40:65:a3:c3:81:32 on en0 ifscope [ethernet]
|
||||
ds916.home (192.168.1.7) at 0:11:32:5b:32:aa on en0 ifscope [ethernet]
|
||||
ds414.home (192.168.1.8) at d8:fe:e3:2f:7c:c5 on en0 ifscope [ethernet]
|
||||
ne-3241-t200022615817dc.home (192.168.1.11) at 0:22:61:58:17:dc on en0 ifscope [ethernet]
|
||||
atv4.home (192.168.1.15) at c8:69:cd:39:71:a5 on en0 ifscope [ethernet]
|
||||
hdhr-1231b9b9.home (192.168.1.16) at 0:18:dd:23:1b:9b on en0 ifscope [ethernet]
|
||||
ds414-1.home (192.168.1.18) at 0:11:32:28:59:45 on en0 ifscope [ethernet]
|
||||
samsung.home (192.168.1.20) at 64:1c:ae:58:54:e0 on en0 ifscope [ethernet]
|
||||
silverbook.home (192.168.1.24) at f4:f:24:30:f9:e0 on en0 ifscope permanent [ethernet]
|
||||
tl-wpa4220.home (192.168.1.28) at c:80:63:75:1e:52 on en0 ifscope [ethernet]
|
||||
un-gout-de-pomme.home (192.168.1.35) at b8:5d:a:85:b4:bc on en0 ifscope [ethernet]
|
||||
hl-2250dn.home (192.168.1.69) at 0:1b:a9:5a:4e:42 on en0 ifscope [ethernet]
|
||||
xigmanas.home (192.168.1.250) at 1c:fd:8:70:20:f7 on en0 ifscope [ethernet]
|
||||
? (192.168.1.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
|
||||
? (224.0.0.251) at 1:0:5e:0:0:fb on en0 ifscope permanent [ethernet]
|
||||
broadcasthost (255.255.255.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
|
||||
```
|
||||
|
||||
|
||||
|
||||
### nmap:
|
||||
|
||||
```bash
|
||||
$ nmap 192.168.1.0/24
|
||||
Starting Nmap 7.90 ( https://nmap.org ) at 2020-10-04 08:10 CEST
|
||||
Nmap scan report for livebox.home (192.168.1.1)
|
||||
Host is up (0.0086s latency).
|
||||
Not shown: 992 filtered ports
|
||||
PORT STATE SERVICE
|
||||
53/tcp open domain
|
||||
80/tcp open http
|
||||
113/tcp closed ident
|
||||
135/tcp closed msrpc
|
||||
139/tcp open netbios-ssn
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
631/tcp open ipp
|
||||
|
||||
Nmap scan report for ds916.home (192.168.1.7)
|
||||
Host is up (0.0048s latency).
|
||||
Not shown: 984 closed ports
|
||||
PORT STATE SERVICE
|
||||
21/tcp open ftp
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
139/tcp open netbios-ssn
|
||||
161/tcp open snmp
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
515/tcp open printer
|
||||
548/tcp open afp
|
||||
631/tcp open ipp
|
||||
873/tcp open rsync
|
||||
3001/tcp open nessus
|
||||
3260/tcp open iscsi
|
||||
3261/tcp open winshadow
|
||||
3689/tcp open rendezvous
|
||||
5510/tcp open secureidprop
|
||||
|
||||
Nmap scan report for ds414.home (192.168.1.8)
|
||||
Host is up (0.062s latency).
|
||||
Not shown: 992 closed ports
|
||||
PORT STATE SERVICE
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
139/tcp open netbios-ssn
|
||||
161/tcp open snmp
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
873/tcp open rsync
|
||||
5357/tcp open wsdapi
|
||||
|
||||
Nmap scan report for ne-3241-t200022615817dc.home (192.168.1.11)
|
||||
Host is up (0.011s latency).
|
||||
Not shown: 997 closed ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
514/tcp open shell
|
||||
8080/tcp open http-proxy
|
||||
|
||||
Nmap scan report for atv4.home (192.168.1.15)
|
||||
Host is up (0.0043s latency).
|
||||
Not shown: 994 closed ports
|
||||
PORT STATE SERVICE
|
||||
5000/tcp open upnp
|
||||
7000/tcp open afs3-fileserver
|
||||
7100/tcp open font-service
|
||||
49152/tcp open unknown
|
||||
49153/tcp open unknown
|
||||
62078/tcp open iphone-sync
|
||||
|
||||
Nmap scan report for hdhr-1231b9b9.home (192.168.1.16)
|
||||
Host is up (0.0044s latency).
|
||||
Not shown: 996 closed ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
554/tcp open rtsp
|
||||
5004/tcp open avt-profile-1
|
||||
8888/tcp open sun-answerbook
|
||||
|
||||
Nmap scan report for ds414-1.home (192.168.1.18)
|
||||
Host is up (0.014s latency).
|
||||
Not shown: 991 closed ports
|
||||
PORT STATE SERVICE
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
139/tcp open netbios-ssn
|
||||
161/tcp open snmp
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
873/tcp open rsync
|
||||
5357/tcp open wsdapi
|
||||
49160/tcp open unknown
|
||||
|
||||
Nmap scan report for silverbook.home (192.168.1.24)
|
||||
Host is up (0.012s latency).
|
||||
Not shown: 992 closed ports
|
||||
PORT STATE SERVICE
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
88/tcp open kerberos-sec
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
3031/tcp open eppc
|
||||
3306/tcp open mysql
|
||||
5900/tcp open vnc
|
||||
|
||||
Nmap scan report for tl-wpa4220.home (192.168.1.28)
|
||||
Host is up (0.011s latency).
|
||||
Not shown: 999 closed ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
|
||||
Nmap scan report for hl-2250dn.home (192.168.1.69)
|
||||
Host is up (0.0023s latency).
|
||||
Not shown: 994 closed ports
|
||||
PORT STATE SERVICE
|
||||
21/tcp open ftp
|
||||
23/tcp open telnet
|
||||
80/tcp open http
|
||||
515/tcp open printer
|
||||
631/tcp open ipp
|
||||
9100/tcp open jetdirect
|
||||
|
||||
Nmap scan report for xigmanas.home (192.168.1.250)
|
||||
Host is up (0.0011s latency).
|
||||
All 1000 scanned ports on xigmanas.home (192.168.1.250) are closed
|
||||
|
||||
Nmap done: 256 IP addresses (11 hosts up) scanned in 28.04 seconds
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Analysez un réseau et découvrez quels serveurs et périphériques sont opérationnels:
|
||||
|
||||
```bash
|
||||
$ nmap -sP 192.168.1.0/24
|
||||
Starting Nmap 7.90 ( https://nmap.org ) at 2020-10-04 08:17 CEST
|
||||
Nmap scan report for livebox.home (192.168.1.1)
|
||||
Host is up (0.0018s latency).
|
||||
Nmap scan report for ds916.home (192.168.1.7)
|
||||
Host is up (0.0033s latency).
|
||||
Nmap scan report for ds414.home (192.168.1.8)
|
||||
Host is up (0.0095s latency).
|
||||
Nmap scan report for ne-3241-t200022615817dc.home (192.168.1.11)
|
||||
Host is up (0.035s latency).
|
||||
Nmap scan report for atv4.home (192.168.1.15)
|
||||
Host is up (0.014s latency).
|
||||
Nmap scan report for hdhr-1231b9b9.home (192.168.1.16)
|
||||
Host is up (0.0050s latency).
|
||||
Nmap scan report for ds414-1.home (192.168.1.18)
|
||||
Host is up (0.0068s latency).
|
||||
Nmap scan report for samsung.home (192.168.1.20)
|
||||
Host is up (0.0093s latency).
|
||||
Nmap scan report for silverbook.home (192.168.1.24)
|
||||
Host is up (0.0017s latency).
|
||||
Nmap scan report for tl-wpa4220.home (192.168.1.28)
|
||||
Host is up (0.0096s latency).
|
||||
Nmap scan report for hl-2250dn.home (192.168.1.69)
|
||||
Host is up (0.0024s latency).
|
||||
Nmap scan report for xigmanas.home (192.168.1.250)
|
||||
Host is up (0.0018s latency).
|
||||
Nmap done: 256 IP addresses (12 hosts up) scanned in 8.13 seconds
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Scannez tous vos appareils / ordinateurs pour les ports ouverts:
|
||||
|
||||
```bash
|
||||
$ nmap -T5 192.168.1.0/24
|
||||
Starting Nmap 7.90 ( https://nmap.org ) at 2020-10-04 08:23 CEST
|
||||
Warning: 192.168.1.15 giving up on port because retransmission cap hit (2).
|
||||
Warning: 192.168.1.24 giving up on port because retransmission cap hit (2).
|
||||
Nmap scan report for livebox.home (192.168.1.1)
|
||||
Host is up (0.0032s latency).
|
||||
Not shown: 992 filtered ports
|
||||
PORT STATE SERVICE
|
||||
53/tcp open domain
|
||||
80/tcp open http
|
||||
113/tcp closed ident
|
||||
135/tcp closed msrpc
|
||||
139/tcp open netbios-ssn
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
631/tcp open ipp
|
||||
|
||||
Nmap scan report for ds916.home (192.168.1.7)
|
||||
Host is up (0.0055s latency).
|
||||
Not shown: 984 closed ports
|
||||
PORT STATE SERVICE
|
||||
21/tcp open ftp
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
139/tcp open netbios-ssn
|
||||
161/tcp open snmp
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
515/tcp open printer
|
||||
548/tcp open afp
|
||||
631/tcp open ipp
|
||||
873/tcp open rsync
|
||||
3001/tcp open nessus
|
||||
3260/tcp open iscsi
|
||||
3261/tcp open winshadow
|
||||
3689/tcp open rendezvous
|
||||
5510/tcp open secureidprop
|
||||
|
||||
Nmap scan report for ds414.home (192.168.1.8)
|
||||
Host is up (0.0063s latency).
|
||||
Not shown: 992 closed ports
|
||||
PORT STATE SERVICE
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
139/tcp open netbios-ssn
|
||||
161/tcp open snmp
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
873/tcp open rsync
|
||||
5357/tcp open wsdapi
|
||||
|
||||
Nmap scan report for ne-3241-t200022615817dc.home (192.168.1.11)
|
||||
Host is up (0.011s latency).
|
||||
Not shown: 997 closed ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
514/tcp open shell
|
||||
8080/tcp open http-proxy
|
||||
|
||||
Nmap scan report for atv4.home (192.168.1.15)
|
||||
Host is up (0.0060s latency).
|
||||
Not shown: 991 closed ports
|
||||
PORT STATE SERVICE
|
||||
873/tcp filtered rsync
|
||||
993/tcp filtered imaps
|
||||
3013/tcp filtered gilatskysurfer
|
||||
5000/tcp open upnp
|
||||
7000/tcp open afs3-fileserver
|
||||
7100/tcp open font-service
|
||||
49152/tcp open unknown
|
||||
49153/tcp open unknown
|
||||
62078/tcp open iphone-sync
|
||||
|
||||
Nmap scan report for hdhr-1231b9b9.home (192.168.1.16)
|
||||
Host is up (0.0052s latency).
|
||||
Not shown: 996 closed ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
554/tcp open rtsp
|
||||
5004/tcp open avt-profile-1
|
||||
8888/tcp open sun-answerbook
|
||||
|
||||
Nmap scan report for ds414-1.home (192.168.1.18)
|
||||
Host is up (0.0071s latency).
|
||||
Not shown: 991 closed ports
|
||||
PORT STATE SERVICE
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
139/tcp open netbios-ssn
|
||||
161/tcp open snmp
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
873/tcp open rsync
|
||||
5357/tcp open wsdapi
|
||||
49160/tcp open unknown
|
||||
|
||||
Nmap scan report for silverbook.home (192.168.1.24)
|
||||
Host is up (0.00014s latency).
|
||||
Not shown: 976 closed ports
|
||||
PORT STATE SERVICE
|
||||
22/tcp open ssh
|
||||
80/tcp open http
|
||||
88/tcp open kerberos-sec
|
||||
443/tcp open https
|
||||
445/tcp open microsoft-ds
|
||||
1011/tcp filtered unknown
|
||||
1050/tcp filtered java-or-OTGfileshare
|
||||
1075/tcp filtered rdrmshc
|
||||
2809/tcp filtered corbaloc
|
||||
3031/tcp open eppc
|
||||
3306/tcp open mysql
|
||||
3546/tcp filtered unknown
|
||||
3689/tcp filtered rendezvous
|
||||
5033/tcp filtered jtnetd-server
|
||||
5730/tcp filtered unieng
|
||||
5900/tcp open vnc
|
||||
5950/tcp filtered unknown
|
||||
8402/tcp filtered abarsd
|
||||
9071/tcp filtered unknown
|
||||
9418/tcp filtered git
|
||||
13782/tcp filtered netbackup
|
||||
16001/tcp filtered fmsascon
|
||||
32777/tcp filtered sometimes-rpc17
|
||||
41511/tcp filtered unknown
|
||||
|
||||
Nmap scan report for tl-wpa4220.home (192.168.1.28)
|
||||
Host is up (0.0057s latency).
|
||||
Not shown: 999 closed ports
|
||||
PORT STATE SERVICE
|
||||
80/tcp open http
|
||||
|
||||
Nmap scan report for hl-2250dn.home (192.168.1.69)
|
||||
Host is up (0.0019s latency).
|
||||
Not shown: 994 closed ports
|
||||
PORT STATE SERVICE
|
||||
21/tcp open ftp
|
||||
23/tcp open telnet
|
||||
80/tcp open http
|
||||
515/tcp open printer
|
||||
631/tcp open ipp
|
||||
9100/tcp open jetdirect
|
||||
|
||||
Nmap scan report for xigmanas.home (192.168.1.250)
|
||||
Host is up (0.0014s latency).
|
||||
All 1000 scanned ports on xigmanas.home (192.168.1.250) are closed
|
||||
|
||||
Nmap done: 256 IP addresses (11 hosts up) scanned in 16.16 seconds
|
||||
```
|
||||
|
||||
|
||||
|
||||
[plus de commandes](https://www.cyberciti.biz/networking/nmap-command-examples-tutorials/)
|
||||
|
||||
@@ -156,7 +156,33 @@ tiger;macOS
|
||||
snowleopard;macOS
|
||||
```
|
||||
|
||||
Afficher la dernière colonne:
|
||||
|
||||
```bash
|
||||
$ awk -F"," '{print $NF}' test.csv
|
||||
Linux
|
||||
Linux
|
||||
Linux
|
||||
Linux
|
||||
macOS
|
||||
macOS
|
||||
macOS
|
||||
macOS
|
||||
```
|
||||
|
||||
Afficher l'avant-dernière colonne:
|
||||
|
||||
```bash
|
||||
$ awk -F"," '{print $(NF - 1)}' test.csv
|
||||
ubuntu
|
||||
mint
|
||||
debian
|
||||
raspbian
|
||||
mojave
|
||||
sierra
|
||||
tiger
|
||||
snowleopard
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -342,6 +342,12 @@ Si la chaine réussie la REGEX [[ STRING1 =~ REGEXPATTERN ]]
|
||||
if [[ "$email" =~ "b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}b" ]]; then
|
||||
```
|
||||
|
||||
Si la chaine commence par '#'
|
||||
|
||||
```bash
|
||||
if [[ ${string:0:1} == '#' ]]; then
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### -nombre
|
||||
|
||||
@@ -35,3 +35,7 @@ Affiche le nombre total de fichiers du répertoire courant et dans tous ses sous
|
||||
find . -type f -print | wc -l
|
||||
```
|
||||
|
||||
|
||||
|
||||
[set -o pipefail](https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/)
|
||||
|
||||
|
||||
@@ -175,6 +175,8 @@ Ne marche pas !!
|
||||
|
||||
[git](git.md)
|
||||
|
||||
[Gitea](Gitea.md)
|
||||
|
||||
[Ghost](Ghost.md)
|
||||
|
||||
[nextcloud](nextcloud.md)
|
||||
|
||||
@@ -79,6 +79,28 @@ drwxr-xr-x 2 bruno psacln 4096 Apr 11 19:15 Photos
|
||||
|
||||
|
||||
|
||||
#### Logs:
|
||||
|
||||
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/logging_configuration.html
|
||||
|
||||
Afficher les logs:
|
||||
|
||||
```bash
|
||||
tail -f /var/www/vhosts/maboiteverte.fr/httpdocs/nextcloud/nextcloud.log
|
||||
```
|
||||
|
||||
Configuration:
|
||||
|
||||
```bash
|
||||
# dans config.php:
|
||||
|
||||
'loglevel' => 2,
|
||||
'log_type' => 'file',
|
||||
'logfile' => 'nextcloud.log',
|
||||
'logdateformat' => 'F d, Y H:i:s',
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
[Nextcloud sur NAS Synology](../Synology/nextcloud.md)
|
||||
|
||||
@@ -402,6 +402,27 @@ Additional .ini files parsed: /usr/local/etc/php70/conf.d/SYNO.SDS.PhotoSta
|
||||
|
||||
### php7.3
|
||||
|
||||
Mettre PHP73 par défaut en CLI:
|
||||
|
||||
```bash
|
||||
$ sudo -i
|
||||
$ cd /usr/bin
|
||||
$ mv php php56
|
||||
#cp /volume1/@appstore/PHP7.3/usr/local/bin/php73 php
|
||||
$ ln -s /volume1/@appstore/PHP7.3/usr/local/bin/php73 php
|
||||
|
||||
root@DS916:/bin# php -v
|
||||
PHP 7.3.16 (cli) (built: Jun 2 2020 11:39:19) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
|
||||
|
||||
bruno@DS916:~ $ php -v
|
||||
PHP 7.3.16 (cli) (built: Jun 2 2020 11:39:19) ( NTS )
|
||||
Copyright (c) 1997-2018 The PHP Group
|
||||
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Composer:
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
[Installer le shell bash](bash.md)
|
||||
|
||||
[Installer Gitea](gitea.md)
|
||||
|
||||
Installer ownCloud (depuis paquet)
|
||||
|
||||
[Installer ownCloud (depuis archive) (DSM6)](owncloud.md)
|
||||
|
||||
@@ -12,6 +12,8 @@ Editeur de scripts PowerShell: **Windows PowerShell ISE** (à ouvrir en administ
|
||||
|
||||
- [Stratégies d'exécution PowerShell](ExecutionPolicies.md)
|
||||
- [Commandes](commands.md)
|
||||
- [Modules](modules.md)
|
||||
- [Variables d'environnement](env.md)
|
||||
- [PowerShell sur macOS](macOS.md)
|
||||
- [Trucs](trucs.md)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
# Modules
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
# Trucs
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
[Chocolatey](Chocolatey.md)
|
||||
|
||||
[Commandes](commandes.md)
|
||||
|
||||
[Créer des clés ssh (pour Windows et WSL)](cles-ssh.md)
|
||||
|
||||
[PowerShell](PowerShell/index.md)
|
||||
|
||||
@@ -636,7 +636,7 @@ $ brew tap <tapname>
|
||||
$ brew untap <tapname>
|
||||
```
|
||||
|
||||
#### Configuration de Homebrew:
|
||||
#### Configuration de Homebrew (brew config):
|
||||
|
||||
```bash
|
||||
$ brew config
|
||||
@@ -662,6 +662,57 @@ Xcode: 11.3.1
|
||||
XQuartz: 2.7.11 => /opt/X11
|
||||
```
|
||||
|
||||
#### Afficher les formules qui ont le paquet cité comme dépendance (brew uses):
|
||||
|
||||
```bash
|
||||
$ brew uses autoconf
|
||||
asdf autoconf-archive automake crosstool-ng node-build php php@7.2 php@7.3 pyenv ruby-build vice
|
||||
|
||||
# afficher uniquement les paquets installés
|
||||
|
||||
$ brew uses --installed autoconf
|
||||
php php@7.2 php@7.3 pyenv
|
||||
|
||||
$ brew info python@3.7
|
||||
python@3.7: stable 3.7.9 (bottled) [keg-only]
|
||||
Interpreted, interactive, object-oriented programming language
|
||||
https://www.python.org/
|
||||
Not installed
|
||||
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/python@3.7.rb
|
||||
License: Python-2.0
|
||||
==> Dependencies
|
||||
Build: pkg-config ✔
|
||||
Required: gdbm ✔, openssl@1.1 ✔, readline ✔, sqlite ✔, xz ✔
|
||||
```
|
||||
|
||||
#### Voir les dépendances d'un paquet:
|
||||
|
||||
```bash
|
||||
$ brew deps thefuck
|
||||
gdbm
|
||||
openssl@1.1
|
||||
python@3.8
|
||||
readline
|
||||
sqlite
|
||||
xz
|
||||
```
|
||||
|
||||
#### Voir tous les packages installés, ainsi que tous les packages installés qui en dépendent:
|
||||
|
||||
```bash
|
||||
$ brew list -1 | while read cask; do echo -ne "\x1B[1;34m $cask \x1B[0m"; brew uses $cask --installed | awk '{printf(" %s ", $0)}'; echo ""; done
|
||||
annie
|
||||
antibody
|
||||
aom ffmpeg
|
||||
apr apr-util httpd php php@7.2 php@7.3
|
||||
apr-util httpd php php@7.2 php@7.3
|
||||
argon2 php php@7.2 php@7.3
|
||||
argyll-cms displaycal
|
||||
aspell php php@7.2 php@7.3
|
||||
atk gtk+ gtk+3
|
||||
autoconf php php@7.2 php@7.3 pyenv
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Commandes externes:
|
||||
|
||||
@@ -214,6 +214,43 @@ published over a year ago by cohara87 <cohara87@gmail.com>
|
||||
|
||||
|
||||
|
||||
#### Funding:
|
||||
|
||||
```bash
|
||||
2 packages are looking for funding
|
||||
run `npm fund` for details
|
||||
```
|
||||
|
||||
Ce message apparait généralement après la m-à-j d'un package tel Angular, React, Vue...
|
||||
Il demande de lancer la commande `npm fund` pour lister les packages qui demandent des fonds pour continuer leur développement.
|
||||
|
||||
```bash
|
||||
~/Sites/node_modules master* ⇡
|
||||
❯ npm fund
|
||||
/Users/bruno/Sites
|
||||
├─┬ https://opencollective.com/bootstrap
|
||||
│ └── bootstrap@4.5.2
|
||||
└─┬ https://opencollective.com/popperjs
|
||||
└── popper.js@1.16.1
|
||||
```
|
||||
|
||||
Pour éviter ce message:
|
||||
|
||||
```bash
|
||||
# à l'installation:
|
||||
npm install --no-fund <package>
|
||||
|
||||
# configuration globale
|
||||
npm config set fund false --global
|
||||
|
||||
# configuration par package:
|
||||
npm config set fund false
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Packages:
|
||||
|
||||
[Rechercher un package](https://npms.io)
|
||||
|
||||
@@ -94,12 +94,12 @@ Mettre à jour NodeJS et réinstaller les paquets.
|
||||
```bash
|
||||
Latest version:
|
||||
nvm install node --reinstall-packages-from=node
|
||||
# nvm install node && nvm reinstall-packages $(nvm current)
|
||||
# nvm install node && nvm reinstall-packages $(nvm current | sed 's/^.//')
|
||||
|
||||
Stable (LTS) version:
|
||||
nvm install lts/* --reinstall-packages-from=node
|
||||
# nvm install --lts=erbium && nvm reinstall-packages $(nvm current)
|
||||
# nvm install --lts=erbium && nvm reinstall-packages 12.13.1
|
||||
# nvm install --lts=erbium && nvm reinstall-packages $(nvm current | sed 's/^.//')
|
||||
# nvm install --lts=erbium && nvm reinstall-packages 12.18.3
|
||||
```
|
||||
|
||||
Liste des versions de Node installées:
|
||||
@@ -202,6 +202,9 @@ Désinstaller une version de Node:
|
||||
```bash
|
||||
$ nvm uninstall 10.16.2
|
||||
Uninstalled node v10.16.2
|
||||
|
||||
$ nvm uninstall --lts=carbon
|
||||
Uninstalled node v8.17.0
|
||||
```
|
||||
|
||||
Les paquets sont installés dans:
|
||||
|
||||
@@ -219,6 +219,42 @@ $ pip3 install 'tornado~=4.5.2'
|
||||
# Installe une version “==4.5.*” qui est aussi “>=4.5.2”.
|
||||
```
|
||||
|
||||
#### Spécifier la version:
|
||||
|
||||
```bash
|
||||
# Opérateurs: ==, >, >=, <, <=, !=, ~=, ===
|
||||
|
||||
docopt == 0.6.1 # Correspondance de version. La version doit être 0.6.1
|
||||
# exclu pre-releases, post releases, developmental releases et 0.6.1.x maintenance releases.
|
||||
|
||||
docopt == 0.6.* # Correspondance de version. La version doit commencer par 0.6. Idem ~= 0.6.0
|
||||
|
||||
|
||||
keyring >= 4.1.1 # Version minimale 4.1.1
|
||||
coverage != 3.5 # Version Exclue. Tout sauf la version 3.5
|
||||
|
||||
Mopidy-Dirble ~= 1.1 # Compatible release. Idem >= 1.1, == 1.* (>= 1.1 AND == 1.*)
|
||||
# version 1.1 ou plus, mais exclu 2.0 ou plus
|
||||
|
||||
tornado ~= 4.5.3 # Compatible release. Idem >= 4.5.3, == 4.5.*
|
||||
# version 4.5.3 ou plus, mais exclu 4.6.0 ou plus
|
||||
tornado === 4.5.3 # Arbitrary equality (Égalité arbitraire)
|
||||
|
||||
|
||||
# On peut spécifier 2 conditions:
|
||||
|
||||
package >= 1.0, <=2.0 # Version comprise entre 1.0 et 2.0
|
||||
|
||||
|
||||
# Si aucune version n'est spécifiée, la dernière version est installée:
|
||||
|
||||
beautifulsoup4
|
||||
tornado
|
||||
|
||||
```
|
||||
|
||||
[PEP 440](https://www.python.org/dev/peps/pep-0440/#version-specifiers)
|
||||
|
||||
|
||||
|
||||
#### Désinstaller un module:
|
||||
@@ -364,6 +400,14 @@ $ pip3 install --user -U mkdocs-material
|
||||
|
||||
|
||||
|
||||
#### Mettre à jour tous les modules:
|
||||
|
||||
```bash
|
||||
$ pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Chercher un module:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -185,6 +185,24 @@ $ ssh-keygen -l -f ~/.ssh/id_rsa.pub
|
||||
|
||||
|
||||
|
||||
#### Vérifier la passphrase:
|
||||
|
||||
```bash
|
||||
# si la passphrase est correcte, renvoie la clé publique:
|
||||
$ ssh-keygen -y
|
||||
Enter file in which the key is (/Users/bruno/.ssh/id_rsa):
|
||||
Enter passphrase:
|
||||
ssh-rsa AAAAB3N....
|
||||
|
||||
# si la passphrase n'est pas correcte:
|
||||
$ ssh-keygen -y
|
||||
Enter file in which the key is (/Users/bruno/.ssh/id_rsa):
|
||||
Enter passphrase:
|
||||
Load key "/Users/bruno/.ssh/id_rsa": incorrect passphrase supplied to decrypt private key
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Changer la passphrase:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -6,15 +6,19 @@
|
||||
|
||||
[composer](composer.md)
|
||||
|
||||
[PHP](php.md)
|
||||
|
||||
[PHP 7.2](php72)
|
||||
|
||||
[MySQL](mysql)
|
||||
|
||||
[mongodb](mongodb)
|
||||
|
||||
[PHP](php.md)
|
||||
|
||||
[PHP 7.2](php72)
|
||||
|
||||
[PHP 7.3](php73.md)
|
||||
|
||||
[Protéger l'accès à une page par un mot-de-passe](htpasswd.md)
|
||||
|
||||
[Xhprof](Xhprof.md)
|
||||
|
||||
[Protéger l'accès à une page](htpasswd.md)
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# PHP 7.2
|
||||
|
||||
|
||||
|
||||
Installer PHP 7.2 (Homebrew)
|
||||
|
||||
|
||||
|
||||
Désintaller PHP
|
||||
|
||||
$ brew uninstall --force php72
|
||||
|
||||
|
||||
|
||||
Installer PHP 7.2
|
||||
|
||||
$ brew install php72 --with-httpd --with-webp
|
||||
|
||||
|
||||
|
||||
Infos sur PHP 7.2
|
||||
|
||||
$ brew info php72
|
||||
homebrew/php/php72: stable 7.2.0 (bottled), HEAD
|
||||
PHP Version 7.2
|
||||
|
||||
|
||||
|
||||
$ brew upgrade php72-xdebug
|
||||
@@ -106,6 +106,17 @@ xdebug.remote_port=9000
|
||||
|
||||
```
|
||||
|
||||
Chaque version de PHP a son propre répertoire d'extensions:
|
||||
|
||||
```bash
|
||||
/usr/local/lib/php/pecl/20160303 ← 7.1
|
||||
/usr/local/lib/php/pecl/20170718 ← 7.2
|
||||
/usr/local/lib/php/pecl/20180731 ← 7.3
|
||||
/usr/local/lib/php/pecl/20190902 ← 7.4
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Installer une extension (depuis les sources):
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user