======================================================================================================================= ||| ||| ||||||||| ||| ||| --- --- ||||||||| ||||||||| ||||||||| ||||||||| ||||||||| ||| ||| ||| ||| ||| ||| --- --- ||| ||| ||| ||| ||| ||| ||| ||| ||| ||| ||| ||| ||| --- ||| ||| ||| ||| ||| |||||| ||||||||| ||| ||| ||| ||| ||| ||| --- --- ||| ||| ||| ||| ||| ||| ||| |||||| ||| ||| ||| ||||||||| --- --- ||| ||| ||||||||| ||| ||||||||| ||||||||| ======================================================================================================================= # T E R M I N A L ----------------------------------------------------------------------------------------------------- sudo apt update 1.download list of updated packages from the repository (do before upgrading) sudo apt upgrade 2.download and install the latest updates for the packages used sudo apt autoremove 3.removing unnecessary packages from the system after uninstall sudo apt autoclean 4.cleaning the downloaded package cache after autoremove sudo apt search xxx search package xxx sudo apt install xxx install package xxx sudo apt remove xxx uninstall packaqe xxx sha256sum xxx.iso check integrity of iso file with SH256 sum wget url download a file via url su - login as root usermod -aG sudo xxx add user xxx to sudo group (login as root before & reboot to make effective) groups xxx check association of user xxx in groups sudo run a command as administrator sudo dpkg-reconfigure tzdata change time zone sudo nano xxx open gnu nano editor to edit the xxx file sudo nano /etc/ssh/sshd_config ssh server configuration sudo reboot reboot now sudo shutdown -h now shutdown now sudo shutdown -h 20:00 shutdown at 20:00 sudo snap refresh 1.if update problem with snap ubuntu, close snap and use this command first sudo snap refresh snap-store 2.then use this command second ./script.sh run the script pwd show current directory cd change directory (cd /home/user/....) cat file display plain text file in terminal kill xxx kill process xxx passwd change pass to current user timedatectl status check time synchronization status apt list --installed show list of installed packages with version details cat /proc/cpuinfo show cpu info cat /proc/meminfo show memory info cat /proc/version show linux version date show date df -h show list of disk partitions free -h show memory usage history show history of commands used history -c delete history of commands used ip a show network info lsblk show disks lscpu show cpu info lsusb show usb connections nmcli device status show internet network connection uname -a show machine name and kernel version uptime -s show last boot time sudo dmidecode show machine details (serial, bios, etc.) sudo smartctl -a /dev/x show details about disks with smartmontools (replace x with the correct disk) sudo systemctl status fail2ban show fail2ban status sudo passwd user edit sudo pass for user sudo raspi-config start raspberry pi software configuration tool sudo rpi-eeprom-update check if the bootloader needs an update sudo apt full-upgrade to be used occasionally to keep the system completely up to date sudo rpi-update to be used as a last resort (firmware update) pictrl show info on GPIO pins pinout show pinout layout on your raspberry vcgencmd measure_temp show soc temperature vcgencmd version show firmware version on your raspberry add pass for sudo sudo nano /etc/sudoers.d/010_user-nopasswd add the ligne and save : user ALL=(ALL) PASSWD: ALL dpkg --get-selections > mypackages.txt create a text file with all installed packages sudo dpkg --set-selections < mypackages.txt to select the packages you want to restore (update before) sudo apt-get -u dselect-upgrade to install the packages # P A C K A G E S ----------------------------------------------------------------------------------------------------- AUDACIOUS audacious audio player BLUEFISH bluefish multi-platform editor BLUEMAN blueman graphical bluetooth manager CUPS cups driver manager for printers DMIDECODE dmidecode reports information about system (hardware and bios) DOCUMENT SCANNER simple-scan scanner manager DOCUMENT VIEWER evince pdf viewer FAIL2BAN fail2ban intrusion prevention software (if ssh & web servers are active) FREE CAD freecad free cad software FREE FILE SYNC freefilesync backup tool manager GALCULATOR galculator gnome calculator GIMP gimp image manipulation GNOME DISK gnome-disk-utility gnome disk tool manager GNOME EXTENSIONS gnome-browser-connector gnome lock keys extension GNOME SYSTEM MONITOR gnome-system-monitor gnome system monitor (modern alternative to htop) GNOME TEXT EDITOR gnome-text-editor gnome text editor GPARTED gparted disk tool manager (alternative to gnome disk tool manager) GSMARTCONTROL gsmartcontrol graphical interface of smartmontools GUFW FIREWALL gufw firewall with graphical interface HARDINFO2 hardinfo system information and benchmark for linux HTOP htop tasks visual manager KICAD EDA kicad electronics design automation suite LIB FUSE 2 libfuse2 appimage file reader LIBRE OFFICE libreoffice office suite LIBRE PCB EDA librepcb electronics design automation suite LIBREWOLF librewolf (via extrepo) custom version of firefox focused on privacy & security NTP ntp more accurate & more resource intensive than systemd-timesyncd PSENSOR psensor graphical sensor monitoring RASPBERRY PI IMAGER rpi-imager easy way to install raspberry pi os on a micro sd card REMMINA remmina remote desktop software client SCREENFETCH screenfetch displays system information alongside the ASCII distro logo SHOTWELL shotwell photo manager and organizer SMARTMONTOOLS smartmontools control and monitor storage systems SYNAPTIC synaptic gui package management system for debian based distributions THONNY thonny python editor TOR PROJECT - download tar file on https://www.torproject.org/ TRANSMISSION tranmsission torrent manager VLC vlc cross-platform multimedia player # C R E A T E B O O T A B L E U S B I S O I M A G E --------------------------------------------------------------- 01.download iso image 02.identify the usb device using the lsblk command (eg: sdX for exemple below) 03.use dd to write the iso image to the usb drive : sudo dd if=/path/to/image.iso of=/dev/sdX bs=4M status=progress (replace /path/to/image.iso with the path to your iso file and /dev/sdX with the device of your usb drive) 04.sync and eject the usb drive : sudo sync && echo "Synchronization completed" # D E B I A N --------------------------------------------------------------------------------------------------------- sudo nano /etc/apt/sources.list edit if necessary to correct links for packages update with debian bookworm add # on the first line to comment it : # deb cdrom:[Debian GNU/Linux ... deb https://deb.debian.org/debian bookworm main non-free-firmware deb-src https://deb.debian.org/debian bookworm main non-free-firmware deb https://security.debian.org/debian-security bookworm-security main non-free-firmware deb-src https://security.debian.org/debian-security bookworm-security main non-free-firmware deb https://deb.debian.org/debian bookworm-updates main non-free-firmware deb-src https://deb.debian.org/debian bookworm-updates main non-free-firmware # Backports allow you to install newer versions of software made available for this release deb https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware deb-src https://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware sudo nano /etc/default/grub add or remove "quiet splash" mode when booting debian GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" version with "quiet splash" mode GRUB_CMDLINE_LINUX_DEFAULT="" version without "quiet splash" mode sudo update-grub to do after modifying the grub file pactl set-sink-volume @DEFAULT_SINK@ +5% keyboard shortcut to setup (for pulseaudio) to increase volume pactl set-sink-volume @DEFAULT_SINK@ -5% keyboard shortcut to setup (for pulseaudio) to decrease volume tiling window managemment with xdotool sudo apt install xdotool, and then create keyboard shortcuts below : xdotool getactivewindow windowsize 50% 100% windowmove 0 0 super key + left to tile the window to the left xdotool getactivewindow windowsize 50% 100% windowmove 50% 0 super key + right to tile the window to the right xdotool getactivewindow windowsize 100% 100% windowmove 0 0 super key + up to maximize the window xdotool getactivewindow windowsize 800 600 windowmove 0 0 super key + down to restore the window # N T P S E R V E R -------------------------------------------------------------------------------------------------- 01.sudo apt install ntp 02.sudo systemctl start ntp 03.sudo nano /etc/ntp.conf 04.copy/past text below step 6 and then ... 05.sudo systemctl restart ntp 06.sudo systemctl status ntp # /etc/ntp.conf, configuration for ntpd # NTP servers server 0.debian.pool.ntp.org iburst server 1.debian.pool.ntp.org iburst server 2.debian.pool.ntp.org iburst server 3.debian.pool.ntp.org iburst # Drift file driftfile /var/lib/ntp/ntp.drift # Restrictions restrict 127.0.0.1 restrict ::1 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap restrict default kod nomodify notrap nopeer noquery # Statistics Options statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable # S E C U R I T Y ----------------------------------------------------------------------------------------------------- > use password for sudo & user > do not use auto login > do constant updates > install ufw & fail2ban > regularly save the list of installed packages dpkg --get-selections > packages.txt save the list of packages in home/user before a major upgrade dpkg --set-selections < packages.txt restore the packages according to the previous generated file sudo ufw status sudo ufw enable sudo ufw disable sudo ufw reload sudo ufw app list sudo ufw status verbose show ufw detailed verbose status, which also includes logging levels sudo ufw status numbered show ufw rules with numbers sudo ufw allow xxx allow port/service sudo ufw deny xxx drop the connection from a specific port/service sudo ufw delete xxx delete the xxx rule sudo systemctl status ssh sudo systemctl enable ssh sudo systemctl start ssh sudo systemctl stop ssh sudo systemctl disable ssh sudo systemctl restart ssh # F A I L 2 B A N ----------------------------------------------------------------------------------------------------- to be completed # A P P I M A G E ----------------------------------------------------------------------------------------------------- 01.install the libfuse2 package 02.create a directory /Applications & move the file inside 03.authorize its execution (right-click > Properties > Permissions > Allow execution) # E R A S E D A T A O N D I S K ------------------------------------------------------------------------------------ 01.use lsblk command to display the disks 02.identify the one to erase (in the example below we want to erase the data from sdX) 03.write random data to make the restoration very complex : sudo dd if=/dev/urandom of=/dev/sdX bs=4M status=progress 04.use a disk tool manager to erase & format disk [250308]