Thursday, April 20, 2017

How to clone IIS apppool and all website for another machine using command line

If you are working in IIS server. you have many websites listed under INSUPLTDVSG.
Suddenly you want same site setting on another laptop.

What you we do...
manual work.... no no...no...

Let me give you a quick solution.


Follow these step.

Step 1.  (Perform on the main machine)

1st you have to take backup of all settings such as apppool and websites.

Open Command Prompt and run this command

%windir%\system32\inetsrv\appcmd list apppool /config /xml > d:\apppools.xml
%windir%\system32\inetsrv\appcmd list site /config /xml > d:\websites.xml

---------------------------------
In D:/ drive, you will get two file. catch this file and sent it to another machine.


Step 2 ( (Perform on the another machine)

Now it's time to import all data so run this command

%windir%\system32\inetsrv\appcmd add apppool /in < d:\apppools.xml
%windir%\system32\inetsrv\appcmd add site /in < d:\websites.xml

----------------------------

Now if your site https:// then you have to make self-sign-certificate. you have to make a certificate,.. once done then bind it with your site.

So, How will do that.

Let's run this command

appcmd set site /site.name:"myapp.com" /+bindings.[protocol='https',bindingInformation='*:443:myapp.com']

run this command as many time as your have sites.

-----------------------------------------------------------------

I am hoping that this article will help you. However, if you got stuck and need additional help, please write a comment below.


How to send ANSI corrector in mail subject using mail function in PHP

Let's say your subject is - "Cómo estás" (that mean - cómo estás )
if you will send this subject then it will not show properly in an email.

So how to solve this issue-:

$subject = "cómo estás";
mail($to, '=?utf-8?B?'.base64_encode($subject).'?=', $body, $headers);

------------
if this code doesn't work for you then le tme know. I Have another solution too. :-)

Sunday, January 29, 2017

[Resolved] How to cancel all sent friendship request on Facebook at one click

Cancel all pending Friendship Request in 30 second. Just in one click.

Step-: 01 Click on Below Link

 https://m.facebook.com/friends/center/requests/outgoing/#friends_center_main 


Step -: 02  Right click on page and select inspect



Step -: 03  Paste below code in console and then hit enter. (wait few second to complete the request)


javascript:var inputs = document.getElementsByClassName('_54k8 _56bs _56bt'); for(var i=0; i<inputs.length;i++) { inputs[i].click(); }



Friday, October 28, 2016

How to find how many parameter / Arguments has been passed and there value

code-
<?php
    function parentFunction($name='name') {
        echo "There are total: ".func_num_args()." Arguments passed.<BR>";
        $args = func_get_args();

echo '<pre>';
print_r($args);
echo '</pre>';

//fetch the value
        for($i = 0; $i < count($args); $i++) {
echo "Passed Value: {$args[$i]}<br />";
        }
      }
    parentFunction($name= 'name','email','phone','location');
?>