sar - Collect, report, or save system activity information. From command line: $ sar -b This command shows the amount of traffic and you can check for spikes in traffic
Command Line – sar
- By Heather Mello
- Apr 5, 2016
sar - Collect, report, or save system activity information. From command line: $ sar -b This command shows the amount of traffic and you can check for spikes in traffic
You may need to sudo: From terminal: $ /etc/init.d/httpd stop $ /etc/init.d/httpd start $ /etc/init.d/httpd restart
Using terminal: $ cd /var/log/httpd/ $ tail -f access_log | grep 64.24.44.47 The -f means run continually until you hit Control - C to stop it ( the ip can be whatever your filtering the results to if your interested in an IP's traffic ) Drop the | grep and the IP if you want all traffic $ tail -f access_log
find /opt/wherever/you/want/to/search -type f -name *.jpg -ls You might have to do it a few times for different file types. Or you can just leave the "-name *.jpg" part out and it will just give you your report on ALL of your files. If you don't like full bytes you could pipe some commands together..... find /opt/wherever/you/want/to/search -type f -name *.jpg | awk '{system("ls -lh \""0"\"")}' Thanks Dave for this tidbit of information!
If you are not using Magento's email invite function because its not what you need. If you want a share link that your customers can post on a blog, or on their web site and when they click the link and sign up, they are going to be set up as an invited friend. This takes advantage of Magento's native invite functionality, but using a different way to connect. Magento has an invite email that you can use, but there are times when that is not enough. This tutorial will help you understand how I adjusted to this task. Part I - Create a .htaccess Part II - Create the module Part III - Create the observer Part IV - What your code may look like to get it on a page in Magento
app—>design—>frontend—->default—>
(your template)—>template—>page—>footer.phtml Find where in the footer you want your navigation links to display and insert: <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘custom-footer-links’)->toHtml(); ?>
Now most of the time the Static block should display just fine but in some cases you are going to have do some extra steps to have the block display. 1) Instead of inserting: <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘custom-footer-links’)->toHtml(); ?>
Use: <reference name=”left”> <block type=”cms/block” name=”left.permanent.callout”> <action method=”setBlockId”><block_id>custom-footer-links</block_id> </action> </block> </reference> 2)Modify catalog.xml app—>design—>frontend—>default—>f002—>layout—>catalog.xml Add under <!– Mage_Catalog –> <block type=”cms/block” name=”left.permanent.callout”> <action method=”setBlockId”><block_id>custom-footer-links</block_id> </action> </block>
How to tell if your on the home page in magento or not
if
(
$this
->getIsHomePage()) {
echo
'You are in Homepage!'
;
}
else
{
echo
'You are NOT in Homepage!'
;
}
Or you can try this:
$routeName
= Mage::app()->getRequest()->getRouteName();
$identifier
= Mage::getSingleton(
'cms/page'
)->getIdentifier();
if
(
$routeName
==
'cms'
&&
$identifier
==
'home'
) {
echo
'You are in Homepage!'
;
}
else
{
echo
'You are NOT in Homepage!'
;
}
Using terminal: $ grep --color=auto -Ri "page.xml" *
--color=auto will color the findings
-R will do a recursive search
-i is case insensitiveCommand Line - delete all email addresses
- By Heather Mello
- Apr 5, 2016
Using Terminal: $ mail ( enter ) $ delete * ( enter ) Thats it you can type : $ h ( enter ) to verify they are all removed
Magento – changing the status of an order
- By Heather Mello
- Apr 5, 2016
Here, I will show you, how you can change your order status programmatically (with PHP coding). First, you need to load your order. If you have order id, you can load order in the following way:-
$orderId = YOUR_ORDER_ID; $order = Mage::getModel('sales/order') ->load($orderId);If you have order increment id, you can load order in the following way:-
$orderIncrementId = YOUR_ORDER_INCREMENT_ID; $order = Mage::getModel('sales/order') ->loadByIncrementId($orderIncrementId);Now, here is the code to change order status:-
/** * change order status to 'Completed' */ $order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true)->save();Similarly, you can change the order status to pending, processing, canceled, closed, holded, etc.