2 Commits
v.0.8 ... v0.9

Author SHA1 Message Date
Ludovic Diemert
a8125f9062 commit 2021-11-15 17:44:50 +01:00
ludo
b82576d49e python2 2021-10-06 09:32:17 +02:00
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
[Interface]
Address = 10.0.2.1/24 # Adresses autorisées dans le VPN
Listenport = 51820
# clé privée de machine A
PrivateKey = WM0fO9rPFKRtkvKKEcqnUXwhTJ/aWtr8oWXkowuEFX8=
# UDP service port; 51820 is a common choice for WireGuard
[Peer]
PublicKey = u0/S3/nbLceihWjlsSbPSBvhT4BsLp/b+dGpeLhqElg=
AllowedIPs = 10.0.2.1/24 # le peer peut acceder au serveur

13
sio2/sisr/20-python/cptmot.py Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/python3
phrase = input('Phrase : ')
tabmot = phrase.split(' ')
cptmot = {}
for mot in tabmot :
if mot in cptmot :
cptmot[mot] = cptmot[mot] + 1
else :
cptmot[mot] = 1
for key in cptmot.keys() :
print (key, " ", cptmot[key])

10
sio2/sisr/20-python/log.py Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/usr/python3
import re
import sys
group = {}
regexp = '^(\S+) (\S+) (\S+) \[([^]]+)\] "(\w+) (\S+).*" (\d+) (\S+)'
for line in sys.stdin:
line = line.rstrip ( )
match = re.match (regexp, line)
if match:
print (match.group(1)," ",match.group(8))