904666888 发布的文章 - 第 3 页 - This-PC
首页
文章归档
Search
1
在VPS上安装飞牛OS
49 阅读
2
VPS初始设置
21 阅读
3
Linux使用群晖的ABB套件进行整机备份
19 阅读
4
Windows10没有休眠选项解决办法
17 阅读
5
Python读取其他程序回显
14 阅读
系统相关
Windows
Linux
虚拟化NAS
群晖
PVE
VMware
飞牛
编程相关
Python
Docker
登录
找到
15
篇与
904666888
相关的结果
- 第 3 页
2025-01-24
Python-IP归属地查询
百度API API:https://opendata.baidu.com/api.php?query=113.89.235.182&co=&resource_id=6006&oe=utf8 API1:https://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8&query=113.89.235.182 响应json: { "status": "0", "t": "", "set_cache_time": "", "data": [ { "ExtendedLocation": "", "OriginQuery": "113.89.235.182", "appinfo": "", "disp_type": 0, "fetchkey": "113.89.235.182", "location": "广东省深圳市 电信", "origip": "113.89.235.182", "origipquery": "113.89.235.182", "resourceid": "6006", "role_id": 0, "shareImage": 1, "showLikeShare": 1, "showlamp": "1", "titlecont": "IP地址查询", "tplt": "ip" } ] }本地数据库 Ip2region GitHub地址 官方示例 # Copyright 2022 The Ip2Region Authors. All rights reserved. # Use of this source code is governed by a Apache2.0-style # license that can be found in the LICENSE file. # from xdbSearcher import XdbSearcher def searchWithFile(): # 1. 创建查询对象 dbPath = "../../data/ip2region.xdb" searcher = XdbSearcher(dbfile=dbPath) # 2. 执行查询 ip = "1.2.3.4" region_str = searcher.searchByIPStr(ip) print(region_str) # 3. 关闭searcher searcher.close() def searchWithVectorIndex(): # 1. 预先加载整个 xdb dbPath = "../../data/ip2region.xdb" vi = XdbSearcher.loadVectorIndexFromFile(dbfile=dbPath) # 2. 使用上面的缓存创建查询对象, 同时也要加载 xdb 文件 searcher = XdbSearcher(dbfile=dbPath, vectorIndex=vi) # 3. 执行查询 ip = "1.2.3.4" region_str = searcher.search(ip) print(region_str) # 4. 关闭searcher searcher.close() def searchWithContent(): # 1. 预先加载整个 xdb dbPath = "../../data/ip2region.xdb"; cb = XdbSearcher.loadContentFromFile(dbfile=dbPath) # 2. 仅需要使用上面的全文件缓存创建查询对象, 不需要传源 xdb 文件 searcher = XdbSearcher(contentBuff=cb) # 3. 执行查询 ip = "1.2.3.4" region_str = searcher.search(ip) print(region_str) # 4. 关闭searcher searcher.close() if __name__ == '__main__': searchWithContent()
系统相关
Python
编程相关
# Python
# API
904666888
1月24日
0
9
0
2025-01-24
Python读取其他程序回显
Python内置模块 subprocess模块不再赘述 第三方模块 plumbum 模块文档 示例 # -*- coding: utf-8 -*- from plumbum import local p = local[r'lol.exe'] process = p.popen() stdout, stderr = process.communicate() stdout = stdout.decode('gbk') if "失败" in stdout: print("失败") else: print("成功")plumbum.png图片
Python
编程相关
# Python
904666888
1月24日
0
14
0
2025-01-21
Linux使用zip
安装ZIP apt install zip -y压缩 zip -r filename.zip ./*-r 选项是指递归地 (recursively) 压缩指定目录 (./ 当前目录) 中的所有文件和文件夹 zip -r filename.zip file1 file2 file3 /path 把 file1、file2、 file3、以及 /path 目录的内容 (假设这个目录存在) 压缩起来,然后放入 filename.zip 文件中 options 参数选项: -r:递归压缩目录及其子目录中的所有文件。 -e:为压缩文件设置密码保护。 -q:静默模式,不显示压缩过程。 -v:显示详细的压缩过程。 -x:排除某些文件或目录,不进行压缩。 -m:压缩后删除原始文件。 -0 到 -9:指定压缩级别,-0 表示存储不压缩,-9 表示最高压缩率,默认是 -6。 -d: 删除zip压缩包里的文件 zip -d filename.zip file.txt-m: 向zip压缩包里添加文件 zip -m filename.zip ./file.txt解压缩 unzip命令 unzip -o -d /path filename.zip-o: 不提示的情况下覆盖文件; -d: -d /path 指明将文件解压缩到/path目录下; 如果不指定则解压缩到当前目录下
系统相关
# Linux
904666888
1月21日
0
13
0
2025-01-21
Linux使用群晖的ABB套件进行整机备份
下载ABB agent for Linux deb下载地址>>>适用于Ubuntu 和 Debian 发行版 rpm下载地址>>>适用于CentOS、RHEL 和 Fedora 发行版 安装agent 解压出压缩包里的install.run 上传到Linux系统 chmod +x install.run sh install.run安装完成后按照提示 abb-cli -c输入服务器 账号 密码 如果提示证书错误按Y 群晖官方说明 群晖操作 打开Active Backup for Business套件>>>物理服务器>>>Linux更新代理: 可以通过直接在设备上安装较新的安装程序来更新代理。在 Active Backup for Business 控制台中可以远程批量更新多个 Linux 物理服务器上的代理。 卸载代理: 在卸载快照驱动程序之前,您需要先卸载备份服务。根据设备上安装程序的文件类型,按照以下步骤操作。 对于deb安装程序: 输入以下命令以卸载备份服务。 apt remove synology-active-backup-business-linux-service输入以下命令以卸载驱动程序。 apt remove synosnap对于rpm安装程序: 输入以下命令以卸载备份服务。 yum remove synology-active-backup-business-linux-service输入以下命令以卸载驱动程序。 yum remove synosnap更新代理: 可以通过直接在设备上安装较新的安装程序来更新代理。在 Active Backup for Business 控制台中可以远程批量更新多个 Linux 物理服务器上的代理。 abb-cli参数 -c 示例:abb-cli -c [连接选项] 连接到 Synology NAS。 -r 示例:abb-cli -r [连接选项] 重新连接到 Synology NAS 或编辑连接。 -l 示例:abb-cli -l [连接选项] 断开与 Synology NAS 的连接。您必须具有软件包管理器权限才能将设备从服务器断开连接。 -s 示例:abb-cli -s [连接选项] 显示备份服务和设备与 Synology NAS 之间连接的最新状态。恢复门户的链接也将可用。 -h 示例:abb-cli -h 查看可用的控制选项。 -v 示例:abb-cli -v 检查代理的当前版本。 -q 示例:abb-cli -q 更改通知设置,仅发送提示和错误通知。 输入命令 abb-cli -s。您将看到当前连接状态、登录账户、备份目的地、上次备份时间和下次备份时间。 恢复备份 使用Active Backup for Business Portal进行指定文件恢复 整机恢复请使用官方恢复引导工具
虚拟化NAS
群晖
# NAS
# 群晖
# Synology
904666888
1月21日
0
19
0
2025-01-21
VPS初始设置
SSH软件推荐Finalshell和WindTerm 新手最好用FinalShell ,熟悉了再用 WindTerm 1:DD一个原版系统 DD系统有可能造成VPS以后升级硬盘容量不显示 DD脚本 GitHub wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh使用方法 bash InstallNET.sh -debian 12 --nomemcheck -mirror "http://mirrors.ustc.edu.cn/debian/" -pwd 'password'默认密码 LeitboGi0ro 旧的DD脚本 #更新系统 #Debian/Ubuntu: apt-get update #RedHat/CentOS: yum update #安装依赖 #Debian/Ubuntu: apt-get install -y xz-utils openssl gawk file #RedHat/CentOS: yum install -y xz openssl gawk file ##DD Linux脚本 wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/installNET/master/Install.sh" && chmod +x Install.sh && ./Install.sh ls #DD Windows+Linux脚本 wget --no-check-certificate -qO InstallNET.sh 'https://sunpma.com/other/oss/InstallNET.sh' && bash InstallNET.sh -dd '[Windows DD包直链地址]'如果出现grub错误,可以尝试下面代码 mkdir /boot/grub2 && grub-mkconfig -o /boot/grub2/grub.cfg2:系统设置 安装常用软件 apt update -y && apt upgrade -y && apt dist-upgrade -y apt install wget curl sudo vim git -y修改VPS时区 timedatectl set-timezone Asia/Shanghai开启Debian11自带bbr echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf sysctl -p sysctl net.ipv4.tcp_available_congestion_control3: docker 安装docker wget -qO- get.docker.com | bash systemctl enable docker修改docker日志占用空间并开启ipv6 先获取本机IP6地址 ip -f inet6 addr show eth0 #eth0换成本机网卡进行修改,替换成上面获取的ipv6地址 cat > /etc/docker/daemon.json <<EOF { "log-driver": "json-file", "log-opts": { "max-size": "20m", "max-file": "3" }, "ipv6": true, "fixed-cidr-v6": "fd00:dead:beef:c0::/80", "experimental":true, "ip6tables":true } EOF或没有IPv6 cat > /etc/docker/daemon.json <<EOF { "log-driver":"json-file", "log-opts": {"max-size":"20m", "max-file":"3"} } EOF重启一下docker systemctl restart docker安装docker-compose curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-Linux-x86_64 > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose安装docker管理平台 portainer-ce汉化版 docker run -d --restart=always --name="portainer" -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock 6053537/portainer-ceportaier默认地址是VPS的IP:9000 3:一些常用脚本 如果想测试VPS性能,可以使用性能测试脚本 curl -L https://github.com/spiritLHLS/ecs/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh或 wget git.io/vpstest && bash vpstest常用的工具箱脚本 搭建测速平台 docker run -d -p 9898:80 -it badapple9/speedtest-x搭建完成后输入VPS的IP:9898就可以测速了 综合工具箱 wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh #综合工具箱带宝塔欢乐版 wget -N --no-check-certificate https://raw.githubusercontent.com/wxfyes/bt/master/kuaijie.sh && bash kuaijie.sh #bench wget -qO- bench.sh | bash魔改XUI bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)
系统相关
Linux
# VPS
# Linux
904666888
1月21日
0
21
0
上一页
1
2
3
易航博客