Add colors to git command output

Instead of seeing a plain output after a git command we can have the display in color. like when we execute git status to view changed or new files we can view each segment in colored way: or for when we execute git diff a_modified_file_name it is better to view deleted lines in red (-)

Common useful git commands

To go to last state after a conflicted merge: git reset –merge ORIG_HEAD To know the current active branch git branch this command show all branches available on local and highlights the active one. To know all available branch git branch -a

png background issue in ie

Sometimes we find png image is now showing properly on IE. i.e its transparent property do not get apply. To solve do the following fix (microsoft Alphaimage filter) .png-background{ background: url(“/path/to/image/source/ong-image.png”) no-repeat scroll transparent; height: n1px; width: n2px _background-image: none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=/path/to/image/source/ong-image.png,sizingMethod=’scale’); }

Install and configure lsyncd on centos

Introduction :- Lsyncd watches a local directory trees event monitor interface (inotify or fsevents). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync. Lsyncd is thus a light-weight live mirror solution that is comparatively easy to install not requiring

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

Bash phpize command not found

[root@localhost gearman-1.0.2]# phpize bash: phpize: command not found This error comes as “phpize” command is not available on my system To fix this, install php-devel package. (Eg: CentOS on my box) [root@localhost gearman-1.0.2]# yum install php-devel

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