Pydantic In Termux? Install Rust And Some Patience
November 04, 2025
Installing Pydantic in Termux requires building from source. The solution: install Rust and wait.
The Problem
Attempting to pip install pydantic in Termux fails because pydantic-core needs to be built from source. No precompiled wheel is available for the Termux environment.
The Solution
Install Rust, pkg install rust then let pip build pydantic-core from source.
The build takes approximately 10 minutes. Let it run in the Termux window without interruption.
Asking Copilot To Write Diagnostic Scripts When Stuck
November 01, 2025
When Copilot gets stuck trying to directly fix a problem, asking it to write a diagnostic script can help get unstuck.
The Pattern
Instead of repeatedly asking Copilot to fix the issue directly, request a standalone diagnostic script. The script should:
- Test different configurations to isolate the problem
- Output detailed information about what works and what doesn’t
- Be independent and easy to run
Example
Whilst fixing a web scraper that was getting 403 errors, direct attempts to fix the issue went in circles. Asking Copilot to write a diagnostic script revealed that the issue was missing HTTP headers.
The diagnostic script tested multiple header combinations and logged the results, making the root cause obvious. See diagnose_403.py for the implementation.
Why This Works
- Diagnostic scripts gather facts rather than making assumptions
- The output provides concrete data for subsequent fixes
- The script becomes documentation of the investigation process
- It’s faster than iterative trial-and-error
Termux API Install Needs to Be from F-Droid
October 27, 2025
Quick fix for a key signing error when using Termux API.
The Problem
Installed Termux from F-Droid, then installed Termux:API via command line:
pkg install termux-api
When attempting to use the API (e.g., termux-storage-get), encountered a key signing error preventing the API from functioning.
The Solution
Install Termux:API from F-Droid, not via pkg install.
Both Termux and Termux:API must come from the same source (F-Droid) to have matching signatures.
The Steps
- Open F-Droid
- Search for “Termux:API”
- Install the Termux:API app
- The command-line tools will now work correctly
References
GitHub Copilot CLI Running On Raspberry Pi
October 23, 2025
This post is being written from GitHub Copilot command line running on a Raspberry Pi.
I attempted to get the install working on Termux on Android first, but couldn’t get it to work. The Raspberry Pi installation was straightforward by comparison.
Google Vision Handwriting Recognition Works!
October 14, 2025
Got Google Vision working on Android mobile. Example picture worked perfectly.
Testing on Android
The entire workflow runs on Android mobile using Termux:
- Set up Google Vision API with service account credentials
- Transferred credentials securely via Tailscale
- Ran the Python script directly on the phone
- Recognition accuracy was excellent
Example Test
Tested with a hand-drawn workflow diagram showing the process: paper → Google Vision API → GitHub. The API accurately recognised the handwritten text written in casual handwriting.
Results
Text accuracy: Excellent - recognised handwritten notes accurately
Setup simplicity: Straightforward once grpcio installation sorted
API response time: Fast enough for real-time use
See the complete working code on GitHub.
The gvision-text repository contains the full working implementation and setup instructions.
Accessing Google Vision API from Python on Android
October 13, 2025
Here’s a summary of what I needed to do to access the Google Vision API from Python using Termux on Android.
- Get API key on laptop - Generate service account key JSON file using Google Cloud Console on a desktop/laptop
- Transfer using Tailscale - Use Tailscale’s file transfer feature to securely move the key file from laptop to phone
- Install grpcio via Termux package -
pip install grpciowon’t work on Android. Use Termux’s native package instead:
# Don't use pip for grpcio on Android
# pip install grpcio # This fails
# Use Termux package instead
pkg install python-grpcio
Complete Instructions
See gvision-text repository for detailed setup and usage instructions.
Starting With Mobile Development Using React Native Expo Go
September 25, 2025
I’m planning to write a new app to remind my wife when she has to pay for a ticket at the barrier-less car park she uses for work.
As a first step I’m experimenting with React Native Expo Go. To start I simply want to display the lat-long value that my phone currently receives.
How To Steer GitHub Copilot Agent Mid-Task: Comment On The Pull Request, Not The Issue
September 11, 2025
Here’s something I learnt when working with GitHub Copilot’s coding agent: if you want to provide feedback or steer the agent whilst it’s working on a task, you need to comment on the pull request it creates, not on the original issue.
The Problem
When Copilot starts working on an issue, it creates a pull request and begins implementing changes. Your natural instinct might be to add comments to the original issue if you want to clarify requirements, suggest a different approach, or provide additional context.
This doesn’t work. Comments added to the parent issue appear to be completely ignored by the agent.
The Solution
Instead, navigate to the pull request that Copilot has created and add your comments there. The agent actively monitors the PR for feedback and will incorporate your guidance into its ongoing work.
Even review comments can be hit-and-miss. I’ve seen Copilot pick up the review comment immediately. I’ve seen Copilot completely ignore review comments. If you’ve put a review in and Copilot is ignoring it, then a @copilot please work to correct the review comments prompt usually gets its attention.
Migrating to Copier for Project Templating
August 25, 2025
Moving from Cookiecutter to Copier to solve the template update problem identified in the Cookiecutter GitHub Copilot project template post.
The Problem with Cookiecutter
Cookiecutter excels at creating new projects but cannot update existing projects when the template changes. This is particularly problematic for frequently evolving files like copilot-instructions.md which I’m constantly refining as I learn better Copilot practices.
Why Copier
Copier addresses this limitation with its updating capability - it can apply template changes to existing projects, maintaining the original answers whilst incorporating new template features.
Migration Plan
- Migrate Existing CookieCutter Git Repo - Convert the cookiecutter-basic template structure to Copier format
- Translate Into A Copier Repo - Transform cookiecutter.json and template variables to Copier’s copier.yml format
- Apply To An Existing Project - Test the converted template on an existing project created with the old Cookiecutter template
- Update The Template Then Reapply To A Project - Verify the update workflow by modifying the template and applying changes to the existing project
Results
Migration completed successfully. Key steps carried out:
- Repository Renamed - Renamed from cookiecutter-basic to copier-copilot-coding
- Automated Migration - Used GitHub Copilot to handle the complete migration in one step:
- Ported
cookiecutter.jsontocopier.yml - Mapped
{{cookiecutter.project_slug}}to{{project_name}} - Updated README.md and copilot-instructions.md to Copier style
- Updated top-level README with Copier usage instructions
- Ported
Critical Note: Remember to commit the created .copier-answers.yml file to git. Without this file committed, you cannot reapply template updates when the template changes. This answers file stores your original configuration choices and is essential for Copier’s update functionality.
The template is now ready for use with Copier’s updating capabilities.
Code to Understand C# Dependency Injection
August 20, 2025
Quick planning post to write code to understand the C# dependency injection magic.
Plan is to:
- Write a library with one function that reverses a string
- Write a console app that takes a string and applies the injected transformation on it
- Use the dependency injection framework to inject the function reverse method into it
- Write another function that capitalises the string
- Change the dependency injection to use the capitalisation
This hands-on approach should demonstrate how DI works by building a simple string transformation pipeline where the specific transformation can be swapped out via dependency injection.
The example will use Microsoft.Extensions.DependencyInjection - the standard DI container for .NET applications.