Tuesday, May 17, 2022

Office 2016 Pro Plus Activation

 cscript ospp.vbs /inpkey:QK3DN-XRPV4-XFQTQ-HJ84R-W8GK2

cscript ospp.vbs /unpkey:BTDRB >nul

cscript ospp.vbs /unpkey:KHGM9 >nul

cscript ospp.vbs /unpkey:CPQVG >nul

cscript ospp.vbs /sethst:kms8.msguides.com

cscript ospp.vbs /setprt:1688

cscript ospp.vbs /act

Saturday, May 14, 2022

How to add file manager in VestaCP

The Vesta CP is a commonly used web hosting control panel in Linux OS. There is no file manager is there by default in Vesta CP. Here is a simple trick to enable the file manager on the panel.

1. Log in as root to a Vesta installed server via terminal.

2. Open the configuration file using any text editor:
vi /usr/local/vesta/conf/vesta.conf

3. Add the following line at the end of that configuration file:
FILEMANAGER_KEY=’ILOVEREO’

4. Save and exit the file.

Try to log out and re-login to Vesta panel and you will be able to see the file manager option now.

Copy files and folders from current directory to another in CentOS

 Using rsync:

First install rsync (if not installed) : yum install rsync

rsync -a /source_directory /destination_directory


Friday, May 6, 2022

Tuesday, April 19, 2022

Decrease product price by 10% using SQL command in Woocommernce from Phpmyadmin

 Query-1:

UPDATE

   wp_wc_product_meta_lookup

SET

    min_price =(min_price - min_price * .13)

WHERE 1;

Query-2;

 UPDATE

   wp_wc_product_meta_lookup

SET

    max_price =(max_price - max_price * .13)

WHERE 1;

Saturday, April 16, 2022

Mark all products as draft Woocommerce using SQL query

 UPDATE `wp_posts` SET `post_status` = 'draft' WHERE `post_type` = 'product' AND `post_status` = 'publish'

Saturday, April 9, 2022

Print Product Group in WHMCS Invoice Item Description

PRODUCTNAME - Domain (Start Date - End Date)

e.g. Standard - abc.com (04/10/2010 - 03/10/2012)

Need to change it to the following:

PRODUCTNAME - Domain (Start Date - End Date)

PRODUCT DESCRIPTION

e.g. Shared Hosting - Standard - abc.com (04/10/2010 - 03/10/2012)

Method -1: 

Place the following script at the top of your /templates/<templatename>/viewinvoice.tpl:


{php}

foreach ($this->_tpl_vars['invoiceitems'] as $key => $value)

{

$result = mysql_query("SELECT (SELECT name FROM tblproductgroups WHERE gid = tblproducts.id) AS groupname FROM tblproducts WHERE name = '".sanitize(substr($value['description'], 0, strpos($value['description']." - ", " - ")))."'");

$data = mysql_fetch_array($result);

if(mysql_num_rows($result) == 1)

$this->_tpl_vars['invoiceitems'][$key]['description'] = $data['groupname']." - ".$value['description'];

}

{/php}

Now place the following script at the top of your /templates/<templatename>/invoicepdf.tpl:
foreach ($invoiceitems as $key => $value)
{
   $result    = mysql_query("SELECT (SELECT name FROM tblproductgroups WHERE gid = tblproducts.id) AS groupname FROM tblproducts WHERE name = '".sanitize(substr($value['description'], 0, strpos($value['description']." - ", " - ")))."'");
   $data     = mysql_fetch_array($result);

   if(mysql_num_rows($result) == 1)
       $invoiceitems[$key]['description'] = $data['groupname']." - ".$value['description'];
}

Method -2: 
Create a new .php file called invoices_productgroup.php in your action hooks directory (/includes/hooks/), and place the following code in it:

<?php
add_hook("InvoiceCreationPreEmail", 1, "invoice_productgroup");

function invoice_productgroup($vars)
{
   $result = select_query("tblinvoiceitems","id,description",array("invoiceid" => $vars['invoiceid']));

   while($data = mysql_fetch_array ($result))
   {
       $result2 = full_query("SELECT (SELECT name FROM tblproductgroups WHERE gid = tblproducts.id) AS groupname FROM tblproducts WHERE name = '".sanitize(substr($data['description'], 0, strpos($data['description']." - ", " - ")))."'");
       $data2   = mysql_fetch_array($result2);

       if(mysql_num_rows($result2) == 1)
           update_query("tblinvoiceitems", array("description" => $data2['groupname']." - ".$data['description']), array("id" => $data['id']));
   }
}
?>
This will add the product group (if applicable) in front of the description from a new invoice.

How to get Ranking of the Students in Excel using RANK Function

=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...