@byxiaoxie3 周前

11/24
00:06
Home

Ubuntu 硬盘空间清理记录

小鸡硬盘只有 10G 不得不压榨了,所以快占满了记录一下清理

查询文件大小并只显示30条:
sudo du -ahx / | sort -rh | head -n 30

发现 journal 日志占用了3G
3.1G /var/log/journal/5465c535145418****

清理 journal 日志:
sudo journalctl --vacuum-size=100M // 限制日志大小(非必要)
sudo journalctl --vacuum-time=7d // 根据时间清理

清理前必须查看是否有重要的日志,因为这个是系统日志包括了 系统日志、用户日志、应用程序日志

清理 apt 缓存:
sudo apt-get clean

使用 logrotate 清理日志文件:
sudo logrotate -f /etc/logrotate.conf  //立即触发日志轮换并清理

批量清理所有日志文件 (非常不建议):
sudo find /var/log -type f -exec truncate -s 0 {} \;  // 删除所有日志内容,不删除文件

删除压缩的旧日志:
sudo find /var/log -type f -name "*.gz" -exec rm -f {} \;
sudo find /var/log -type f -name "*.1" -exec rm -f {} \;

删除超过指定时间的日志文件:
sudo find /var/log -type f -mtime +30 -exec rm -f {} \;
压榨前:
root@byxiaoxie:~# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs       47M 996K   46M   3% /run
/dev/vda2  9.9G 9.1G  224M  98% /
tmpfs      234M  20K  234M   1% /dev/shm
tmpfs      5.0M    0  5.0M   0% /run/lock
tmpfs       47M    0  47M    0% /run/user/0

压榨后:
root@byxiaoxie:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            47M  996K   46M   3% /run
/dev/vda2       9.9G  7.6G  1.8G  82% /
tmpfs           234M   40K  234M   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            47M     0   47M   0% /run/user/0

 

Ubuntu 硬盘空间清理记录

@byxiaoxie4 周前

11/15
23:40
Home

PVE 添加CPU GPU Nvme 温度显示 (AMD CPU)

PVE 添加 CPU GPU Nvme 温度显示 (AMD CPU)

1. 安装必要的软件包
apt-update && apt-get install lm-sensors -y

2. 安装完成后执行指令 [sensors]
    root@pve:~# sensors
    amdgpu-pci-0500
    Adapter: PCI adapter
    vddgfx:        1.44 V  
    vddnb:       937.00 mV 
    edge:         +50.0°C  
    PPT:          14.00 W  

    nvme-pci-0400
    Adapter: PCI adapter
    Composite:    +53.9°C  (low  =  -5.2°C, high = +79.8°C)
                        (crit = +84.8°C)

    k10temp-pci-00c3
    Adapter: PCI adapter
    Tctl:         +52.8°C

3. 下面代码的正则表达式需要按照上面的输出文本进行调整

4. 找到文件 [Nodes.pm] 路径:[/usr/share/perl5/PVE/API2]

搜索代码关键字: 
$dinfo = df('/', 1);

在它的下面添加代码:
$res->{CPUtemperature} = `sensors`;
$res->{GPUtemperature} = `sensors`;
$res->{Nvmetemperature} = `sensors`;

修改后的样子:
my $dinfo = df('/', 1);     # output is bytes
$res->{CPUtemperature} = `sensors`;
$res->{GPUtemperature} = `sensors`;
$res->{Nvmetemperature} = `sensors`;

$res->{rootfs} = {
    total => $dinfo->{blocks},
    avail => $dinfo->{bavail},
    used => $dinfo->{used},
    free => $dinfo->{blocks} - $dinfo->{used},
};

return $res;

5. 找到文件 [pvemanagerlib.js] 路径:[/usr/share/pve-manager/js]

搜索代码找到关键字 [PVE.node.StatusView]:
Ext.define('PVE.node.StatusView', {})

关键字下面找到高度:
height: 350, // 按需求增加高度 例如我自己的是:height: 450

添加温度显示代码,找到 [items] 在代码中添加:
{
    itemId: 'CPUtemperature',
    colspan: 2,
    printBar: false,
    title: gettext('CPU Temperature'),
    textField: 'CPUtemperature',
    renderer: function(value){
        const regex = /Tctl:\s+([-+]?[0-9]*\.?[0-9]+)/;
        const match = value.match(regex);
        const temperature = match ? parseFloat(match[1]) : null;
        return ` ${temperature}℃`;
    }
},
{
    itemId: 'GPUtemperature',
    colspan: 2,
    printBar: false,
    title: gettext('GPU Temperature'),
    textField: 'GPUtemperature',
    renderer: function(value){
        const regex = /edge:\s+([-+]?[0-9]*\.?[0-9]+)/;
        const match = value.match(regex);
        const temperature = match ? parseFloat(match[1]) : null;
        return ` ${temperature}℃`;
    }
},
{
    itemId: 'Nvmetemperature',
    colspan: 2,
    printBar: false,
    title: gettext('Nvme Temperature'),
    textField: 'Nvmetemperature',
    renderer: function(value){
        const nvmeTemps = Array.from(value.matchAll(/Composite.*?\+([\d\.]+)?/g), m=>m[1]);
        return nvmeTemps.map((element, index) => `${element}℃`).join(' | ');
    }
}

