Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8125f9062 | ||
|
|
b82576d49e | ||
|
|
1b80141dc4 |
14
sio2/cyber/10-WireGuard/wg0.conf
Normal file
14
sio2/cyber/10-WireGuard/wg0.conf
Normal 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
|
||||
|
||||
|
||||
4
sio2/sisr/20-python/Exercice1
Executable file
4
sio2/sisr/20-python/Exercice1
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
rayon = input('donnez la valeur du rayon : ')
|
||||
perimetre = 2 * 3.141592 * int(rayon)
|
||||
print (perimetre, " cm ")
|
||||
18
sio2/sisr/20-python/Exercice2
Executable file
18
sio2/sisr/20-python/Exercice2
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/python3
|
||||
tableau = []
|
||||
for i in range(3)
|
||||
entier = int(input('chiffre : '))
|
||||
tableau.append(entier)
|
||||
|
||||
moy= sum(tableau)/len(tableau)
|
||||
|
||||
def maximum(tableau):
|
||||
vmax = tableau[0]
|
||||
|
||||
|
||||
|
||||
|
||||
def minimum(tableau):
|
||||
vmax = tableau[0]
|
||||
|
||||
|
||||
13
sio2/sisr/20-python/Exercice3
Executable file
13
sio2/sisr/20-python/Exercice3
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/python3
|
||||
phrase = input ("Phrase : ")
|
||||
tabmot = phrase.split(' ')
|
||||
cptmot = {}
|
||||
for mot in tabmot :
|
||||
if mot in tabmot:
|
||||
cptmot [mot]=cptmot[mot] +1
|
||||
else:
|
||||
cptmot[mot]=1
|
||||
for key in cptmot.keys():
|
||||
print (key, " ",cptmot[key])
|
||||
|
||||
|
||||
13
sio2/sisr/20-python/cptmot.py
Executable file
13
sio2/sisr/20-python/cptmot.py
Executable 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])
|
||||
26
sio2/sisr/20-python/creatusr.py
Normal file
26
sio2/sisr/20-python/creatusr.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
nbarg = len(sys.arg)
|
||||
|
||||
if nbarg !=2
|
||||
print ("Nombre d'arguments invalides")
|
||||
exit (1)
|
||||
filename = sys.arg[1]
|
||||
|
||||
try:
|
||||
fh = open("user.txt", "r")
|
||||
except:
|
||||
print ("Fichier user.txt inconnu")
|
||||
else:
|
||||
line = fh.readline ()
|
||||
while line:
|
||||
nouvline = line.rstrip()
|
||||
login.nomlong = nouvline.split(':')
|
||||
print (nbarg)
|
||||
#useradd (login)
|
||||
line = fh.readline()
|
||||
|
||||
fh.close()
|
||||
|
||||
|
||||
10
sio2/sisr/20-python/log.py
Executable file
10
sio2/sisr/20-python/log.py
Executable 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))
|
||||
3
sio2/sisr/20-python/user.txt
Normal file
3
sio2/sisr/20-python/user.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
jdaniel : Jack Daniel
|
||||
wpeel : William Peel
|
||||
ngraphaneaud : Noe Graphaneaud
|
||||
Reference in New Issue
Block a user