Monday, January 21, 2013

Run web pages or console to be served via common HTTP or HTTPS that runs on port 80 and port 443 with Skype

Many developer face problem when they run http apache in xampp,wamp and  skype conversation tool simultaniously. You can not run both at a time because skype also uses port 80 and 443 as alternatives for incomming connections.

In oeder to solve this issue and run  both web pages or console to be served via common HTTP or HTTPS that runs on port 80 and port 443 and Skype you need to change configuration setting for listning post in either webserver or skype.

Linux command for starting samba service

Samba is a suite of utilities that allows your Linux to share files and other resources, such as printers, with Windows.

In order to start/stop samba service on linux machine you need use following commands -

To start :    /etc/init.d/smb start

To Stop :   /etc/init.d/smb stop

To Restart : /etc/init.d/smb restart

MySQL Take backp or create dump file of all databases on server with mysqldump

Below command can be used for taking backup of all databases with mysqldump.
 # mysqldump -u root -p --all-databases > alldbs.sql

Saturday, January 19, 2013

Mysql InnoDB store all databases in one file

In mysql all InnoDB table/data info live within ibdata1. The only manifestation of any InnoDB table outside of ibdata1 is the .frm file of the InnoDB table. Copying all InnoDB data at once requires copying all of /var/lib/mysql.

Friday, January 18, 2013

Mysql Xampp - Import large database through command prompt

There is limit to import database from GUI (phpmyadmin) in xampp. For large databases you can import via. comman line. Below are the steps you need to follow:

Step 1: Open / Run command prompt

Windows : Start > Rum > Type "cmd" > click "ok"

Friday, January 11, 2013

Purposal Documents for new site


Many times we need to send a proposal documents to our client as a negotiation before starting any project.
Here is sample proposal document for a drupal site.
You can  copy and change it according to your project domain.

Drupal 7 Content Management Guide for your clients

Many of us work on different type of CMS for different type of clients. Our clients may have of different nature some can manage site contents without any guide or other asks us for a full guide for managing contents.

Here I am sharing format of Content management guide for Drupal 7 admin.

Download and change it according to your needs. I hope it will be very helpful..

Drupal7 Content Management Guide.docx
Don't forget to leave your comments to improve this guide.

MySQL convert column type from TEXT to VARCHAR()

You can convert column type from TEXT to VARCHAR() with below query.

ALTER TABLE tablename MODIFY columnname VARCHAR(X)

Trick to write faster complex queries in mysql with views

Views can be used to optimize complex queries. As we can store result of some set of calculations in view and can join our queries with view.

Here all complex calculations will be performed by view. That will make the query lightweight and faster.

To illustrate :

If you have a record with update track in child table and you want to get each time latest updated record. For large table query for getting latest updates of a record will take time.

So make this query faster we can create a view separately for getting latest updates. Then can join this view with main table. It will faster your query.


Dump single table with mysqldump command

You can easily take backup of single large table with musqldump command

mysqldump -u user -p database name tablename > '/target_path/filename.sql'

Once you enter it will ask for mysql user password, after entering password it will create dump file at specified location.

Extract sql.gz file on linux server with ssh command

Simple command to extract sql.gz file on linux server with ssh :

gzip -d example.sql.gz

It will extract file at the same location where the zip file is.