Prompting tips for maintenance tasks – Part 2

This blog is also a living document for myself so I can improve and reference this working pattern in the future.

Model selection

If using ChatGPT for coding tasks, especially maintenance tasks, opt for o1, other models are crap and will hallucinate or forget more of the original code.

Avoiding regressions

If the goal is to alter existing code, ChatGPT risks breaking existing code by removing as part of the end result, a good prompt is something like below, to reduce the amount of feedback loop and future debugging.

[insert-here your own description of your problem to be solved by ChatGPT/LLM, with instructions]

Here is the code to be modified. I want the complete code as the final result, with the same number of functions as in the original.

First, tell me the list of ALL the functions you see, and which ones you will modify.
Show me all the resulting code from each modification.
Show me the final file with the modifications
.
Do not omit code for brevity, keep untouched code same as before.

[Insert here the original code to be maintained/modified/debugged by the LLM]

See also

Flow

  • Cannot really stop coding while in a task. Coding is fun.
  • Cannot really stop improving after solving a task. I'm in the flow and each improvement unlocks another.
  • Cannot really stop bug fixing before solving it. Interruption is frustrating and I need to kill this problem.

Related

Continuous improvement is addictive because of the desire to reach perfection and repair the broken window (cfr Broken window theory).

Thanks to Vincent L. for the thoughts that inspired this blog.

Sans

Can you live a day at work and at home "sans"?

Sans smartphone?

We used to boot a computer and even a modem and be actually productive and enjoy life without checking for news, notifications, or email every 15 minutes.

Sans version control conflicture crap due to using Git-ware conflict-friendly patterns?

We used to just work together on code and discuss code, without focusing on the version control tooling.

Sans CI/CD tools to validate your work?

We used to validate our work before committing, in the old days.

Sans markdown?

We used to be able to read and write text without non-sense formatting, HTML was even a thing.

Sans proprietary note taking digital tools (Obsidian, Notion)?

We used to take notes on paper or in our own text editors in the past and format our notes in "raw" HTML.

Sans LLM for coding?

We used to reason about code and go read a programming language book or ask for help from colleagues in case of doubt.

Sans daily upgrades and ads and other modern web crap?

We used to have nice experience with computers.

In a world that used to be simple, what other "sans" would you can think of?

The art of crafting and loving your own tools

I have learned one good lesson from tasting someone's else food, it's never salty enough and I always miss the good drink pairing or something else is missing. And I'll feel bad for making any critique or special request.

I have a similar feeling about apps, tools and platforms I don't maintain. Sure i can help fixing them with requests that will likely be forgotten in their backlog. Or I can pick an alternative product which will unfortunately lack features from the former or will have their own ux issues, bugs, weirdness...

In the end I'll flavor ones that focus on simplicity and which provide good documentation and support for data import/export and customizations through their API or through plugins and scripting.

Miniflux, Shaarli, Obsidian, Dropbox, Cloudron....are those kinds of apps and platforms I use that do a thing well yet I have customized to my taste, e.g of such personalizations:

  • Dropbox is automatically organized based on custom rules, all orchestrated through cron jobs.
  • Bookmarks in Shaarli are tagged automatically thanks to a plugin I've made available in my shaarli_plugins Git repository.
  • My apps hosted in Cloudron are restarted automatically on schedule if they stop responding, thanks to some cron jobs and Cloudron's API.
  • Music I download on-the-go from my mobile phone through Seeker (Soulseek client) is synced automatically to my storage and visible in my Navidrome and Subsonic clients; so I do not need Spotify. It is also orchestrated via cron jobs, using rsync and syncthing.
  • Notes I take on my Obsidian at work and at home are synced automatically thanks to Syncthing an Git on my personal Gitea server.
  • Miniflux is the tool I've extended the most as I've blogged in Reading RSS in peace with a few Miniflux Hacks, e.g:
    • organize the feed categories in Miniflux.
    • group items by author.
    • show stats about each feed.
    • highlight links I've already bookmarked in Shaarli.
    • add one-click buttons Add to Shaarli / Follow in Miniflux next to each link mentioned in those articles depending if it's some RSS feed or a random link I might want to bookmark in Shaarli.
    • Some of those recipes are available in my repo.
  • Email attachments related to our financial activity are archived in our Dropbox and renamed automatically based on their content, using OCR. The whole thing simplifies communication with our accountant and their software.
  • My monthly invoices are generated automatically from InvoiceNinja and I'm looking at a solution using only Python.
  • I'm also making my own RSS feeds from sources that lack one like https://indieblog.page/all and https://www.journee-mondiale.com/les-journees-mondiales.htm, I've shared the source code for indieblog and for journee-mondiale, both are orchestrated via cron jobs.
  • I keep building more, I'm working on my own tools to supplement or replace InvoiceNinja, Shaarli, Wallabag, Obsidian and Miniflux. The fewer apps I rely on, the more focused I become.

