Linux Little Tricks
搜索引擎小技巧
cats and dogs
Result about cats or dogs"cats and dogs"
Result about exact term “cats and dogs”cats -dogs
Fewer dogs in resultcats +dogs
More dogs in resultcats filetype:pdf
PDFs about cats- Supported types: pdf, doc(x), xls(x), ppt(x), html
*
模糊....
范围intitle:标题
inurl:网址
related:相关类型
define:word
etymology:"word,"
joker site:drive.google.com
Proxy
- Browser:
SwitchyOmega
- gfwlist:
https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt
- Terminal Proxy
CapsLock -> Ctrl
X11
xev
展示按下按键的信息pacman -S xorg-xmodmap
:xmodmap
xmodmap -pke
xmodmap -pke > ~/.Xmodmap
- 使用
remaps
脚本
Wayland
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:ctrl_modifier']"
触控板设置
- xorg 使用 libinput 配置触控板
- dwm 默认触控板无法使用单击, 双击等
- 在
xorg.conf.d
目录下添加30-touchpad.conf
配置文件, 并添加以下配置30
表示执行顺序 (10 比 30 先执行).conf
后缀 arch wiki 说必须加上不可以省略
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"
Option "TappingButtonMap" "lmr"
Option "NaturalScrolling" "true"
EndSection
多显示器设置
X11 默认多显示器是相同输出, xrandr
可以用来查看显示器输出端口的信息, 可以通过两种方式设置
xrandr --output DP1 --auto --right-of eDP1
可以设置显示器显示不同的内容- 设置配置文件
/etc/X11/xorg.conf.d/40-monitor.conf
Section "Device"
Identifier "Intel Corporation HD Graphics 630" # 视频输出的显卡名,可以通过 `lspci -v` 查看
Option "Monitor-eDP1" "eDP1 screen"
Option "Monitor-DP1" "DP1 screen"
EndSection
Section "Monitor"
Identifier "DP1 screen"
Option "RightOf" "eDP1 screen"
EndSection
Section "Monitor"
Identifier "eDP1 screen"
EndSection
- 设置 Xorg 多显示器显示相同的内容
xrandr --output DP1 --auto --same-as eDP1
--mode
可以设置分辨率
Archlinux install Latex
pacman -S texlive-most
-
texlive-most
is a package group, includestexlive-core texlive-bin
-
texlive-lang
添加除英文外的其他语言的支持, 不推荐安装
-
pdftex '\empty Hello World!\bye'
查看是否安装成功texdoc
查看帮助文档的命令
NetworkManager
设置 grub 主题
- 复制 grub2 主题到
/boot/grub/themes
vim /etc/default/grub
修改GRUB_THEME=/boot/grub/themes/{theme_name}/theme.txt
grub-mkconfig -o /boot/grub/grub.cfg
重新创建 grub 配置
archlinux using 32位 gcc
首先, 修改 /etc/pacman.conf
文件
[multilib]
Include = /etc/pacman.d/mirrorlist
安装 pacamn -S multilib-devel lib32-glibc lib32-gcc-libs
使用 cronie 设置定时任务
tmux 使用 ssh 连接,断开连接后 tmux session 也会关闭的问题
- 默认应该是不会发生这种情况的,但如果发生了看下面的解决办法
- 编辑
/etc/systemd/logind.conf
文件 - 设置
KillExcludeUsers=root MY_USERNAME
和KillUserProcess=no
- 产生问题的原因应该是 optimus manager 在这个文件中
/usr/lib/systemd/logind.conf.d/*.conf
设置了KillUserProcess=yes
- tmux server being killed after logging out
使用 laptop 时关闭合盖后依然保持运行
- 编辑
/etc/systemd/logind.conf
文件 - 设置
HandleLidSwitch=ignore
变量重启系统即可 - how to disable auto suspend when i close laptop lid
systemd
.service
文件位置:/usr/lib/systemd/system/
/usr/lib/systemd/user/
~/.config/systemd/user/
- how-to-set-up-an-automatic-restart-of-a-background-ssh-tunnel
- tunnelling-with-ssh-different-approaches-and-tips
file permissions
- files
- Read – Can view or copy file contents
- Write – Can modify file content
- Execute – Can run the file (if its executable)
- directories
- Read – Can list all files and copy the files from directory
- Write – Can add or delete files into directory (needs execute permission as well)
- Execute – Can enter the directory
locale problem: not found files
- Arch: See Installation Guide
- Fedora:
dnf install langpacks-zh_CN
- Ubuntu:
cd /usr/share/locales
./install-language-pack zh_CN.UTF-8
dpkg-reconfigure locales
X11 Debug a Window Manager
- use
Xephyr :1
to start a new DISPLAY server - use
DISPLAY=:1 {gui_command}
to startgui_command
in the new server
ubuntu using x11 instead of wayland
vim /etc/gdm3/custom.conf
- uncomment this line
#WaylandEnable=false
ubuntu disable showing icons in desktop
sudo apt remove gnome-shell-extension-desktop-icons-ng -y
- ref: How disable show folder in desktop ubuntu?
VirtualBox
Arch Linux Install
pacman -S virtualbox
- 使用
virtualbox-host-modules-arch
内核依赖
- 使用
- 创建虚拟机有问题就重新加载内核执行命令
sudo vboxreload
- Install extpack
- download the extension manually
sudo VBoxManage extpack install <.vbox-extpack>
VirtualBox in windows 11 are so slow
<
<<
<<<
<()
<
: The input redirectioncat < README.md
<<
: The here documentcat > output.txt <<EOF
the EOF is an DELIMITER, when stdin recives the DELIMITER, the stdin will close<<<
: The here stringcat <<< "Demo text"
input one line of stings to a script or a command.<()
: redirection command output to another commandcat <(echo "Demo text")