Colored git diff by default

Normally git diff are shown colorless, colored diff are easier to understand since it differentiate addition and removing of code with different colors. You can have it colored with  this command:

git diff –color

But if you want it always colored without using –color option, just change the configuration:

git config color.diff true

This make all git diff colored for current repository. If you want to apply it all projects, just change the configuration globally:

git config –global color.diff true

Posted in Tips | Tagged , , , | Leave a comment

Show colored git diff by default

If you want to show the git diff in color, you can use the command:

git diff –color

If you want it show always in color, change the config by:

git config color.diff auto

If you want to enable it on all projects the change it globally:

git config –global color.diff auto

 

Posted in Tips | Tagged , | Leave a comment

Get Number of Tables in a MySQL DB

To get number of tables in a mysql db name ‘sample_db’ you can use this snippet in your mysql commandline prompt;

SELECT count(*) from information_schema.tables WHERE table_schema = ‘sample_db’;

 

Posted in Tips | Tagged , , | Leave a comment

MySQL Dump Exporting and Importing, Compact Form

Creating mysql dump with single line of commands:

mysqldump -u username -p db_name | gzip > outputfile.sql.gz

Importing gzipped dump to database:

gunzip -c outputfile.sql.gz | mysql -u username -p db_name

Posted in Tips | Tagged , , , , | Leave a comment

Changing BSNL Connection from 2G to 3G and Vice Versa

To change or convert existing 2G connection to 3G: send SMS “M3G120″ to 53733 and on getting reply asking for confirmation, send confirmation message “M3G120Y” to 53733.

Similarly you can also change your 3G connection to 2G: send SMS “M2G” to 53733 and on getting reply asking for confirmation, send confirmation message “M2GY” to 53733.

Posted in Tips | Tagged , , , , , | Leave a comment

To Know Balance of BSNL 3G Data Card

If you have activated 3G data on your mobile SIM connection, as you know, it is easy to check current data balance expiry date just dialing *124*4# or send SMS “DATA 3G” to 53733.

What if you have 3G data card (3G USB dongle) that you use to access Internet on your laptop or PC? Removing SIM card from dongle and put it in mobile phone then sending SMS is very inconvenient method. It also may damage either SIM or dongle or both.

There one easier method to check 3G data card balance. Just send SMS “DATA3G<space><10 digit number of sim connection in data card>”.

Posted in Tips | Tagged , , , | Leave a comment

To know BSNL prepaid data balance

To know BSNL prepaid data balance. Just dial *124*4# or send SMS ‘DATA 3G’ to 53733

Posted in Tips | Tagged , , , , | Leave a comment