Pages

Tuesday, October 29, 2019

Fedora 30 : 8 Gb RAM to my old hardware.

I add another DDR3 memory RAM to my hardware for Fedora distro Linux version 30.
I will try to find a CPU gen2 for 1155 socket because is an old CPU.
This is a part of fpaste command output:
[mythcat@desk ~]$ sudo fpaste --sysinfo --printonly 
=== fpaste 0.4.0.1 System Information (fpaste --sysinfo) ===
* OS Release (cat /etc/*-release | uniq):
     Fedora release 30 (Thirty)
     NAME=Fedora
     VERSION="30 (Server Edition)"
     ID=fedora
     VERSION_ID=30
     VERSION_CODENAME=""
... 
* Kernel (uname -r ; cat /proc/cmdline):
     5.3.7-200.fc30.x86_64
* Desktop(s) Installed (ls -m /usr/share/xsessions/ | sed 's/\.desktop//g' ):
     LXDE, openbox
     
* SELinux Status (sestatus):
     SELinux status:                 enabled
     SELinuxfs mount:                /sys/fs/selinux
     SELinux root directory:         /etc/selinux
     Loaded policy name:             targeted
     Current mode:                   enforcing
     Mode from config file:          enforcing
     Policy MLS status:              enabled
     Policy deny_unknown status:     allowed
     Memory protection checking:     actual (secure)
     Max kernel policy version:      31
     
* SELinux Errors (without results: "selinuxenabled && journalctl --since yesterday |grep avc: | grep 
-Eo comm="[^ ]+" | sort |uniq -c |sort -rn"):
     N/A

* CPU Model (grep 'model name' /proc/cpuinfo | awk -F: '{print $2}' | uniq -c |
         sed -re 's/^ +//' ):
     2  Intel(R) Celeron(R) CPU G1620 @ 2.70GHz
     
* 64-bit Support (grep -q ' lm ' /proc/cpuinfo && echo Yes || echo No):
     Yes
     
* Hardware Virtualization Support (grep -Eq '(vmx|svm)' /proc/cpuinfo && echo Yes || echo No):
     Yes
     
* Load average (uptime):
      21:42:37 up  2:46,  1 user,  load average: 0.42, 0.60, 0.90
     
* Memory usage (free -m):
                   total        used        free      shared  buff/cache   available
     Mem:           9694        2641        5422         189        1631        6605
     Swap:          3563           0        3563
     
* Top 5 CPU hogs (ps axuScnh | awk '$2!=3629' | sort -rnk3 | head -5):
         1000  2306 20.8  4.4 3620080 444832 ?      Sl   21:05   7:39 firefox
         1000  3497 17.2  0.0  16304  5284 pts/0    Ss   21:41   0:11 bash
         1000  2590 10.2  3.9 2825496 392932 ?      Sl   21:07   3:34 Web Content
         1000  2362  9.5  4.8 3206080 480436 ?      Sl   21:05   3:30 Web Content
         1000  2801  5.4  4.4 2989744 437088 ?      Sl   21:12   1:38 Web Content
     
* Top 5 Memory hogs (ps axuScnh | sort -rnk4 | head -5):
         1000  2362  9.5  4.8 3206080 480436 ?      Sl   21:05   3:30 Web Content
         1000  2468  3.1  4.6 2986868 466524 ?      Sl   21:05   1:09 Web Content
         1000  2801  5.4  4.4 2989744 437088 ?      Sl   21:12   1:38 Web Content
         1000  2306 20.8  4.4 3620080 444832 ?      Sl   21:05   7:39 firefox
         1000  2590 10.2  3.9 2825496 392932 ?      Sl   21:07   3:34 Web Content
...
* GL Support (glxinfo | grep -E "OpenGL version|OpenGL renderer"):
     OpenGL renderer string: NVA8
     OpenGL version string: 3.3 (Compatibility Profile) Mesa 19.1.7
     
* Xorg errors (without results: "grep '^\[.*(EE)' /var/log/Xorg.0.log ~/.local/share/xorg/Xorg.0.log
 | cut -d ':' -f 2- "):
     N/A
   
* DNF Repositories (dnf repolist):
     repo id                     repo name                                     status
     *fedora                     Fedora 30 - x86_64                            56,582
     *fedora-modular             Fedora Modular 30 - x86_64                       135
     *rpmfusion-free             RPM Fusion for Fedora 30 - Free                  616
     *rpmfusion-free-updates     RPM Fusion for Fedora 30 - Free - Updates        290
     *rpmfusion-nonfree          RPM Fusion for Fedora 30 - Nonfree               227
     *rpmfusion-nonfree-updates  RPM Fusion for Fedora 30 - Nonfree - Updates      68
     *updates                    Fedora 30 - x86_64 - Updates                  13,734
     *updates-modular            Fedora Modular 30 - x86_64 - Updates             144
     
...
* EFI boot manager output (without results: "efibootmgr -v"):
     N/A
My test performance with octane.

Wednesday, October 16, 2019

Fedora 30 : News about python 3.8.0 and install on Linux.

The new release of python development comes today.
You can see on the official webpage the new versions of Python 3.7.5 Oct. 15, 2019 and Python 3.8.0 Oct. 14, 2019.
I wrote about how to install version 3.8.0 on Fedora 30.
See the full tutorial here.

Sunday, October 6, 2019

Fedora 30 : The paris-traceroute tool.

Today I tested two Linux tools named:paris-traceroute. This tool can be install with dnf tool. This tool named paris-traceroute was implemented by Xavier Cuvellier. Debugged and enhanced by Brice Augustin. The techniques invented by the authors of Paris-traceroute to enumerate the paths of ECMP flow-based load balancing. I used the 8.8.8.8 address to test this tool.
[root@desk mythcat]# paris-traceroute 8.8.8.8 -p icmp
...
[root@desk mythcat]# paris-traceroute 8.8.8.8 -i
...
[root@desk mythcat]# paris-traceroute 8.8.8.8 -l
...
Using the verbose mode the tool will print debug messages:
[root@desk mythcat]# paris-traceroute 8.8.8.8 -v
[DEBUG](Options.cc, 222)dst_addr = 8.8.8.8
[DEBUG](Options.cc, 340)protocol     = udp
[DEBUG](Options.cc, 341)src_add      = 
[DEBUG](Options.cc, 342)dst_addr     = 8.8.8.8
[DEBUG](Options.cc, 343)ttl_initial  = 1
[DEBUG](Options.cc, 344)ttl_max      = 30
[DEBUG](Options.cc, 345)tos          = 0
[DEBUG](Options.cc, 346)probe_length = 0
[DEBUG](Options.cc, 347)algo         = hopbyhop
[DEBUG](Options.cc, 348)timeout      = 5000
[DEBUG](Options.cc, 349)delay        = 50
[DEBUG](Options.cc, 350)max_try      = 3
[DEBUG](Options.cc, 351)max_missing  = 3
[DEBUG](Options.cc, 352)id_initial   = 1
[DEBUG](Options.cc, 353)resolve      = true
[DEBUG](Options.cc, 354)ipid         = false
[DEBUG](Util.cc, 246)p_proto = 1
[INFO](Server.cc, 216)waiting for the first packet..

[INFO](TracertImpl.cc, 48)HopByHop algo
[INFO](TracertImpl.cc, 183)Send probe, ttl=1, id=1
[DEBUG](UDPProbe.cc, 247)==> UDP Probe :
[DEBUG](IP4Header.cc, 346)IP4 header :
[DEBUG](IP4Header.cc, 347)tos                = 0
[DEBUG](IP4Header.cc, 348)total_length       = 30
[DEBUG](IP4Header.cc, 349)ttl                = 1
[DEBUG](IP4Header.cc, 350)protocol           = 17
[DEBUG](IP4Header.cc, 353)source_address     = 
[DEBUG](IP4Header.cc, 355)dest_address       = 8.8.8.8
[DEBUG](UDPHeader.cc, 143)UDP header :
[DEBUG](UDPHeader.cc, 144)source_port        = 
[DEBUG](UDPHeader.cc, 145)dest_port          = 
[DEBUG](UDPHeader.cc, 146)datagram_length    = 10
[DEBUG](UDPHeader.cc, 147)checksum           = 12584
[DEBUG](UDPProbe.cc, 250)Data :
[DEBUG]0x01 0x00 
[DEBUG]0x45 0x00 0x00 0x1e 0x00 0x01 0x00 0x00 
[DEBUG]0x01 0x11 0x00 0x00 0xc0 0xa8 0x00 0x8f 
[DEBUG]0x08 0x08 0x08 0x08 0x82 0xb0 0x82 0xb1 
[DEBUG]0x00 0x0a 0x28 0x31 0x01 0x00 
[INFO](Server.cc, 276)Captured first packet!

[DEBUG](Server.cc, 280)Incoming message :
[DEBUG](Server.cc, 281)parsing.. ef72baa0 58
[DEBUG]0x45 0xc0 0x00 0x3a 0x5c 0xcd 0x00 0x00 
[DEBUG]0x40 0x01 0x9b 0x55 0xc0 0xa8 0x00 0x01 
[DEBUG]0xc0 0xa8 0x00 0x8f 0x0b 0x00 0xc6 0x62 
[DEBUG]0x00 0x00 0x00 0x00 0x45 0x00 0x00 0x1e 
[DEBUG]0x00 0x01 0x00 0x00 0x01 0x11 0xe8 0x87 
[DEBUG]0xc0 0xa8 0x00 0x8f 0x08 0x08 0x08 0x08 
[DEBUG]0x82 0xb0 0x82 0xb1 0x00 0x0a 0x28 0x31 
[DEBUG]0x01 0x00 
[DEBUG](Server.cc, 285)Incoming message parsed :
[DEBUG](IP4Header.cc, 346)IP4 header :
[DEBUG](IP4Header.cc, 347)tos                = 192
[DEBUG](IP4Header.cc, 348)total_length       = 58
[DEBUG](IP4Header.cc, 349)ttl                = 64
[DEBUG](IP4Header.cc, 350)protocol           = 1
[DEBUG](IP4Header.cc, 353)source_address     = 
...
You can see more about this tool here. Another tool is dublin-traceroute works like paris-traceroute but introduces a new technique for NAT detection ( this is not in the Fedora repo).

Friday, October 4, 2019

Fedora 30 : A general intro to linux signals with python.

UNIX/Linux systems offer special mechanisms to communicate between each individual process with signals. Let's see these signals:
[mythcat@desk ~]$ kill -l
 1) SIGHUP  2) SIGINT  3) SIGQUIT  4) SIGILL  5) SIGTRAP
 6) SIGABRT  7) SIGBUS  8) SIGFPE  9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
Each signal is represented by an integer value, and the list of signals that are available. This simple python script create a process and print one message. Each process named PID comes with a number.
[mythcat@desk ~]$ cat python3 signal_001.py 
cat: python3: No such file or directory
import os
import sys
import time
print('PID number is:', os.getpid())
while True:
    print('Waiting...')
    time.sleep(6)
[mythcat@desk ~]$ python3 signal_001.py 
PID number is: 2566
Waiting...
Waiting...
Waiting...
Waiting...
Waiting...
Hangup
The PID process can be kill with this command:
[mythcat@desk ~]$ kill -SIGTERM 2566
Let's see another example that receives the signal we have sent to the process.
import os
import signal
import time

def receiveSignal(signalNumber, frame):
    print('Received:', signalNumber)
    raise SystemExit('Exiting')
    return

if __name__ == '__main__':
    # register the signals to be caught
    signal.signal(signal.SIGHUP, receiveSignal)
    signal.signal(signal.SIGINT, receiveSignal)
    signal.signal(signal.SIGQUIT, receiveSignal)
    signal.signal(signal.SIGILL, receiveSignal)
    signal.signal(signal.SIGTRAP, receiveSignal)
    signal.signal(signal.SIGABRT, receiveSignal)
    signal.signal(signal.SIGBUS, receiveSignal)
    signal.signal(signal.SIGFPE, receiveSignal)
    #signal.signal(signal.SIGKILL, receiveSignal)
    signal.signal(signal.SIGUSR1, receiveSignal)
    signal.signal(signal.SIGSEGV, receiveSignal)
    signal.signal(signal.SIGUSR2, receiveSignal)
    signal.signal(signal.SIGPIPE, receiveSignal)
    signal.signal(signal.SIGALRM, receiveSignal)
    signal.signal(signal.SIGTERM, receiveSignal)
    # register the signal to be caught
    signal.signal(signal.SIGUSR1, receiveSignal)

    # register the signal to be ignored
    signal.signal(signal.SIGINT, signal.SIG_IGN)

    # output current process id
    print('My PID is:', os.getpid())

    signal.pause()
Let't run it and see what happend when send a signal to the PID:
[mythcat@desk ~]$ python3 py_pid.py
My PID is: 2698
Received: 10
Exiting
You can see the kill command will send this output: Received: 10 Exiting .
[mythcat@desk ~]$ kill -SIGUSR1 2698