#vaultwarden backup

import subprocess
import datetime
import os

def create_encrypted_backup(password):
    # 获取当前日期和时间
    timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M')
    backup_file = f'/root/vaultwarden_{timestamp}.tar.enc'
    
    # 创建加密备份
    tar_command = f'tar -cvf - /root/vaultwarden/ | openssl enc -aes-256-cbc -e -out {backup_file} -pass pass:{password}'
    subprocess.run(tar_command, shell=True, check=True)
    
    return backup_file

def upload_to_rclone(backup_file, rclone_upload_path):
    # 使用 rclone 上传文件
    subprocess.run(["rclone", "copy", "--transfers", "5", backup_file, rclone_upload_path], check=True)

def cleanup_local_backup(backup_file):
    # 删除本地备份文件
    if os.path.exists(backup_file):
        os.remove(backup_file)

def main():
    password = '11111'  # 替换为实际的密码
    rclone_upload_path = 'download:vaultwarden加密备份/'
    
    try:
        backup_file = create_encrypted_backup(password)
        upload_to_rclone(backup_file, rclone_upload_path)
        cleanup_local_backup(backup_file)
        print("备份上传成功,本地文件删除.")
    except subprocess.CalledProcessError as e:
        print(f"发生错误: {e}")
    except Exception as e:
        print(f"发生错误:{e}")

if __name__ == "__main__":
    main()
#openssl #加密 tar

使用 AES-256-CBC 加密算法时,破解的难度非常高。AES(高级加密标准)是目前最安全的对称加密算法之一,广泛用于保护敏感数据。

加密打包
tar -cvf - /root/path/ | openssl enc -aes-256-cbc -e -out /root/1.tar.enc
而后输入密码

linux解密
openssl enc -aes-256-cbc -d -in 1.tar.enc | tar xvf -

win解密
openssl enc -aes-256-cbc -d -in 1.tar.enc -out 1.tar
基于http响应的 #Jellyfin 多入口负载机自切换

这样做的话,当某台入口服务器流量跑完或故障时,可以自己切换到其他入口。
为什么不同时多条解析?一是收费dns功能,二是怕请求源反复横跳。
代码长了,整个文件吧
jfokPlus.py
12.2 KB
列出所有 #docker 容器使用的 #具体ip

docker ps -q | xargs -n 1 -I {} bash -c 'echo -n "$(docker inspect -f "{{.Name}}" {}) "; docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" {}'

openwrt:
 docker ps -q | xargs -n1 docker inspect --format '{{.Name}} {{range .Netw
orkSettings.Networks}}{{.IPAddress}}{{end}}' | sed 's#^/##'
化妆品监管 3.3.4

化妆品监管是由国家药监局开发的官方应用,尽管界面不够精致,但信息可靠。用户可以查询化妆品的备案情况,帮助辨别产品真伪及成分是否符合标准。对于海淘或购买高端护肤品的用户来说,这款应用非常实用,能够有效避免购买到假冒伪劣产品。
链接:https://pan.quark.cn/s/12fcf8c0bc9f
卸载 #华为云 监控

整理了需要卸载这个几个组件,以下命令均需要root权限运行:

#ModemManager
systemctl |grep Modem
systemctl stop ModemManager.service
systemctl disable ModemManager.service
apt-get purge --auto-remove -y modemmanager  

#hostguard
dpkg -P hostguard
irqbalance
apt-get purge --auto-remove -y irqbalance

#polkitd
systemctl disable polkit.service
systemctl stop polkit.service

#CloudResetPwdUpdateAgent
bash /CloudrResetPwdAgent/bin/cloudResetPwdAgent.script remove
bash /CloudResetPwdUpdateAgent/bin/cloudResetPwdUpdateAgent.script remove
rm -rf /CloudrResetPwdAgent
rm -rf /CloudResetPwdUpdateAgent
Autodesk AutoCAD 2025.1.1_中文破解版本

Autodesk AutoCAD2025中文破解版是欧特克全球著名的专业计算机辅助设计软件,Autodesk AutoCAD2025破解版用于二维绘图,详细绘制,设计文档和基本三维设计,广泛应用于机械设计,工程制图,土木建筑,装饰装潢,服装加工等多个行业领域.借助AutoCAD绘图程序软件可以准确地和客户共享设计数据,体验本地DWG格式所带来的强大优势.DWG格式是业界使用最广泛的设计数据格式之一,支持演示的图形,渲染工具和绘图及三维打印功能,让您的设计将会更加出色.
https://www.123pan.com/s/A6cA-WfoJh
115网盘不改变现状 2年内必凉

前有阿里网盘祭天,背刺svip,用户苦不堪言 大量涌入115。115喜从天降,收了大量的用户钱,不扩容服务器 不优化开发,导致服务器压力巨大,开始限制api调用频率,限制用户设备数,现在又限制上传和下载,不尊重基本的用户使用体验。反向优化太逆天。
如果说阿里盘是忘记初衷,伺机敛财;115则是库库收钱,十年如一日摆烂。
2024-jetbrains全家桶 软件开发者必备工具(已激活版)

