Proxmox VE 8.0 日常维护,去掉未订阅的提示,和设置国内源——2023年12月27日更新

移除未使用的Linux内核

  • 若不存在pvekclean,请先安装
git clone https://github.com/jordanhillis/pvekclean.git
cd pvekclean
chmod +x pvekclean.sh

安装完成后执行pvekclean即可

./pvekclean.sh

日常软件更新命令:

apt update -y && apt dist-upgrade -y

更新PVE,并安装常用软件

apt-get update && apt-get install vim lrzsz unzip net-tools curl screen uuid-runtime git -y && apt dist-upgrade -y

ServerOnArm资料收集(入坑教训)

  • 最近入手了OrangePi5Plus(RK3588),纯粹是想体验一下目前的arm架构,顺便搭建一些Android虚拟机,方便进行各种实验。
  • 无奈相关资料实在太少,经过了无数的坑,勉强算走入正轨并成功运行Android虚拟机(带显卡)
  • 下面是整个过程中的一些总结性资料,未认真整理

前言——最惨痛教训

!!!请安装厂商提供的Desktop的系统,不要安装Server版本!!!

!!!请安装厂商提供的Desktop的系统,不要安装Server版本!!!

!!!请安装厂商提供的Desktop的系统,不要安装Server版本!!!

  • 因为系统版本的原因,浪费了一周的时间
  • 根本原因是Desktop的系统自带了显卡驱动,而Server版本并没有,导致显卡无法正常驱动。除非不打算用显卡了,否则必须老老实实安装Desktop版本的系统

ProxmoxVE 7.4升级到8.0,详细步骤

第一步:详细阅读官方文档

https://pve.proxmox.com/wiki/Upgrade_from_7_to_8

注意:
如果远程使用ssh连接的话,建议先使用screen命令,避免网络不稳定,操作中断导致的各种问题

第二步:升级到最新的 7.4 版本

apt update -y && apt dist-upgrade -y

sed -i_orig "s/data.status === 'Active'/true/g" /usr/share/pve-manager/js/pvemanagerlib.js
sed -i_orig "s/if (res === null || res === undefined || \!res || res/if(/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
sed -i_orig "s/.data.status.toLowerCase() !== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy

pveversion

最新的版本是 7.4.15

电视盒子TVBox takagen99版,v20230307_2315 (附最新接口地址)

开源,免费,自行配置接口,直播、点播两用,安卓设备。

takagen99版拥有全新UI外观、功能更加丰富,支持挂载WebDav和本地盘,播放器显示分辨率、网速、时间屏显等功能。
二、TVbox使用教程
首页点击“设置”,选择“配置地址”,输入”数据源地址“,开启存储权限,“确定”后选择数据源,然后就可以使用了。

使用ffmpeg批量删除音视频的片头片尾

步骤

1. 下载ffmpeg

  • 步骤略

2. 编辑Bat脚本

@echo off & setlocal enabledelayedexpansion

rem ===================需手动设置===================
rem 设定片头片尾长度,格式为 HH:mm:ss.fff
set "s1=00:01:07.0"
set "s2=00:01:30.0"
rem ================================================

for /f "tokens=1-4delims=:." %%a in ("%s2%") do (
    set /a "t2=(1%%a %% 100 *3600 + 1%%b %% 100 * 60 + 1%%c %% 100) * 1000 + 1%%d %% 1000"
)

md myvideo 2>nul
for %%i in (*.avi *.mkv *.mp4 *.flv) do (
    for /f "tokens=2-5delims=:., " %%a in ('ffmpeg -i "%%i" 2^>^&1 ^| find "Duration:"') do (
        set /a "t=(1%%a%%100*3600+1%%b%%100*60+1%%c%%100)*1000+1%%d0%%1000,t-=t2,ms=t%%1000,t/=1000"
        set /a h=t/3600,m=t%%3600/60,s=t%%60,h+=100,m+=100,s+=100,ms+=1000
        set "t=!h:~1!:!m:~1!:!s:~1!.!ms:~1!"
        ffmpeg -ss !s1! -to !t! -accurate_seek -i "%%i"  -c copy -avoid_negative_ts 1 "myvideo\%%i" -y
    )
)
pause

gitlab-ci-yml配置说明(官方文档翻译)

重要的内置变量

CI_COMMIT_REF_NAME: The branch or tag name for which project is built.
CI_CONFIG_PATH: The path to the CI/CD configuration file. Defaults to .gitlab-ci.yml. Read-only inside a running pipeline.
CI_PROJECT_PATH: The project namespace with the project name included.
CI_BUILDS_DIR: The top-level directory where builds are executed.
CI_PROJECT_DIR: The full path the repository is cloned to, and where the job runs from. If the GitLab Runner builds_dir parameter is set, this variable is set relative to the value of builds_dir. For more information, see the Advanced GitLab Runner configuration.

logback 自定义添加 logstash 字段

步骤

如果想在输出的JSON中,加上自定义字段,需要配置arguments参数

<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
        <providers>
            <pattern>
                <pattern>
                    {
                    "timestamp": "%date{\"yyyy-MM-dd HH:mm:ss\"}",
                    "log_level": "%level",
                    "class_name": "%class",
                    "thread": "%thread",
                    "message": "%message",
                    "stack_trace": "%exception{5}"
                    }
                </pattern>
            </pattern>
            <arguments/>
        </providers>
    </encoder>