小工具集合

Reference https://ffmpeg.org/documentation.html Usage flac to mp3 ffmpeg -i input.flac -ab 320k -map_metadata 0 -id3v2_version 3 output.mp3 ffplay https://www.jianshu.com/p/c7c6871a8b7c https://www.jianshu.com/p/fd3c6d02a625 VLC VLC 命令行播放音乐 参考 https://wiki.videolan.org/Console/ ✗ vlc -I rc VLC media player 3.0.16 Vetinari (revision 3.0.16-0-g5e70837d8d) [00007fe29244ebe0] main playlist: playlist is empty [00007fe292712650] [cli] lua interface: Listening on host "*console". VLC media player 3.0.16 Vetinari Command Line Interface initialized. Type `help' for help. > help +----[ CLI commands ] | add XYZ . . . . . . . . . . . . . . . . . . . . add XYZ to playlist | enqueue XYZ . . . . . . . . . . . . . . . . . queue XYZ to playlist | playlist . . . . . . . . . . . . . show items currently in playlist | search [string] . . search for items in playlist (or reset search) | delete [X] . . . . . . . . . . . . . . . . delete item X in playlist | move [X][Y] . . . . . . . . . . . . move item X in playlist after Y | sort key . . . . . . . . . . . . . . . . . . . . . sort the playlist | sd [sd] . . . . . . . . . . . . . show services discovery or toggle | play . . . . . . . . . . . . . . . . . . . . . . . . . . play stream | stop . . . . . . . . . . . . . . . . . . . . . . . . . . stop stream | next . . . . . . . . . . . . . . . . . . . . . . next playlist item | prev . . . . . . . . . . . . . . . . . . . . previous playlist item | goto, gotoitem . . . . . . . . . . . . . . . . . goto item at index | repeat [on|off] . . . . . . . . . . . . . . toggle playlist repeat | loop [on|off] . . . . . . . . . . . . . . . . toggle playlist loop | random [on|off] . . . . . . . . . . . . . . toggle playlist random | clear . . . . . . . . . . . . . . . . . . . . . clear the playlist | status . . . . . . . . . . . . . . . . . . . current playlist status | title [X] . . . . . . . . . . . . . . set/get title in current item | title_n . . . . . . . . . . . . . . . . next title in current item | title_p . . . . . . . . . . . . . . previous title in current item | chapter [X] . . . . . . . . . . . . set/get chapter in current item | chapter_n . . . . . . . . . . . . . . next chapter in current item | chapter_p . . . . . . . . . . . . previous chapter in current item | | seek X . . . . . . . . . . . seek in seconds, for instance `seek 12' | pause . . . . . . . . . . . . . . . . . . . . . . . . toggle pause | fastforward . . . . . . . . . . . . . . . . . . set to maximum rate | rewind . . . . . . . . . . . . . . . . . . . . . set to minimum rate | faster . . . . . . . . . . . . . . . . . . faster playing of stream | slower . . . . . . . . . . . . . . . . . . slower playing of stream | normal . . . . . . . . . . . . . . . . . . normal playing of stream | rate [playback rate] . . . . . . . . . . set playback rate to value | frame . . . . . . . . . . . . . . . . . . . . . play frame by frame | fullscreen, f, F [on|off] . . . . . . . . . . . . toggle fullscreen | info [X] . . information about the current stream (or specified id) | stats . . . . . . . . . . . . . . . . show statistical information | get_time . . . . . . . . . seconds elapsed since stream's beginning | is_playing . . . . . . . . . . . . 1 if a stream plays, 0 otherwise | get_title . . . . . . . . . . . . . the title of the current stream | get_length . . . . . . . . . . . . the length of the current stream | | volume [X] . . . . . . . . . . . . . . . . . . set/get audio volume | volup [X] . . . . . . . . . . . . . . . raise audio volume X steps | voldown [X] . . . . . . . . . . . . . . lower audio volume X steps | achan [X] . . . . . . . . . . . . set/get stereo audio output mode | atrack [X] . . . . . . . . . . . . . . . . . . . set/get audio track | vtrack [X] . . . . . . . . . . . . . . . . . . . set/get video track | vratio [X] . . . . . . . . . . . . . . . set/get video aspect ratio | vcrop, crop [X] . . . . . . . . . . . . . . . . set/get video crop | vzoom, zoom [X] . . . . . . . . . . . . . . . . set/get video zoom | vdeinterlace [X] . . . . . . . . . . . . . set/get video deinterlace | vdeinterlace_mode [X] . . . . . . . set/get video deinterlace mode | snapshot . . . . . . . . . . . . . . . . . . . . take video snapshot | strack [X] . . . . . . . . . . . . . . . . . set/get subtitle track | | vlm . . . . . . . . . . . . . . . . . . . . . . . . . load the VLM | description . . . . . . . . . . . . . . . . . describe this module | help, ? [pattern] . . . . . . . . . . . . . . . . . a help message | longhelp [pattern] . . . . . . . . . . . . . . a longer help message | lock . . . . . . . . . . . . . . . . . . . . lock the telnet prompt | logout . . . . . . . . . . . . . . exit (if in a socket connection) | quit . . . . . . . . quit VLC (or logout if in a socket connection) | shutdown . . . . . . . . . . . . . . . . . . . . . . . shutdown VLC +----[ end of help ] > https://github.com/pemako/beancount ...

