How to do diff like `git diff –word-diff` without git on Linux?

Posted on

The 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

How to convert PDF to text with format kept on Linux?

Posted on

How 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 install driver for TP-LINK T2U wifi adapter on Linux?

Posted on

How 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

Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password?

Posted on

Firefox 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

Where is the source code for the free command on Linux?

Posted on

Where 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

How to install Chrome on Fedora Linux?

Posted on

How 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

Auto Pressing Multiple Keys Together in Linux

Posted on

This 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 set the replication factor for one file when it is uploaded by `hdfs dfs -put` command line in HDFS?

Posted on

When uploading a file by the hdfs dfs -put command line in HDFS, how to set a replication factor instead of the global one for that file? For example, HDFS’s global replication factor is 3. For some temporary files, I would like to save just one copy for faster uploading and saving disk space. The
Read more

How to iterate all files and directories under a directory in Python?

Posted on

How 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

How to force ssh client to authenticate using password on Linux?

Posted on

ssh client can use many authentication methods like password, keys. On a server, I set password-less log in with private/public key. Now, I want to try whether the new password is set correctly by log on using ssh. By default, the key-based authentication method is used again. How to force ssh client to authenticate using
Read more

How to detect whether Linux runs in UEFI or BIOS mode inside the Linux?

Posted on

How to detect whether Linux runs in UEFI or BIOS mode inside the Linux itself without needed to boot the the management console of the mother board? You can detect whether Linux runs in EFI mode by checking whether /sys/firmware/efi exist. In bash, you can test by [ -d /sys/firmware/efi/ ] This technique is used
Read more

How to force a USB 3.0 port to work in USB 2.0 mode in Linux?

Posted on

We know that we can disable USB 3.0 in the BIOS. But is there a way to force a USB 3.0 port to work in USB 2.0 mode inside of a running Linux? On Linux on some platforms booted in BIOS modes, you can use the following command to force USB 2.0 modes for your
Read more

How to advertise different gateway ip via DHCP in OpenWRT?

Posted on

How to advertise a different router/gateway ip via DHCP in OpenWRT? In general, you need to configure the DHCP option with code 3 (router). (A list of all options can be found in http://www.networksorcery.com/enp/protocol/bootp/options.htm ) For example, to advise the gateway IP 192.168.1.2, you will send this option: “3,192.168.1.2” Now, for OpenWRT, you have 2
Read more