Back End

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

 

Tags: 

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. 

Installation

sudo apt update
sudo apt install cups

 

Tags: 

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.

Grant Privileges to MySQL User accounts (MySql)

  • Posted on: 6 January 2017
  • By: jmu

It is very easy to create a new user in mysql and give access to database. By using GRANT, you can assign what privileges to any user not only new but also existing users. Just make sure you are using the right username and hostname. Recently, I am working on setting up master and slave replication. But I don't want all my master tables and databases backup on my slave database. Therefore, I listed some important grant statements here that you can use. Also, I provided some hints below as well.

A fast way to send SMTP HTML email by using php (PHPMailer)

  • Posted on: 30 November 2016
  • By: jmu

Yesterday, I worked on an email function in php. Since I would like to avoid spam filter, PHPMailer is the greatest choice for me to use. I also tried some other ways and will share in other articles if I have time. Although it is easy to set up and use, I still spent a lot of time on sending different emails to multiple receivers because I don't even know it can only send a same email to one same receiver by default.

Pages