Hi all,

I must say: ChatGPT (or generative AI in general) is such a game changer for me doing SelfHosting.

Today, I wrote following scripts with GenAI:

  1. A bash script, that logins in all my LXC container on Proxmox, stops all currently running docker container, exports all persistent docker data to my Proxmox-Host, starts the Container again, and makes a backup via Borg. Afterwards, I get a success notification via Gotify.
  2. A python script, that uses the Portainer API to export the stack configuration of all my 10 docker environments into easy to backup .yml files ( e.g. backup-host_name-container_name.yml )
  3. A bash scripts, that checks if the defined containers are running on my docker hosts, and if not, sends a notification to Healthcheck.io
  4. Different Templates for Obsidian, e.g. Daily / Weekly / Monthly notes with Task-Management etc.

It’s really fun, as I now can find solutions to more complex problems, with just limited program knowledge. Not perfect yet, e.g. it used the Portainer API wrong, and I had to direct it to the right direction via “error messages” and “API documentations”.Sometimes, it also say’s “it’s not possible”, but when you gave some hints (e.g. could you use pct exec instead of ssh) it gives you the right solution .

What are your experiences? Are you using GenAI for your SelfHosting and if yes - where?

My next step will be Ansible, as I had to much respect for it yet, but with some GenAI support I might get everything running …

  • No-Command9510@alien.top
    cake
    B
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Same here , I really like that it give you kind of direction in scripting how something could be done. It helped me to write a python script which listens for incoming mails and triggering commands based on subject. Without chatgpt i would have spend days to figure out how to do it. Sure the example code isn’t perfect , but good enough as template

    • operator207@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I had gotten stuck on some code, and had someone ask me if I had asked ChatGPT to write a python script to do some BLE stuff in Win11. So we got on a call, and started asking ChatGPT.

      It wrote the python code… for linux. Then decided to dump some WinRT stuff in there to …make it more windows like? Not sure what it was doing, it wasn’t for ble, or GATT. We went through a few times trying to explain that we didn’t want anything with linux and it needed to run in Win11.

      It told us to install wsl, install python, and run its script through wsl. Ya, that won’t work for the environment this is running in. So I spent an hour, searched a bit for the one bit of python code I was getting stuck on, and finished the script. Works for what I need it to do. Doesn’t require wsl, and runs in python, along with being converted to an exe that runs on the systems I need it to run on.

      Having said all that, it DID do a good job on a powershell script I needed it for a few days later. I think it got hung up in some logic loop thinking that you HAD to have linux somewhere to even do anything with python.

      • blindsight@beehaw.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Probably should have started over with a new chat, priming it with some simple windows scripting in python.

        That might have worked, anyway.

      • bonelifer@alien.topB
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        This is where I learned to create new session. Take the prompts that got somewhere. Made sure to clearly tell it what I didn’t want in the first prompt. Also switch between Bard and ChatGPT.