How to install Gearman PHP extension

Gearman PHP Extension While installing Gearman PHP extension I have used my custom path to use PHP config from. If we have custom installation of PHP we need to provide –with-php-config option while configure. We can find available option to give while configuring can be found by -help option passed with ./configure # ./configure –help

20 Useful GREP Commands

20 Useful GREP Commands grep -V Show the version of Grep command like “grep (GNU grep) 2.14” grep "search string" file_name Search for the given string. grep "search string" file_name_* Search given string in multiple files. grep -i "search string" file_name Ignore case search. grep -w "This is a test" file_name Full world search. grep

To Find if a record exists or not in MySql

To Find if a record exists or not: Normally we use : SELECT COUNT(*) FROM anj_table WHERE fileldName = ‘anj_field’ Instead use sub-query SELECT EXISTS (SELECT 1 FROM `anj_table` WHERE fieldName = ‘anj-value’ ) It executes faster than SELECT COUNT(*) to get if a particular row exists or not. Reason being sub-query stop executing when

Common Linux commands

Archive.tar Create Archive tar cvf archive.tar dir_name/ Creating archive.tar Extract Files tar xvf archive.tar Extracting all files from archive.tar tar xvf archive.tar /path/to/file Extract a single file from archive.tar tar xvf archive.tar /path/to/dir/ Extract a single directory from archive.tar tar xvf archive.tar --wildcards '*.php' Extract group of files from archive.tar using –wildcards View Files tar

How to write php array in a file

Sometimes we want to store php array in file for debugging or examination purpose. One way for this is to capture all the values (including array ) in buffer and later print on a file: For example: ob_start(); // Start buffering print_r($arrValue); // Print the value of array. We can also use var_dump just as

Installing Maven 3.3.3 on Ubuntu 14

I am upgrading from 2.4 to 3.3.3 Pre-requisite: JDK 1.5 or above, JAVA_HOME set in environment variable Step 1) Download Maven-3.3.3 binary from a repository using the wget command. wget http://mirrors.sonic.net/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz Step 2) Untar the downloaded binary. tar -zxf apache-maven-3.3.3-bin.tar.gz Step 3) Move the application directory to /usr/local sudo cp -R apache-maven-3.3.3 /usr/local Step 4)

How to write a custom command on linux

I want to create a custom command on linux (ubantu) which I need to execute regularly. steps are: create a shell-script place the shell script in /usr/bin/ dir name of shell-script file is custom command e.g I want kill node processes running by just typing “killnode” #!/bin/bash #fileName /usr/bin/killnode #echo "the folder is `pwd`" #echo