debian(linux)安装webp库最简单的方法

到谷歌下载代码库: 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....
2026-01-22 20:56 | 阅读 670 次 | 评论 0 条

virtualbox导出虚拟电脑前运行以下命令,减少ova包的大小

sudo dd if=/dev/zero of=/EMPTY bs=1M status=progress || true sudo rm -f /EMPTY sync dd 会把 所有空闲块写成 0,VirtualBox 才能在导出时真正丢弃这些块。
2026-01-16 12:36 | 阅读 826 次 | 评论 0 条

清理static文件夹gz文件的常用bash shell脚本

# 递归查找 .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 "$...
2026-01-15 23:43 | 阅读 619 次 | 评论 0 条

创建用户级tmux.service服务

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...
2026-01-13 19:16 | 阅读 821 次 | 评论 0 条

debian13网络设置

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...
2026-01-12 08:53 | 阅读 844 次 | 评论 0 条

debian13中163镜像源和debian中国镜像源的sources.list

文件:/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...
2026-01-11 20:58 | 阅读 939 次 | 评论 0 条

VirtualBox导出虚拟电脑的时候文件名千万不要含有中文

惨痛教训,文件名含有中文的时候导出操作一切正常,导入的时候就完蛋了,根本无法导入。只能重装系统重新导出备份
2026-01-11 18:50 | 阅读 126 次 | 评论 0 条

Linux(Debian)设置主机名

hostnamectl set-hostname 主机名 然后重新登录即可生效
2025-12-29 15:43 | 阅读 1234 次 | 评论 0 条

查看logrotate的执行日志

# 查看logrotate服务状态 systemctl status logrotate # 查看logrotate定时任务执行日志 journalctl -u logrotate journalctl -u logrotate -f # 实时跟踪 journalctl -u logrotate --since "2026-01-01"
2025-12-26 20:55 | 阅读 1321 次 | 评论 0 条

Linux环境下swap配置方法

通过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
2023-07-19 16:22 | 阅读 1414 次 | 评论 0 条

tmux应用配置文件

tmux source-file .tmux.conf
2023-06-24 23:12 | 阅读 1062 次 | 评论 0 条

tmux开启鼠标拖动等操作

tmux set-option -g mouse on
2023-06-20 14:48 | 阅读 1111 次 | 评论 0 条

linux修改hostname

vi /etc/hostname
2023-03-02 23:22 | 阅读 1007 次 | 评论 0 条

ImageMagick生成缩略图[适配短边+只缩小不放大]

mogrify -thumbnail 300x300^\> 图片.jpg ^:表示让短的一边长度为300,长的一边等比例的大于300 \>:表示只压缩短的一边大于300的,短的一边小于300的保留原尺寸
2022-12-06 17:09 | 阅读 1633 次 | 评论 0 条

[linux]history记录时间而不显示时间

编辑 .bashrc 让history记录时间: HISTTIMEFORMAT="%y-%m-%d %T " 加上这行设置后就会记录时间,但是history命令也会显示时间 如果不想看时间,可以设置一个alias,用sed替换为空: alias h='history | sed "s/[[:digit:]]*-[[:digit:]]*-[[:digit:]]* [[:digit:]]*:[[:digit:]]*:[[:digit:]]* //"' 这样,用 h 命令就可以显示不带时间的history了
2022-11-23 21:53 | 阅读 1849 次 | 评论 0 条

使用find命令查找大文件

查找当前目录下大小超过100M的文件 find . -xdev -type f -size +100M
2022-11-23 13:06 | 阅读 1532 次 | 评论 0 条

debian11永久设置dns nameserver

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
2022-11-22 17:21 | 阅读 1937 次 | 评论 0 条

docker image(镜像)改名

docker image tag old_image_name new_image_name docker rmi old_image_name
2022-11-22 02:03 | 阅读 968 次 | 评论 0 条

docker删除所有容器和镜像

删除所有容器: docker rm -vf $(docker ps -aq) 删除所有镜像: docker rmi -f $(docker images -aq)
2022-11-22 00:34 | 阅读 1406 次 | 评论 0 条

docker把所有的镜像备份到一个文件

备份到一个文件: docker save $(docker images --format '{{.Repository}}:{{.Tag}}') -o allinone.tar 恢复到所有镜像: docker load -i allinone.tar
2022-11-21 21:38 | 阅读 1099 次 | 评论 0 条
浏览3064424次
文章归档
最新评论
  • 静夜思:感受ai的强大魔力吧👍
  • 静夜思:-1是多核