guest@backslash:~/posts/linux/debian-cleanup$

Debian cleanup

~1 minlinux debian

How to clean up Debian after upgrades

Vacuuming system logs

sh
sudo journalctl --vacuum-size=300M

Clean apt cache

sh
sudo apt-get clean

Rotate logs

sh
sudo logrotate /etc/logrotate.conf

How to adjust power settings

if value is suspend it will suspend when idle

sh
gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type

adjust it

sh
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'

similar setting for battery

sh
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'nothing'

Systemd sleep

Documented here

sh
sudo mkdir -p /etc/systemd/sleep.conf.d
sudo bash -c 'cat <<EOF > /etc/systemd/sleep.conf.d/nosuspend.conf
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
EOF'

Fix buzzing sound

Check

cat /sys/module/snd_hda_intel/parameters/power_save

if larger than 0 it means the audio card goes to sleep and then speaker can buzzzz

sudoedit /sys/module/snd_hda_intel/parameters/power_save

and set to 0

Make it permanent

create new file

sh
sudo vim /etc/modprobe.d/audio_disable_powersave.conf

content:

sh
options snd_hda_intel power_save=0

BACKSLASH(1)                  User Commands

NAME
       backslash - keyboard navigation

KEYS
       j / k      scroll down / up
       n / p      next / previous post
       gg / G     top / bottom of the page
       /          filter posts
       ?          this help
       Esc        close