添加完成后重启PVE面板:
systemctl restart pveproxy

效果图

image PVE 添加CPU GPU Nvme 温度显示 (AMD CPU)

PVE 添加CPU GPU Nvme 温度显示 (AMD CPU)

@byxiaoxie1 年前

10/31
16:39
Home

修改/隐藏 Tomcat 版本号

##方法1
	在[lib]目录下创建文件夹
	org -> apache -> catalina -> util -> Serverinfo.properties
	将 [Serverinfo.properties] 里面的版本号修改掉或删除保存后运行即可

[Serverinfo.properties] 原文件内容
	# Licensed to the Apache Software Foundation (ASF) under one or more
	# contributor license agreements.  See the NOTICE file distributed with
	# this work for additional information regarding copyright ownership.
	# The ASF licenses this file to You under the Apache License, Version 2.0
	# (the "License"); you may not use this file except in compliance with
	# the License.  You may obtain a copy of the License at
	#
	#     http://www.apache.org/licenses/LICENSE-2.0
	#
	# Unless required by applicable law or agreed to in writing, software
	# distributed under the License is distributed on an "AS IS" BASIS,
	# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	# See the License for the specific language governing permissions and
	# limitations under the License.

	server.info=Apache Tomcat/8.5.93
	server.number=8.5.93.0
	server.built=Aug 23 2023 22:43:14 UTC

##方法2
	在 [lib] 找到 [catalina.jar] 使用压缩软件打开或解包也可以
	找到路径: org -> apache -> catalina -> util -> Serverinfo.properties
	和上面方法一样修改里面内容后重新打包回去 [catalina.jar] 即可

 

修改/隐藏 Tomcat 版本号

@byxiaoxie2 年前

05/15
01:13
Home

Shatterline(破碎线) B-HOP

-- Www.ByXiaoXie.Com
-- Shatterline Auto B-HOP Logitech Lua

local Start = false

function OnEvent(event, arg)
	if (IsMouseButtonPressed(5)) then
		if (Start == false) then
			PressKey("lctrl")
			Sleep(100)
			ReleaseKey("lctrl")
			for i = 0, 40 do
				PressAndReleaseKey("spacebar")
				MoveMouseRelative(100, 0)
				Sleep(1)
			end
			for i = 0, 40 do
				PressAndReleaseKey("spacebar")
				MoveMouseRelative(-100, 0)
				Sleep(1)
			end
			Start = true
		end
		repeat
			if (Start) then
				PressAndReleaseKey("spacebar")
				Sleep(20)
			end
		until not IsMouseButtonPressed(5)
		Start = false
	end
end

鼠标按键说明:按住鼠标侧键上(前进键)

BHOP使用方法:跑起来后按住鼠标侧键上(前进键) 马上松开W即可自动连跳

Shatterline(破碎线) B-HOP

@byxiaoxie2 年前

03/8
21:35
Home

Openwrt 动态DDNS f3322更新失败解决方法

修改列表文件:
	路径:/usr/share/ddns/list 
	在列表中添加一行名称为 [3322.net] 然后保存

修改Json文件:
	路径:/usr/share/ddns/default
	将原来的 [3322.org.json] 复制一份副本然后名称修改为 [3322.net.json]
	
	修改Json内容:
		[3322.org] 名称修改为 [3322.net]
		[members.3322.org] 更改为 [members.3322.net]
		
		然后保存返回Openwrt 动态DDNS 页面编辑更换 DDNS服务供应商 为 [3322.net] 即可
		
		例子:
		{
			"name": "3322.net",
			"ipv4": {
				"url": "http://[USERNAME]:[PASSWORD]@members.3322.net/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
			}
		}

QQ图片20230308213047-300x83 Openwrt 动态DDNS f3322更新失败解决方法

QQ图片20230308213047-300x83 Openwrt 动态DDNS f3322更新失败解决方法

QQ图片20230308213047-300x83 Openwrt 动态DDNS f3322更新失败解决方法

Openwrt 动态DDNS f3322更新失败解决方法

@byxiaoxie2 年前

03/6
21:38
Home

