MoonPoint Support Logo

 


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
October
Sun Mon Tue Wed Thu Fri Sat
 
21 22 23 24 25 26 27
28 29 30 31      
2018
Months
OctNov Dec


Tue, Dec 12, 2017 11:25 pm

NetworkManager and nm-tool

If you wish to check the speed of network interfaces on a CentOS Linux system, if the nm-tool utility, is installed, then you can use it to determine the speed of the network ports.

$ nm-tool

NetworkManager Tool

State: disconnected

- Device: em1 ------------------------------------------------------------------
  Type:              Wired
  Driver:            bnx2
  State:             unmanaged
  Default:           no
  HW Address:        D4:AE:52:CD:0A:D4

  Capabilities:
    Carrier Detect:  yes
    Speed:           1000 Mb/s

  Wired Properties
    Carrier:         on


- Device: em2 ------------------------------------------------------------------
  Type:              Wired
  Driver:            bnx2
  State:             unmanaged
  Default:           no
  HW Address:        D4:AE:52:CD:0A:D5

  Capabilities:
    Carrier Detect:  yes

  Wired Properties
    Carrier:         off


$

If it is installed, the nm-tool program will likely be in /usr/bin . It is part of the NetworkManager package.

[ More Info ]

[/os/unix/linux/centos] permanent link

Sun, Dec 10, 2017 7:39 pm

Determining the version of CentOS on a system

If you are logged into a CentOS Linux system, there are a few ways you can determine the version of CentOS running on the system from a command-line interface (CLI), i.e., a shell prompt.

In the /etc directory, there should be a /etc/centos-release file containing information on the version of CentOS.

