- 用户权限
sudo usermod -aG sudo username, 需要logout后重登,但是个人试验时重启才生效 - sshd
apt install openssh-server - settings -> power -> power saving -> Automatic Suspend 关闭
ssh-keygen
vnc 或 rdp 配置
debian 13 默认用的 gnome + wayland,折腾了 tigervnc xfce4 gnome-remote-desktop 还有内置的设置,都不行。 不弄了,反正基本用不上界面,命令行足够
emacs
emacs --daemon
emacsclient
最小配置:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-enabled-themes '(tango-dark))
'(make-backup-files nil)
'(menu-bar-mode nil)
'(scroll-bar-mode nil)
'(tool-bar-mode nil)
'(visible-bell t)
'(which-key-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(setq indent-tabs-mode nil)
(setq tab-width 4)
(global-set-key (kbd "M-o") 'other-window)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(use-package markdown-mode
:ensure t)
(use-package magit
:ensure t)
(use-package company
:ensure t
:init
(global-company-mode 1))
(use-package which-key)
(use-package counsel
:ensure t
:bind
(("C-s" . swiper-isearch)
("M-x" . counsel-M-x)
("C-x C-f" . counsel-find-file)
("C-x b" . ivy-switch-buffer)))
磁盘
系统装在固态里,挂另外一个机械
lsblk -f # 找磁盘号 ${disk}
# fdisk /dev/sdb # 分区,可能不需要
sudo mkfs.ext4 /dev/${disk} # debian 有些命令在 /usr/sbin/ 里,就算是 root 不用 sudo 也看不见,有点怪
mkdir /mnt/hdd
mount /dev/${disk} /mnt/hdd
sudo blkid /dev/${disk} # 找 ${uuid}
echo "UUID=${uuid} /mnt/hdd ext4 defaults 0 2" >> /etc/fstab
nvidia
- 查看显卡
lspci -nn | egrep -i "3d|display|vga" apt install nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] [10de:1b06] (rev a1)
Checking card: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
Your card is supported by all driver versions.
Your card is also supported by the Tesla 535 drivers series.
It is recommended to install the
nvidia-driver
package.
- 根据上一条结果,在 Debian 13 “Trixie” 下选择 Version 550.163.01
- 必须先安装这个
apt install linux-headers-$(dpkg --print-architecture) - 修改 /etc/apt/sources.list,添加 contrib、non-free、non-free-firmware,例如
deb http://ftp.hk.debian.org/debian/ trixie main contrib non-free non-free-firmware
deb-src http://ftp.hk.debian.org/debian/ trixie main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
deb http://ftp.hk.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware
deb-src http://ftp.hk.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware
- 关闭secureboot或者enroll
apt install nvidia-open-kernel-dkms nvidia-driver firmware-misc-nonfree- 检查是否安装成功
sudo dkms status
wayland
echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nvidia-drm.modeset=1 nvidia-drm.fbdev=1"' > /etc/default/grub.d/nvidia-modeset.cfg
sudo update-grub
sudo apt install nvidia-suspend-common # 应该已经安完了
systemctl enable nvidia-suspend.service
systemctl enable nvidia-hibernate.service
systemctl enable nvidia-resume.service
cat /proc/driver/nvidia/params | grep PreserveVideoMemoryAllocations # 需要保证是1
# 如果不是1
echo 'options nvidia NVreg_PreserveVideoMemoryAllocations=1' > /etc/modprobe.d/nvidia-power-management.conf
# apt install nvidia-cuda-dev nvidia-cuda-toolkit # cuda