For accountability, I decided to publish 12-week reviews. In a month there is not always something big happening, so I start with a year quarter. Maybe I’ll transform it into a newsletter later. I’ll publish it as a YouTube video too.
Protocol buffers organization in Python microservices
In this post one of the approaches to organizing Protobuf files in microservices architecture using gRPC.
How to move to a new Mac without Migration Assistant
Last summer I got a new MacBook Pro M2 and decided to go with a fresh install. With my previous MacBooks, I used Migration Assistant and it worked well. But this time it was a switch from Intel and I wanted to clean unnecessary files, applications, and settings.
Here is the list of files I moved and apps I installed.
How to Overcome Procrastination: A Mindset Shift for Productivity
As responsible individuals, we often find ourselves prioritizing others over our own goals. If you’ve ever struggled to make progress on a personal project, this mindset change might be the key to unlocking your productivity.
Essential Python tools for writing quality code
Writing quality code is essential for both personal and team projects. It helps to reduce the number of bugs, makes the code more readable and maintainable, and improves the overall quality of the project.
In this article some basic libraries that I use in everyday life.
2023 Achievements
This blog has been on hold since 2020, and every year I’m thinking of restarting it. This year is no exception.
The stopping factor was that it’s the technical blog. Yet, I write a lot during journaling and when preparing YouTube videos. I don’t know if I’ll be able to transform them into blog posts, but I’ll try.
How to replace azure-storage
Continue of previous task.
from azure.storage.blob import BlockBlobService, ContentSettings, PublicAccess
BlockBlobService(
account_name=cluster_config["config"]["AZURE_STORAGE_ACCOUNT"],
account_key=cluster_config["config"]["AZURE_STORAGE_KEY"],
)
storage.create_container(container_name, public_access=PublicAccess.Blob)
storage.create_blob_from_bytes(
container_name, blob_name, content, content_settings=ContentSettings(content_type=content_type)
block_blob_service.create_blob_from_stream(
folder_name, filename, content, content_settings=ContentSettings(content_type=mimetype)
)
from azure.storage.blob import ContainerClient, ContentSettings, PublicAccess
account_name = cluster_config["config"]["AZURE_STORAGE_ACCOUNT"]
account_key = cluster_config["config"]["AZURE_STORAGE_KEY"]
account_url = f"https://{account_name}.blob.core.windows.net"
container_clients.append(
ContainerClient(account_url=account_url, credential=account_key, container_name=container_name)
if not container_client.exists():
container_client.create_container(public_access=PublicAccess.Blob) # exception, or overwrite true
container_client.get_blob_client(blob_name).upload_blob(
content, content_settings=ContentSettings(content_type=content_type) , overwrite=Tru
How to replace oauth2client with google-auth and google-auth-oauthlib
Recently I made an update for some legacy code and one of the tasks was to replace oauth2client. This library used to interact with OAuth2-protected resources related to Google API and deprecated since September 2018. The recomendation is to use google-auth and for OAuth 2 flow google-auth-oauthlib. The changes are simple.
How to use asyncio gRPC in AioHTTP microservices
Usually I have a lot of microservices and they communicate using REST API. For communication with frontend I still need REST, but between microservices gRPC looks more promising.
Some benefits of it:
- is built on HTTP2, using multiplexed streams - better connection management
- performance benefits because of Protobuf binary format
- code generation for a multilingual environment
Here is my first attempt to use gRPC in AioHTTP applications with some explanations.
Celery queues monitoring in Datadog
If you have Redis integration in Datadog, there is an easy way to add monitoring for celery queues.