Relying on my own recipes, scheduling things though cron jobs and building my own platform saves me costs, improve my computer experience and make me more efficient about problem solving.

It also likely make me a bit lazier and annoying.

You can be more efficient too, and I can help if you like!

Contact me to learn how to master of your digital life.

Contabo is cheap for reasons

TLDR: In December 2023 I picked this low-cost VPS provider. I do not recommend them, and I hope this writing will save people from wasting any time or money on Contabo.

They claimed "German Quality, Always". It's neither good quality, neither always.

For the most part, from December 2023 to September 2024, I could almost live without caring too much about managing my server, whose setup is mostly delegated to Cloudron. And I had no problem using Cloudron for my web apps on this cheap VPS; my Cloudron backups were also configured in Cloudron to use Contabo Object Storage. No problem on the surface. Until Murphy's law enter the game:

  • An outage in September 2024 broke availability in Nuremberg Data center and so my backups and my Cloudron instance were unavailable. I entered panic mode because there was nothing I could see or do. Contabo offered no support because their customer portal was impacted as well and no fail-over mechanism had been put in place. That tells a lot. Fortunately this was solved after a few days.
  • Quickly after this outage resolution, I noticed too that rclone and Cloudron backups were acting weird, mostly due to the slowness or rate limiting of Contabo Object storage API. I couldn't find an explanation so I just contacted Contabo support, which fixed my problem without saying much, sadly.
  • Few weeks later still in September 2024, my DNS config on my VPS starts to cause issues, but only to the light of problems encountered in WordPress, Miniflux and Changedetection. All those issues exploded to my face in the form of timeouts or unreachable URLs. Fortunately I found this write up https://www.thomasmartens.eu/contabo-dns-lookup-timeouts/ and could just fix my default NetPlan configuration and switched from Contabo DNS to 1.1.1.1 (CloudFlare) and 9.9.9.9 (Quad9).
  • I noticed too that my object storage space was filling up constantly, causing me some anxiety. And I couldn't clean anything. The backup cleanups were also silently frequently in Cloudron as a result. In the end I couldn't find the root cause but switching to Hetzner storage instead of Contabo Object Storage fixed and made the whole process faster.

Unfortunately I went through those issues. But I could have avoided them. When one have to pick a product or service, it's better to do more research and ask around for advice.

Use ChatGPT to be brutally honest when giving you advice and saving you money and pain.

Or just visit forums and communities like Reddit;

Lessons learned

  • Some products and services are cheap for reasons: quality for free is often a scam.
  • I should have checked internet before. Be more picky, check the community forums and reviews. Avoid unneeded pain.
  • Do not put all your eggs in the same basket, i.e pick different locations and providers for your compute and data.
  • Monitor the health of your backups and storage location.
  • Plan for disaster.

Specs comparison

If you ever need to battle test your VPS, have a look at some of those VPS benchmarking scripts: https://monovm.com/blog/vps-benchmark-tools/.

I've picked the first from the list, namely bench.sh https://github.com/haydenjames/bench-scripts/blob/master/README.md#benchsh in order to compare the specs of my Gitea runner running on Hetzner vs my main Cloudron instance running at Contabo.

Here are the specs and price on paper:

Contabo VPS M SSD https://www.vpsbenchmarks.com/hosters/contabo/plans/m-ssd (deprecated plan)

  • CPU 6 cores
  • Memory 16 GB
  • Disk 600 GB (100% SSD)
  • Port 400 Mbit/s
  • Price €11.25 / month

Hetzner - CX32 https://www.vpsbenchmarks.com/hosters/hetzner/plans/cx32 (still available on Nov 13, 2024).

Both are in the same region. The amount of CPU and disk space vary, but overall there is a clear winner about performance.

-------------------- A Bench.sh Script By Teddysun -------------------
 Version            : v2024-11-11
 Usage              : wget -qO- bench.sh | bash
----------------------------------------------------------------------
 CPU Model          : AMD EPYC Processor (with IBPB)
 CPU Cores          : 6 @ 2799.996 MHz
 CPU Cache          : 512 KB
 AES-NI             : ✓ Enabled
 VM-x/AMD-V         : ✗ Disabled
 Total Disk         : 593.5 GB (53.7 GB Used)
 Total Mem          : 15.6 GB (4.9 GB Used)
 Total Swap         : 4.0 GB (268.2 MB Used)
 System uptime      : 6 days, 17 hour 31 min
 Load average       : 0.67, 0.85, 1.09
 OS                 : Ubuntu 22.04.3 LTS
 Arch               : x86_64 (64 Bit)
 Kernel             : 5.15.0-124-generic
 TCP CC             : cubic
 Virtualization     : Dedicated
 IPv4/IPv6          : ✓ Online / ✗ Offline
 Organization       : AS51167 Contabo GmbH
 Location           : Nürnberg / DE
 Region             : Bavaria
