Reset customer password in db

UPDATE customer_entity_varchar SET VALUE = md5('new_password') 
WHERE entity_id=(SELECT entity_id FROM customer_entity WHERE email='email@hostname.com') 
AND attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'password_hash' AND entity_type_id = 1);

Get core config data

$erpSettings = Mage::getStoreConfig('my/path/settings');
$storeId = 15;
$erpSettings = Mage::getStoreConfig('my/path/settings', $storeId);

Get adminhtml url

echo Mage::helper("adminhtml")->getUrl("/vendorname_modulename/controllername/",array("param1" => $value1));
echo Mage::helper("adminhtml")->getUrl("/vendorname_modulename/controllername/");

Get current website id

$website_id = Mage::app()->getWebsite()->getId();

Get current store id

$store_id = Mage::app()->getStore()->getId();

Get the store id from the store code

$store_id = Mage::app()->getStore($storeCode)->getId();
$store_id = Mage::getModel("core/store")->load($storeCode, "code");

Magento select single record from db

    public function getSingleRecord($userId)
    {
        return $this->getCollection()
            ->addFieldToFilter('user_id', $userId)
            ->getFirstItem();
    }

Where Magento keeps configuration data

SELECT * FROM magento01.core_config_data WHERE path LIKE 'modulename%';

Magento default settings

In config.xml

<?xml version="1.0"?>
<config>
    <default>
        <modulename>
            <parametergroup>
                <param>value</param>
            </parametergroup>
        </modulename>
    </default>
</config>

Magento collection add join and filter

$tableDataCollection = Mage::getResourceModel('modulename/tablename_collection')->setPageSize(50);
 
$tableDataCollection->getSelect()
            ->join(array('alias' => Mage::getSingleton('core/resource')->getTableName('modulename/tablename')),
                'main_table.id=alias.id', '*')
            ->where('alias.condition = ?', true);