$ ls -l /etc/*elease
-rw-r--r--  1 root root  27 Mar 28  2017 /etc/centos-release
-rw-r--r--. 1 root root 152 Nov 25  2013 /etc/lsb-release
lrwxrwxrwx  1 root root  14 Apr 20  2017 /etc/redhat-release -> centos-release
lrwxrwxrwx  1 root root  14 Apr 20  2017 /etc/system-release -> centos-release
$ cat /etc/*elease
CentOS release 6.9 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphi
cs-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.9 (Final)
CentOS release 6.9 (Final)
$

To just see the version number, you can use one of the grep commands below.

$ grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release
6.9
$ grep -oE '[0-9]+\.[0-9]+' /etc/centos-release
6.9
$

[ More Info ]

[/os/unix/linux/centos] permanent link

Sat, Jul 15, 2017 10:51 pm

Burning a CD/DVD on a Linux system with the cdrecord command

If you need to burn a CD or DVD from an ISO file from the command line on a Linux system, you can use the cdrecord command. If you include the -v argument to the program, you will see verbose information on the actions performed by the utility and the progress as it writes to the optical disc. When the program is finished you can use the eject command to eject the disc.

[ More Info ]

[/os/unix/linux/utilities/cd-dvd] permanent link

Thu, Jul 13, 2017 11:00 pm

Unbanning an IP address banned with fail2ban

I needed to remove an IP address from the "jail" it was placed in by fail2ban, which is intrusion prevention sotware, due to an incorrect password being entered too many times by a legitimate user of the system during attempts to log into a CentOS Linux system that runs fail2ban. The attempted logins were made via Secure Shell (SSH). After the number of attempts with an incorrect password reached the cutoff for fail2ban to automatically ban the IP address from which the login attempts were originating, the user then got the following error message on subsequent login attempts:

$ ssh jdoe@example.com
ssh: connect to host example.com port 22: Connection refused
$

The fail2ban log on the system is at /var/log/fail2ban.log. You can check that log to see which IP addresses were banned and the time any bans went into effect. So I first verified the IP address from which the login attempts were made.

# tail -n 3 /var/log/fail2ban.log
2017-07-13 21:59:06,304 fail2ban.filter         [1664]: INFO    [sshd] Found 192.168.1.21
2017-07-13 21:59:06,818 fail2ban.actions        [1664]: NOTICE  [sshd] Ban 192.168.1.21
2017-07-13 21:59:11,538 fail2ban.filter         [1664]: INFO    [sshd] Found 192.168.1.21
#

You can determine the name for the jail and IP address is in by issuing the command fail2ban-client status.

[ More Info ]

[/os/unix/linux] permanent link

Tue, Jul 04, 2017 10:47 pm

Determining the model and serial number of a HDD in a Linux system

If you need to know the model number and/or serial number of a hard disk drive (HDD) in a Linux system, one tool that you can use to obtain that information as well as other information on the drive is the lsblk utility, which is included in the util-linux package. E.g.:

# lsblk -o MODEL,SERIAL,SIZE,STATE --nodeps
MODEL            SERIAL            SIZE STATE
WDC WD10EZEX-00W WD-WCC6Y4ZYE4Y3 931.5G running
DVD A  DH16ACSHR 238229911623     1024M running
vmDisk-CD        13043003455      1024M running

You can see the list of arguments you can provide to the program with lsblk -h.

[ More Info ]

[/os/unix/linux/utilities/sysmgmt] permanent link

Fri, Jun 23, 2017 10:22 pm

lscpu

On a Linux system, you can use the lscpu command to obtain information on the system's Central Processing Unit (CPU). On a CentOS Linux system, the utility is included in the util-linux package. On a CentOS system, you can install that package using the yum package management utility, if it isn't already installed, using yum install util-linux. You can check on whether the lscpu program is already present using which lscpu and, on a CentOS system or another system that uses RPM, you can use rpm -qi util-linux to determine if the util-linux package is already installed.

[ More Info ]

[/os/unix/linux/utilities/sysmgmt] permanent link

Tue, Jun 20, 2017 10:22 pm

NetHogs

If you wish to monitor the top bandwidth consuming processes on a Linux system, you can use the nethogs program, which displays bandwidth usage by process. It will display the process id (PID) of the processes consuming the most bandwidth. E.g.:

NetHogs version 0.8.5

    PID USER     PROGRAM                    DEV        SENT      RECEIVED       
  19355 jim      sshd: jim@pts/0            enp1s4      0.188       0.082 KB/sec
  15022 apache   /usr/sbin/httpd            enp1s4      0.000       0.000 KB/sec
      ? root     unknown TCP                            0.000       0.000 KB/sec

  TOTAL                                                 0.188       0.082 KB/sec

The above output shows me that the two processes consuming the most bandwidth at the time the program was run had PIDs of 19355 and 15022. I can get additional information on those processes using the ps command.

$ ps 19355
  PID TTY      STAT   TIME COMMAND
19355 ?        S      0:19 sshd: jim@pts/0
$ ps 15022
  PID TTY      STAT   TIME COMMAND
15022 ?        S      0:00 /usr/sbin/httpd -DFOREGROUND
$

[ More Info ]

[/os/unix/linux/network] permanent link

Tue, May 23, 2017 10:36 pm

Checking speed and duplex settings on a Linux system

Sometimes network performance problems on a system can be due to a mismatch in the speed and/or duplex settings on a system and the switch or router to which it connects. Autonegotiation normally works to ensure that two connected devices have compatible settings, but occasionally it may not work as intended. On a Linux system, one way to check the spped and duplex values is by using the ethtool command. If the utility, which provides capabilities for querying and changing settings such as speed, port, auto-negotiation, PCI locations and checksum offload on many network devices, especially of Ethernet devices, isn't installed already you can install it on a Ubuntu Linux system with the command sudo apt-get install ethtool. On a CentOS Linux system, you can use yum install ethtool. You can run the software to show the settings for a network interface controller (NIC) by issuing the command ethtool devname where devname is the name associated with the network interface, e.g., you might issue the command ethtool eth0 on a Ubuntu system. You can see the available network interfaces using the command ifconfig -a. Below is the output of the command run on a CentOS system:

$ ethtool enp1s4
Settings for enp1s4:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	                        1000baseT/Half 1000baseT/Full 
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Speed: 100Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: Unknown
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000037 (55)
			       drv probe link ifdown ifup
	Link detected: yes
$

[/os/unix/linux/utilities/network] permanent link

Tue, Mar 28, 2017 9:39 pm

Determining which packages were recently installed on a CentOS Linux system

I needed to determine which packages were recently installed on a CentOS 7 system where yum is used to install packages. The command rpm -qa --last will list all packages that have been installed in chronological order with the most recently installed packages listed first, since the --last option orders the package listing by install time such that the latest packages are at the top. E.g.:

# rpm -qa --last
amarok-utils-2.8.0-19.el7.x86_64              Fri 12 Aug 2016 09:02:34 PM EDT
amarok-libs-2.8.0-19.el7.x86_64               Fri 12 Aug 2016 09:02:34 PM EDT
amarok-2.8.0-19.el7.x86_64                    Fri 12 Aug 2016 09:02:31 PM EDT
taglib-extras-1.0.1-8.el7.x86_64              Fri 12 Aug 2016 09:02:17 PM EDT
mariadb-embedded-5.5.50-1.el7_2.x86_64        Fri 12 Aug 2016 09:02:17 PM EDT
qjson-0.8.1-4.el7.x86_64                      Fri 12 Aug 2016 09:02:15 PM EDT
kdelibs-webkit-4.14.8-1.el7.x86_64            Fri 12 Aug 2016 09:02:14 PM EDT
qtscriptbindings-0.2.0-5.el7.x86_64           Fri 12 Aug 2016 09:02:13 PM EDT
qtwebkit-2.3.4-6.el7.x86_64                   Fri 12 Aug 2016 09:01:57 PM EDT
alpine-2.20-2.el7.x86_64                      Mon 08 Aug 2016 10:13:54 PM EDT
fuse-sshfs-2.5-1.el7.x86_64                   Mon 08 Aug 2016 09:28:26 PM EDT
gpg-pubkey-352c64e5-52ae6884                  Mon 08 Aug 2016 09:27:13 PM EDT
epel-release-7-6.noarch                       Mon 08 Aug 2016 09:12:51 PM EDT
lynx-2.8.8-0.3.dev15.el7.x86_64               Fri 05 Aug 2016 10:28:17 PM EDT
telnet-0.17-59.el7.x86_64                     Sat 30 Jul 2016 04:34:17 PM EDT
thunderbird-45.2-1.el7.centos.x86_64          Sat 30 Jul 2016 04:10:55 PM EDT
mutt-1.5.21-26.el7.x86_64                     Sat 30 Jul 2016 03:50:58 PM EDT
<text snipped>
gnu-free-fonts-common-20120503-8.el7.noarch   Fri 15 Jul 2016 03:10:39 PM EDT
dejavu-fonts-common-2.33-6.el7.noarch         Fri 15 Jul 2016 03:10:39 PM EDT
libgcc-4.8.5-4.el7.x86_64                     Fri 15 Jul 2016 03:10:38 PM EDT
fontpackages-filesystem-1.44-8.el7.noarch     Fri 15 Jul 2016 03:10:38 PM EDT
control-center-filesystem-3.14.5-8.el7.x86_64 Fri 15 Jul 2016 03:10:38 PM EDT
#

[ More Info ]

[/os/unix/linux/centos] permanent link

Sun, Mar 26, 2017 5:10 pm

Unrar for Centos 7

I needed to convert a rar file to a zip file on a CentOS 7 Linux system. But when I tried installing an unrar package with yum, the package manager on the system, I found none was available from any of the software repositories the system was configured to check for packages.

# yum install unrar
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.firehosted.com
 * epel: mirror.us.leaseweb.net
 * extras: centos.aol.com
 * updates: mirror.umd.edu
No package unrar available.
Error: Nothing to do
# yum install rar
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.firehosted.com
 * epel: mirror.us.leaseweb.net
 * extras: centos.aol.com
 * updates: mirror.umd.edu
No package rar available.
Error: Nothing to do
#

I had previously installed support for the Extra Packages for Enterprise Linux (EPEL) repository, but though I thought the unrar package might be found there, it wasn't found. I did find an RPM file for the software, howerver, at RPM CentOS 7 unrar 5.0.12 x86_64 rpm. I downloaded that file with wget and, since yum can be used to install RPM files, installed it with yum.

[ More Info ]

[/os/unix/linux/centos/7] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo