Skip to content

Commit 4e29901

Browse files
authored
Merge branch 'iam-veeramalla:main' into main
2 parents 9ea7b69 + 4126860 commit 4e29901

File tree

4 files changed

+52
-24
lines changed

4 files changed

+52
-24
lines changed

Day-12/README.md

Whitespace-only changes.

Day-12/server.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Server Configuration File
2+
3+
# Network Settings
4+
PORT = 8080
5+
MAX_CONNECTIONS=600
6+
TIMEOUT = 30
7+
8+
# Security Settings
9+
SSL_ENABLED = true
10+
SSL_CERT = /path/to/certificate.pem
11+
12+
# Logging Settings
13+
LOG_LEVEL = INFO
14+
LOG_FILE = /var/log/server.log
15+
16+
# Other Settings
17+
ENABLE_FEATURE_X = true

Day-12/update_server.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
def update_server_config(file_path, key, value):
2+
# Read the existing content of the server configuration file
3+
with open(file_path, 'r') as file:
4+
lines = file.readlines()
5+
6+
# Update the configuration value for the specified key
7+
with open(file_path, 'w') as file:
8+
for line in lines:
9+
# Check if the line starts with the specified key
10+
if key in line:
11+
# Update the line with the new value
12+
file.write(key + "=" + value + "\n")
13+
else:
14+
# Keep the existing line as it is
15+
file.write(line)
16+
17+
# Path to the server configuration file
18+
server_config_file = 'server.conf'
19+
20+
# Key and new value for updating the server configuration
21+
key_to_update = 'MAX_CONNECTIONS'
22+
new_value = '600' # New maximum connections allowed
23+
24+
# Update the server configuration file
25+
update_server_config(server_config_file, key_to_update, new_value)

README.md

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,53 +67,39 @@
6767
- Practice exercises and examples:
6868
- Example: Managing a dictionary of server configurations and optimizing retrieval.
6969

70-
## Day 12: Functions and Modules
71-
- Introduction to functions in Python.
72-
- Writing functions and function parameters.
73-
- Return values and modular code.
70+
## Day 12: Python Tasks for DevOps (Part 1) - File Operations
71+
- Introduction to File Operations and Boto3.
72+
- Automating File operations.
7473
- Practice exercises and examples:
75-
- Example: Creating a function to automate server status checks.
74+
- Example: Update a server resources in the server.conf file up on external notification.
7675

77-
## Day 13: Functions and Modules (Part 2)
78-
- Advanced function topics (recursion, lambda functions).
79-
- Function libraries and built-in functions.
80-
- Practice exercises and examples:
81-
- Example: Developing a library of custom functions for DevOps automation.
82-
83-
## Day 14: Python Libraries for DevOps (Part 1)
84-
- Introduction to external libraries like Paramiko, Fabric, and Boto3.
85-
- Automating SSH connections with Paramiko.
86-
- Running commands on remote servers.
87-
- Practice exercises and examples:
88-
- Example: Using Paramiko to create a secure remote backup solution.
89-
90-
## Day 15: Python Libraries for DevOps (Part 2)
76+
## Day 13: Python Tasks for DevOps (Part 2)
9177
- Using Fabric for remote task automation.
9278
- AWS automation with Boto3.
9379
- Managing EC2 instances, S3 buckets, and more.
9480
- Practice exercises and examples:
95-
- Example: Creating a Fabric script for deploying applications to remote servers.
81+
- Example: Creating a aws script for deploying applications to remote servers.
9682

97-
## Day 16: Working with RESTful APIs
83+
## Day 14: Working with RESTful APIs
9884
- Introduction to RESTful APIs.
9985
- Making HTTP requests using Python.
10086
- Parsing JSON responses and error handling.
10187
- Practice exercises and examples:
10288
- Example: Developing a script to monitor RESTful API endpoints for your DevOps tools.
10389

104-
## Day 17: Data Serialization and Configuration Files
90+
## Day 15: Data Serialization and Configuration Files
10591
- Serializing and deserializing data (JSON, YAML).
10692
- Managing configuration data.
10793
- DevOps use cases for configuration files.
10894
- Practice exercises and examples:
10995
- Example: Building a configuration manager to handle application settings in JSON format.
11096

111-
## Day 18: Automation with Cron Jobs
97+
## Day 16: Automation with Cron Jobs
11298
- Scheduling automated tasks using cron.
11399
- Creating Python scripts for scheduled automation.
114100
- Handling periodic tasks and reports.
115101
- Practice exercises and examples:
116102
- Example: Using cron and Python to schedule regular backups of your data.
117103

118-
## Day 19: Python Interview Questions & Answers
104+
## Day 17: Python Interview Questions & Answers
119105

0 commit comments

Comments
 (0)