How to create virtual host using ubuntu/nginx

Create server block file named tutorials.local under path
/etc/nginx/sites-available
and put following contents:

server {
        listen 127.0.0.10:80;
        root /var/www/html/tutorials;
        server_name tutorials.local;
        index index.html index.htm index.php;
        charset utf-8;
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt { access_log off; log_not_found off; }

   access_log off;

   sendfile off;

  client_max_body_size 100m;

 location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        #fastcgi_pass  127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REQUEST_SCHEME $scheme;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~ /\.ht {
        deny all;
    }
}

now run following command in terminal

sudo ln -s /etc/nginx/sites-available/tutorials.local /etc/nginx/sites-enabled/

Now restart nginx

sudo service nginx restart
Create hosts entry
sudo vi /etc/hosts

and add following at the end of file

127.0.0.10 tutorials.local

How to change git url

I was searching about how to change url for git repo.
Then i came to a stackoverflow post http://stackoverflow.com/questions/2432764/change-the-uri-url-for-a-remote-git-repository/2432799#2432799
Its pretty easy to change url with only one command:

git remote set-url origin newurl

And thats it, you can verify newly set url by entering following command:

git remote show origin

How to upload file from local to remote machine or vise versa

How to upload file from local to remote machine??

By using following command we can upload file from local machine to remote machine using terminal.

scp filename.zip username@remote.machine:/destination-derectory

This will use port 22 by default. But if you have to specify custom port then you can use following command.

scp -P 2000 filename.zip username@remote.machine:/destination-derectory

 
By using following command we can download file from remote machine to local machine using terminal.

scp -P 22 user@remoteMachineAddressORIP:/fileDestinatio LocalMachineFolderPAth

How to run secondary skype from terminal safely

When i was working on linux(ubuntu), i started secondary skype from terminal using follwing command:

skype --secondary

after executing this command skype started but i was unable to do any work using terminal
then i have done some research and found a command Continue reading How to run secondary skype from terminal safely

How to make a USB Bootable on windows 7 or windows 8

Open the Command Prompt. You will need to run Command Prompt as an Administrator. Right-click on it and select Run as Administrator. You may need to enter the Administrator password.
Open the disk management utility. This can be opened by entering the command
Continue reading How to make a USB Bootable on windows 7 or windows 8

How to create virtual host on ubuntu apache2

create conf file under /etc/apache2/sites-available/
name it as vhosts.conf and put following contents

<VirtualHost 127.0.0.3:80>
	ServerAdmin webmaster@test.dev
	ServerName test.dev
	ServerAlias www.test.dev
	DocumentRoot /var/www/html/projects/test
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost> 

run following command to enable site

sudo a2ensite vhosts.conf

run following command to restart apache service

sudo service apache2 restart

run following command to enable rewrite mode

sudo a2enmod rewrite 

and thats it, now you can access test.dev in your browser.