Skip to content

SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search
SysTutorials

  • QA

    How to check interrupts lively in your systems?

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    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

    Read More How to check interrupts lively in your systems?Continue

  • QA

    How to force a fsck during next rebooting of Linux?

    ByEric Ma Mar 24, 2018Nov 21, 2019

    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 force a fsck during next rebooting of Linux?Continue

  • QA

    How to force a checkpointing of metadata in HDFS?

    ByEric Ma Mar 24, 2018Nov 21, 2019

    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 checkpointing of metadata in HDFS?Continue

  • QA

    How to set one task’s CPU affinity quickly?

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    How to set one task’s CPU affinity quickly? 1, Get this task’s ID # taskset -pc PID 2, Set this task’s CPU affinity # taskset -c affinity ./task There is also another format # taskset -pc affinity pid For example: set process with PID 3783 to CPU 15 # taskset -pc 15 3783

    Read More How to set one task’s CPU affinity quickly?Continue

  • QA

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

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    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 tune systems to achieve high performance in virtualization circumstances?Continue

  • QA

    How to flush STDOUT buffer in Python?

    ByEric Ma Mar 24, 2018Mar 30, 2026

    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 flush STDOUT buffer in Python?Continue

  • QA

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

    ByEric Ma Mar 24, 2018Mar 30, 2026

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

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

  • QA

    How to configure SPF for my email domain hosted by DreamHost?

    ByEric Ma Mar 24, 2018Nov 21, 2019

    My domain’s email is hosted by DreamHost and all my emails from that domain are sent using DreamHost’s SMTP. How to configure the SPF record for my email domain hosted by DreamHost? For a domain with email and SMTP hosted by DreamHost, you can set its SPF record to v=spf1 include:netblocks.dreamhost.com Reference: What SPF records…

    Read More How to configure SPF for my email domain hosted by DreamHost?Continue

  • QA

    How to install gfortran on CentOS 7?

    ByEric Ma Mar 24, 2018Mar 30, 2026

    How to install the gfortran fortran compiler on Rocky Linux 9 Linux? gfortran on Rocky Linux 9 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:…

    Read More How to install gfortran on CentOS 7?Continue

  • Linux | Software | Tutorial

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

    ByEric Ma Mar 24, 2018Mar 30, 2026

    How to disable the fastmirror yum plugin in Rocky Linux 9 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…

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

  • QA

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

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    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 limit a user’s CPU resources in Linux SystemsContinue

  • QA

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

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    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 get vCPU thread ID in QEMU/KVM host OS?Continue

  • QA

    Cannot make directory ‘/var/run/screen/S-apache’: Permission denied

    ByEric Ma Mar 24, 2018Nov 21, 2019

    Hello! Im trying to create a screen folder for the user apache, Not root. But it seems to fail, I have no idea on how to fix this issue. I only get the error: Cannot make directory ‘/var/run/screen/S-apache’: Permission denied Im using Cent OS 7 There may be various possible reasons. 2 common reasons: screen…

    Read More Cannot make directory ‘/var/run/screen/S-apache’: Permission deniedContinue

  • QA

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

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    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 For QEMU/KVM, how to share data between host and guestContinue

  • QA

    How to get processes’ I/O utilization percentage

    ByWeiwei Jia Mar 24, 2018Jan 7, 2020

    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 How to get processes’ I/O utilization percentageContinue

  • QA | Tutorial

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

    ByQ A Mar 24, 2018Mar 30, 2026

    How to make iptables/ip6tables configurations permanent across reboot on Rocky Linux 9 Linux? Rocky Linux 9 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…

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

  • QA

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

    ByEric Ma Mar 24, 2018Mar 30, 2026

    Where is MySQL / MariaDB storage location by default on Rocky Linux 9? No special configuration to the MariaDB from official repository of CentOS. On Rocky Linux 9 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…

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

  • QA

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

    ByEric Ma Mar 24, 2018Mar 30, 2026

    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 Rocky Linux 9? You need to install the package php-xml to have DOMCoument…

    Read More How to add PHP DOMDocument extension to httpd in CentOS 7?Continue

  • Tutorial

    How to get a substring at words boundaries in PHP?

    ByEric Ma Mar 24, 2018Aug 8, 2020

    How to get a substring at words boundaries in PHP? For example, for a string $a = “ab cc dde ffg ff”;, I would like to get its substring of length at most 7 from position 0 without breaking words. A simple substring($a, 0, 7) will break the word dde. Here, we consider “words” are…

    Read More How to get a substring at words boundaries in PHP?Continue

  • QA

    How to convert a piece of HTML code to plain text in PHP?

    ByEric Ma Mar 24, 2018Nov 21, 2019

    How to convert a piece of HTML code to plain text without leading and ending spaces in PHP? For example, I would like to convert <div> <b>hello</b> world</div> to a string hello world You may use this piece of code in PHP to strip HTML tags, remove leading and ending spaces and convert special characters…

    Read More How to convert a piece of HTML code to plain text in PHP?Continue

Page navigation

Previous PagePrevious 1 … 10 11 12 13 14 … 70 Next PageNext

© 2026 SysTutorials

  • Tutorials
  • Linux
  • Linux Manuals
  • Systems
  • Programming
  • Software
  • Subscribe
  • Search