April 9, 2026 · 8 min · Theme PaperMod

终端原理

Go 终端编程原理详解 基于 golang.org/x/term 和 github.com/creack/pty 的完整技术文档 目录 终端基础概念 文件描述符 termios:终端 I/O 控制 Cooked 模式 vs Raw 模式 golang.org/x/term API 详解 PTY(伪终端)原理 完整示例解析 常见问题与最佳实践 参考资料 1. 终端基础概念 什么是终端(Terminal) 终端最初是物理设备(电传打字机、CRT 显示器),通过串口连接到主机,用于输入命令和查看输出。现代操作系统中的"终端"是对这一概念的软件模拟,称为终端模拟器(Terminal Emulator),如 macOS 的 Terminal.app、iTerm2,Linux 上的 GNOME Terminal 等。 用户键盘输入 │ ▼ ┌─────────────┐ ┌──────────────┐ ┌─────────┐ │ 终端模拟器 │─────▶│ TTY 驱动层 │─────▶│ 进程 │ │ (Terminal) │◀─────│ (内核) │◀─────│ (Shell) │ └─────────────┘ └──────────────┘ └─────────┘ │ ▼ 屏幕显示输出 TTY 与终端设备文件 在 Linux/macOS 中,终端通过特殊的设备文件暴露给进程: ...

April 9, 2026 · 13 min · Theme PaperMod

虚拟机安装

系统下载安装 说明该版本的系统主要是作为学习 《程序员的自我修养》这本书的环境 下载对应的 iso 镜像版本 https://old-releases.ubuntu.com/releases/7.04/ 配置 ubuntu 提供的老的 apt 镜像源 问题1 问题2 # 先备份 cp /etc/apt/sources.list /etc/apt/sources.list.bak # 替换 sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list # then update with sudo apt-get update && sudo apt-get dist-upgrade # 删除 cdrom 的行 sed -i '/cdrom/d' /etc/apt/sources.list 网络配置 这里主要是想固定虚拟机的ip地址,开启 ssh 服务,这样可以通过终端登录。故这里选择的网络模式为 Nat + Host-only 模式。 在 Tools->Network->Create 选择 Host-only Networks 添加一个网络配置 在虚拟机的 Settings->Network->Adapter 1 中选择 NAT (这里默认选择) 配置 Adapter 2 网络在 图一添加的 host only network 的名字 ...

April 9, 2026 · 1 min · Theme PaperMod