Appreciation post: ChatGPT and co. - the best thing that happened to SelfHosting? reddit / selfhosted ---------------------------------------------------------------------- Simplixt · 2023-11-26 15:04 Hi all, I must day: 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](https://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 ... ---------------------------------------------------------------------- how_now_brown_cow · 2023-11-26 15:34 Just make sure you aren’t passing in external ips, ports, dns names into GPT unless you are running it locally… ---------------------------------------------------------------------- Negimeister · 2023-11-26 15:47 It's great for creating home assistant blueprints too. Just click together an automation, feed it the YAML and ask it to make a blueprint with XY entity configurable. ---------------------------------------------------------------------- No-Command9510 · 2023-11-26 15:49 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 ---------------------------------------------------------------------- EndlessHiway · 2023-11-26 16:16 No ---------------------------------------------------------------------- ArgoPanoptes · 2023-11-26 16:16 > I now can find solutions to more complex problems, with just limited program knowledge. I would be very careful if you don't know 100% what the proposed solution does. That is why I prefer to read the Docs and follow guides or tutorials. Once you understand it, it will be easier to use than asking to an AI and hope for the best. ---------------------------------------------------------------------- Impressive-Cap1140 · 2023-11-26 16:18 Elaborate on your hate ---------------------------------------------------------------------- EndlessHiway · 2023-11-26 16:28 I don't think it is the best thing to happen to self-hosting. Hope this helps you understand. ---------------------------------------------------------------------- Simplixt · 2023-11-26 16:32 I can read and understand the code to verify it makes sense, I'm just really bad in writing ;) ---------------------------------------------------------------------- Simplixt · 2023-11-26 17:07 Yeah, "best thing" might be a little bit too much ;) However, we got some really great new apps this year that started as ChatGPT-made applications, e.g. [https://github.com/Frooodle/Stirling- PDF](https://github.com/Frooodle/Stirling-PDF) ---------------------------------------------------------------------- ybizeul · 2023-11-26 17:09 Nope. Nope and nope. It’s just too scary that an AI can make in 10s what I would craft manually with all care and love the work deserves, and that includes the bugs I’d introduce, flaws that make my scripts very personal and unique Not doing it. ---------------------------------------------------------------------- EndlessHiway · 2023-11-26 17:30 It is great for people too lazy to learn anything. ---------------------------------------------------------------------- Simplixt · 2023-11-26 17:34 It depends. Would say I learned quite a load. It reduce the barrier to write code, and instead of try & error for 1-2 days, I get the things done in 1h. As long as you don't do just copy & past, but try to understand the code, it helps a lot. ---------------------------------------------------------------------- suamai · 2023-11-26 17:57 You know what, there is a new tool around that could help with that task... 🤔 ---------------------------------------------------------------------- cr1tic · 2023-11-26 17:59 For what it's worth I am a developer who is fluent in multiple languages and I definitely agree. Even for things that I could do myself I'll often ask ChatGPT to do because at worst, it produces something a new hire would do and I'm very used to code review. At best, it introduces me to new tools or ways of doing things. It feels like I've got a personal intern now. ---------------------------------------------------------------------- fernatic19 · 2023-11-26 18:04 People said the same thing when cars were invented and replacing horses for transportation. It's not about fearing something new, it's about learning to use it correctly so it benefits you. ---------------------------------------------------------------------- ybizeul · 2023-11-26 18:06 I forgot about Reddit and irony 😂 I deserve de downvotes ! ---------------------------------------------------------------------- [deleted] · 2023-11-26 18:09 [deleted] ---------------------------------------------------------------------- d-cent · 2023-11-26 18:34 Honestly that makes sense to me. It is like people who can listen or read a foreign language but can't speak it. You just aren't fully fluent in programming language yet lol ---------------------------------------------------------------------- Zeal514 · 2023-11-26 18:41 >It feels like I've got a personal intern now. Exactly this. LLMs act like great interns handling basic tasks. But they also act like amazing teachers. Like if you wanted to learn how DNS works, like all of it, from root, tld, authrotative, recursive and iterative etc. you can ask for an explainer. Than you can explain what it said to you, in your own words. This does 2 things, 1st, it forces ChatGPT to double check your answer to it's own, hopefully eliminating hallucinations (the more questions you ask the better), and 2, it enables you to explain your understanding, which helps you understand better. The thing is, ChatGPT can be wrong, but so can human beings, and I feel a lot of ppl get hung up on the fact it can be wrong. ---------------------------------------------------------------------- Alarmed-Literature25 · 2023-11-26 18:51 I don’t think people are understanding the satire haha ---------------------------------------------------------------------- sottey · 2023-11-26 18:57 Last night I needed to write a cone better no Yolanda that converted multiple opml files to a proprietary format. I told gpt about it and literally had the entire code in 30 seconds. It was nuts. ---------------------------------------------------------------------- sottey · 2023-11-26 18:58 Autocorrect. Ugh ---------------------------------------------------------------------- gmonk63 · 2023-11-26 19:41 The only issue is ChatGPT is that is shouldn't be relied upon completely. You should have some common knowledge when using it for coding etc.. I have tested it several times where the code given was wrong or suggested libraries that didn't even exist. Thats the only downfall I see. Is regardless of right or wrong it seems to display an answer because that's what it's trained to do. ---------------------------------------------------------------------- Important-Feedback28 · 2023-11-26 20:21 Yes, at the bottom of the ChatGPT page it tells you: ​ >ChatGPT can make mistakes. Consider checking important information. ---------------------------------------------------------------------- DUD3_L3B0W5KI · 2023-11-26 20:40 Should have used AI for your comment ;) ---------------------------------------------------------------------- Gabe_Isko · 2023-11-26 21:14 I find that it is much quicker for me to write all these things myself. ---------------------------------------------------------------------- ChocoDarkMatter · 2023-11-26 21:18 To add, if you take the time to make GPTs for specific subjects and just shovel in pdfs you basically have expert level references without ChatGPTs tendency to make up stuff. I’ve been testing this by combining pdfs/books into single pdf documents to maximize GPTs document restrictions . If you can find books that are relatively small in size the 20 pdf file restriction can easily be over 400 books with each book roughly 400 pages. The hardest part is finding enough books for a given subject ---------------------------------------------------------------------- Omni__Owl · 2023-11-26 22:49 Did you share the proprietary format with chatgpt...? If you did, that's potentially handing over information to a 3rd party you have no right to. I'd be very careful. OpenAI saves everything that is shared with ChatGPT. ---------------------------------------------------------------------- GenerlAce · 2023-11-26 22:50 100% agree. I have used chat gpt multiple times from simple notifications to doing stuff with if/then thoughts. Or even just a simple rclone script to make automating multiple sync easier. I love it and very thankful for it. ---------------------------------------------------------------------- sottey · 2023-11-26 23:35 I should have said custom format. Basically a specially formatted text file ---------------------------------------------------------------------- Omni__Owl · 2023-11-26 23:36 Yeah that's quite different... ---------------------------------------------------------------------- Aritra_1997 · 2023-11-26 23:51 The best thing I did with chat gpt which blew my mind was translating PHP code to python code for an API with no example for python. ---------------------------------------------------------------------- Psychological_Try559 · 2023-11-27 00:31 🤔 ---------------------------------------------------------------------- operator207 · 2023-11-27 00:40 I 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. ---------------------------------------------------------------------- zn448sk39 · 2023-11-27 00:45 3.5 or 4? ---------------------------------------------------------------------- zn448sk39 · 2023-11-27 00:47 You can opt-out: https://help.openai.com/en/articles/5722486-how-your- data-is-used-to-improve-model-performance ---------------------------------------------------------------------- Omni__Owl · 2023-11-27 00:48 Opting out does not mean it isn't processed, stored or otherwise. Too many companies have proven this. ---------------------------------------------------------------------- NoEngineering4 · 2023-11-27 03:02 I love bugging it with questions about all kinds of things, I don’t like to do the same on forums because I’d be a pest, but having someone/thing to just spam with questions is very good for my curiosity ---------------------------------------------------------------------- Charming-Molasses-22 · 2023-11-27 03:56 Same. I've written many custom bash scripts with it and just about the only thing I know about bash is that it starts with a #!/bin/sh line at the top. It's also very good at explaining things even though you have to prod it many times to give it direction otherwise it can get lost in its own cloud. ---------------------------------------------------------------------- yoganerdYVR · 2023-11-27 04:59 Use the Reddit API to write a post to r/selfhosted about all the awesome automations we have made together… ---------------------------------------------------------------------- zn448sk39 · 2023-11-27 08:11 Sure, but do you use github? ---------------------------------------------------------------------- bonelifer · 2023-11-27 08:34 ChatGPT is a lot better in this regard than Bard. It feels almost like Google rained Bard to make software up. ChatGPT more often just suggests software that is EOL, eg python2, abandoned and no longer working. Much less annoying than Bard. ---------------------------------------------------------------------- bonelifer · 2023-11-27 08:38 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. ---------------------------------------------------------------------- cmprsd · 2023-11-27 09:09 How long time did it take to do that? ---------------------------------------------------------------------- jourdan442 · 2023-11-27 10:23 Would like to see your obsidian templates ---------------------------------------------------------------------- ratcodes · 2023-11-27 12:14 against the grain opinion: once you reach a certain level, it's actually a lot slower to get gpt to generate code for you and then go through the slog of proofreading its obvious errors, and scary non- obvious ones. i gave it a try for a period of time because of the praise it was receiving for automation, but i wouldn't really trust it for non-basic code gen. great for explainers though. ---------------------------------------------------------------------- surreal3561 · 2023-11-27 12:56 None of those things you mentioned are private or secret. Pretty much the only thing that shouldn’t be passed are static credentials. ---------------------------------------------------------------------- isleepbad · 2023-11-27 13:36 It's amazing. I wrote my first app with a front-end in reactjs with the help of chat gpt. It can be wrong sometimes but if you use the correct prompts plus the documentation it can be super helpful. Especially when what you're trying to do doesn't fit into general help forums/frequently asked questions. My best example is server side events with a python fastapi backend and JavaScript frontend (when I didn't know JS but knew python well). Lots of googling and prompting to get things to play nicely together. ---------------------------------------------------------------------- maof97 · 2023-11-27 14:25 Maybe offtopic but why don’t you use the Proxmox backup feature? For me it creates a weekly backup of all my VMs and LXC container and restoring is easy-peasy. You can also make use of the Proxmox Backup Server if you have one for offsite backups (or just copy the backup archives). Also you may be interested in [Uptime Kuma](https://github.com/louislam/uptime-kuma) for easy uptime / health overview and alerting. ---------------------------------------------------------------------- Simplixt · 2023-11-27 15:16 **Proxmox Backup** I'm using Proxmox Backup Server for my local daily backups. But for external cloud backup, it's 5 GB for docker config + persistent data vs. 60GB for the complete LXC containers. So it's more convenient to just backup the data to the cloud that you really need for an emergency-restore. **Uptime Kuma** I try to minimize the number of applications that have access to the docker.socket, as this can be a high potential security risk (e.g. a malicious container update because of a hacked github account) . If I can achieve the same goal with just a simple bash script and without additional software, it's the better solution for me :) ---------------------------------------------------------------------- datumerrata · 2023-11-27 15:22 It's still usually better than getting answers off forums. I might find a forum that's 10 years old and in a different distro. So I ended up chasing package dependencies. It's better to have an environment that can be destroyed and recreated. Create tests to see if the code is working as intended. GPT is great because you can ask it to create the tests, how to get more logging, and give it error messages for solutions. So, you shouldn't rely on it, but I wouldn't rely on my coding either. ---------------------------------------------------------------------- yusufmalikul · 2023-11-27 15:54 🤔