Perfect tools for daily use: Difference between revisions
No edit summary |
No edit summary |
||
(54 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
! 目标或作用 | ! 目标或作用 | ||
! 对应方法 | ! 对应方法 | ||
|- | |||
| 不想上的网课怎么办 | |||
| 去 greasyforks 搜该网课的域名 | |||
|- | |||
| 怎样在 Emacs query-replace-regex 里使用“或”语义 | |||
| <nowiki>\|</nowiki> | |||
|- | |||
| 怎样让文件总是提示“建议只读”模式打开 | |||
| “保存”时,保存左边有个“工具” - “常规选项” - “建议只读” | |||
|- | |||
| mediawiki gd 不支持 webp | |||
| sudo apt install imagemagick libwebp-dev,再在 LocalSettings.php 里打开 convert | |||
|- | |||
| Emacs 密钥过期无法更新 package 时应该怎么做 | |||
| 手动到 [https://elpa.gnu.org/packages/gnu-elpa-keyring-update.html GNU ELPA - gnu-elpa-keyring-update] 下载 gnu-elpa-keyring-update | |||
在 Emacs 里打开这个 tar 文件,执行 package-install-from-buffer | |||
|- | |||
| 音频转文字 | |||
| <code>whisper ~/S01E01.aac --model turbo -f srt --output_dir ~/</code> | |||
<pre> | |||
model: tiny, base, small, medium, large, 或 turbo | |||
f: format. txt, srt, vtt 等 | |||
</pre> | |||
|- | |||
| 视频提取音频 | |||
| <code>ffmpeg -i ~/S01E01.mp4 -vn -acodec copy ~/S01E01.aac</code> | |||
<pre> | |||
i: input | |||
vn: vedio none 不要视频 | |||
acoder copy: audio copy 直接复制音轨 | |||
</pre> | |||
|- | |||
| 表格中的第一个 # 号不解析 | |||
| # | |||
# 天空 | |||
# 大地 | |||
# 人间 | |||
# 湖水 | |||
即在左上角先放一个 # 号 | |||
|- | |||
| Semantic MediaWiki 日期标准化 | |||
| ?开庭日期#ISO | |||
|- | |||
| pubkey 不方便往服务器上粘 | |||
| 用 echo "Ctrl V" >> sth | |||
|- | |||
| Semantic MediaWiki 网页端清除缓存 | |||
| 在网页端 ?action=purge | |||
在 CLI 端 sduo php extensions/SemanticMediaWiki/maintenance/rebuildData.php | |||
|- | |||
| 调整特定页面的某个部分的字体 | |||
| Custom CSS 拓展可以哪里不爽改哪里,如: | |||
<syntaxhighlight lang="bash"> | |||
.answer p { | |||
font-size: 16px !important; | |||
color: #191b1f !important; | |||
} | |||
</syntaxhighlight> | |||
|- | |||
| 命令替换,在命令中引用其他命令的结果 | |||
| $(command) 即用 $() 把命令括起来。或 | |||
`command` 即用反引号把命令括起来 | |||
|- | |||
| mediawiki 日志调试 | |||
| $wgShowExceptionDetails = true; | |||
|- | |||
| grep 用法 | |||
| 在目录下递归找字符串 grep -r string /dir/want | |||
|- | |||
| 一个 extension 不适用于当前 mediawiki 较低版本怎么办 | |||
| 别傻乎乎升级 mediawiki 版本,你可以在 extension 的历史记录中,按时间或 tags 找对应 mediawiki 当时的 extension 版本 | |||
|- | |||
| 查本机图形化协议是 x11 还是 wayland 还是 Hyprland 还是 Sway | |||
| echo $XDG_SESSION_TYPE | |||
|- | |||
| 找源码 | |||
| grep -rn --include='*.c' --include='*.h' '' | |||
|- | |||
| 显示硬盘及分区 | |||
| lsblk | |||
|- | |||
| 查找 uuid | |||
| sudo blkid /dev/sda | |||
|- | |||
| 挂载硬盘 | |||
| 在 /etc/fstab 中写入:UUID=xxxx-xxxx-xxxx /mnt/data ext4 defaults 0 2 | |||
|- | |||
| MediaWiki 某页不要 toc 的数字序号 | |||
| | |||
<syntaxhighlight lang="bash"> | |||
# 先在 MediaWiki:Common.css 设置: | |||
.noautonum .tocnumber { | |||
display: none; | |||
} | |||
# 后在某页添加: | |||
<div class="noautonum">__TOC__</div> | |||
</syntaxhighlight> | |||
|- | |||
| 设置 Edit With Emacs 打开的窗口的大小 | |||
| | |||
<syntaxhighlight lang="elisp"> | |||
# 写入 early-init.el 中 | |||
(setq initial-frame-alist '((width . 80) (height . 35))) | |||
(setq default-frame-alist '((top . 30) (left . 320) (width . 180) (height . 60))) | |||
(setq frame-inhibit-implied-resize t) | |||
</syntaxhighlight> | |||
|- | |||
| dd 制作安装盘 | |||
| sudo dd if=./EndeavourOS.iso of=/dev/sdc | |||
|- | |||
| ventoy 制作安装盘 | |||
| 把 ventoy 安装到 U 盘,再把 iso 文件复制进 U 盘 | |||
|- | |||
| 添加 sudo 免密 | |||
| 写入 /etc/sudoer:username ALL=(ALL) NOPASSWD:ALL | |||
(ALL) 只设置用户权限,不管组权限。(ALL:ALL) 既设置用户权限,也设置组权限。按最小化权限原则,设置免密时使用 ALL=(ALL) | |||
|- | |||
| 找不到 firefox for android 安装包? | |||
| https://ftp.mozilla.org/pub/fenix/releases/ | |||
|- | |||
| 根据 sha256.txt 检测软件下载是否完整 | |||
| sha256sum -c --ignore-missing sha256.txt | |||
|- | |- | ||
| 解决 zip 文件解压后文件名乱码 | | 解决 zip 文件解压后文件名乱码 | ||
| unar -e GBK | | unar -e GBK | ||
|- | |||
| emacs 中数字通配符 | |||
| <nowiki>[[:digit:]]</nowiki> | |||
|- | |||
| mediawiki 上传容量改大 | |||
| | |||
<syntaxhighlight lang="bash"> | |||
# 改 /etc/php/版本号/cli/php.ini | |||
post_max_size = 50M | |||
upload_max_filesize = 50M | |||
systemctl restart apache2 | |||
</syntaxhighlight> | |||
|- | |- | ||
| 显示所有进程,且只显示第 12 列 | | 显示所有进程,且只显示第 12 列 | ||
Line 43: | Line 182: | ||
|- | |- | ||
| 找找文件详细路径 | | 找找文件详细路径 | ||
| locate file.txt | | | ||
<syntaxhighlight lang="bash"> | |||
sudo apt install plocate | |||
sudo updatedb | |||
locate file.txt | |||
</syntaxhighlight> | |||
|- | |- | ||
| 猜猜我是谁 | | 猜猜我是谁 | ||
Line 77: | Line 221: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
| ssh | | ssh 使远程机器通过 5432 端口连接到本机的 12345 端口 | ||
| | | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
Line 88: | Line 232: | ||
|- | |- | ||
| 用 sed 删掉 apache 注释 | | 用 sed 删掉 apache 注释 | ||
| sed '/^#/d' apache2.conf > apache2.conf.nocomments 这行命令有点牛,一下把所有注释删掉了 | | sed '/^#/d' apache2.conf > apache2.conf.nocomments 这行命令有点牛,一下把所有注释删掉了 d 表示删除行 | ||
sed 's/old/new/g' file.txt > change.txt 把 file.txt 中的所有 old 替换为 new | |||
|- | |- | ||
| 查找文件并执行命令,\; 代表命令结束符 | | 查找文件并执行命令,\; 代表命令结束符 | ||
Line 163: | Line 309: | ||
|- | |- | ||
| wsl 遭遇 DNS 污染 | | wsl 遭遇 DNS 污染 | ||
| | | 改一下 DNS 为 114.114.114.114 | ||
打开虚拟化平台时,改的是虚拟网卡 | 打开虚拟化平台时,改的是虚拟网卡 | ||
Line 176: | Line 320: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
git tag | sort -V | tail -5 | git tag | sort -V | tail -5 | ||
</syntaxhighlight> | |||
|- | |||
| powershell 中查 sha512 | |||
| | |||
<syntaxhighlight lang="bash"> | |||
Get-FileHash -Path "E:\EndeavourOS_Mercury-Neo-2025.03.19.iso" -Algorithm SHA512 | Format-List | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |