Oct 27, 2016 ·
1 minute read
linux
In Fedora I prefer to apply updates just before shutting down so that next time I boot up the updates will be in place. For me this seems like the best way to do it. To make that easier I also then create a keybinding so that I can hit [Start]+[q] to trigger the upgrade/shutdown process in a terminal Being a lazy developer I prefer to have things automated and
Read On →
Oct 26, 2016 ·
2 minute read
monitoring
What is atop? Taken from the man page: The program atop is an interactive monitor to view the load on a Linux system. It shows the occupation of the most critical hardware resources (from a performance point of view) on system level, i.e. cpu, memory, disk and network. Raw Data Format The raw data format is a binary log file that atop can be configured to record. This log file can be generated for any length of time and allows you to go back in time to debug system performance issues.
Read On →
Oct 18, 2016 ·
1 minute read
magento2
The tabs on the product page are handled by the Magento_Catalog’s product/view/details.phtml template file. In there the line $block->getGroupChildNames('detailed_info', 'getChildHtml') collects all blocks in the detailed_info group for the tabs. This means the following layout XML will add a new tab: <referenceBlock name="product.info.details"> <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::path/to/template.phtml" name="INSERT NAME" group="detailed_info"> <arguments> <argument name="title" translate="true" xsi:type="string">TAB TITLE HERE</argument> </arguments> </block> </block> </referenceBlock> The group="detailed_info" part adds it to the tabbed area. The <argument name="title" part of that sets a string value on the block which will be used for the tab’s title.
Read On →
Oct 13, 2016 ·
2 minute read
magento
TL;DR Run the script at the bottom. The Issue If you’ve previously applied the SUPEE-1533 patch to your Magento site, then when you try to apply the SUPEE-8788 patch you’ll see the following error: checking file app/code/core/Mage/Adminhtml/controllers/DashboardController.php Hunk #1 FAILED at 91. 1 out of 1 hunk FAILED This is caused by the fact that the SUPEE-8788 patch seems to have been taken against an un-patched version of Magento. This can be seen from the following: The SUPEE-8788 patch contains: @@ -91,7 +91,7 @@ class Mage_Adminhtml_DashboardController extends Mage_Adminhtml_Controller_Actio if ($gaData && $gaHash) { $newHash = Mage::helper('adminhtml/dashboard_data')->getChartDataHash($gaData); - if ($newHash == $gaHash) { + if (hash_equals($newHash, $gaHash)) { if ($params = unserialize(base64_decode(urldecode($gaData)))) { $response = $httpClient->setUri(Mage_Adminhtml_Block_Dashboard_Graph::API_URL) ->setParameterGet($params) The important line here is: if ($params = unserialize(base64_decode(urldecode($gaData)))) { Which is supposed to match up with: if ($gaData && $gaHash) { $newHash = Mage::helper('adminhtml/dashboard_data')->getChartDataHash($gaData); if ($newHash == $gaHash) { $params = json_decode(base64_decode(urldecode($gaData)), true); if ($params) { $response = $httpClient->setUri(Mage_Adminhtml_Block_Dashboard_Graph::API_URL) ->setParameterGet($params) The important lines here are: $params = json_decode(base64_decode(urldecode($gaData)), true); if ($params) { Now they don’t match because of the change made in SUPEE-1533: if ($gaData && $gaHash) { $newHash = Mage::helper('adminhtml/dashboard_data')->getChartDataHash($gaData); if ($newHash == $gaHash) { - if ($params = unserialize(base64_decode(urldecode($gaData)))) { + $params = json_decode(base64_decode(urldecode($gaData)), true); + if ($params) { $response = $httpClient->setUri(Mage_Adminhtml_Block_Dashboard_Graph::API_URL) ->setParameterGet($params) The Fix In order to apply SUPEE-8788 we need to temporarily revert the changes made to DashboardController.php by SUPEE-1533.
Read On →
Oct 5, 2016 ·
1 minute read
css
While developing a site, you often put a pile of placeholder links in with a plain <a href="">Link</a>. These can sometimes sneak through because they’re so easily forgotten about. A simple CSS block will automatically highlight these for you, so you don’t forget: a[href='']:after { content:'!'; background:red; color:#FFFFFF; padding-left:3px; padding-right:3px; opacity:0.3; white-space: nowrap; } a[href='']:hover:after { content:'empty link'; opacity:1.0; } You can adjust the selector if you use href="#" instead of blank ones.
Oct 4, 2016 ·
1 minute read
linux
Here is a nice little one liner to search recursively in a directory and then pull out all email addresses that it finds grep -shoPR '[a-zA-Z_]+?@domain.co.uk' * | sort -u This will quickly find all email addresses and hten give you a sorted unique list Handy!