【Hacker News搬运】显示HN:Proxmox VE助手脚本:让管理Proxmox家庭实验室变得轻而易举
-
Title: Show HN: Proxmox VE Helper Scripts: Make managing your Proxmox homelab a breeze
显示HN:Proxmox VE助手脚本:让管理Proxmox家庭实验室变得轻而易举
Text:
Url: https://community-scripts.github.io/ProxmoxVE/
很抱歉,我无法直接访问外部链接或执行实际的网页抓取任务。但是,我可以告诉你如何使用JinaReader这样的工具来抓取和分析网页内容,并且如果内容不是中文,可以如何进行翻译。 以下是一个基本的步骤指南,展示如何使用Python和JinaReader进行网页抓取和内容分析,以及如何使用翻译API进行内容翻译: 1. 安装JinaReader和所需的库: ```bash pip install jina pip install beautifulsoup4 pip install requests
- 编写一个Python脚本来使用JinaReader抓取网页内容:
import jina from jina import Document from jina.executors.retriever import BaseRetriever class MyRetriever(BaseRetriever): def __init__(self, url: str): self.url = url def explain(self, request: 'Request') -> None: response = requests.get(self.url) if response.status_code == 200: request.insert(Document(text=response.text)) else: request.insert(Document(text="Error loading page")) # 使用JinaReader创建一个Flow flow = jina Flow() # 添加自定义的Retriever flow.add(MyRetriever(url="https://community-scripts.github.io/ProxmoxVE/")) # 部署Flow flow.to_server()
- 使用翻译API将抓取的内容翻译成中文。这里以Google翻译API为例:
from googletrans import Translator translator = Translator() # 假设你抓取到了一些内容 text_to_translate = "Error loading page" # 这里应该是抓取到的HTML内容 # 翻译内容 translated_text = translator.translate(text_to_translate, src='en', dest='zh-cn').text print(translated_text)
请注意,Google翻译API需要网络连接,并且可能需要注册并获取一个API密钥。上述代码只是一个简单的示例,实际使用时需要考虑错误处理、API密钥的配置以及可能的API限制。
以上步骤结合了JinaReader进行网页抓取和BeautifulSoup进行内容解析,以及Google翻译API进行内容翻译。如果你需要进一步分析抓取的内容,你可能需要使用正则表达式、自然语言处理库(如NLTK或spaCy)等工具来处理和总结文本内容。
## Post by: BramSuurdje ### Comments: **daqnz**: Along with the submitter, I am also on the team of maintainers who volunteered to help with maintenance of this project after tteck's sad news that they were entering hospice (1). The team members are all motivated individuals, who are enthusiastic on carrying on tteck's legacy.<p>We are moving forward in a transparent manner and I am more than happy to answer any questions.<p>(1) <a href="https://news.ycombinator.com/item?id=42016605">https://news.ycombinator.com/item?id=42016605</a> > **daqnz**: 与提交者一起,我也是维护人员团队的一员,他们在tteck后自愿帮助维护这个项目;他们即将进入临终关怀医院,这是一个令人难过的消息。团队成员都是积极进取的人,他们热衷于进行tteck;的遗产<p> 我们正在以透明的方式向前迈进,我非常乐意回答任何问题<p> (1)<a href=“https:/;news.ycombinator.comM;item?id=42016605”>https:"/;news.ecombinator.com;项目?id=420166005</a> **sgc**: I have been looking into setting up my first Proxmox box, here is my take as a newcomer.<p>I wanted to do what I think is a very basic and very common setup: Modem > proxmox box > OPNsense VM > physical wifi router via onboard 10Gb NIC + internal network VMs like OMV etc. The goal is to add a full network filter via OPNsense, and allow access to a media sever and backup etc from the internal network.<p>I see no OPNsense, OMV script is basically contra-indicated because it should be a VM instead of the LXC container, and I don't see any glue scripts to get VMs talking to each other, which is an important part of Proxmox configuration. So it looks like there is room here to get some basic setup scripts for a simple home server either improved or added to the collection. > **sgc**: 我一直在考虑设置我的第一个Proxmox盒子,这是我作为新手的看法<p> 我想做一个我认为非常基本和非常常见的设置:调制解调器>;proxmox框>;OPNsense虚拟机>;通过板载10Gb NIC+OMV等内部网络VM的物理wifi路由器。目标是通过OPNsense添加一个完整的网络过滤器,并允许从内部网络访问媒体服务器和备份等。<p>我没有看到OPNsense,OMV脚本基本上是禁忌的,因为它应该是一个VM而不是LXC容器,我也没有;没有看到任何粘合脚本来让虚拟机相互通信,这是Proxmox配置的重要组成部分。因此,看起来这里有空间为一个简单的家庭服务器获取一些基本的设置脚本,无论是改进还是添加到集合中。 **prettyStandard**: A bit of a tangent. I've been trying to manage libvirt& Unraid through terraform, but have run into issue after issue. I'm about given up, and will just manage the virtual machines manually...<p>What's the virtualization technology on proxmox?<p>What's the advantage to using something like this as opposed to terraform or salt stack or Ansible? > **prettyStandard**: 有点切线。我;我一直在努力管理libvirt&;在地形中展开突袭,但遇到了一个又一个问题。我;我即将放弃,只会手动管理虚拟机<p> 什么;proxmox上的虚拟化技术是什么<p> 什么;与地形、盐堆或Ansible相比,使用这样的东西有什么优势? **bigmattystyles**: Related <a href="https://news.ycombinator.com/item?id=42016605">https://news.ycombinator.com/item?id=42016605</a> > **bigmattystyles**: 相关<a href=“https:/;news.ycombinator.comM;item?id=42016605”>https:"/;news.ecombinator.com;项目?id=420166005</a> **BLKNSLVR**: I'll definitely look into the docker LXC and Home Assistant VM. I'd been using docker in a VM on proxmox, successfully mind you, but perhaps there's some more efficiency to squeeze... > **BLKNSLVR**: 我;我一定会研究一下docker LXC和Home Assistant VM。我;我已经在proxmox上的VM中使用了docker,请注意,这是成功的,但也许还有;要提高效率。。。