Skip to content

Instantly share code, notes, and snippets.

View plewandowski's full-sized avatar

Piotr Lewandowski plewandowski

View GitHub Profile
@madismanni
madismanni / Checkout.php
Last active June 18, 2018 17:39
One Step Checkout SUPEE 9767 manual patch
<?php
/**
{{COPYRIGHT_NOTICE}}
*/
class Idev_OneStepCheckout_Block_Checkout extends Mage_Checkout_Block_Onepage_Abstract
{
public $formErrors;
public $settings;
@RJ
RJ / vmware-ec2.md
Last active February 1, 2023 13:18
Exporting VMWare images (OVA) from EC2

How to provision VMWare compatible .ova images on EC2

EC2 only lets you export instances as VMWare-compatible OVA files if you originally imported that instance from an OVA. Presumably it preserves the metadata and XML gubbins for the instance, and just wraps it up again using that metadata on export.

In order to provision arbitrary VMs in an OVA-exportable way, we abuse the volume snapshots on one VM.

Prep work:

  • Make a fresh install of ubuntu server or whatever your base distro is, in VMWare, export as OVA file. (single disk only!)
  • Untar the OVA and import the VMDK file into ec2 using ec2-instance-import onto an HVM instance type (ie, no xen kernel needed)
@Stasevi4
Stasevi4 / jpegoptim
Last active July 8, 2016 12:45
Optimize images in folder ( Magento optimize image) jpegoptim and optipng
sudo apt-get install jpegoptim
sudo apt-get install optipng
find /path/to/magento/ -iname '*.jpg' -exec jpegoptim --strip-all -p {} \; -exec chmod 755 {} \; -exec chown www-data:www-data {} \;
find . -iname '*.png' -exec optipng -o7 -preserve {} \; -exec chown www-data:www-data {} \;
@Vinai
Vinai / bootstrap.php
Last active January 29, 2019 22:50
Simple Magento integration test PHPUnit bootstrap
<?php
/**
* Simple Magento integration test PHPUnit bootstrap
*/
chdir(__DIR__ . '/../..');
$mageFile = 'htdocs/app/Mage.php';
umask(0);
clear db
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name