Tuesday, January 30, 2018

Install LAMP stack on linux(UBUNTU)

There are 5 to 6 commands are giving below to install LAMP stack on your ubuntu 16.04 machine:
1. sudo apt-get update

2. sudo apt-get install apache2

3. sudo apt-get install php5
    - if you get any problem with php5 then add ppa and you are good to go
    - for ppa follow below command

    - sudo add-apt-repository ppa:ondrej/php then run sudo apt-get update
    - then sudo apt-get install php5.6
    - then install some php modules by this command sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml

4. sudo apt-get install mysql-server

5. sudo apt-get install phpmyadmin
    - for phpmyadmin you will have to add the below line at the very last in apache.conf file
    - Include /etc/phpmyadmin/apache.conf
    - sudo gedit /etc/apache2/apache2.conf in this file

6. restart apache by this command sudo /etc/init.d/apache2 restart

Wednesday, January 24, 2018

Lost windows 10 menu item from dual boot with ubuntu

You can do that with one command simply in ubuntu:
sudo update grub


*it will bring your windows 10 menu in boot menu

Tuesday, January 23, 2018

Uninstall ubuntu from windows 10 dual boot

There are five to six steps to uninstall ubuntu from windows 10:
1. Open any partition magic software like aomei partition assistant or minitool partition tool.
2. Delete ext4, swap area or any other partitions those are related to that ubuntu OS.
3. Select the previous windows drive and resize it (take those free space to selected windows drive).
4. Then select full hard drive and click "Rebuid MBR"
5. And apply.
6. Reboot/Restart your windows.
Windows will enter straight to windows after booting.

Wednesday, January 10, 2018

Reset user password Drupal 7


  1. First go to drupal project's root directory and open command prompt
  2. Then paste the below command and press enter
    php ./scripts/password-hash.sh yourpassword
  3. It will generate a hash, copy the hash characters and go to database.
  4. Then if you are in phpmyadmin then in users table update the pass field with the hash characters Or you can run an update query.
  5. YOU ARE DONE. 😎

Wednesday, April 20, 2016

Vim command to exit after Git amend

In Vim, Press Esc then type :wq and Enter.
You are done and return to Git screen...

Monday, April 18, 2016

Setup SSH key pair for Git

1. After installing Git, open your terminal and type the following command to create SSH key pair:
ssh-keygen -t rsa -C "youremail@something.com"
2. then press enter
3. then press enter again
4. then put your password
5. then put your password again
And your key has been generated.

Now go to where is your id_rsa.pub is created and open it in word pad or text pad and copy all.

Then go to bitbucket -> settings -> SSH keys
Then type a level and paste your key and press add.
You are done.

Tuesday, March 29, 2016

Git fork sync

Git command to fork sync:

1. git fetch upstream
2. git merge upstream / branch_name
3. git push origin branch_name [optional, if you want to update your account remote]

Note : if you did not add upstream as remote then add by below command:
git remote add upstream(remote_name)  remote_url

Basic :  if you don't know, which one is origin and which one is upstream then read below:

After forking repo, that repo will come to your account and that is ORIGIN and UPSTREAM is which you have forked from. Like:

Another account / repo (upstream) => forked => your account / forked repo (origin)

Wordpress debug log function

Wordpress error log code: if ( ! function_exists ( 'write_log' ) ) { function write_log ( $data ) { if ( defined ( '...