Debian Notes

Find the package that provides a file (without knowing the full path)

# Install apt-file and build the index
sudo apt install apt-file
sudo apt-file update

# Then, search:
$ apt-file search minimodem
minimodem: /usr/bin/minimodem
minimodem: /usr/share/doc/minimodem/README
minimodem: /usr/share/doc/minimodem/changelog.Debian.gz
minimodem: /usr/share/doc/minimodem/copyright
minimodem: /usr/share/man/man1/minimodem.1.gz

Force IPv4 for APT

Use this when you’re tired of apt timing out connecting to an IPv6 mirror.

echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4

SDDM Auto Login

cat << EOF > /etc/sddm.conf
[Autologin]
User=user
Session=lxqt.desktop
Relogin=false
EOF

https://manpages.debian.org/bullseye/sddm/sddm.conf.5.en.html

ZFS

zpool status
zpool create -f ext6tb /dev/sdb
zpool status

zfs create ext6tb/scratch
zfs set compression=off ext6tb/scratch

ls -l /ext6tb/scratch/

https://serverfault.com/questions/736805/zfs-on-a-single-external-hdd-drive-setup-tutorial-and-workflow

https://www.howtogeek.com/175159/an-introduction-to-the-z-file-system-zfs-for-linux/

http://jenpeterson.net/zfs-blog/

https://ubuntu.com/tutorials/using-zfs-snapshots-clones#2-using-snapshots

UFW

apt install ufw
ufw default allow outgoing
ufw default deny incoming
ufw allow ssh
# ufw allow from 192.168.1.0/24 to 192.168.1.2 port ssh proto tcp
ufw enable

Switch from systemd-timesyncd to chronyd

apt update
apt install chrony

cat << EOF > /etc/chrony/chrony.conf
confdir /etc/chrony/conf.d

pool pool.ntp.org iburst

sourcedir /run/chrony-dhcp
sourcedir /etc/chrony/sources.d
keyfile /etc/chrony/chrony.keys
driftfile /var/lib/chrony/chrony.drift
ntsdumpdir /var/lib/chrony

# Uncomment the following line to turn logging on.
#log tracking measurements statistics
logdir /var/log/chrony

maxupdateskew 100.0
rtcsync
makestep 1 3
leapsectz right/UTC
EOF

systemctl enable chrony
systemctl restart chrony
chronyc sources -a

Additional package for servers

apt install vim aide-dynamic ncdu curl tmux sudo

Run commands under a /sbin/nologin user

sudo -u www-data [command]

Manually Set the IP

sudo ip addr add 10.10.10.10 dev ens18