Posts

Showing posts from February, 2018

dmesg - message buffer of the kernel | /var/log/messages | watch "dmesg | tail -20" | dmesg | grep sda

To discover which hard disks has been detected by kernel , you can search for the keyword “sda” along with “grep” like shown below. [root@tecmint.com ~]# dmesg | grep sda [    1.280971] sd 2:0:0:0: [sda] 488281250 512-byte logical blocks: (250 GB/232 GiB) [    1.281014] sd 2:0:0:0: [sda] Write Protect is off [    1.281016] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00 [    1.281039] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [    1.359585]  sda: sda1 sda2 < sda5 sda6 sda7 sda8 > [    1.360052] sd 2:0:0:0: [sda] Attached SCSI disk [    2.347887] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [   22.928440] Adding 3905532k swap on /dev/sda6.  Priority:-1 extents:1 across:3905532k FS [   23.950543] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro [   24.134016] EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: (null) [   24.330762] EXT4-fs (sda7): mounted filesystem with ordered dat

desktop GNOME 2 Unity

Unity is a shell interface for the GNOME environment used primarily on Ubuntu systems. GNOME 2 is a desktop environment and GUI that is developed mainly by Red Hat, Inc

read from a file run and sort

read from a file run the following command: sort < file1.txt sort < file1.txt > output-file.txt

/proc/interrupts

This file records the number of interrupts per IRQ on the x86 architecture. A standard  /proc/interrupts  looks similar to the following: CPU0 0: 80448940 XT-PIC timer 1: 174412 XT-PIC keyboard 2: 0 XT-PIC cascade 8: 1 XT-PIC rtc 10: 410964 XT-PIC eth0 12: 60330 XT-PIC PS/2 Mouse 14: 1314121 XT-PIC ide0 15: 5195422 XT-PIC ide1 NMI: 0 ERR: 0 For a multi-processor machine, this file may look slightly different: CPU0 CPU1 0: 1366814704 0 XT-PIC timer 1: 128 340 IO-APIC-edge keyboard 2: 0 0 XT-PIC cascade 8: 0 1 IO-APIC-edge rtc 12: 5323 5793 IO-APIC-edge PS/2 Mouse 13: 1 0 XT-PIC fpu 16: 11184294 15940594 IO-APIC-level Intel EtherExpress Pro 10/100 Ethernet 20: 8450043 111

curl healthchcheck example %{http_code} %{time_total}

$ URL = https :// example . com $ curl "$URL" - s - o / dev / null - w \ > "response_code: %{http_code}\n > dns_time: %{time_namelookup} > connect_time: %{time_connect} > pretransfer_time: %{time_pretransfer} > starttransfer_time: %{time_starttransfer} > total_time: %{time_total} > " response_code : 200 dns_time : 0.029 connect_time : 0.046 pretransfer_time : 0.203 starttransfer_time : 0.212 total_time : 0.212

ping www.google.fr | while read pong; do echo "$(date): $pong"; done

ping www.google.fr | while read pong; do echo "$(date): $pong"; done

apt-get install arp-scan

apt-get install arp-scan

zombie process | ps aux -> Z | kill -s SIGCHLD

How do I see if there are zombie processes on a system? Run “ ps aux ” and look for a Z in the STAT column. How do I remove zombie processes from a system? Well, first you can wait. It’s possible that the parent process is intentionally leaving the process in a zombie state to ensure that future children that it may create will not receive the same pid. Or perhaps the parent is occupied, and will reap the child process momentarily. Secondly, you can send a SIGCHLD signal to the parent (“ kill -s SIGCHLD <ppid> “). This will cause well-behaving parents to reap their zombie children. Finally, you can kill the parent process of the zombie. At that point, all of the parent’s children will be adopted by the init process (pid 1), which periodically runs  wait()  to reap any zombie children. ================ kernel may not be able to successfully kill the process in some situations. If the process is waiting for network or disk I/O, the kernel won’t be able to stop it.