There are many Vim tutorials and Vim tips on the Web. However, I find the
provides the best tutorial among those so far as I found on the Web while the
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
in a web page which is especially easier for Vim beginners to get and learn. » Read more
Sometimes, we may want to migrate one process/thread to one specific CPU for some specific purpose. In the Unix/Linux systems, you may choose sched_setaffinity to finish this job. This article will help you to understand how sched_setaffinity (or other APIs like pthread_setaffinity_np in user-space) works internal Linux kernel.
-- sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
--- __set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask, bool check)
---- stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg)
----- migration_cpu_stop(void *data)
------ __migrate_task(struct rq *rq, struct task_struct *p, int dest_cpu)
------- move_queued_task(struct rq *rq, struct task_struct *p, int new_cpu)
-------- enqueue_task(struct rq *rq, struct task_struct *p, int flags)
--------- returns the new run queue of destination CPU
Above character steps give a workflow of how sched_setaffinity works (how it migrates one process/thread from the run queue of source CPU to the run queue of destination CPU). » Read more
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.
Make Alt-Tab “classic” instead of grouping windows by application. It substitutes Alt-Tab with a window based switcher. » Read more
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 1.8 on CentOS 7. » Read more
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
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.
Steps are as follows. Note: you will need to replace HOST and USER with the actual username and hostname you are using. » Read more
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
Bash script may need to get its own path. In normal Bash script,
is the path to the script. However, when a script is sourced, such as
does not give
while the caller’s name. How to reliably get a bash script’s own path no matter whether the Bash script is executed or sourced is introduced in this post. » Read more
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 ∞
lists all interfaces.
Find the interface name to set, such as
Edit the interface’s configuration file ∞
, the configuration file is stored in
. » Read more
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
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
As you may know, Adobe stopped supporting the NPAPI version of Flash on Linux and the latest NPAPI version of Flash player at version 11.2 released back in 2012 will only receive security fixes. Even the security fixes to the 11.2 version of the Flash Plugin your Firefox is using will end on May 4, 2017, five years from the release date. » Read more
Doing actions upon changes of files and directories is very useful. Examples like compiling a project after the source code files are changed, sending emails after important configuration files are modified, building the PDF after a TeX file is modified. On Linux, the
provide good support for trigger actions after changes. In this post, I will introduce a small tool do-after-change.sh which continuously runs a command upon certain files and directories change. » Read more
The hplip packages contains all the tools you need to set up the HP scanner. For scanning, you may use the
tools. The tricky part to enable the scanner is carefully choose which driver to use from the hplip package. If you choose a non-suitable driver, only the printer will work and the scanner will not be found by Linux. » Read more
RAID systems such as MegaRAID add signatures to disks to maintain the infomration on these didks. When we simply remove these disks and install them to another server, Linux on the new server may detect these RAID signature infomration and refuses to continue write to the disk. Here is one example that
reports “apparently in use by the system” and refuses making a filesystem. » Read more
Vim is pretty fast and powerful. However, the core of Vim is (yet) single-threaded (some discussions and tries on porting Vim to be multi-threading, but not yet there). This means some functions that are slow will block Vim there and you have to wait for it. While Vim is fast, some plugins are not. When Vim turns to be slow, it is very likely caused by one or more plugins. » Read more
You may already well know “Linux” and may also use the “operating system based on the Linux kernel” directly or indirectly (you are indirectly using it now as this site is hosted on Linux). But how should we name the OS based on Linux? You may know there is GNU/Linux naming controversy. Different people have different opinions about this. Today, let’s see how do these widely used distributions call themselves by looking at their “about” web pages. » Read more
A pop-up terminal is great and handy on Linux and similar OS. On KDE, Yakuake is great. On Gnome or GTK, I ever tried Guake. It is quite good. However, it has not been as mature, stable and figure-rich as gnome-terminal. One day, I got this idea: why not using a script/program to manage the gnome-terminal and take action upon hotkey hits? » Read more
If your website uses a self-signed certificates, Chrome will show a warning every time and you need clicks to continue. In this post, I will introduce how to make Chrome accept self-signed certificates for sites on Linux.
This post is made short on purpose and you need to search the Web and learn if you want to understand the stuff.
You will need
package on Debian/Ubuntu/Linux Mint or
on CentOS/Fedora/RHEL. » Read more
My best favorite disk partition table manipulation tools are
on Linux. However, for large disks,
will just give up with a message suggesting GPT partition table format and using GNU
WARNING: The size of this disk is 6.0 TB (6001042391040 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. » Read more