This problem appears when I try to rsync directories with hosts inside a cluster used NAT for forwarding ports to internal nodes. Hence, the ssh port for internal nodes are not the default 22. So, how to use rsync with the non-standard ssh ports? The -e options of rsync play the trick very well. For
Read more
Author: Eric Ma
Eric is a 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.How to convert a .docx .doc MS Word file to pdf in command line on Linux
Posted onHow to convert a MS Word document file such as .docx and .doc to pdf on Linux using command line tools? Use LibreOffice: libreoffice –headless –convert-to pdf –outdir /path/to/out/dir/ /path/to/doc/docx/file While this LibreOffice answer works, the –headless option still needs as display, even though it does not use it. In otherwords, this option won’t work
Read more
How to make eps files using gnuplot
Posted onHow to make gnuplot generate eps files instead of plot the figures on screen? First, save a Gnuplot plot as a PostScript file by this commands: # gnuplot> load ‘saveplot’ # gnuplot> !mv my-plot.ps another-file.ps The saveplot file’s content: set size 1.0, 0.6 set terminal postscript portrait enhanced mono dashed lw 1 “Helvetica” 14 set
Read more
How to revert only one file back to a revision or commit
Posted onI messed up with one file in one repository and want to check out only that file back to a commit. How to achieve this? To check the file with my_file.name at git commit commit_sha1: $ git checkout commit_sha1 my_file.name You can also use the relative commit instead of commit_sha1 such as master~4, HEAD~4, HEAD^,
Read more
How to install Python environment in my own account on Dreamhost?
Posted onHow to install Python environment in my own account on Dreamhost so that my application can use the python that I installed by myself instead of the system-wide one? The post for Bluehost works very well for Dreamhost too: https://my.bluehost.com/cgi/help/python-install In short: mkdir ~/python cd ~/python wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz tar zxfv Python-2.7.2.tgz find ~/python -type d
Read more
How to change the window title font family and size in Gnome 3?
Posted onIt was ever possible to set it in gnome-teak-tool. However, in the latest Gnome 3, it disappears. Is there any other way to set it? The configuration is the org.gnome.desktop.wm.preferences titlebar-font under dconf. You can use dconf-editor to find the appropriate key entry and set it. Or use gsettings: $ gsettings set org.gnome.desktop.wm.preferences titlebar-font ‘Sans
Read more
Find broken links on my site
Posted onThere are lots internal and external links on my site. Unfortunately, some of them are broken over years. How to find out all these broken links on my site? I use this tool http://www.brokenlinkcheck.com/ which can detect the broken links well. More info here: Broken links checker for sites
How to convert a latex file to a single page html
Posted onHow to convert a latex file to a single page html? htlatex is a good choice. On Fedora, install it by yum install texlive-tex4ht. To generate the HTML page from a latex file doc.tex: htlatex doc You can use the latex2html (can be installed on Fedora by yum install latex2html). $ latex2html -split +0 -info
Read more
How to count the number of page view
Posted onI have seen the question Better way to count total page views? I think, the better way is.. We can save the number of page views in the database. It is acceptable. But, it is not fulfilling my requirement, if many different users can appear to have the same IP Address (e.g, if they are
Read more
How to automatically fill a batch of data to the PDF form
Posted onHow to automatically fill a batch of data (well structured) to the PDF form? There are lots data items, so automatically do this by a program/script is required. If you know a little bit of Python, you can achieve this in Python with some libraries. Check How can I auto-populate a PDF form in Django/Python.
Read more
How to install Scala from the official Scala distribution
Posted onHow to install Scala from the official Scala distribution? This is needed on a Linux release with older version of Scala in the repository, e.g. Fedora 12. Use the install-scala.sh script: # wget https://raw2.github.com/zma/usefulscripts/master/script/install-scala.sh # sh ./install-scala.sh VER where VER is the scala version that you want to install. First step, install and configure the
Read more
Single sign-in for social accounts for question2answer?
Posted onHow to enable single sign-in for social accounts for question2answer? These servers are required: Google, Facebook, Twitter, OpenID. This site moved from Loginza to Question2Answer Open Login which works like a charm. I use the Loginza and it works very well. For Q2A, SLonoed wrote a nice plugin for loginza. How to use it: Download
Read more
ANSI C Grammar and ANSI C Grammar Specification in YACC
Posted onANSI C is a standardized version of the C programming language that was introduced in 1989 by the American National Standards Institute (ANSI). The ANSI C standard defines the syntax and semantics of the C language, including its grammar. In this post, we will explore the ANSI C grammar in more detail. The ANSI C
Read more
SEEK_HOLE and SEEK_DATA: efficiently archive/copy large sparse files
Posted onHow to efficiently archive a very large sparse file, say 1TB? The sparse file may contains a small amount of data, say 32MB. SEEK_HOLE and SEEK_DATA The SEEK_HOLE/SEEK_DATA functionalities play the trick and makes `tar` and `cp` handle the large sparse file very efficiently. `lseek` with `SEEK_HOLE` returns the offset of the start of the
Read more
Where Does Evolution Save Its Data and Configuration Files on Linux?
Posted onEvolution is a great personal information management tool that provides Email, address book and calendar tools. Evolution provides many enterprise friendly feature such as native support to Microsoft Exchange connectivity for Emails, address books and calendars. Evolution uses various ways including plain files and dconf configuration systems. This post will give an introduction to the
Read more
How to Export an NFSv4 Server to External Networks
Posted onWe ever discussed fixing ports used by NFSv3 so that it can be easily exported to external networks. For NFSv4.1 or higher, things are much easier. The ports for mountd, statd, and lockd are not required in a pure NFSv4 environment. We have less ports to control or allow for connections. Only port 111 and
Read more
A List of Common Software on Windows
Posted onQuick links to some useful software on Windows including Web browsers, Video/audio player and ssh/scpsftp/vnc tools for connecting to Linux. ssh/scp/sftp/vnc for connecting to Linux For Linux users, it is sometimes unavoidably to use Windows. With Windows, the Linux users will need to connect to Linux for some tasks. Some general software are needed. The
Read more
A Beginners’ Guide to x86-64 Instruction Encoding
Posted onThe 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
Read more
How to force a metadata checkpointing in HDFS
Posted onThe 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
Read more
How to Install Paravirtualized CentOS 7 DomU on Xen
Posted onThis 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.
Read more