搭建 Real-ESRGAN 动漫图片修复

系统环境:Windows 10 1909  显卡:GTX 1060  CPU:I7 8700k  (测试GPU算法修复动漫图片 5s 跑完4X修复)
CUDA 下载并安装:
	Docs文档(用于查询对应版本):https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
	CUDA下载:https://developer.nvidia.com/cuda-toolkit-archive

Anaconda 下载安装:

	官方地址:https://www.anaconda.com/

	安装完成后需配置环境变量

	例子 Path:D:\Anaconda3\condabin

Anaconda 创建虚拟环境:

	conda create -n 名称 jupyter notebook cudnn

	预先安装第三方库 jupyter notebook cudnn

	cudnn 用于深度神经网络的 GPU 加速库
	jupyter notebook 交互式编辑器

	例子 conda create -n gary jupyter notebook cudnn

	切换到新的虚拟环境
	activate 名称

	例子 activate gary

	切换后可用 [conda env list] 查看是否切换成功

报错信息:
Collecting package metadata (current_repodata.json): failed

CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.

Exception: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

解决方法:
配置环境变量 Path: D:\Anaconda3\Library\bin
开始部署 Real-ESRGAN :

	Github:https://github.com/xinntao/Real-ESRGAN

	1.	先安装PyTorch 地址:https://pytorch.org/get-started/locally/
	2.	下载仓库代码 git clone https://github.com/xinntao/Real-ESRGAN.git
	3.	pip install -r requirements.txt
	4.	下载已经训练好的模型
			wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P weights
	5.	执行测试 -n 模型名称 -i 输入的目录或文件 --face_enhance 人脸修复(官方文档上提示是不建议修复动漫图片的)
			python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance
	6.	即可输出测试的动漫图片高清修复

 

搭建 Real-ESRGAN 动漫图片修复

@byxiaoxie3 年前

05/26
00:18
Home

Apex Mobile Game IP

Update Time 2022-5-27 00:06:51
#Apex Mobile Game IP (Recommend)
13.33.0.0/16
18.200.0.0/16
23.208.0.0/16
23.50.0.0/16
23.59.0.0/16
23.61.0.0/16
31.13.0.0/16
34.240.0.0/16
34.241.0.0/16
34.242.0.0/16
34.246.0.0/16
34.248.0.0/16
34.253.0.0/16
46.51.0.0/16
52.17.0.0/16
52.18.0.0/16
52.208.0.0/16
52.210.0.0/16
52.211.0.0/16
52.212.0.0/16
52.215.0.0/16
52.31.0.0/16
52.48.0.0/16
52.49.0.0/16
52.50.0.0/16
54.154.0.0/16
54.195.0.0/16
54.246.0.0/16
54.72.0.0/16
54.73.0.0/16
54.75.0.0/16
54.77.0.0/16
63.32.0.0/16
63.34.0.0/16
99.80.0.0/16
142.251.0.0/16
157.240.0.0/16
172.217.0.0/16
#Apex Mobile Game IP All
13.33.0.0/16
18.200.0.0/16
23.0.0.0/8
31.13.0.0/16
34.0.0.0/8
46.51.0.0/16
52.0.0.0/8
54.0.0.0/8
63.0.0.0/8
99.80.0.0/16
142.251.0.0/16
157.240.0.0/16
172.217.0.0/16
#Apex Mobile Game IP (Untreated)
31.13.80.0/24
34.253.94.0/24
54.73.229.0/24
52.215.44.0/24
52.208.127.0/24
52.215.121.0/24
23.61.246.0/24
52.48.13.0/24
34.246.49.0/24
54.75.232.0/24
23.61.246.0/24
54.195.100.0/24
18.202.102.0/24
54.77.35.0/24
34.248.62.0/24
34.242.254.0/24
54.72.161.0/24
52.215.31.0/24
52.49.165.0/24
23.61.246.0/24
52.211.225.0/24
52.31.59.0/24
34.241.171.0/24
63.32.154.0/24
34.240.154.0/24
54.154.147.0/24
52.18.116.0/24
46.51.203.0/24
142.251.35.0/24
31.13.92.0/24
31.13.80.0/24
34.253.104.0/24
63.34.50.0/24
34.246.221.0/24
23.208.14.0/24
18.200.69.0/24
157.240.221.0/24
99.80.87.0/24
52.50.203.0/24
23.50.129.0/24
23.50.129.0/24
63.32.161.0/24
52.212.70.0/24
52.17.172.0/24
13.33.174.0/24
23.59.247.0/24
172.217.175.0/24
52.210.182.0/24
54.246.126.0/24
54.77.200.0/24

 

Apex Mobile Game IP

加载中……