diff --git a/DotnetApp/Program.cs b/DotnetApp/Program.cs index 586449a..ada9359 100644 --- a/DotnetApp/Program.cs +++ b/DotnetApp/Program.cs @@ -1,6 +1,4 @@ -using System.IO; using System.Linq; -using Microsoft.Extensions.FileProviders; using DotnetApp.Services; using DotnetApp.Models; diff --git a/python/point.py b/python/point.py deleted file mode 100644 index e69de29..0000000 diff --git a/python/sql.py b/python/sql.py index bc2121e..ff6190b 100644 --- a/python/sql.py +++ b/python/sql.py @@ -3,22 +3,22 @@ def search_user(username): conn = mysql.connector.connect(user='root', password='password', host='localhost', database='users') cursor = conn.cursor() - query = "SELECT * FROM users WHERE username = '" + username + "'" + query = "SELECT * FROM users WHERE username = %s" # Execute the query and process the results - cursor.execute(query) + cursor.execute(query, (username,)) result = cursor.fetchall() cursor.close() conn.close() return result def add_user(username, password): - conn = mysql.connector.connect + conn = mysql.connector.connect(user='root', password='password', host='localhost', database='users') cursor = conn.cursor() - query = "INSERT INTO users (username, password) VALUES ('" + username + "', '" + password + "')" + query = "INSERT INTO users (username, password) VALUES (%s, %s)" # Execute the query - cursor.execute(query) + cursor.execute(query, (username, password)) conn.commit() cursor.close() conn.close() diff --git a/python/tests/test_calculator.py b/python/tests/test_calculator.py deleted file mode 100644 index e69de29..0000000 diff --git a/rust/tcp.rs b/rust/tcp.rs new file mode 100644 index 0000000..4b10402 --- /dev/null +++ b/rust/tcp.rs @@ -0,0 +1,21 @@ +use std::io::{Read, Write}; +use std::net::TcpStream; + +pub fn handle_tcp_stream(mut stream: TcpStream) { + let mut buffer = [0; 1024]; + + match stream.read(&mut buffer) { + Ok(size) => { + if size > 0 { + println!("LOG (TCP): Received {} bytes", size); + let response = b"HTTP/1.1 200 OK\r\nContent-Length: 2\r\n\r\nOK"; + if let Err(e) = stream.write_all(response) { + println!("ERROR (TCP): Failed to send response: {}", e); + } + } + } + Err(e) => { + println!("ERROR (TCP): Failed to read from stream: {}", e); + } + } +} diff --git a/scripts/report_bofa_emu_versions.py b/scripts/report_bofa_emu_versions.py index 1e494da..145e612 100644 --- a/scripts/report_bofa_emu_versions.py +++ b/scripts/report_bofa_emu_versions.py @@ -1,10 +1,8 @@ #!/usr/bin/env python3 import argparse import csv -import os -import re import sys -from collections import Counter, defaultdict +from collections import Counter from pathlib import Path diff --git a/terraform/iac.tf b/terraform/iac.tf deleted file mode 100644 index e69de29..0000000