----------------------------------------------------------------------
 I/O Speed(1st run) : 131 MB/s
 I/O Speed(2nd run) : 98.0 MB/s
 I/O Speed(3rd run) : 94.4 MB/s
 I/O Speed(average) : 107.8 MB/s
----------------------------------------------------------------------
 Node Name        Upload Speed      Download Speed      Latency     
 Speedtest.net    399.41 Mbps       399.48 Mbps         11.37 ms    
 Los Angeles, US  378.05 Mbps       401.30 Mbps         155.48 ms   
 Dallas, US       390.21 Mbps       402.25 Mbps         127.98 ms   
 Montreal, CA     44.98 Mbps        400.75 Mbps         105.08 ms   
 Paris, FR        404.24 Mbps       397.38 Mbps         18.16 ms    
 Amsterdam, NL    392.33 Mbps       396.11 Mbps         23.08 ms    
 Beijing, CN      275.61 Mbps       410.68 Mbps         241.41 ms   
 Shanghai, CN     129.99 Mbps       362.16 Mbps         428.46 ms   
 Hong Kong, CN    224.22 Mbps       386.99 Mbps         284.37 ms   
 Singapore, SG    93.82 Mbps        362.53 Mbps         329.19 ms   
 Tokyo, JP        302.55 Mbps       393.36 Mbps         256.67 ms   
----------------------------------------------------------------------
 Finished in        : 5 min 43 sec
 Timestamp          : 2024-11-13 09:18:58 UTC
----------------------------------------------------------------------
-------------------- A Bench.sh Script By Teddysun -------------------
 Version            : v2024-11-11
 Usage              : wget -qO- bench.sh | bash
----------------------------------------------------------------------
 CPU Model          : Intel Xeon Processor (Skylake, IBRS, no TSX)
 CPU Cores          : 4 @ 2099.998 MHz
 CPU Cache          : 16384 KB
 AES-NI             : ✓ Enabled
 VM-x/AMD-V         : ✗ Disabled
 Total Disk         : 75.0 GB (3.5 GB Used)
 Total Mem          : 7.6 GB (632.2 MB Used)
 System uptime      : 39 days, 14 hour 22 min
 Load average       : 0.03, 0.02, 0.00
 OS                 : Ubuntu 24.04 LTS
 Arch               : x86_64 (64 Bit)
 Kernel             : 6.8.0-41-generic
 TCP CC             : cubic
 Virtualization     : Dedicated
 IPv4/IPv6          : ✓ Online / ✓ Online
 Organization       : AS24940 Hetzner Online GmbH
 Location           : Nürnberg / DE
 Region             : Bavaria
----------------------------------------------------------------------
 I/O Speed(1st run) : 846 MB/s
 I/O Speed(2nd run) : 795 MB/s
 I/O Speed(3rd run) : 929 MB/s
 I/O Speed(average) : 856.7 MB/s
----------------------------------------------------------------------
 Node Name        Upload Speed      Download Speed      Latency     
 Speedtest.net    2292.48 Mbps      2473.56 Mbps        0.66 ms     
 Los Angeles, US  605.99 Mbps       2986.01 Mbps        157.65 ms   
 Dallas, US       702.97 Mbps       3420.20 Mbps        128.18 ms   
 Montreal, CA     175.26 Mbps       937.60 Mbps         90.89 ms    
 Paris, FR        7119.88 Mbps      9681.24 Mbps        13.65 ms    
 Amsterdam, NL    4993.84 Mbps      7353.62 Mbps        10.41 ms    
 Beijing, CN      627.18 Mbps       2611.88 Mbps        187.03 ms   
 Shanghai, CN     1.34 Mbps         1791.62 Mbps        325.14 ms   
 Hong Kong, CN    352.36 Mbps       2526.89 Mbps        234.43 ms   
 Singapore, SG    181.44 Mbps       670.17 Mbps         194.45 ms   
 Tokyo, JP        313.71 Mbps       2686.38 Mbps        236.80 ms   
----------------------------------------------------------------------
 Finished in        : 5 min 48 sec
 Timestamp          : 2024-11-13 09:25:24 UTC
----------------------------------------------------------------------

Conclusion and what's next

I still have my main VPS at Contabo, however my storage and backups are with Hetzner, migrating to Hetzner should be a no brainer, thanks to the built-in quality of Cloudron.

I've also configured another VPS with Hetzner, with satisfaction, for running Gitea Actions, because there is no way I rely on GitHub.

So you know. Move away from them, unless for cheap, non business critical workflows where performance and reliability are not a concern.