Pull to refresh
512K+

Python *

Interpreted high-level programming language for general-purpose programming

441,98
Rating
Show first
Rating limit
Level of difficulty

Reverse Engineering the Xiaomi Smart Band 10

Level of difficultyHard
Reading time16 min
Reach and readers1.8K

Wearable devices present a paradox: the band measures your heart rate, sleep, and activity, but the manufacturer doesn't provide a ready-made open API to integrate this data into third-party systems (like a home monitoring setup or a local database). The official Xiaomi Mi Fitness app shows beautiful graphs, but the data remains 'locked' within the mobile ecosystem.

The initial task was purely practical: to set up automatic collection of health data into a local SQLite database and display reports in a family Telegram bot. Since the band syncs with the app, which in turn syncs with the Xiaomi cloud, the data is guaranteed to be transmitted over the network. I needed to understand the format in which it's transmitted and how to retrieve it.

This article is a technical breakdown of the journey from analyzing network traffic and setting up trust for a custom CA to reverse-engineering Xiaomi's RC4 protocol, decrypting AES/CBC objects from FDS storage, and parsing the proprietary binary sleep format.

Read more

Wrapping YouTube with a snake, or how to watch and download YouTube videos without a VPN using pure Python. Part 1

Level of difficultyEasy
Reading time13 min
Reach and readers1.5K

The modern world is saturated with all kinds of information, and in our difficult times, it's important to be able to not only find it but also to save it. Many have probably noticed that on YouTube, besides the junk, cats, and other useless things (which we sometimes don't mind watching), there is a lot of useful material on a wide variety of topics. And sometimes it would be nice to save this material for the future, so as not to depend on the changing moods in the world.

In this article, I want to explain how you can download videos, audio (Part 1 of the article), playlists, and entire channels from YouTube (Part 2 of the article) without using a VPN and in pure Python. A quick disclaimer: we won't need a VPN, but we will create our own tool that will solve the "problem with outdated and worn-out equipment Google Global Cache" (you know what I mean). I think this tool will be especially relevant today, when for many Russians, YouTube barely works or doesn't work at all.

Read more

You don't need OpenClaw—write your own

Level of difficultyEasy
Reading time14 min
Reach and readers905

Hello, Habr! My name is Nikita Pastukhov—author of FastStream, Principal Engineer, and maintainer of AG2 (a framework for developing agents). I’ve been in development for 8 years, and for the last year, I’ve been up to my ears in agents.

And I want to prove to you that writing your own agent is no more difficult than writing a CRUD

Why does this even need proving? Because there’s a noticeable gap between what’s happening with AI globally and what’s happening in the average Russian company. Globally—every company has an OpenAI subscription, there are a billion startups with AI products, and agents are deeply integrated into the back office. In Russia—it’s “dangerous, we host our own models,” “it’s unclear,” and support chatbots. Globally, engineers already know how to develop agents. In Russia—it’s “what even is that?”

So let’s break down how agents work using the example of OpenClaw—the most hyped “personal AI agent” right now. It lives in your messenger, sorts your email, manages your social media, writes code, and deploys services. Its popularity is a testament to how little people are currently using agents in their daily lives. For those in the know, OpenClaw hasn’t brought anything new to the table.

Let's figure it out

constexpr Game of Life

Level of difficultyMedium
Reading time20 min
Reach and readers773

For over 10 years, C++ has had constexpr, which allows the programmer to cleverly offload some computations to the compiler. At the time, this blew my mind, because the compiler can calculate some rather complex things before the program is even run!

At some point, I thought: if the compiler can calculate everything for you, then why do you need a runtime at all? What are you going to do there—print the answer or something? That’s just silly. That’s unsportsmanlike.

This is where my challenge was born:

“No hands” or “don’t even think about running the exe file”

Challenge accepted!

Arrow neural network: Fire extinguishing equipment no longer needs to be checked

Reading time2 min
Reach and readers3.6K

Every day, every single day, devices in fire suppression systems need to be checked! When these are enormous warehouses spread across vast territories, a security guard has to constantly walk around and inspect all of them — just for this one task. The pressure gauge has become a symbol of punishment in fire safety authorities.

Millions of analog sensors are also used in gas and water distribution systems, as well as in many other industries.

Read more

I Taught a Virtual Camera to Behave Like a Human Operator: How a Face Tracking Algorithm for Shorts/Reels Works

Level of difficultyHard
Reading time14 min
Reach and readers8.9K

In the previous article I described my “anime factory” in detail — a pipeline that automatically turns episodes into finished Shorts. But inside that system there is one especially important module that deserves a separate deep dive: a virtual camera for automatic reframing.

