May 10, 2020
2 min read
Debian: post-install tweaks

First steps:

Installing the bash skin:

echo 'export PS1="\[\033[0;0;1;31m\]\u \[\033[0;0;0;37m\]\w\[\033[0;0;1;31m\] > \[\033[00m\]"' >> ~/.bashrc && source ~/.bashrc

Update the system:

1
2
apt update
apt upgrade

Swap file:

Make sure you don’t have a swap yet:

free -h

Check available disk space:

df -h

Create a swap file:

fallocate -l 1.5G /swapfile

Make sure you reserve enough space:

ls -lh /swapfile

Turn it on:

1
2
3
chmod 600 /swapfile
mkswap /swapfile
swapon --priority 50 /swapfile

Final check:

1
2
3
swapon --show
free -h
htop

Make sure that /swapfile is enabled after a restart:

Create backup of /etc/fstab:

cp /etc/fstab /etc/fstab.bak

Execute:

echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Check:

cat /etc/fstab

Make calls to swap more rare to improve performance:

We look at the current value:

cat /proc/sys/vm/swappiness

I have 60 there, and it might be good for ssd, but for a server with hdd, it’s better to set value close to 0.

Change it:

sysctl vm.swappiness=10

We make sure that this setting is preserved after a restart:

nano /etc/sysctl.conf

Add the line vm.swappiness=10 to the end of this file.

Then we look at the current value of vfs_cache_pressure parameter:

cat /proc/sys/vm/vfs_cache_pressure

Set vfs_cache_pressure equal to 50:

sysctl vm.vfs_cache_pressure=50

And again:

nano /etc/sysctl.conf

Add the line vm.vfs_cache_pressure=50 to the end of the file.

FTP server

proftpd does not require additional settings, you can connect immediately after installation.

apt install proftpd

Tmux

tmux is a useful utility for creating bash sessions that can be connected and disconnected without interrupting the applications running in them:

pacman -S tmux

tmux manual:

  1. https://www.ocf.berkeley.edu/~ckuehl/tmux/
  2. https://tmuxcheatsheet.com/

Miniconda

Python virtualization tool.

1
2
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

When installing, I recommend leaving the default settings.

Finishing

1
2
3
conda clean --all
apt autoremove
apt autoclean