The oeuvre of Dimitri Molokov
  • About
  • Articles

Articles

The articles focus on AI, DevOps, Web3, and other related topics in the realm of web development

August 12, 2025

Preparing ubuntu for web-server, gaming and streaming. Including auto install with yaml config and encrypted partition

Preparing ubuntu for web-server, gaming and streaming. Including auto install with yaml config and encrypted partition

For your baremetal server hosting multiple services—a one-page website, a Counter-Strike game server, video hosting, and video streaming—designing your disk partitions with encryption requires balancing security, performance, and management ease. Here are best practices to map your disk partitions with encryption for such a setup:

  1. Separate Key Partitions for Isolation and Performance

    • /boot (unencrypted): Small partition (512MB–1GB) on an unencrypted partition. It holds bootloader and kernel files that must be accessible before unlocking encrypted volumes.
    • Encrypted root (/) partition: Holds the operating system and core software.
    • Encrypted data partitions, separately for major service data:
      • Web server data (e.g., /var/www or a dedicated mount point)
      • Game server files (Counter-Strike server files and logs)
      • Video storage (videos for hosting and streaming)
      • Logs and cache (optionally, isolate logs on a separate partition to avoid filling critical volumes)
  2. Use LUKS Full Disk / Partition Encryption

read more
August 5, 2025

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:

read more
August 3, 2025

Fix Terraform Bug

Here are the advanced bug fixing tasks about DevSecOps in Terraform manifests for GitLab CI/CD pipelines, now with concrete example snippets and solutions:

1. Production Pipeline: Misconfigured Terraform State Backends

Problem:
The terraform apply step in your production GitLab CI pipeline fails with errors related to locked state files or concurrent access conflicts.

Example and Solution:

In your Terraform manifest (e.g., backend.tf), configure the backend with proper state locking using AWS S3 and DynamoDB for locking:

read more
August 3, 2025

Fix Pipeline Bug

Here are three advanced bug examples and solutions related to modern GitLab CI/CD DevSecOps pipelines with security best practices and explanations. These focus on common pitfalls and necessary configurations for secure, robust pipelines using .gitlab-ci.yml.

Advanced Bug Example 1: Secrets Leakage via Unprotected Variables

Buggy .gitlab-ci.yml snippet:

stages:
  - build
  - deploy

variables:
  DB_PASSWORD: "SuperSecretPassword"

build_job:
  stage: build
  script:
    - echo "Building the app..."
    - ./build-script.sh

deploy_job:
  stage: deploy
  script:
    - echo "Deploying with password $DB_PASSWORD"

Problem:

read more
August 3, 2025

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:

read more
April 9, 2017

How to install docker. Two ways.

Long time ago we had simple instalation procedure for docker. It can be installed by root or by unpriveleged user. There was some differences.

For now, installing Docker is even simplier than couple years ago. There are 2 main ways:

    1. Setup a repository for easy update in future (recomended)
    1. By hand for difficult update in future

Recomended way

Update index of package database:

sudo apt update

Install required packages:

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

Add Docker’s official GPG key:

read more
April 9, 2017

How to recover wordpress access

Once uppon a time I had forgotten a password to one of my wordpress login. I need it because I need to update wordpress in case I had interesting read about new Critical Log4Shell (Apache Log4j) Zero-Day Attack. After no luck searching in lastpass records and keep cards I decided to go next step of difficulity. Also, level up or remember some of my devops oldtimes.

So I managed a simple steps to recover access:

read more
April 9, 2017

Must known web3

There was a lot of web. Spider web, fishing web, internet web 0.1, web 1.0, web 2.0 and next web 3.0 is our near future. The web 3.0 aka decentralized internet is all I can think of these days. In case there are too low sources about it. Strikingly how blazing web3 technology comes to everyday life without good documentation and clear way to get information, explanation with examples. The list below is for hunt down to make web3 and decentralized internet understandable to use and get clear way to web3 software development.

read more
© The oeuvre of Dimitri Molokov 2025