Basic Usage of Ubuntu

Restart / Stop / Check Status of Apache2

sudo service apache2 restart
sudo service apache2 stop
sudo service apache2 status


Start / Stop xampp

sudo /opt/lampp/lampp start
sudo /opt/lampp/lampp stop


Advertisements

Git Installation and usages

In Linux ubuntu

sudo apt-get install git-core
cd /apt/lampp/htdocs (or) cd /var/www/html

clone project to your local
sudo git clone http://tester@127.0.0.1:8080/test.git

checking all git branches
git branch -a

checking current git branch
git branch

pulling / downloading the latest files
git pull

change to the other branch by checkout
git checkout dedicated_branch

checking the edited files
git diff file

adding edited file to comit
git add file

commit edited files to push
git commit -m “About the commit”

push the edited files
git push

Exporting / Importing data in MySql

Importing data

mysql -h[host] -u[user] -p database < file.sql

Exporting data

mysqldump -h[host] -u[user] -p database > database.sql
mysqldump -h[host] -u[user] -p database table1 table2 > database_tables.sql

mysqldump –no-create-info -h[host] -u[user] -p database table1 table2 > database_tables.sql
mysqldump –no-data -h[host] -u[user] -p database table1 table2 > database_tables.sql

Installation Mcrypt Extension for Laravel / Mcrypt PHP extension required.

In linux ubuntu

 sudo php5enmod mcrypt
It helped to install mcrypt. If you can not install try the following one.

The above one doesnot help you, because your PHP doesnot compiled with Mcrypt. So we need to install it now.
sudo apt-get install php5-mcrypt

The above one helps you to install mcrypt. After installing php5-mcrypt you have to make a symlink to ini files in mods-available Here is the one:
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini

enable :
sudo php5enmod mcrypt

now restart your php5-fpm:
sudo service php5-fpm restart.

That’s it. Remember all the steps needs to restart your server to take effect.