How to autohide top and bottom panel in RHEL 7

Posted on

How to autohide top and bottom panels in RHEL 7 while application is running I don’t think GNOME 3 or GNOME 3 classic has this function available or there any plugins that supports so. If you need this function that the panel can hide automatically, you may consider another desktop environment, such as MATE, that
Read more

How to force a checkpointing of metadata in HDFS?

Posted on

HDFS SecondaraNameNode log shows 2017-08-06 10:54:14,488 ERROR org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Exception in doCheckpoint java.io.IOException: Inconsistent checkpoint fields. LV = -63 namespaceID = 1920275013 cTime = 0 ; clusterId = CID-f38880ba-3415-4277-8abf-b5c2848b7a63 ; blockpoolId = BP-578888813-10.6.1.2-1497278556180. Expecting respectively: -63; 263120692; 0; CID-d22222fd-e28a-4b2d-bd2a-f60e1f0ad1b1; BP-622207878-10.6.1.2-1497242227638. at org.apache.hadoop.hdfs.server.namenode.CheckpointSignature.validateStorageInfo(CheckpointSignature.java:134) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doCheckpoint(SecondaryNameNode.java:531) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.doWork(SecondaryNameNode.java:395) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode$1.run(SecondaryNameNode.java:361) at org.apache.hadoop.security.SecurityUtil.doAsLoginUserOrFatal(SecurityUtil.java:415) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.run(SecondaryNameNode.java:357) It seems the checkpoint
Read more

How to force a fsck during next rebooting of Linux?

Posted on

How to force a fsck of a file system, say the root, during the next rebooting of Linux? 2 possible ways: /forcefsck way for / # touch /forcefsck and reboot. Next time the / will be fsck’ed . systemd way Add these 2 kernel boot parameters: fsck.mode=force fsck.repair=yes What these 2 kernel parameters do: KERNEL
Read more

How to check interrupts lively in your systems?

Posted on

I need to see what kind of interrupts are handled by which CPU. Please run command: # cat /proc/interrupts or you can execute $ watch -n1 “cat /proc/interrupts” to watch interrupts every 1 second. See [1] [2] for more details. References: [1] https://stackoverflow.com/questions/28301875/how-to-observe-interrupts-in-windows-or-linux-ubuntu-14-04 [2] http://www.linuxjournal.com/content/watch-live-interrupts

How to flush STDOUT buffer in Python?

Posted on

How to flush the STDOUT buffer in Python so that the content wrote to STDOUT is shown immediately? Call the flush library function on sys.stdout which is the STDOUT: import sys sys.stdout.flush() From python doc: flush() Flush the write buffers of the stream if applicable. This does nothing for read-only and non-blocking streams. If you
Read more

How to tune systems to achieve high performance in virtualization circumstances?

Posted on

Most time, we need to tune system parameters to achieve better performance but what the general parameters to be tuned in Linux systems. I think you may want to add following parameters to Kernel boot (/etc/default/grub) parameters intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll intel_pstate=disable At the same time, you may also want to shutdown/open Pause Loop Exiting (PLE).
Read more

How to install gfortran on CentOS 7?

Posted on

How to install the gfortran fortran compiler on CentOS 7 Linux? gfortran on CentOS 7 is provided in the gcc-gfortran package. You may install it to install gfortran. # yum install gcc-gfortran Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: ftp.cuhk.edu.hk * epel: ftp.cuhk.edu.hk * extras: centos.01link.hk * nux-dextop: li.nux.ro *
Read more

Why “ValueError: zero length field name in format” error in Python on CentOS 6?

Posted on

The same Python program runs without any problem while it report ValueError: zero length field name in format error in Python on CentOS 6 The piece of code in Python is: print ‘== {} SPF’.format(d) Why “ValueError: zero length field name in format” error in Python on CentOS 6? This feature of {} without the
Read more

How to disable the fastestmirror yum plugin in CentOS 7 Linux?

Posted on

How to disable the fastmirror yum plugin in CentOS 7 Linux? The fastestmirror function of yum is provided by the package `yum-plugin-fastestmirror`. However, because `yum` depends on it, the `yum-plugin-fastestmirror` package can not be removed. If you try to remove it, `yum` will report failures like. # yum remove yum-plugin-fastestmirror Loaded plugins: fastestmirror Resolving Dependencies
Read more

How to get vCPU thread ID in QEMU/KVM host OS?

Posted on

In order to collect more information about CPU information internal guest OS, we usually need to get vCPU’s thread ID in host OS. Solution 1: Under directory ‘/sys/fs/cgroup/cpuset/machine’, you will find virtual_machine_name.libvirt-qemu directory. And under this directory, you will find all vCPU sub-directories and under these dirs, you will find vCPU thread IDs. For example
Read more

How to limit a user’s CPU resources in Linux Systems

Posted on

When you use a server with other users, you might want to limit other users’ CPU resources for some specific aims. Cgroup has lots of parameters we can use to control computer resources. For CPU resources, you can tune cpu.shares parameter to limit users’ CPU resources. To be more precise, change directory to /sys/fs/cgroup/cpu/user and
Read more

How to get processes’ I/O utilization percentage

Posted on

Two notices: 1, a process has only one main thread which is itself. 2, a process has many threads. Solution 1: Please use taskstats [1] related interfaces, and send TASKSTATS_TYPE_PID and TASKSTATS_TYPE_TGID commands to kernel to get a process’s ‘blkio_delay_total’ parameter for a process with one main thread and a process with threads separately. Solution
Read more

For QEMU/KVM, how to share data between host and guest

Posted on

General question for developers to access data between VM and VMM. As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance. Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel. Add following in your
Read more

How to add PHP DOMDocument extension to httpd in CentOS 7?

Posted on

Just migrated a PHP site to a new server. However, in /var/log/httpd/error_log, there are errors like [:error] [pid 2810] [client 61.92.242.24:43372] PHP Fatal error: Class ‘DOMDocument’ not found in /var/www/…/some.php on line 16 How to add PHP DOMDocument extension to httpd in CentOS 7? You need to install the package php-xml to have DOMCoument support
Read more

Where is MySQL / MariaDB storage location by default on CentOS 7?

Posted on

Where is MySQL / MariaDB storage location by default on CentOS 7? No special configuration to the MariaDB from official repository of CentOS. On CentOS 7 Linux it is usually by default /var/lib/mysql But here I give you another “hacky” way to find it out. The method is to find out the mysql daemon mysqld’
Read more

How to make iptables/ip6tables configurations permanent across reboot on CentOS 7 Linux?

Posted on

How to make iptables/ip6tables configurations permanent across reboot on CentOS 7 Linux? CentOS 7 uses FirewallD by default. If you would like to manage iptables/ip6tables rules directly without using FirewallD, you may use the old good iptables-services service which will load the iptables/ip6tables rules saved in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables when it is started during boot
Read more

How to upgrade vim to version 8 on CentOS 7?

Posted on

vim on CentOS 7 is version 7.4 with patches 1-160: $ vim –version VIM – Vi IMproved 7.4 (2013 Aug 10, compiled Dec 21 2016 17:00:20) Included patches: 1-160 How to upgrade it to version 8 which is the latest major version? Update on Oct 23 2018: the repository introduced in the original method is
Read more