Below you will find pages that utilize the taxonomy term “Python”
Devops Automation Example
Here are production-tested, real-world DevOps automation examples in Python and Bash from reputable DevOps resources.
Python DevOps Automation Scripts
1. System Resource Monitoring
Monitor CPU and memory usage, sending alerts if thresholds are exceeded:
import psutil
def check_system_resources():
cpu_usage = psutil.cpu_percent(interval=1)
memory_usage = psutil.virtual_memory().percent
if cpu_usage > 80:
print(f"High CPU usage: {cpu_usage}%")
if memory_usage > 80:
print(f"High Memory usage: {memory_usage}%")
check_system_resources()
This type of monitoring is fundamental for production reliability.[1][2]
2. AWS Automation (List S3 Buckets)
Automate AWS tasks like listing all S3 buckets with boto3:
Fix Python Bug
Fix Python Bug
Simple bug-finding task for a Python programmer:
Task: Find the Bug in the Code Here is a short Python function that is supposed to return the square of a number, but it contains a bug. Your job is to find and fix the bug.
def square_number(num):
result = num * num
return result + 1
print(square_number(5)) # Expected output: 25
What’s wrong with this code? How can you fix it?
Original code:
About
Welcome!
I am excited to share my journey as a software engineer with you!
My name is Dimitri Molokov, and this website is a reflection of my professional journey. I created it to showcase my skills and build a portfolio that will help me land a job in my field.
As a software engineer, I am known for my ability to quickly learn and adapt to new environments and team dynamics. I have a wide range of programming skills, including web, mobile, and backend development. I have experience with various programming languages, including JavaScript, Golang, NodeJS, Electron, Python, Dart, Flutter, and others that are less common but still interesting.