Daily tip

Is there any script or utility or way to check if you are running in a virtual machine or in a physical server?

You can install the package virt-what, that is basically a script displaying the type of VM inferred from the system or if you are in a physical machine.

Daily tip

How do I disable the Network Manager in Redhat distros?

It can be disabled on single interfaces by adding the below line to the /etc/sysconfig/network-scripts/<IFCFG_FILE>

NM_CONTROLLED=no

And you need to restart network services.

Daily tip

How can I query the audit daemon logs?

With the command ausearch

For instance #ausearch -m avc -ts recent

Daily tip

How to display cgroups virtual file system hierarchies?

With the command $lssubsys -M

(you need the package libcgroup and libcgroup-tools installed)

Daily tip

How to disable the route 169.254.0.0 (also known as “APIPA address”) in Redhat distros ?

Just insert NOZEROCONF=yes or NOZEROCONF=no in the file /etc/sysconfig/network and then restart the network services.

Daily tip

I get the error “autoreconf not found” when trying to build a package from sources

Please check that you have installed the package autoconf.

Daily tip

How do I list HBA devices and WWN?

#systool -c fc_host -v

or

$lspci |grep -i hba

or write a script containing

if [ -e /sys/class/fc_host ]; then
for HOST in $(ls /sys/class/fc_host)
do cat /sys/class/fc_host/$HOST/node_name
done
else
echo “No fiber host adapter found.”
fi