cleverblog.pl
Practical engineering notes from real production work.
Linux, Raspberry Pi and home automation — verified in production.
Latest articles
Articles: 30 of 30

Troubleshooting Markdown Code Fences in LLM Translation Pipelines
Nested Markdown can break when an outer fenced block uses the same delimiter length as a fence inside its content. This field guide explains how Markdown fence matching works, how longer backtick or tilde fences preserve nested content, and why Canvas and Artifacts must be distinguished from ordinary chat text during extraction.

Diagnosing and Hardening a .NET AI Pipeline Adapter
A production .NET AI pipeline can fail even when a provider returns syntactically valid JSON. This troubleshooting guide follows the verified failure chain: a reflection indexer, nested-record deserialization, unexpected array shapes, objects in string arrays, guessed field names, and an invalid reason code. It then records the adapter fixes and the verified rerun results.

Diagnosing Gemini HTTP 400 Errors Caused by Incompatible MCP Tool Schemas
A Gemini-family integration can reject every request when one MCP tool declaration uses nullable JSON-Schema unions that are incompatible with Gemini function-declaration validation. Indexed declaration errors can identify the affected tools, while a non-Gemini comparison and a focused schema-compatibility check help separate schema failures from authentication and quota problems.

When an Autonomous Agent Keeps Reading the Same Asynchronous-Job Result
An observed autonomous-agent loop repeatedly read unchanged asynchronous-job results, including a terminal full-payload result, while the dependent action never began. A narrowly bounded stop condition is to stop after two identical consecutive outputs and hand a terminal full-payload result to the dependent action or an operator.

Troubleshooting UnixLocal Workspace I/O and Cancellation Safety
UnixLocal workspace I/O and cancellation involve two separate correctness boundaries: keeping workspace operations away from the event loop, and preserving worker ownership until a cancellation-safe operation has completed. The upstream implementation and its regression tests provide bounded evidence for both boundaries.

When an Async Stream Finishes but the Run Failed: Preserving Exceptions at the Boundary
An asynchronous event stream can reach completion while its background run loop has failed. This troubleshooting note describes the exception boundary that preserves that failure, the race it addresses, and the focused regression cases that verify both failure and success paths.

Idempotency Isn't Enough: Three Retry Bugs in Pipelines with Retrying
Even with stable IDs, unique constraints and retries, a pipeline can become inconsistent after a crash. Learn how to protect artifacts and task order.

Debugging TargetParameterCountException in .NET: hidden indexer in IReadOnlyList<T>
When .NET reflection throws "Parameter count mismatch", the real cause may be an IReadOnlyList<T> indexer. Learn how to find and fix it.

Flashing the CC2652P Chip Using CH9102X
Flash the CC2652P coordinator with a CH9102X USB-Serial adapter for Zigbee2Mqtt. A step-by-step guide to updating the firmware.

File Permissions in Linux (chmod)
Learn how to change file and directory permissions in Linux with chmod, using symbolic, numeric, recursive and bulk permission methods.

Managing systemd services in Linux
Learn how to start, stop and restart Linux services with systemctl, service and /etc/init.d scripts. Administrator privileges are required.

Adding your own systemd service in Linux
Learn how to add a Linux service with systemd and systemctl, then enable it to start automatically at boot. Administrator privileges are required.

Viewing logs in Linux (systemctl and journalctl)
Learn how to view Linux process logs with systemctl status and journalctl, including full logs. Administrator privileges are required.

Checking the file system on the next reboot (fsck)
Learn how to force fsck at the next reboot and configure regular filesystem checks in Linux using tune2fs.

Copying files over SSH (scp)
Learn how to copy files over SSH with SCP: from your computer to a server, back again, or directly between two Linux servers.

Programming and Flashing CC2531 Without a Cable Using Raspberry Pi
Flash a CC2531 using only a Raspberry Pi, with no CC Debugger, UART cable or ESP. Works with any CC2531 device, including EBYTE E18-2G4U04B PA.

Integrating Domoticz with a Printer
Manage a system printer with scripts that send printer status to Domoticz and clear the system print queue when needed.

Domoticz Integration with Xiaomi Mi Temperature & Humidity Monitor
Send Xiaomi thermometer data to Domoticz automatically, including temperature, humidity and battery level.

Adding a User to a Group in Linux (usermod)
Learn how to create Linux groups, add existing or new users, and grant sudoers access. A root account is required.

Searching for Files in Linux (find and fd)
Use the Linux find command to search files by name, extension or date, then delete matches or change their permissions in bulk.

Internet Watchdog on Raspberry Pi
Monitor your internet connection with a script that restarts the router if it fails and reboots the device if the problem continues.

Installing Home Assistant on Raspberry Pi
Install Home Assistant, the free open-source home automation platform written in Python, and use it as the central hub for your smart home.

Your Own OpenVPN Server on mikr.us
Run your own OpenVPN server on mikr.us and securely access your local network, home automation, file server or printer remotely.

Setting and changing a user password in Linux (passwd)
Learn how to set or change passwords in Linux for users, administrators and groups.

Installing a MySQL/MariaDB Server on Raspberry Pi
Run a MySQL server on your Raspberry Pi, create databases and store data for your applications.

.NET (dotnet) on Raspberry Pi
Install the .NET environment on your Raspberry Pi and start building applications in C#.

MiniDLNA Media Server on Raspberry Pi
Build your own media server and access your movies, music and other media whenever and however you want.

Accessing MySQL/MariaDB from outside the server
Make your MySQL or MariaDB server accessible from outside your local network.

Mounting Remote WebDAV Drives in Linux
Access remote file servers, expand your storage space and gain extra room for files and backups.

Jupyter Notebook on Raspberry Pi
Writing Python scripts for Raspberry Pi can be even easier.