共有 54 篇文章
搭建NTP服务器
2024-05-12 - 2024-09-18

为其他设备提供NTP授时服务

 1# 安装NTP服务
 2apt-get install ntp
 3# 编辑配置文件, pool 后替换为想要的ntp地址
 4vim /etc/ntpsec/ntp.conf
 5# 重启NTP服务
 6systemctl status ntp
 7systemctl restart ntp
 8# 检查NTP同步功能
 9ntpq -p
10# 开放UDP的123端口
1# 检查与NTP服务器的连接, 使用IP可以跳过dns解析
2ntpdate -q 13.113.25.87
1# 设置NTP服务器
2vim /etc/ntpsec/ntp.conf
指纹识别 Fingerprint
2024-04-26 - 2024-09-18

Debian指纹识别

1# 安装
2sudo apt install fprintd
3# 录入 (录入5次后会显示completed)
4sudo fprintd-enroll
5# 识别
6sudo fprintd-verify
Debian 触摸板 Touchpad
2024-02-06 - 2024-09-18

使触摸板敲击(不是按压)时也产生左键事件

1sudo apt install xserver-xorg-input-synaptics
2sudo vim /etc/X11/xorg.conf.d/50-synaptics.conf

在文件中添加以下内容

 1Section "InputClass"
 2    Identifier "touchpad catchall"
 3    Driver "synaptics"
 4    MatchIsTouchpad "on"
 5
 6    Option "TapButton1" "1"            #单指敲击产生左键事件
 7    Option "TapButton2" "2"            #双指敲击产生中键事件
 8    Option "TapButton3" "3"            #三指敲击产生右键事件
 9
10    Option "VertEdgeScroll" "on"       #滚动操作:横向、纵向、环形
11    Option "VertTwoFingerScroll" "on"
12    Option "HorizEdgeScroll" "on"
13    Option "HorizTwoFingerScroll" "on"
14    Option "CircularScrolling" "on"
15    Option "CircScrollTrigger" "2"
16
17    Option "EmulateTwoFingerMinZ" "40" #精确度
18    Option "EmulateTwoFingerMinW" "8"
19    Option "CoastingSpeed" "20"        #触发快速滚动的滚动速度
20
21    Option "PalmDetect" "1"            #避免手掌触发触摸板
22    Option "PalmMinWidth" "3"          #认定为手掌的最小宽度
23    Option "PalmMinZ" "200"            #认定为手掌的最小压力值
24EndSection

键入时禁止触摸板

键入时禁止触摸板可以避免焦点变化,影响当前的输入。 对于使用 startx 来启动的桌面系统,可以修改其 .xinitrc 初始化配置文件来完成:

Pake: 打包网页为桌面端应用
2024-01-04 - 2024-09-18

https://github.com/tw93/Pake/tree/master

安装程序

1npm install pake-cli -g 

安装依赖

 1sudo apt install libwebkit2gtk-4.0-dev \
 2    build-essential \
 3    curl \
 4    wget \
 5    file \
 6    libssl-dev \
 7    libgtk-3-dev \
 8    libayatana-appindicator3-dev \
 9    librsvg2-dev
10# 安装rust
11curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

打包网站

Nvidia 显卡驱动
2024-01-03 - 2024-09-18

Nvidia 驱动在Linux下, 必须安装 Xorg

查看显卡信息

 1lspci -k | grep -EA3 'VGA|3D|Display'
 2lspci | grep VGA
 3lspci | grep -i nvidia
 4# 查看指定显卡的详细信息用以下指令
 5lspci -v -s 00:0f.0
 6# Nvidia自带一个命令行工具可以查看显存的使用情况:
 7nvidia-smi
 8# Fan:显示风扇转速,数值在0到100%之间,是计算机的期望转速,如果计算机不是通过风扇冷却或者风扇坏了,显示出来就是N/A; 
 9# Temp:显卡内部的温度,单位是摄氏度;
10# Perf:表征性能状态,从P0到P12,P0表示最大性能,P12表示状态最小性能;
11# Pwr:能耗表示; 
12# Bus-Id:涉及GPU总线的相关信息; 
13# Disp.A:是Display Active的意思,表示GPU的显示是否初始化; 
14# Memory Usage:显存的使用率; 
15# Volatile GPU-Util:浮动的GPU利用率;
16# Compute M:计算模式; 
17
18# 如果要周期性的输出显卡的使用情况,可以用watch指令实现
19watch -n 10 nvidia-smi
20
21# 检测显卡驱动是否正常
22sudo apt-get install hwinfo
23hwinfo --display

安装核显驱动

Intel 核显不需要单独安装驱动,系统自带

Keyboard rate
2024-01-03 - 2024-09-18

修改键盘重复频率和延迟

XServer startup options

As alternative to this tool, you can set defaults for the X Server at startup.

For the keyboard repeat rate:

/etc/X11/xinit/xserverrc

1X -ardelay 200 -arinterval 30  # (interval is 1000/rate_in_hz)

For this to configure, you need the privileges to edit X launch properties (probably in your login tool like lightdm).

XServer configuration file

XServer since version 21.1.0 supports the option AutoRepeat. Basically you need an xorg config section like this (the second value again 1000/rate_in_hz):

屏幕保护、息屏
2024-01-03 - 2024-09-18

可以使用xset命令进行操作

1xset dpms force off # 关闭屏幕
2xset s 300 #设置屏保时间为300秒,时间单位为秒
3xset s 0 #关闭屏幕保护
4xset dpms 600 900 1200 # 三个数值分别为Standby、Suspend、Off,具体什么意思就不多说了,单位秒
5xset -dpms #关闭电源管理
6
7xset -q # 查看设置情况。

也可以编辑xorg.conf(或者在/etc/X11/xorg.conf.d/添加.conf结尾的配置文件),添加如下选项把xscreen saver直接关闭:

PPTP VPN
2023-12-29 - 2024-09-18
1# 安装PPTP客户端
2apt-get install pptp-linux

编辑配置文件 vim /etc/ppp/chap-secrets

1# Secrets for authentication using CHAP
2# client	server	secret			IP addresses
3your_username PPTP your_password home.akvicor.com

/etc/ppp/peers/ 下新建一个VPN配置文件,文件名就是VPN的名字 vim /etc/ppp/peers/PPTP

使用find和rm搜索并删除文件
2023-09-19 - 2024-09-18

删除指定目录下指定文件

find /path -name .svn | xargs rm -rf

删除指定名称的文件或文件夹: find -type d | grep .svn$ | xargs rm -r

分析:

find -type d | grep .svn$ 通过此命令查找文件夹 过滤正则表达式中的目录 | xargs rm -r 执行删除指令

X11VNC Srver
2023-08-09 - 2024-09-18

安装配置

1# 安装x11vnc
2apt install x11vnc
3# 设置开机自动启动连接密码,将密码储存在/etc/x11vnc.pass 下
4x11vnc -storepasswd /etc/x11vnc.pass

查看认证服务

1ps wwwwaux | grep auth

类似以下信息中的/var/run/lightdm/root/:0