Skip to content

Commit

Permalink
update files for day-12
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-veeramalla committed Nov 21, 2023
1 parent a30ed9f commit 4126860
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
Empty file removed Day-12/README.md
Empty file.
17 changes: 17 additions & 0 deletions Day-12/server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Server Configuration File

# Network Settings
PORT = 8080
MAX_CONNECTIONS=600
TIMEOUT = 30

# Security Settings
SSL_ENABLED = true
SSL_CERT = /path/to/certificate.pem

# Logging Settings
LOG_LEVEL = INFO
LOG_FILE = /var/log/server.log

# Other Settings
ENABLE_FEATURE_X = true
25 changes: 25 additions & 0 deletions Day-12/update_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
def update_server_config(file_path, key, value):
# Read the existing content of the server configuration file
with open(file_path, 'r') as file:
lines = file.readlines()

# Update the configuration value for the specified key
with open(file_path, 'w') as file:
for line in lines:
# Check if the line starts with the specified key
if key in line:
# Update the line with the new value
file.write(key + "=" + value + "\n")
else:
# Keep the existing line as it is
file.write(line)

# Path to the server configuration file
server_config_file = 'server.conf'

# Key and new value for updating the server configuration
key_to_update = 'MAX_CONNECTIONS'
new_value = '600' # New maximum connections allowed

# Update the server configuration file
update_server_config(server_config_file, key_to_update, new_value)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
- Practice exercises and examples:
- Example: Managing a dictionary of server configurations and optimizing retrieval.

## Day 12: Python Libraries for DevOps (Part 1)
## Day 12: Python Tasks for DevOps (Part 1) - File Operations
- Introduction to File Operations and Boto3.
- Automating File operations.
- Practice exercises and examples:
- Example: Update a server resources in the server.conf file up on external notification.

## Day 13: Python Libraries for DevOps (Part 2)
## Day 13: Python Tasks for DevOps (Part 2)
- Using Fabric for remote task automation.
- AWS automation with Boto3.
- Managing EC2 instances, S3 buckets, and more.
Expand Down

0 comments on commit 4126860

Please sign in to comment.