How to handle missing blocks and blocks with corrupt replicas in HDFS?

Posted on

One of HDFS cluster’s hdfs dfsadmin -report reports: Under replicated blocks: 139016 Blocks with corrupt replicas: 9 Missing blocks: 0 The “Under replicated blocks” can be re-replicated automatically after some time. How to handle the missing blocks and blocks with corrupt replicas in HDFS? Understanding these blocks A block is “with corrupt replicas” in HDFS
Read more

How to make AdSense responsive ads show rectangle ads instead of horizontal ones?

Posted on

I noticed that many sites with AdSense responsive ads show large rectangle ads (336px x 280px) or large rectangle text ads (full width x 280px). However, in my own website (640px width content area), it shows most of time horizontal ones. How to make AdSense responsive ads show rectangle ads instead of horizontal ones? At
Read more

How to find a wireless network adapter’s speed in Linux?

Posted on

How to find a wireless adapter‘s speed in Linux? ethtool does not show the speed of the wireless adapters. For finding the configured speed of wireless adpaters in Linux, you can use the iwconfig tool. iwconfig: configure a wireless network interface For example, to find the speed of the wireless adapter wlp8s0: # iwconfig wlp8s0
Read more

How to find a network adapter’s speed in Linux?

Posted on

I have a Linux box and it is connected to a network through a network adapter, say gate. How to find what is the current speed (10Mbps, 100Mbps or 1000Mbps) of the adapter? You can find the network adapter speed by the ethtool command: ethtool: query or control network driver and hardware settings For example,
Read more

Implementation of strstr in glibc

Posted on

What is the implementation of strstr in glibc? Implementation of STRSTR in glibc (string/strstr.c): /* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK if NEEDLE is empty, otherwise NULL if NEEDLE is not found in HAYSTACK. */ char * STRSTR (const char *haystack_start, const char *needle_start) { const char *haystack = haystack_start; const
Read more

How to exclude last N columns in Bash on Linux?

Posted on

How to exclude last N columns of a string in bash? The point is that the number of columns in each line is uncertain (but > N). For example, I would like to remove the last 2 columns separated by ‘.’ in the following lines. systemd.3.gz systemd.mount.3.gz systemd.mount.f.3.gz The simple cut command cut -d’.’ -f1
Read more

Vim turns to be slow after enabling some plugins, how to find which leads the problem?

Posted on

Vim itself is very fast. But it turns to be slow after enabling some plugins. How to find which plugin leads the slowness of Vim? You may use the profiling mechanisms in Vim. Please check a tutorial on profiling Vim. For profiling Vim startup: vim –startuptime profile.log For profiling certain actions in Vim: :profile start
Read more

Required packages for building YouCompleteMe for Vim on Fedora 21

Posted on

YouCompleteMe for Vim on Fedora 21 reports this error: [zma@laptop:~/.vim/bundle/YouCompleteMe]$ ./install.sh — The C compiler identification is GNU 4.9.2 — The CXX compiler identification is GNU 4.9.2 — Check for working C compiler: /usr/bin/cc — Check for working C compiler: /usr/bin/cc — works — Detecting C compiler ABI info — Detecting C compiler ABI info
Read more

How to redirect WordPress search query to Google CSE?

Posted on

How to redirect WordPress search query to Google CSE? You can configure Google CSE to read the query variable (by default, it is q). Then, in your WordPress’s .htaccess file, add these 2 lines RewriteCond %{QUERY_STRING} ^s=(.*)$ RewriteRule ^ https://www.google.com/cse/publicurl?cx=xyz&q=%1 [R,L] Here, “https://www.google.com/cse/publicurl?cx=xyz” is your CSE’s public URL or the webpage that contains the Google
Read more

How to move all the files under Users for a user to another drive on Windows?

Posted on

Unfortunately, my C: drive is almost full. Most of the space are used by the user home under C:Users. How can I move the home directory to another drive while not affecting the user’s usage of Windows. On Linux/Unix, moving the directory to another drive/partition and then keeping a softlink is enough. But how to
Read more

How to find which program or process is listening on a certain port in Linux?

Posted on

My program reports that the port is already used. How to find which program or process is listening on a certain port in Linux? You can use netstat to do this. netstat can print network connections. For example, to find which program is listing on port 9999 netstat -pln | grep 9999 You will need
Read more

How to limit the network rate used by scp in Linux?

Posted on

I am using a shared network and scp to upload files. I do not want to use most of the bandwidth available. How to limit the network rate used by scp in Linux? You can use the -l option of scp to limit the rate of bandwidth. -l limit Limits the used bandwidth, specified in
Read more

VirtualBox report “Kernel driver not installed” on Fedora 21

Posted on

VitualBox is installed on Fedora 21 by # yum install VirtualBox The following packages are installed kmod-VirtualBox-3.18.7-200.fc21.x86_64-4.3.20-4.fc21.4.x86_64 VirtualBox-4.3.20-3.fc21.x86_64 There is the kernel modules package installed. However, when running virtualbox (after reboot), it reports: [zma@laptop:~]$ virtualbox WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (3.18.7-200.fc21.x86_64) or
Read more

How to resolve a domain name from a specific DNS server instead of the configured one in Linux?

Posted on

I would like to check whether the domain name’s IP has changed in the authoritative DNS server. The system’s configured DNS server may still cache the old IP, which is fine. The question is how to query from the authoritative DNS server the new IP? You can use dig – DNS lookup utility to query
Read more