The samtools merge can merge bam files while it can not work for sam files. How to merge sam files on Linux? According to the sam format specification, header lines start with @, while alignment lines do not. So you can use grep to merge sam files as follows efficiently. Assume the header is from
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.Free VNC server software on Windows
Posted onRealVNC only gives free version to personal usage of their server software while it limits the functions. Could you suggest some good free VNC server software with full functions? TightVNC is an open-source software for VNC with servers and clients. You can download the server software for Windows from TightVNC download page: http://www.tightvnc.com/download.php The software
Read more
How to change the DPI of tiff images exported by PowerPoint?
Posted onThe DPI of the tiff images exported by PowerPoint seems 96. For posters, larger DPIs like 150 or 300 are needed. Is it possible to change the DPI of tiff images exported by PowerPoint? In the options of PowerPoint, there is a setting for choosing DPIs. However, it have no effect. Check the post on
Read more
How to convert tiff images from RGB color to CMYK color on Linux?
Posted onI have a poster to be submitted to the publisher which requires image files in CMYK color. The file I already have is in RGB color. How to convert it on Linux? The convert tool from ImageMagick with option -colorspace to alternate image colorspace of images. The plain output with colorspace is quite large. So
Read more
How to convert PDF to text with format kept on Linux?
Posted onHow to convert PDF to text with format kept on Linux? Many of the formatting in PDF will not be available in text. But better keep the text’s relative positions as the same. For example, the table columns should be kept. The pdftotext tool can convert PDF to text pretty well: pdftotext – Portable Document
Read more
How to do diff like `git diff –word-diff` without git on Linux?
Posted onThe result of git by git diff –word-diff is great. But how to do diff like git diff –word-diff without git on Linux? The plain diff command on Linux seems not accept options like –word-diff. The wdiff is for word-diff: wdiff program is a front end to diff for comparing files on a word per
Read more
Where is the source code for the free command on Linux?
Posted onWhere can I find the source code for the free command on Linux? The source code for the free commands (and many more, like kill, ps, top, sysctl) can be found in procps-ng: https://gitlab.com/procps-ng/procps procps is a set of command line and full-screen utilities that provide information out of the pseudo-filesystem most commonly located at
Read more
Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password?
Posted onFirefox needs an email address and a password to login and sync. Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password? In short, only you with your password can see your data. Others, even Mozilla’s servers, without your password, can not see your decrypted data. In
Read more
How to install driver for TP-LINK T2U wifi adapter on Linux?
Posted onHow to install driver for TP-LINK T2U wifi adapter on Linux? I am using Fedora Linux 22. The kernel module for the driver for TP-LINK T2U is “mt7650u_sta”. TP-LINK and mediatek provide drivers (mediatek one is for 7610u). But neither work for Fedora 22 AFAIK. This piece of modified driver work for me on Fedora
Read more
How to convert an object to json in Node.js?
Posted onHow to convert general JavaScript objects to json in Node.js? Assume jo is a JavaScript object, you can convert it to a json string by: JSON.stringify(jo)
How to capture the close event of an opened window by window.open() in JavaScript?
Posted onHow to capture the close event of an opened window by window.open() in JavaScript? This JavaScript code works well for me: var newwindow = window.open(“/newwindow.html”); newwindow.onbeforeunload = function () { // processing event here alert(“new window closed”); } Note that after the callback function is executed, the newwindow is closed.
How to pass results from the opened window to the openning window in JavaScript?
Posted onFrom the opening window by JavaScript window.open(), we can pass info to the opened by hash. But how to pass results back from the opened window to the openning window in JavaScript? Assume in the opener window, a JavaScript variable is defined like var exchangeVar = ”; In the opened window, you can update the
Read more
How to cut by multiple spaces in Linux?
Posted onHow to cut by multiple spaces in Linux? For example, if I get a string like a b c d where the spaces among the fields are not decided. How to get the four fields a, b, c and d out? Here, we take getting ‘b’ (the 2nd field) as the example. You can first
Read more
Auto Pressing Multiple Keys Together in Linux
Posted onThis post introduces a key presser on Linux with xvkb. But how to simulate pressing multiple keys together on Linux? That is, I would like to have multiple keys such as “A” “B” “C” “D” pressed together and being hold. How to simulate this on Linux with programs/commands? You can make use of xdotool (xdotool:
Read more
How to install Chrome on Fedora Linux?
Posted onHow to install the Chrome browser on Fedora Linux from Google? Google provides a repository for yum/dnf on Fedora. First, following http://www.systutorials.com/3471/additional-repositories-for-fedora-linux/#google-chrome-repository to add Google Chrome repository. Then, you can install Google Chrome by yum/dnf: # dnf install google-chrome-stable
How to get file size in Python?
Posted onHow to get a file’s size in Python from the full path of a file? You can use this piece of Python code: os.path.getsize(file_path) It returns the size in bytes. It raises os.error if the file does not exist or is inaccessible. Manual of os.path.getsize(): https://docs.python.org/2/library/os.path.html#os.path.getsize
How to open a URL in a new window in JavaScript?
Posted onHow to open a URL in a new window in JavaScript? For example, to open a new window to browse “http://www.systutorials.com“. Open the URL in a new window: url = “http://www.systutorials.com”; window.open(url); Some browser will open the window in a new tab depending on the configuration. If you want to force the browser to open
Read more
How to send POST request in JavaScript?
Posted onHow to send POST request in JavaScript from the users’ browsers? One easy method I find is to use the jQuery library’s post() method. Here is one example that send POST request with data “file: filename” to the “/fileview” URL on the server and show the replied data: $.post(“/fileview”, {file: filename}, function (data) { //
Read more
How to get the file extension from a filename in Python?
Posted onHow to get the file extension from a filename in Python? For example, I would like to get “.txt” from “file.txt”. The Python code: >>> name, ext = os.path.splitext(‘file.txt’) >>> name ‘file’ >>> ext ‘.txt’ Manual of os.path.splitext: https://docs.python.org/2/library/os.path.html#os.path.splitext
How to iterate all files and directories under a directory in Python?
Posted onHow to iterate all files and directories under a directory in Python? For example, I would like to iterate each file and directory under /mnt/data/ /mnt/data/ |– file.txt `– great That is: /mnt/data/files.txt /mnt/data/great You can use the os.walk to do this: root, dirs, files = os.walk(path).next() root will be the path.dirs will contain the
Read more