https://yun.139.com/shareweb/#/w/i/1J5C1nNH8NcMH
#CMD设置代理

在不便设置‘真全局’的代理环境(透明代理,tun模式)下,cmd永久设置代理:
setx http_proxy http://127.0.0.1:9999
setx https_proxy http://127.0.0.1:9999
爱快ipv6 #防火墙设置

近期广东电信,江苏电信开始强硬回收公网v4,需早做准备。从v4转到v6,区别于内网v4是需要nat转发出去,分配v6的设备则是全球裸奔,必须进行安全设置。目前爱快使用的是ACL规则作为简单的防火墙使用(虽然不好使 勉强能用)

*修改↓地址和端口,保存为acl.txt导入规则。第一条含义是阻止wan→lan的ipv6数据 保证安全,第二条是ipv6放行某设备的某个端口;放行优先级大于阻断,即可组合效果

id=1 enabled=yes comment= action=drop dir=forward ctdir=1 iinterface=adsl1,adsl2,adsl3,adsl4 ointerface=lan1 src_addr= dst_addr= src6_addr= dst6_addr= src6_mode=0 dst6_mode=0 src6_suffix= dst6_suffix= src6_mac= dst6_mac= protocol=any src_port= dst_port= week=1234567 time=00:00-23:59 ip_type=6

id=2 enabled=yes comment= action=accept dir=forward ctdir=0 iinterface=【wan列表】 ointerface=lan1 src_addr= dst_addr= src6_addr= dst6_addr=【设备ipv6地址】/64 src6_mode=0 dst6_mode=0 src6_suffix= dst6_suffix= src6_mac= dst6_mac= protocol=tcp src_port= dst_port=【端口列表】 week=1234567 time=00:00-23:59 ip_type=6
web表格 #Excel

import os
import subprocess

from bs4 import BeautifulSoup
import pandas as pd
from datetime import datetime
import random
import string
from selenium import webdriver
from selenium.webdriver.chrome.service import Service


def generate_random_string(length=6):
    return ''.join(random.choices(string.ascii_letters + string.digits, k=length))

try:
    subprocess.run(
        ["taskkill", "/f", "/im", "chrome.exe"],
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL,
        check=True
    )
except subprocess.CalledProcessError:
    pass

user_data_dir = os.path.join(os.environ['LOCALAPPDATA'], r"Google\Chrome\User Data")

options = webdriver.ChromeOptions()
options.add_argument(f"user-data-dir={user_data_dir}")
service = Service(executable_path=r'C:\Windows\chromedriver.exe')

driver = webdriver.Chrome(options=options, service=service)

# 打开一个网页
driver.get("https://baidu.com")

while True:
    try:
        # 提示用户按回车开始读取网页内容
        input("请访问web表格所在页面,回车开始执行:")
        div_html = driver.page_source

        # 使用 BeautifulSoup 解析 HTML
        soup = BeautifulSoup(div_html, 'html.parser')

        # 获取 title 标签内容或生成随机字符串
        title_tag = soup.title.string if soup.title else generate_random_string()
        current_date = datetime.now().strftime("%m%d")

        # 找到所有表格
        tables = soup.find_all('table')

        num_tables = len(tables)
        if num_tables == 0:
            print("未找到表格,请检查页面内容。")
            continue

        print(f"*****识别到 {num_tables} 个表格*****")

        dataframes = []
        for i, table in enumerate(tables):
            rows = []
            for row in table.find_all('tr'):
                cols = row.find_all(['td', 'th'])
                cols = [ele.text.strip() for ele in cols]
                rows.append(cols)

            # 使用 pandas 将数据转换为 DataFrame
            df = pd.DataFrame(rows[1:], columns=rows[0])
            dataframes.append(df)

            print(f"\n======================预览数据 (表格 {i + 1})===========================")
            print(df.head())

        # 用户选择需要输出的表格序号
        selection = input(f"\n请输入要输出的表格序号 (1-{num_tables}) 或 'a' 输出所有表格: ").strip().lower()

        if selection == 'a':
            for i, df in enumerate(dataframes):
                excel_path = f'{title_tag}_{current_date}_table{i + 1}.xlsx'
                df.to_excel(excel_path, index=False)
                print(f"数据已保存到 {excel_path}")
        else:
            try:
                selected_table = int(selection) - 1
                if 0 <= selected_table < num_tables:
                    excel_path = f'{title_tag}_{current_date}_table{selected_table + 1}.xlsx'
                    dataframes[selected_table].to_excel(excel_path, index=False)
                    print(f"数据已保存到 {excel_path}")
                else:
                    print("无效的table序号。")
            except ValueError:
                print("请输入有效的序号")

    except Exception as e:
        if 'target window already closed' in str(e):
            print('监听窗口已关闭..')
            exit()
        print(f"发生错误: {e}")

    # 检查是否继续
    cont = input('继续处理?(y/其他退出): ')
    if cont.strip().lower() != 'y':
        driver.quit()
        break
Back to Top