到谷歌下载代码库:
https://developers.google.com/speed/webp/download
点击“下载代码库”,进入:
https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html
拉到最下面找到“libwebp-x.x.x-linux-x86-64.tar.gz”字样的链接,右键复制链接地址下载,比如现在最新的是libwebp-1.6.0-linux-x86-64.tar.gz,如:
wget https://storage.googleapis....
sudo dd if=/dev/zero of=/EMPTY bs=1M status=progress || true
sudo rm -f /EMPTY
sync
dd 会把 所有空闲块写成 0,VirtualBox 才能在导出时真正丢弃这些块。
# 递归查找 .js.gz / .css.gz 比源文件老 1 分钟以上(排除 plugins)
find . \
-path "*/plugins/*" -prune -o \
\( -name "*.js.gz" -o -name "*.css.gz" \) -print0 |
while IFS= read -r -d '' gz; do
src="${gz%.gz}"
if [ -f "$src" ]; then
gz_t=$(stat -c %Y "$gz")
src_t=$(stat -c %Y "$...
mkdir -p ~/.config/systemd/user
vi ~/.config/systemd/user/tmux.service
输入以下内容:
[Unit]
Description=tmux default session
After=network.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c '/usr/bin/tmux has-session -t aaaaaaaaaaaaaaaaaaaaaaaa || /usr/bin/tmux new-session -d -s aaaaaaaaaaaaa...
1、设置静态IP
sudo vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# Th...
文件:/etc/apt/sources.list
ftp.cn.debian.org 源:
#deb cdrom:[Debian GNU/Linux 13.3.0 _Trixie_ - Official amd64 NETINST with firmware 20260110-10:59]/ trixie contrib main non-free-firmware
deb http://ftp.cn.debian.org/debian/ trixie main non-free-firmware
deb-src http://ftp.cn.debian.org/debi...
惨痛教训,文件名含有中文的时候导出操作一切正常,导入的时候就完蛋了,根本无法导入。只能重装系统重新导出备份
hostnamectl set-hostname 主机名
然后重新登录即可生效
# 查看logrotate服务状态
systemctl status logrotate
# 查看logrotate定时任务执行日志
journalctl -u logrotate
journalctl -u logrotate -f # 实时跟踪
journalctl -u logrotate --since "2026-01-01"
通过dd命令增加swap,增加一个256M的swap空间
sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
创建swap文件
sudo mkswap /swapfile
挂载
sudo swapon /swapfile
自动挂载
sudo vi /etc/fstab,加入一行
/swapfile
卸载
sudo swapoff /swapfile
查看
swapon -s
tmux source-file .tmux.conf
tmux set-option -g mouse on
vi /etc/hostname
mogrify -thumbnail 300x300^\> 图片.jpg
^:表示让短的一边长度为300,长的一边等比例的大于300
\>:表示只压缩短的一边大于300的,短的一边小于300的保留原尺寸
编辑 .bashrc
让history记录时间:
HISTTIMEFORMAT="%y-%m-%d %T "
加上这行设置后就会记录时间,但是history命令也会显示时间
如果不想看时间,可以设置一个alias,用sed替换为空:
alias h='history | sed "s/[[:digit:]]*-[[:digit:]]*-[[:digit:]]* [[:digit:]]*:[[:digit:]]*:[[:digit:]]* //"'
这样,用 h 命令就可以显示不带时间的history了
查找当前目录下大小超过100M的文件
find . -xdev -type f -size +100M
vi /etc/network/interfaces
最下面加入两行:
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
然后运行命令:
systemctl restart resolvconf.service
systemctl restart systemd-resolved.service
再重启 /etc/resolv.conf 里 nameserver 配置就不会被清空了,自动加入了上面的两个nameserver
docker image tag old_image_name new_image_name
docker rmi old_image_name
删除所有容器:
docker rm -vf $(docker ps -aq)
删除所有镜像:
docker rmi -f $(docker images -aq)
备份到一个文件:
docker save $(docker images --format '{{.Repository}}:{{.Tag}}') -o allinone.tar
恢复到所有镜像:
docker load -i allinone.tar