Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

A Beginners’ Guide to x86-64 Instruction Encoding

The encoding of x86 and x86-64 instructions is well documented in Intel or AMD’s manuals. However, they are not quite easy for beginners to start with to learn encoding of the x86-64 instructions. In this post, I will give a list of useful manuals for understanding and studying the x86-64 instruction encoding, a brief introduction and an example to help you get started with the formats and encodings of the x86-64 instructions. » Read more

How to force a metadata checkpointing in HDFS

The metadata checkpointing in HDFS is done by the Secondary NameNode to merge the fsimage and the edits log files periodically and keep edits log size within a limit. For various reasons, the checkpointing by the Secondary NameNode may fail. For one example, HDFS SecondaraNameNode log shows errors in its log as follows. 2017-08-06 10:54:14,488 ERROR org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Exception in doCheckpoint Inconsistent checkpoint fields. » Read more

How to Install Paravirtualized CentOS 7 DomU on Xen

This post introduces how to install a paravirtualized CentOS 7 DomU on Xen. The very common way of installing DomU does not work for CentOS 7. A little trick to set the repository and the network used by the VM should be used by adding a setting strings to the “extra=” field for this VM. To install the DomU VM, first download the pxeboot images from CentOS’s official website at » Read more

How to Compile and Install Linux Kernel from the Source Code in an Existing Linux OS

Building Linux kernel may sound a complex and geek-only thing. However, as Linux kernel itself has much less depended tools/packages compared to other software packages, it is quite easy to compile, build and install a Linux kernel from the source code in an existing Linux OS. Building Linux kernel is needed if you need to build a specific Linux kernel or update your drivers for a kernel by yourself. » Read more

Vim Tutorial for Beginners: vimtutor

There are many Vim tutorials and Vim tips on the Web. However, I find the vimtutor provides the best tutorial among those so far as I found on the Web while the vimtutor seems usually reachable from a terminal which is not obviously known to Vim beginners who are usually Linux beginners too. This page shows the content of the Vim tutorial from the command vimtutor in a web page which is especially easier for Vim beginners to get and learn. » Read more

Essential Gnome Shell Extensions for Gnome 3 Users

Gnome Shell has a clean design. But many users want to get more from the desktop environment. Gnome 3’s extension system can help users customize the Gnome Shell’s look greatly. In this post, we summarize 6 extensions we considered essential to make Gnome Shell great. AlternateTab ∞ Make Alt-Tab “classic” instead of grouping windows by application. It substitutes Alt-Tab with a window based switcher. » Read more

How to Install Wine 32-bit on CentOS 7

Since version 7, RHEL has only x86-64 versions. The same thing happens to CentOS 7. In CentOS 7/EPEL, there is only package for Wine x86-64. However, many Windows .exe files are 32-bit. Even there are 64-bit versions for some software, their installation file is 32-bit. And for some certain software such as Office 2007, 32-bit wine is preferred. In this post, we will check how to install 32-bit Wine on CentOS 7. » Read more

Additional Repositories for CentOS Linux

CentOS is a super solid Linux distro. However, its default repository’s packages are limited compared to Fedora. Even Fedora needs some additional repositories to have software packages for daily usage, such as MPlayer, ffmpeg. Fortunately, some community maintained repositories provides these software. In this post, we introduce theses additional common repositories and how to install them into CentOS. For the installation method, we use CentOS 7 as an example. » Read more

How to Change Systemd Boot Target on Linux

Many Linux distros, such as RHEL/CentOS 7, Fedora, Ubuntu 16, are now using systemd instead of init as the init system. It is common for Linux users to set Linux to boot to “GUI” or “Text” mode. The old way of changing ‘/etc/inittab’ for choosing Linux runlevels is not working for sytemd. This post will introduce the way for systemd systems to select the “runlevels”. » Read more

How to Change Linux Account Password Through SSH: A Beginners’ Tutorial

People are sometimes given access to Linux/Unix and asked to change their initial passwords. But for beginners, changing a Linux/Unix password is not an easy task, especially when there is only SSH log on allowed to the Linux/Unix server. This post introduces how to change password of user USER on host HOST remotely using SSH. linux-passwd.png Steps are as follows. Note: you will need to replace HOST and USER with the actual username and hostname you are using. » Read more

How to Force Linux to Unmount a Filesystem Reporting “device is busy”

Linux may report “device is busy” when we try to umount a filesystem. This behavior is reasonable as it can help us avoid data loss by disallowing unmouting a filesystem when it is being used. But for situations when we are sure there is something wrong happened or we care not data lost such as a NFS mounting failed because that the NFS server is dead and will never be back. » Read more

How to Disable and Enable Laptop Keyboard in Linux

Attaching a USB keyboard to a laptop is common when using a laptop because a normal keyboard may provide a more convenient typing experience. The laptop keyboard is not used in these situations. However, the laptop keyboard may still be touched by accident. In this post, we will discuss how to disable and enable the laptop keyboard in Linux. I will also provide scripts ready for you to directly use them for disabling/enabling the laptop keyboard. » Read more

How to Automatically Move Junk Emails to The Junk Folder in Thunderbird

Junk Emails, or Email spams, are annoying and they cost time to deal with. While they are something we need to cope with, we can use tools to help us. Thunderbird has an adaptive junk filter that can learn from user’s actions to identify junk messages. I find that Thunderbird default settings are not fully configured as I expected to make fully use of its features. » Read more

How to Set the Static IP Address Using CLI in Fedora/CentOS Linux

How to set the static IP address for CentOS 7/Fedora 22+ is introduced in this post. Here, we assume the Linux is using NetworkManager to manage the network. All steps are done as root. Find the interface you want to set the address ∞ Command ifconfig -a lists all interfaces. Find the interface name to set, such as enp2s0. datacenter-servers.jpg Edit the interface’s configuration file ∞ For interface NAME, the configuration file is stored in /etc/sysconfig/network-scripts/ifcfg-NAME. » Read more

Three Methods of Executing Commands on Many Nodes in Parallel via SSH on Linux

It is common to execute commands on many nodes/hosts via SSH for managing a cluster of Linux servers. On Linux, there are many choices for this task. Generally, to run commands on many nodes, there are two modes: serial mode and parallel mode. In serial mode, the command is executed on the node one by one. In parallel mode, the command is executed on many nodes together. » Read more

How to Add Google to Firefox in Linux Mint as Default Search Engine

In Firefox on Linux Mint, Google is not in the default list of search engines. Linux Mint has its criteria for adding search engines while Google seems not in those suggested by Linux Mint because “Amongst commercial search engines, only the ones which share with Linux Mint the revenue Linux Mint users generate for them are included by default” while Google seems not share revenue with Linux Mint. » Read more

Notes for Beginners of Software Development on Linux

Linux is a great platform for software development targeting servers or backends. In general, working on Linux is very productive. The problem that beginners on Linux face is the the learning curve is steep at the beginning. But believe me, after you get through the initial green steep learning step as in the figure below with some hard work, you will feel like working on a rocket in the yellow part. » Read more

Uploading Large Files to Amazon S3 with AWS CLI

Amazon S3 is a widely used public cloud storage system. S3 allows an object/file to be up to 5TB which is enough for most applications. The AWS Management Console provides a Web-based interface for users to upload and manage files in S3 buckets. However, uploading a large files that is 100s of GB is not easy using the Web interface. From my experience, it fails frequently. » Read more