How to make CentOS 6.6 power off the console screen automatically?

Posted on

On CentOS 6.6, I find that it can make the screen (console, not X) blank after a while. However, it does not power the screen off. This usually work on Fedora or other releases. I guess this is caused by some configurations specific in CentOS 6.6. How to make CentOS 6.6 power off the console
Read more

How to set replication factors for HDFS directories?

Posted on

Is it possible to set the replication factor for specific directory in HDFS to be one that is different from the default replication factor? This should set the existing files’ replication factors but also new files created in the specific directory. This can simplify the administration. We can set the replication factor of /tmp/ to
Read more

Deleting a Specific Line From a Text File in Command Line in Linux

Posted on

On Linux, how to delete a specific line from a text file in command line? For example, to delete the 4th line from a file aaa bbb ccc ddd eee ffffff You can use the “stream editor for filtering and transforming text” sed. With GNU sed: sed -i ‘4d’ ./file Here, -i means edit the
Read more

How to enable RPM Fusion for CentOS 6.6?

Posted on

How to enable RPM Fusion for CentOS 6.6? Enable RPM fusion on RHEL 6 or compatible like CentOS: su -c ‘yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm’ It will install https://fedoraproject.org/wiki/EPEL. If it fails to install EPEL automatically, you will need to install it manually. Reference: http://rpmfusion.org/Configuration

How to install vbetool on CentOS 6.6?

Posted on

I found CentOS 6.6 does not ship vbetool in its default repositories, EPEL or RPMfusion. How to install vbetool on CentOS 6.6? First, download the source package from http://www.codon.org.uk/~mjg59/vbetool/ and unpack the package. Second, install needed packages: # yum pciutils-devel pciutils-devel-static libx86-devel During the building, it will try to find the libpci.a in a different
Read more

How to convert .pptx slides to .jpg or .png images on Linux in command line?

Posted on

How to convert .pptx slides to .jpg or .png images on Linux in command line? This following method works best for me. First, convert .pptx file to .pdf using libreoffice: libreoffice –headless –convert-to pdf file.pptx –headless makes libreoffice run in batch mode and not start the GUI. The pdf file will be named file.pdf by
Read more

How to convert between Simplified Chinese and Traditional Chinese characters in text files on Linux?

Posted on

How to convert between Simplified Chinese and Traditional Chinese characters in text files on Linux from command line? You can use opencc to convert between Traditional Chinese and Simplified Chinese: https://github.com/BYVoid/OpenCC For example, to transfer a file in simplified Chinese sc.txt to traditional Chinese: opencc -i sc.txt -o tc.txt -c zhs2zht.ini The authors also provide
Read more

How to merge git branches quickly and correctly

Posted on

Suppose I have following branches harryxiyou@common_vm ~/forest/sqle/sqle/scripts $ git branch * dev-harry master rc After I did some changes on dev-harry branch, I wanted to merge dev-harry into rc branch. 1, git checkout rc 2, git merge dev-harry References:http://stackoverflow.com/questions/24147169/merge-two-remote-branches-in-githttps://www.atlassian.com/git/tutorials/using-brancheshttp://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging I usually add –no-ff during git merge to force git to add a commit for the
Read more

How to build mplayer with libdvdnav on Linux?

Posted on

I find the mplayer from rpmfusion does not contain libdvdnav. How to build mplayer with libdvdnav on Linux? I did this on Fedora 21 to build mplayer with libdvdnav: Download mplayer src from http://www.mplayerhq.hu/design7/dload.html and extract the tarball. Install needed packages (you will need more if you need more features): # yum install gcc make
Read more

How to make dd faster on Linux?

Posted on

dd seems slow when I use command like # dd if=/dev/sda2 of=./sda2.bak How to make it faster? You can make dd faster by specifying a good bs like # dd if=/dev/sda2 of=./sda2.bak bs=8192 8192 is a magic number. There are may be other good sizes for bs for different systems. But 8192 works pretty well
Read more

How to understand some key system consistency algorithoms

Posted on

When we design a system, we may want our systems to be consistency, scalability and so on. Currently, there are some famous consistency algorithms. How to understand them easily. 1, Paxos and its extensions 2, Replicated State Machine mechanisms 3, Quorum Welcome to adding other famous consistency algorithms and its understanding ;-) Reading text books
Read more

When should the authors anonymize themselves in a paper submitted to a conference for review?

Posted on

When should the authors anonymize themselves in a paper submitted to a conference for review? Several general concepts: Peer review is the evaluation of work by one or more people of similar competence to the producers of the work (peers). — Wikipedia Single-blind describes experiments where information that could introduce bias or otherwise skew the
Read more

How to display chinese character in lxterminal

Posted on

Do you know how to display chinese character in lxterminal? I tried to install lxterminal on my workstation and it seems display Chinese characters well: FYI, my Linux system is Fedora 21. The lxterminal version: $ rpm -q lxterminal lxterminal-0.1.11-10.fc21.x86_64 Not sure what’s the reason why it does not work for you. You may check
Read more

Basic iptables configuration for Linux

Posted on

What is a good basic iptables config? Basic rules needed: Allow incoming TCP to 22 for SSH but blocks all others. Allow outgoing TCP/UDP connections. You may consider using the following rules as a start: for tables in iptables ip6tables ; do # Flush existing rules $tables -F # Default policy $tables -P INPUT DROP
Read more

How to log connections hitting certain rules in iptables on Linux?

Posted on

How to log connections hitting certain rules in iptables on Linux? Like the one that are dropped because of too frequently creating SSH connections. You can create a new chain named LOGNDROP that log the connections and drop them, then pass the connection to be redirected to the LOGNDROP chain. $tables -N LOGNDROP # Connections
Read more