电视盒子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>

常用Github开源项目推荐

BBDown

一款命令行式哔哩哔哩下载器. Bilibili Downloader.
https://github.com/nilaoda/BBDown

iOS日历增强——中国节假日补班日历

中国节假日补班日历
https://github.com/lanceliao/china-holiday-calender

CPU单核跑分天梯图

本图收集了常见CPU型号单核跑分图,包括英特尔 酷睿(Intel Core)桌面处理器系列, 英特尔 酷睿(Intel Core)移动处理器系列和AMD 锐龙(Ryzen)处理器系列。
https://github.com/mediv01/CPU-Single-Core-Benchmark

Homebrew国内快速安装

https://github.com/ineo6/homebrew-install

Ubuntu / CentOS 磁盘根目录在线扩容 & 修改分区 inode 数量

Ubuntu 作为服务器系统使用的时候,系统盘的空间可能并不是很充裕,apt apt 着,根目录就满了。诚然,增加磁盘 / 分区并挂载是一个方案,但并不能解决所有问题(例如 apt)。同时,一些跑在云平台上的服务器并没有很好的离线操作磁盘的手段,这时候在线扩容就显得极为必要了。

数据无价!对磁盘进行任何操作前,请务必做好备份!

0. 简要操作步骤

#系统分区扩容
parted -l
fdisk -l
cfdisk

#扩容块(sda3)
lsblk
pvresize /dev/sda3
lsblk

#扩容lv和vg(Ubuntu)
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
df -h

#扩容lv和vg(CentOS)
lvextend -l +100%FREE /dev/mapper/centos-root
resize2fs /dev/mapper/centos-root
df -h

1. 磁盘根目录在线扩容

操作环境:Proxmox VE 虚拟化 / Ubuntu 22.04.5 LTS / GPT 分区表 / ext4 分区

PVE对特定容器定时重启

背景

  • 由于观测到HomeAssistant这台VM的内存占用总是随着时间的推移而增加,然后最终会OOM,且无论升级了多少个版本也是如此,推测HomeAssistant有内存泄漏问题

解决方案

  • 在虚拟机层面,对该VM进行定期重启(每天一次)
  • 登录到PVE所在的服务器
  • 执行crontab -e,并输入下面命令
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

0 12 * * * qm stop 2007 ; sleep 10 ; qm start 2007
  • 注:命令中的2007是vmid,即VM的全局唯一ID

【转】iptables持久化方案

debian若没有安装iptables,使用以下命令安装

apt-get install iptables

清除已有规则

iptables -F;iptables -X;iptables -Z

开放端口

允许本地回环接口(即运行本机访问本机) && 允许已建立的或相关连的通行

iptables -A INPUT -i lo -j ACCEPT;iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT