From b340597f356d7e2e30ff1fb1c87201dae6186770 Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Fri, 21 Nov 2025 11:01:01 +0530 Subject: [PATCH 1/9] Update README.md --- Day-04/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Day-04/README.md b/Day-04/README.md index 381972ef..84221558 100644 --- a/Day-04/README.md +++ b/Day-04/README.md @@ -96,7 +96,7 @@ In this example, we import the `math` module and then use functions and variable Python workspaces refer to the environment in which you develop and run your Python code. They include the Python interpreter, installed libraries, and the current working directory. Understanding workspaces is essential for managing dependencies and code organization. -Python workspaces can be local or virtual environments. A local environment is the system-wide Python installation, while a virtual environment is an isolated environment for a specific project. You can create virtual environments using tools like `virtualenv` or `venv`. +Python workspaces can be local or virtual environments. A local environment is the system-wide Python installation, while a virtual environment is an isolated environment for a specific project. You can create virtual environments using tools like `virtualenv` or `venv`.(logical seperation for python packages on virtual machine). **Example:** @@ -111,4 +111,4 @@ myenv\Scripts\activate source myenv/bin/activate ``` -Once activated, you work in an isolated workspace with its Python interpreter and library dependencies. \ No newline at end of file +Once activated, you work in an isolated workspace with its Python interpreter and library dependencies. From 60389fba05860aa66931751996634bb5513a2044 Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Fri, 21 Nov 2025 06:47:30 +0000 Subject: [PATCH 2/9] by me on 21-112025 --- Day-04/calc.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Day-04/calc.py diff --git a/Day-04/calc.py b/Day-04/calc.py new file mode 100644 index 00000000..e38ed5d4 --- /dev/null +++ b/Day-04/calc.py @@ -0,0 +1,33 @@ +import sys +import os + + +def add(num1,num2): + add = num1 + num2 + return add + +def sub(num1, num2): + sub = num1 - num2 + return sub + +def mul(num1, num2): + m = num1 * num2 + return m + +num1= float(sys.argv[1]) +operation = sys.argv[2] +num2 = float(sys.argv[3]) + +if operation=='add': + output=add(num1,num2) + print(output) + +if operation =='sub': + output=sub(num1,num2) + print(output) + +if operation =='mul': + output=mul(num1,num2) + print(output) + +print(os.getenv("password")) \ No newline at end of file From 503d0e51921635c64d562d33702a2404a5225baf Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Fri, 21 Nov 2025 09:01:36 +0000 Subject: [PATCH 3/9] new file --- Day-06/02-Assignment/test.py | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Day-06/02-Assignment/test.py diff --git a/Day-06/02-Assignment/test.py b/Day-06/02-Assignment/test.py new file mode 100644 index 00000000..9d91f41d --- /dev/null +++ b/Day-06/02-Assignment/test.py @@ -0,0 +1,65 @@ +#a=3 +#b=4 + +#sum=a+b +#difference=a-b +#product=a*b +#quotient=a/b +#modulus=a%b +#exponentiation=a**b +#floor_division=a//b + +#greater=a>b +#less=a=b +#less_equal=a<=b +#equal=a==b +#not_equal=a!=b + +#x=True +#y=False + +#and_1=x and y +#or_1=x or y +#not_1= not y +#not_2= not x + +#total =10 + +#total +=4 +#total -=7 +#total *=8 +#total /=2 + +#print("Sum of function is=",sum) +#print("difference of function is=",difference) +#print("product of function is=",product) +#print("quotient of function is=",quotient) +#print("modulus of function is=",modulus) +#print("exponentiation of function is=",exponentiation) +#print("floor division of function is=",floor_division) + +#print("Greater than function is=",greater) +#print("Less than function is=",less) +#print("Greater than or equal to function is=",greater_equal) +#print("Less than or equal to function is=",less_equal) +#print("Equal to function is=",equal) +#print("Not equal to function is=",not_equal) + +#print("Logical and is", and_1) +#print("Logical or is", or_1) +#print("Logical not is", not_1 ) +#print("Logical not is", not_2 ) + +#print("final value of total is=",total) + +#my_list=["apple","grapes","rabbit",1,2,3,4] +#u="apple" + +#b="grapes" +#c="banana" + +#print(u is u) +#print(u is not my_list) +#print(b in my_list) +#print(c not in my_list) \ No newline at end of file From 6d7173e290f2f7d929e16fdbca7747bcd2cea6ab Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Fri, 21 Nov 2025 09:59:48 +0000 Subject: [PATCH 4/9] new file --- Day-07/test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Day-07/test.py diff --git a/Day-07/test.py b/Day-07/test.py new file mode 100644 index 00000000..d9834add --- /dev/null +++ b/Day-07/test.py @@ -0,0 +1,11 @@ +import sys +type= sys.argv[1] + +if type=="t2.micro": + print("charges are 2 dollar/tb data transfer") +elif type=="t2.medium": + print("charges are 8 dollar/tb data transfer") +elif type=="t2.xlarge": + print("charges are 10 dollar/tb data transfer") +else: + print("wrong type of instance provided") \ No newline at end of file From 1451ce8e05d6f8d39d6a5d2af752eeee797c811e Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Mon, 24 Nov 2025 05:07:50 +0000 Subject: [PATCH 5/9] new file --- Day-09/test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Day-09/test.py diff --git a/Day-09/test.py b/Day-09/test.py new file mode 100644 index 00000000..fa65828c --- /dev/null +++ b/Day-09/test.py @@ -0,0 +1,10 @@ +log_file = [ + "INFO: Operation successful", + "ERROR: line 43-File not found", + "DEBUG: Connection established", + "ERROR: port-4385 Database connection failed", +] + +for line in log_file: + if "ERROR" in line: + print(line) \ No newline at end of file From 01404871dbcbf6d251e37a9cf1147eb382024fd9 Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Mon, 24 Nov 2025 05:13:38 +0000 Subject: [PATCH 6/9] shell file use case for devops --- Day-09/test1.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Day-09/test1.py diff --git a/Day-09/test1.py b/Day-09/test1.py new file mode 100644 index 00000000..1dfd9180 --- /dev/null +++ b/Day-09/test1.py @@ -0,0 +1,29 @@ +servers=("server1" "server2" "server3") +for server in "${servers[@]}"; do + configure_monitoring_agent "$server" +done + +environments=("dev" "staging" "prod") +for env in "${environments[@]}"; do + deploy_configuration "$env" +done + +databases=("db1" "db2" "db3") +for db in "${databases[@]}"; do + create_backup "$db" +done + +log_files=("app.log" "access.log" "error.log") +for log_file in "${log_files[@]}"; do + rotate_and_cleanup_logs "$log_file" +done + +servers=("server1" "server2" "server3") +for server in "${servers[@]}"; do + check_resource_utilization "$server" +done + +servers=("server1" "server2" "server3") +for server in "${servers[@]}"; do + check_resource_utilization "$server" +done From d85484fa73f26a9a379225e5619627afbec2dccc Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Mon, 24 Nov 2025 07:11:26 +0000 Subject: [PATCH 7/9] new test case --- Day-09/{test1.py => test1.sh} | 1 + Day-09/test2.sh | 31 +++++++++++++++++++++++++++++++ Day-10/test.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) rename Day-09/{test1.py => test1.sh} (99%) mode change 100644 => 100755 create mode 100755 Day-09/test2.sh create mode 100644 Day-10/test.py diff --git a/Day-09/test1.py b/Day-09/test1.sh old mode 100644 new mode 100755 similarity index 99% rename from Day-09/test1.py rename to Day-09/test1.sh index 1dfd9180..6f474575 --- a/Day-09/test1.py +++ b/Day-09/test1.sh @@ -1,3 +1,4 @@ + servers=("server1" "server2" "server3") for server in "${servers[@]}"; do configure_monitoring_agent "$server" diff --git a/Day-09/test2.sh b/Day-09/test2.sh new file mode 100755 index 00000000..af810cb1 --- /dev/null +++ b/Day-09/test2.sh @@ -0,0 +1,31 @@ +servers=("server1" "server2" "server3") +for server in "${servers[@]}"; do + check_resource_utilization "$server" +done + +while ! aws ec2 describe-instance-status --instance-ids i-1234567890abcdef0 | grep -q "running"; do + echo "Waiting for the EC2 instance to be running..." + sleep 10 +done + +while true; do + if tail -n 1 /var/log/app.log | grep -q "ERROR"; then + send_alert "Error detected in the log." + fi + sleep 5 +done + +while true; do + replication_lag=$(mysql -e "SHOW SLAVE STATUS\G" | grep "Seconds_Behind_Master" | awk '{print $2}') + if [ "$replication_lag" -gt 60 ]; then + trigger_data_sync + fi + sleep 60 +done + +while true; do + if ! check_service_health; then + restart_service + fi + sleep 30 +done \ No newline at end of file diff --git a/Day-10/test.py b/Day-10/test.py new file mode 100644 index 00000000..befd0a25 --- /dev/null +++ b/Day-10/test.py @@ -0,0 +1,28 @@ +import os + +def list_files_in_folder(folder_path): + try: + files=os.listdir(folder_path) + return files, None + except FileNotFoundError: + return None, "folder not found" + except PermissionError: + return None, "persmission denied" + + +def main(): + folder_paths= input("Enter folder paths seperated by space:").split() + + for folder_path in folder_paths: + files, error_message=list_files_in_folder(folder_path) + if files: + print(f"files in {folder_path}") + for file in files: + print(file) + + else: + print(f"error in folder {folder_path}: {error_message}") + +if __name__=="__main__": + main() + From b222915bc6822f00262a4bba4db21d5e40e5f438 Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Mon, 24 Nov 2025 11:27:16 +0000 Subject: [PATCH 8/9] new file --- Day-11/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Day-11/test.py diff --git a/Day-11/test.py b/Day-11/test.py new file mode 100644 index 00000000..fa821649 --- /dev/null +++ b/Day-11/test.py @@ -0,0 +1,9 @@ +import requests + +response= requests.get("https://api.github.com/repos/kubernetes/kubernetes/pulls") + +complete_detail = response.json() + +for i in range(len(complete_detail)): + print(complete_detail[i]) + From 63ca8b8e31fe8a22b0906a4dca38ae17a6fd0a49 Mon Sep 17 00:00:00 2001 From: Ayushman-1744 Date: Mon, 24 Nov 2025 11:46:38 +0000 Subject: [PATCH 9/9] new file --- Day-12/server.conf | 2 +- Day-12/test.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Day-12/test.py diff --git a/Day-12/server.conf b/Day-12/server.conf index e9d46d83..be193449 100644 --- a/Day-12/server.conf +++ b/Day-12/server.conf @@ -2,7 +2,7 @@ # Network Settings PORT = 8080 -MAX_CONNECTIONS=600 +MAX_CONNECTIONS=1000 TIMEOUT = 30 # Security Settings diff --git a/Day-12/test.py b/Day-12/test.py new file mode 100644 index 00000000..9f3e58ea --- /dev/null +++ b/Day-12/test.py @@ -0,0 +1,13 @@ +def update_server_config(file_path, key, value): + + with open(file_path,"r") as file: + lines=file.readlines() + + with open(file_path,"w") as file: + for line in lines: + if key in line: + file.write(key + "=" + value + "\n") + else: + file.write(line) + +update_server_config("server.conf", "MAX_CONNECTIONS","1000") \ No newline at end of file