diff --git a/Jenkins/docker-compose.yaml b/Jenkins/docker-compose.yaml new file mode 100644 index 0000000..360354e --- /dev/null +++ b/Jenkins/docker-compose.yaml @@ -0,0 +1,16 @@ +services: + jenkins: + container_name: my_jenkins_01 + image: jenkins/jenkins:latest + environment: + TZ: "Europe/Bucharest" + ports: + - "60199:8080" + - "5000:5000" + volumes: + - "jenkins:/var/jenkins_home" + - "/var/run/docker.sock:/var/run/docker.sock" + restart: unless-stopped + +volumes: + jenkins: \ No newline at end of file diff --git a/Jenkins_jobs/jenkinsfile b/Jenkins_jobs/jenkinsfile new file mode 100644 index 0000000..a680392 --- /dev/null +++ b/Jenkins_jobs/jenkinsfile @@ -0,0 +1,25 @@ +pipeline { + agent { label 'itschool' } + stages { + stage ('scm checkout') { + steps { + checkout scm + } + } + stage ('primul job') { + steps { + sh 'pwd' + sh 'echo "Hello! Bine ai venit la It_School Jenkins startup!" > jenkins.txt' + sh 'ls -alh' + } + } + stage ('job doi') { + steps { + script { + def Age=21 + echo "I have ${Age} years old" + } + } + } + } +} \ No newline at end of file diff --git a/Python_module_1/python_010.py b/Python_module_1/python_010.py new file mode 100644 index 0000000..13753d1 --- /dev/null +++ b/Python_module_1/python_010.py @@ -0,0 +1,18 @@ +#!/home/andrei/it_school/bin/python3 + +lista = [1, 43, 53, 67, 98] +for i in lista: + print(i) + +for j in range(3): + print(j) + +print("-----") + +for v in range(1, 5): + print(v) + +print("-----") + +for z in range(0, 10, 3): + print(z) diff --git a/Python_module_1/python_011.py b/Python_module_1/python_011.py new file mode 100644 index 0000000..505b245 --- /dev/null +++ b/Python_module_1/python_011.py @@ -0,0 +1,23 @@ +#!/home/andrei/it_school/bin/python3 + +T = [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] +] + +print(T[0][0]) # 1 +print(T[1][2]) # 6 +print(T[2][1]) # 8 + +print("---") + +for i in T: + print(i) + +print("---") + +for j in T: + for v in j: + print(v) +print("---") \ No newline at end of file diff --git a/Python_module_1/python_012.py b/Python_module_1/python_012.py new file mode 100644 index 0000000..80fc289 --- /dev/null +++ b/Python_module_1/python_012.py @@ -0,0 +1,19 @@ +#!/home/andrei/it_school/bin/python3 + +Tuplu = ("apa","paine","suc","fructe") +for i in Tuplu: + print(i) +print("--------") +mytuples = {"brand", "model", "year"} +for j in mytuples: + print(j) +print("--------") +Mydictionary = { "cetatentie": "roman", "datanasterii": "1 Oct 1996", "inaltime": 190} +print(Mydictionary) +print("--------") +for key, value in Mydictionary.items(): + print(key, ";", value) +print("--------") +print ("Cetatentia e:", Mydictionary["cetatentie"]) +print ("Data nasterii e:", Mydictionary["datanasterii"]) +print ("Inaltimea e:", Mydictionary["inaltime"]) diff --git a/Python_module_1/python_013.py b/Python_module_1/python_013.py new file mode 100644 index 0000000..ca66ce8 --- /dev/null +++ b/Python_module_1/python_013.py @@ -0,0 +1,22 @@ +#!/home/andrei/it_school/bin/python3 + +def functie_test(): + print("Aceasta este o functie de test") + +def functie_nume(nume): + print("Numele meu este:", nume) + +def adunare(a, b): + return a + b + +# creeaza o functie care primeste ca parametrii o lista si vrem sa afiseze fiecare element din lista pe o linine noua +def afisare_lista(lista): + for element in lista: + print(element) + +functie_test() +functie_nume("Andrei") +print("Suma este:", adunare(5, 7)) + +lista_de_test = [100, 200, 300, 400] +afisare_lista(lista_de_test) \ No newline at end of file diff --git a/Python_module_1/python_014.py b/Python_module_1/python_014.py new file mode 100644 index 0000000..1d31bfc --- /dev/null +++ b/Python_module_1/python_014.py @@ -0,0 +1,15 @@ +#!/home/andrei/it_school/bin/python3 + +mynumber = 3 +mystring = "Salutare" +mylist = [10, 20, 30] +mytuple =("a", "b", "c",43,54) +mydictionary = {"nume":"Andrei", "varsta":43, "oras":"Bucuresti"} +bolean_var = True + +print(type(mynumber)) +print(type(mystring)) +print(type(mylist)) +print(type(mytuple)) +print(type(mydictionary)) +print(type(bolean_var)) diff --git a/Python_module_1/python_015.py b/Python_module_1/python_015.py new file mode 100644 index 0000000..e773a08 --- /dev/null +++ b/Python_module_1/python_015.py @@ -0,0 +1,12 @@ +#!/home/andrei/it_school/bin/python3 + +import math + +rezultat = math.sqrt(16) +print("Radical din 16 este:", rezultat) +print("Valoarea lui pi este:", math.pi) +rezultat_putere = math.pow(2, 5) +print("2 la puterea 5 este:", rezultat_putere) + +print("Link catre match module: https://docs.python.org/3/library/math.html") + diff --git a/Python_module_1/python_016.py b/Python_module_1/python_016.py new file mode 100644 index 0000000..a6b0887 --- /dev/null +++ b/Python_module_1/python_016.py @@ -0,0 +1,13 @@ +#!/home/andrei/it_school/bin/python3 + +class Student: + def __init__(self, nume, varsta, nota): + self.nume = nume + self.varsta = varsta + self.nota = nota + + def display_info(self): + print(f"Nume: {self.nume}, Varsta: {self.varsta}, Nota: {self.nota}") + +student1 = Student("Andrei", 20, 9.5) +student1.display_info() diff --git a/Python_module_2/python_001.py b/Python_module_2/python_001.py new file mode 100644 index 0000000..cb8e118 --- /dev/null +++ b/Python_module_2/python_001.py @@ -0,0 +1,27 @@ +#!/home/andrei/it_school/bin/python3 + +import os +import sys + +def gestioneaza_fiesere(director): + # Verificam daca directorul exista + if os.path.exists(director): + print(f"Directorul '{director}' exista. Fisierele din acest director sunt:") + # Listam fisierele din director + for nume_fisier in os.listdir(director): + cale_fisier = os.path.join(director, nume_fisier) + if os.path.isfile(cale_fisier): + dimensiune_kb = os.path.getsize(cale_fisier) / 1024 + print(f"- {nume_fisier} ({dimensiune_kb:.2f} KB)") + else: + print(f"Directorul '{nume_fisier}' nu este un fisier.") + else: + os.mkdir(director) + print(f"Directorul '{director}' nu exista. A fost creat.") + +if __name__ == "__main__": + if len(sys.argv) > 1: + director_de_gestionat = sys.argv[1] + gestioneaza_fiesere(director_de_gestionat) + else: + print("Va rugam sa specficati un director ca argument la linia de comanda.") diff --git a/Python_module_2/python_002.py b/Python_module_2/python_002.py new file mode 100755 index 0000000..e88bbcb --- /dev/null +++ b/Python_module_2/python_002.py @@ -0,0 +1,24 @@ +#!/home/andrei/it_school/bin/python3 + +import sys + +def main(): + if len(sys.argv) < 4: + print("Eroare: Trebuie sa furnizati cel putin trei argumente numerice.") + + numbers = [] + + for arg in sys.argv[1:]: + try: + num = float(arg) + numbers.append(num) + except ValueError: + print(f"Eroare: '{arg}' nu este un numar valid.") + return + total = sum(numbers) + average = total / len(numbers) + print(f"Suma: {total}") + print(f"Media: {average}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/Python_module_2/python_003.py b/Python_module_2/python_003.py new file mode 100755 index 0000000..76c0833 --- /dev/null +++ b/Python_module_2/python_003.py @@ -0,0 +1,14 @@ +#!/home/andrei/it_school/bin/python3 + +import sys +import subprocess + +def check_service_status(service_name): + try: + # Run the systemctl command to check the service status + result = subprocess.run(['systemctl', 'is-active', service_name], capture_output=True, text=True) + return result.stdout.strip() == 'active' + except Exception as e: + print(f"Error checking service status: {e}") + return False + \ No newline at end of file diff --git a/comenziLinux.txt b/comenziLinux.txt deleted file mode 100644 index 461fc1a..0000000 --- a/comenziLinux.txt +++ /dev/null @@ -1,5 +0,0 @@ -d -f -g -h -h