update stock quantity in Magento

In this article you learn how to update stock quantity of a product by coding...
If you want to update quantity which product have more then 10 quantity change in 50 quantity.
So if you do by admin then will take lots of time. Here by coding is easy way,...
code run in root dir.

Here is full code....

 $mageFilename = 'app/Mage.php';
 require_once $mageFilename;
 ini_set('display_errors', 1);

 $newstock = 100;

 $productCollection = Mage::getModel('catalog/product')
   ->addAttributeToFilter('qty', array("gt" => 30));

 foreach($productCollection as $product)
  $producte = Mage::getModel('catalog/product')->load($product->getId());
  $stockQty = $producte->getStockData();
  $stockQty['qty'] = $newstock;
  $stockQty['is_in_stock'] = 1;