User Tools

Site Tools


linux:ubuntu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:ubuntu [2023/11/02 08:18] – [Essencial Commands] skipidarlinux:ubuntu [2024/05/15 05:10] (current) – [Performance Monitoring commands] skipidar
Line 62: Line 62:
 & # When placed at the end of a command, execute that command in the background. "vim &" & # When placed at the end of a command, execute that command in the background. "vim &"
 fg # bring theprocess back to the foreground. jobs; fg %1 fg # bring theprocess back to the foreground. jobs; fg %1
- + 
 +# enable the NTP server for time syncronization 
 +sudo timedatectl set-ntp on 
 +timedatectl 
 # clear /var/log/journal/ files, leave only data of last 10d # clear /var/log/journal/ files, leave only data of last 10d
 sudo journalctl --vacuum-time=10d sudo journalctl --vacuum-time=10d
Line 183: Line 187:
 </VirtualHost> </VirtualHost>
 </code> </code>
 +
 +
 +==== Performance Monitoring commands ====
 +
 +{{https://s3.eu-central-1.amazonaws.com/alf-digital-wiki-pics/sharex/c12ezuvdZY.png}}
 +
 +how to diagnose a mysterious process that’s taking too much CPU, memory, IO, etc? 
 + 
 +The diagram below illustrates helpful tools in a Linux system. 
 +
 +<sxh shell>
 +vmstat # reports information about processes, memory, paging, block IO, traps, and CPU activity. 
 +iostat # reports CPU and input/output statistics of the system. 
 +netstat # displays statistical data related to IP, TCP, UDP, and ICMP protocols. 
 +lsof # lists open files of the current system. 
 +pidstat # monitors the utilization of system resources by all or specified processes, including CPU, memory, device IO, task switching, threads, etc. 
 +</sxh>
 + 
 +
 + 
 +Credit: Diagram by Brendan Gregg 
  
  
Line 1453: Line 1478:
  
    dig -t NS google.com @1.1.1.1 ANY    dig -t NS google.com @1.1.1.1 ANY
 +
 +
 +===== Upgrading packages =====
 +
 +
 +==== Python3 ====
 +
 +<sxh shell>
 +
 +# install new version of python
 +sudo add-apt-repository ppa:deadsnakes/ppa
 +sudo apt update
 +sudo apt install python3.12
 +
 +# setting the python12 as default version of python
 +sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
 +
 +# gives python3.12.2
 +python3 --version
 +</sxh>
  
linux/ubuntu.1698913097.txt.gz · Last modified: by skipidar