Skip to content

Instantly share code, notes, and snippets.

@dominicsayers
dominicsayers / elasticsearch.md
Last active February 24, 2026 06:11
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@SchumacherFM
SchumacherFM / README.md
Last active September 21, 2018 10:05
Avoiding database deadlocks in Magento 1.7

After having many deadlocks due to a high order volumne I've applied the these fixes to the core. Some can be found in a Magento forum. Before the fixes we could only process 1 order every 5-10 secs. Updating to Magento 1.8 is currently not an option but in 1-2 months.

1st Deadlock

Mage_Sales_Model_Abstract::_afterSave must be removed and replaced with afterCommitCallback. This is important to move the grid update (of sales_flat_order_grid) out of the transaction.

2nd Deadlock

Rewrite the method of the Mage_CatalogInventory_Model_Observer::reindexQuoteInventory() to remove the price reindexing from the transaction. That index process will also be fired in event sales_model_service_quote_submit_success.

@herveguetin
herveguetin / clean_catalogsearch.sql
Last active August 29, 2015 13:59 — forked from leek/_Magento1_DeleteTestData.md
Clean Magento Database
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `catalogsearch_fulltext`;
TRUNCATE `catalogsearch_query`;
TRUNCATE `catalogsearch_result`;
--
-- Enterprise Edition
--
@SchumacherFM
SchumacherFM / CatalogDeleteNull.sql
Last active January 15, 2023 15:41
Magento: Remove all NULL values from catalog_*_entity_* tables
DELETE FROM catalog_category_entity_datetime WHERE `value` IS NULL;
DELETE FROM catalog_category_entity_decimal WHERE `value` IS NULL;
DELETE FROM catalog_category_entity_int WHERE `value` IS NULL;
DELETE FROM catalog_category_entity_text WHERE `value` IS NULL;
DELETE FROM catalog_category_entity_varchar WHERE `value` IS NULL;
DELETE FROM catalog_product_entity_datetime WHERE `value` IS NULL;
DELETE FROM catalog_product_entity_decimal WHERE `value` IS NULL;
DELETE FROM catalog_product_entity_gallery WHERE `value` IS NULL;
DELETE FROM catalog_product_entity_group_price WHERE `value` IS NULL;
@StefanWallin
StefanWallin / README.md
Last active January 15, 2022 06:22 — forked from konklone/ssl.rules
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).

Step by step to install Scala + Play Framework in Ubuntu 14.04 with Activator.

Install Scala

sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.6.deb
sudo dpkg -i scala-2.11.6.deb
sudo apt-get update
sudo apt-get install scala
@peterjaap
peterjaap / Observer.php
Created June 2, 2015 10:34
Fixed Orchid_CouponFix_Model_Observer for Magento 1.7+
<?php
class Orchid_CouponFix_Model_Observer
{
public function cancel($observer)
{
$resource = Mage::getModel('core/resource');
$db = $resource->getConnection('core_write');
$event = $observer->getEvent();
$order = $event->getPayment()->getOrder();
if ($order->canCancel()) {
@danieljwonder
danieljwonder / facebook-wca-standard-events.html
Last active October 14, 2024 07:21
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>
@hawkup
hawkup / Install Play Framework on Ubuntu 14.04.md
Last active May 15, 2019 16:20
Install Play Framework on Ubuntu 14.04

Install Play Framework on Ubuntu 14.04

  1. download file from https://www.typesafe.com/activator/download
  2. move unzipped directory to /usr/local/share
  3. export
export ACTIVATOR_HOME=/usr/local/share/activator-dist-1.3.6
export PATH=$PATH:$ACTIVATOR_HOME/bin
  1. create Play app