2024年7月

def increment_ipv6(ipv6):
    parts = ipv6.split(':')
    for i in range(len(parts) - 1, -1, -1):
        if parts[i] == '':
            parts[i] = '0'
        parts[i] = f'{int(parts[i], 16) + 1:04x}'
        if int(parts[i], 16) <= 0xffff:
            break
        parts[i] = '0000'
    return ':'.join(parts)

def generate_sequential_ipv6(start_ipv6, count):
    current_ipv6 = start_ipv6
    for _ in range(count):
        yield current_ipv6
        current_ipv6 = increment_ipv6(current_ipv6)

# 从指定的IPv6地址开始生成10个顺序IPv6地址,并将其保存在一个txt文件里
start_ipv6 = '2001:f8c0:56f2:2e13:0000:0000:0000:0001'
count = 10

with open('ipv6_addresses.txt', 'w') as file:
    for ipv6 in generate_sequential_ipv6(start_ipv6, count):
        file.write(ipv6 + '\n')

print("The IPv6 addresses have been successfully saved to ipv6_addresses.txt")

docker安装的哪吒面板服务端搬家特别简单,找到/opt/nezha/路径下dashboard文件夹直接打包放到新服务器下相同路径即可
新服务器需要先拉取哪吒面板的镜像,否则opt里没有nezha文件夹
切换到dashboard文件夹:cd /opt/nezha/dashboard

最后运行 docker-compose up

首先设置hostname,根据实际情况自行修改,我这里设置为freenn

hostnamectl set-hostname freenn

修改/etc/hosts,添加如下内容

127.0.0.1 localhost.localdomain localhost
8.8.8.8 freenn.proxmox.com freenn

8.8.8.8为你服务器公网IP,请自行修改
如果你的hostname设置为freenn,那么必须设置域名为freenn.proxmox.com,同理如果hostname设置为test,则域名为test.proxmox.com

如果是安装pve8,且版本为bookworm,则添加如下源

echo "deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm port">/etc/apt/sources.list.d/pveport.list

如果是安装pve7,且系统版本为debian11,则添加如下源

echo "deb https://mirrors.apqa.cn/proxmox/debian/pve bullseye port">/etc/apt/sources.list.d/pveport.list

添加apt-key

curl https://mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg

安装Proxmox VE
使用正确的path

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

安装Proxmox VE

apt update && apt install -y proxmox-ve