cp /usr/share/zoneinfo/Europe/Riga /etc/localtime
Add:
echo loop > /etc/modules-load.d/loop.conf
systemctl enable cron.service
install the basic desktop on CentOS:
yum groupinstall basic-desktop
Screen is deprecated into Redhat, now replaced by TMUX
https://www.redhat.com/sysadmin/introduction-tmux-linux
TMUX is a terminal using a background session, so you can run long process without being disconnected from TIMEOUT (TMOUT)
$ tmux
For HELP
You can now run your first Tmux command. For example, to get a list of all commands, you would type: Ctrl+b ?
To start using tmux, type tmux on your terminal. This command launches a tmux server, creates a default session (number 0) with a single window, and attaches to it.
You can detach from your tmux session by pressing Ctrl+B then D. Tmux operates using a series of keybindings (keyboard shortcuts) triggered by pressing the “prefix” combination. By default, the prefix is Ctrl+B. After that, press D to detach from the current session.
List you background sessions
$ tmux ls 0: 1 windows (created Sat Aug 27 20:54:58 2022)
Connect to session number 0 (or maybe attach-session ?)
$ tmux attach -t 0
As you can see, the command continued to run and print messages on the screen. You can type Ctrl+C to cancel it.
Satart a session with specific name
tmux new -s Session1
TMUX options
then toggle the mouse on (or off) with the command set -g mouse.
Using colors:
Change the status bar background color: set -g status-bg cyan Change inactive window color: set -g window-status-style bg=yellow Change active window color: set -g window-status-current-style bg=red,fg=white
You can change the tmux configuration permanently by modifying the tmux configuration file. By default, this file is located at $HOME/.tmux.conf.
For example, the default prefix key combination is Ctrl+B, but sometimes this combination is a little awkward to press, and it requires both hands. You can change it to something different by editing the configuration file. I like to set the prefix key to Ctrl+A. To do this, create a new configuration file and add these lines to it:
$ cat $HOME/.tmux.conf # Set the prefix to Ctrl+a set -g prefix C-a # Remove the old prefix unbind C-b # Send Ctrl+a to applications by pressing it twice bind C-a send-prefix
Another example
# Improve colors set -g default-terminal 'screen-256color' # Set scrollback buffer to 10000 set -g history-limit 10000 # Customize the status line set -g status-fg green set -g status-bg black
Only for historic info
Screen (command) is a background terminal, you can start applications in background, quit your windows and recall your session.
Start a sceen session using a specific name
# screen -S session_name
Help
Ctrl+a ?
Below are some most common commands for managing Linux Screen Windows:
You can detach from the screen session at any time by typing:
Ctrl+a d
Reattach to a Linux Screen:
screen -r
To find the session ID list the current running screen sessions with:
# screen -ls There are screens on: 10835.pts-0.linuxize-desktop (Detached) 10366.pts-0.linuxize-desktop (Detached) 2 Sockets in /run/screens/S-linuxize.
If you want to restore screen 10835.pts-0, then type the following command:
screen -r 10835
You can easily limit CPU usage with cpulimit command like:
# cpulimit -l 10 -- /usr/bin/clamscan -r / --exclude-dir=/sys/ --quiet --infected > /var/log/clamscan/clamscan.$(date +%Y%m%d).log