In this article, I will break down not just an “auto-crop function,” but a full virtual camera algorithm for vertical video. This is exactly the kind of task that looks simple at first glance: you have a horizontal video, you need to turn it into 9:16, keep a person in frame, and avoid making the result look like a jittery autofocus camera from the early 2010s.

But as soon as you try to build it not for a demo, but for a real pipeline, engineering problems immediately show up:

Read more

How I Built an “Anime Factory”: a System That Automatically Turns Episodes into YouTube Shorts

Level of difficultyMedium
Reading time18 min
Reach and readers5.9K

Hi, Habr!

Over the past few months, I have been building a system that I internally call an “anime factory”: it takes a source episode as input and produces a ready-to-publish YouTube Short with dynamic reframing, subtitles, post-processing, and metadata.

What makes it interesting is not just the fact that editing can be automated, but that a significant part of this work can be decomposed into engineering stages: transcription, audio and scene analysis, strong-moment discovery, “virtual camera” control, and a feedback loop based on performance metrics.

In this article, I will show how this pipeline is structured, why I chose a modular architecture instead of an end-to-end black box, where the system broke, and which decisions eventually made it actually usable.

Read more

Copper Filler: Saving on PCB Manufacturing in KiCad

Level of difficultyMedium
Reading time5 min
Reach and readers4.1K

Hello, fellow developers!

Anyone who designs multilayer printed circuit boards in KiCad has faced the need, during routing, to leave large areas free of copper polygons (whether connected to nets or not) for schematic or other reasons. On outer layers, this isn't a big problem. On inner layers, it's a bit different. While it might be fine from a topology perspective, it's not ideal from a manufacturing point of view.

Today, we want to share a plugin we developed to solve this problem. It's a tool for automatically filling free areas on a PCB with non-current-carrying copper elements, either square or round, of a configurable size.

Why is this needed?

At first glance, an empty area on a board is just bare laminate without copper. But for the manufacturer and the end-user of the device, this has two important consequences.

Read more

How to Create a Telegram Chatbot with No Programming Skills

Level of difficultyEasy
Reading time14 min
Reach and readers4.4K

We will write a bot like this one

Nowadays, anyone without programming skills can write a simple chatbot on their own. For example, to provide services via Telegram, organize a community's work, etc. Let's say, for tracking attendance in a classroom, for communicating in a building's group chat, or for downloading movies and music. And for a technical specialist, writing such a bot is a trivial task. In this article, we will discuss why chatbots are needed, how they can be used by businesses and individuals, and how to write a bot yourself, whether you have programming skills or not.
Read more →

Simple Telegram bot in Python in 30 minutes

Reading time4 min
Reach and readers3.9K
On Habr, and not only there, so much has already been said about bots that it's almost too much. But having become interested in this topic a couple of weeks ago, I couldn't find any decent material: all the articles were either for complete beginners and were limited to sending a message in response to a user's message, or they were outdated. This is what prompted me to write an article that would explain to a beginner like me how to write and launch a more or less meaningful bot (with the possibility of expanding its functionality).

Read more →

Build your own AI agent from scratch for free in 5 minutes

Level of difficultyEasy
Reading time4 min
Reach and readers13K

In this article, I will show you how to build your first AI agent from scratch using Google’s ADK (Agent Development Kit). This is an open-source framework that makes it easier to create agents, test them, add tools, and even build multi-agent systems.

Read more

How we made python pytest suites 8.5× faster

Level of difficultyEasy
Reading time6 min
Reach and readers10K

My name is Anatoly Bobunov, and I work as a Software Development Engineer in Test - or SDET for short - at EXANTE. When I joined one of our projects, I discovered that several of our test suites took more than an hour to run - painfully slow, to the point where running them for every merge request was simply unrealistic. We wanted fast feedback on each commit, but at that speed, it just wasn’t going to happen.

Eventually, through a series of small but precise improvements, I managed to speed things up to 8.5× faster, without rewriting the tests from scratch. In this article, I’ll walk through the bottlenecks we found and how we fixed them.

Read more

START: how to defeat hallucinations and teach LLMs accurate calculations

Level of difficultyEasy
Reading time3 min
Reach and readers12K

START is an open-source LLM designed for precise calculations and code verification. It addresses two major issues that most standard models face: hallucinations and errors in multi-step calculations. This article explains why these problems arise and how START solves them.

Read more

Docling in Working with Texts, Languages, and Knowledge

Level of difficultyMedium
Reading time20 min
Reach and readers14K

DocLing in Working with Texts, Languages, and Knowledge — an in-depth overview of the open-source DocLingtoolkit for extracting, structuring, and analyzing data from documents. The article covers approaches to processing multilingual texts, building language- and domain-specific knowledge models, and integrating DocLing into AI and NLP projects. Includes practical examples and recommendations for developers working with large volumes of unstructured data.

Read more
1
23 ...