diff --git a/practic03/.idea/.gitignore b/practic03/.idea/.gitignore
new file mode 100644
index 0000000..b58b603
--- /dev/null
+++ b/practic03/.idea/.gitignore
@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/practic03/.idea/inspectionProfiles/profiles_settings.xml b/practic03/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/practic03/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/practic03/.idea/misc.xml b/practic03/.idea/misc.xml
new file mode 100644
index 0000000..b5d2e7b
--- /dev/null
+++ b/practic03/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/practic03/.idea/modules.xml b/practic03/.idea/modules.xml
new file mode 100644
index 0000000..a2e0c61
--- /dev/null
+++ b/practic03/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/practic03/gitea_api.py b/practic03/gitea_api.py
new file mode 100644
index 0000000..1ef31cc
--- /dev/null
+++ b/practic03/gitea_api.py
@@ -0,0 +1,55 @@
+import os
+import requests
+from dotenv import load_dotenv
+
+# 1. Загружаем токен из файла .env
+load_dotenv()
+TOKEN = os.getenv("GITEA_TOKEN")
+
+if not TOKEN:
+ print(" Ошибка: Токен не найден! Проверь файл .env")
+ exit()
+
+# Заголовки для авторизации (стандарт Gitea)
+headers = {
+ "Authorization": f"token {TOKEN}",
+ "Content-Type": "application/json"
+}
+
+
+def check_user():
+ print("--- Шаг 1: Проверка профиля ---")
+ url = "https://git.vyatsu.ru/api/v1/user"
+ response = requests.get(url, headers=headers)
+
+ if response.status_code == 200:
+ data = response.json()
+ print(f" Успешный вход! Логин: {data.get('login')}")
+ else:
+ print(f" Ошибка авторизации: {response.status_code}")
+
+
+def create_repo(repo_name):
+ print(f"\n--- Шаг 2: Создание репозитория '{repo_name}' ---")
+ url = "https://git.vyatsu.ru/api/v1/user/repos"
+ payload = {
+ "name": repo_name,
+ "description": "Лабораторная работа по сетям",
+ "private": False,
+ "auto_init": True # Создаст сразу README.md
+ }
+
+ response = requests.post(url, headers=headers, json=payload)
+
+ if response.status_code == 201:
+ print(f" Репозиторий создан: {response.json().get('html_url')}")
+ elif response.status_code == 422:
+ print(" Репозиторий с таким именем уже существует.")
+ else:
+ print(f" Что-то пошло не так: {response.text}")
+
+
+if __name__ == "__main__":
+ check_user()
+ # В названии репозитория укажи что-то уникальное, чтобы не пересекаться с другими
+ create_repo("NIMER3")
diff --git a/practic03/http_requests.py b/practic03/http_requests.py
new file mode 100644
index 0000000..5701c2f
--- /dev/null
+++ b/practic03/http_requests.py
@@ -0,0 +1,5 @@
+import requests
+
+response = requests.get("http://vyatsu.ru")
+print(response.status_code)
+print(response.text[:500])
\ No newline at end of file
diff --git a/practic03/http_socket.py b/practic03/http_socket.py
new file mode 100644
index 0000000..4c1fa7e
--- /dev/null
+++ b/practic03/http_socket.py
@@ -0,0 +1,9 @@
+import socket
+
+client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+client.connect(('vyatsu.ru', 80))
+request = "GET / HTTP/1.1\r\nHost: vyatsu.ru\r\n\r\n"
+client.sendall(request.encode())
+response = client.recv(4096)
+print(response.decode())
+client.close()
\ No newline at end of file
diff --git a/practic03/tcp_client.py b/practic03/tcp_client.py
new file mode 100644
index 0000000..f42ec16
--- /dev/null
+++ b/practic03/tcp_client.py
@@ -0,0 +1,8 @@
+import socket
+
+client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+client.connect(('127.0.0.1', 10000))
+client.sendall(b'hello server11')
+data = client.recv(1024)
+print(f"Ответ от сервера: {data.decode()}")
+client.close()
diff --git a/practic03/tcp_server.py b/practic03/tcp_server.py
new file mode 100644
index 0000000..8f14be6
--- /dev/null
+++ b/practic03/tcp_server.py
@@ -0,0 +1,21 @@
+import socket
+
+server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+server.bind(("0.0.0.0", 10000))
+server.listen(1)
+print("TCP сервер запущен")
+
+while True:
+
+ conn, addr = server.accept()
+ print(f"Подключение от {addr}")
+
+ data = conn.recv(1024)
+ if not data:
+ break
+ conn.sendall(data.upper())
+
+ conn.close()
+
+ if data.upper() == b'EXIT':
+ break
\ No newline at end of file
diff --git a/practic03/udp_cerver.py b/practic03/udp_cerver.py
new file mode 100644
index 0000000..eb4d6d0
--- /dev/null
+++ b/practic03/udp_cerver.py
@@ -0,0 +1,10 @@
+import socket
+
+server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+server.bind(('0.0.0.0', 10000))
+print("UDP сервер запущен")
+
+while True:
+ data, addr = server.recvfrom(1024)
+ print(f"Сообщение от {addr}: {data.decode()}")
+ server.sendto(data.upper(), addr)
\ No newline at end of file
diff --git a/practic03/udp_client.py b/practic03/udp_client.py
new file mode 100644
index 0000000..75cd478
--- /dev/null
+++ b/practic03/udp_client.py
@@ -0,0 +1,7 @@
+import socket
+
+client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+client.sendto(b'hello server', ('127.0.0.1', 10001))
+data, _ = client.recvfrom(1024)
+print(f"Ответ от сервера: {data.decode()}")
+client.close()
\ No newline at end of file