How do I find all files containing specific text on Linux

  • Posted on: 4 May 2018
  • By: jmu

This command will help us find all files which contain specific text on Linux:

grep -rnl "/var/path/samplefolder" -e "sampletext"

If you would like to know what that line looks like and get the line number, use the following command:

grep -rnw "/var/path/samplefolder" -e "sampletext"

-r is recursive

-n is line number

-l (lowercase L) returns the file name which contains the text you need 

-w gives the line which contains the whole matching word



How to install cups printer server on ubuntu - remote server

  • Posted on: 29 January 2018
  • By: jmu

This blog is about how to install Common UNIX Printing System (CUPS) on AWS remote server Ubuntu 14.04. At the end of this blog, I will point out some solutions about how to solve ERR_CONNECTION_TIMED_OUT & "bad request" error. 


sudo apt update
sudo apt install cups



Cursor cannot focus on the input field on iPhone (Fixed)

  • Posted on: 1 December 2017
  • By: jmu

Recently, we tried to build a form on a pop-up layer. But when we tested on the real phone, we found that the cursor cannot be focused inside of the input field on iPhone 6 (that's the only iPhone version we have currently). We were using some CSS code to fix this bug.

iPhone safari is not very stable once you use "position: fixed" and "input" at the same time.

Calculate Shipping Based on Subtotal Drupal 7

  • Posted on: 15 August 2017
  • By: jmu

Recently, I am struggling how to calculate a shipping fee based on the subtotal instead of the total (total might include tax, default shipping fee and so on). I found a sandbox module called Commerce Order Sub-total. The rule condition part works perfectly for me. However, this module only provides one rule action which returns "NUMBER" instead of "DECIMAL". In order to implement "calculate a shipping fee based on the subtotal", I need to use the result from "Commerce Order Sub-total" rule action in "Calculate a Value" action.

Pass '+'(plus) character by URLSearchParams in Angular2

  • Posted on: 1 August 2017
  • By: jmu

Recently, I am working on Angular 2. When I tried to send the description by POST request, I found that the '+'(plus) sign cannot be passed to my backend. Then, I read the official document here, and found the reason.


These are the characters that are not encoded: ! $ \' ( ) * + , ; A 9 - . _ ~ ? /

But they also provide a solution if you have to use these characters. I will give an example in this blog.

How to create custom commerce order state programmatically Drupal 7

  • Posted on: 27 April 2017
  • By: jmu

Right now, I am working on the e-commerce website, and trying to add some "ORDER STATE" that drupal doesn't provide by default. In this tutorial, I will provide the code and some samples. It is very simple to create custom states. Let do it!

If you have never created a custom module, please briefly read the official tutorial first. You can find it here.