This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Forward relevant Vagrant forwarded ports to standard ports using iptables (adjust 8080, 8443). | |
# To make persistent install and use "iptables-persistent" package. Just do a | |
# "sudo iptables-persistent save" and service will reload saved rules on each boot. | |
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080 | |
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Marko Martinović | |
# https://devgenii.com/ | |
# | |
# Workaround for issue where Vagrant fails to install plugins due to RubyGems > v2.3.0 and Bundler Gem v1.12.0: | |
# | |
# ... `block in sort_dependencies': undefined method `payload' for nil:NilClass (NoMethodError) | |
# | |
# For example Vagrant 1.8.3 installed from .deb package @ HashiCorp website on Ubuntu 16.04 LTS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -i | |
cat > /etc/sudoers.d/10_vagrant <<EOF | |
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports | |
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status | |
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start | |
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar | |
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /*/exports | |
Cmnd_Alias VAGRANT_EXPORTS_REMOVE_2 = /bin/cp /*/exports /etc/exports | |
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE, VAGRANT_EXPORTS_REMOVE_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com | |
# See https://www.byte.nl/blog/magento-cacheleak-issue | |
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!! | |
user app; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* @var $installer Mage_Customer_Model_Resource_Setup */ | |
$installer = Mage::getResourceModel('customer/setup','customer_setup'); | |
$installer->startSetup(); | |
if (!$installer->getAttributeId('customer', 'attribute_name')) { | |
$installer->addAttribute('customer', 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION: | |
/** Standard values defined @see Mage_Eav_Model_Entity_Setup::_prepareValues() */ | |
'label' => 'Label', // eav_attribute.frontend_label admin input label | |
'backend' => 'module/class_name', // eav_attribute.backend_model backend class (module/class_name format) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Comma separated list of IPs to be excluded | |
echo "123.123.123.123,234.234.234.234">var/.maintenance.ip | |
# For the rest of the world we go down for maintenance NOW | |
touch var/.maintenance.flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Debug SOAP requests | |
*/ | |
$client = new SoapClient( | |
'http://example.loc/index.php/api/v2_soap/?wsdl' | |
); | |
// Set yourself debug session cookie, for Xdebug and Phpstorm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Marko Martinović | |
# Prints command traces | |
set -x | |
# Tables to ignore | |
IGNORE_TABLES=(dataflow_batch_export dataflow_batch_import log_customer log_quote log_summary log_summary_type log_url log_url_info log_visitor log_visitor_info log_visitor_online report_event index_event enterprise_logging_event_changes core_cache core_cache_tag core_session core_cache_tag) | |
# Source SSH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123.123.123.123 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/142/form_key/CSLLfXodh1AqB5KK/ HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21" | |
234.234.234.234 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/8086/form_key/CSLLfXodh1AqB5KK HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21" | |
123.123.123.123 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/3734/form_key/CSLLfXodh1AqB5KK/ HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.21" | |
123.123.123.123 - - [23/Nov/2017:11:39:48 +0000] "POST /checkout/cart/add/uenc/xyz/product/8086/form_key/CSLLfXodh1AqB5KK HTTP/1.1" 444 0 "http://www.example.com" "Mozilla/5.0 (Windows NT 6.1; WOW64) Appl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `catalog_product_index_price_bundle_idx` | |
SELECT `e`.`entity_id`, | |
`cg`.`customer_group_id`, | |
`cw`.`website_id`, | |
IF(IF(Ifnull(tas_tax_class_id.value_id, -1) > 0, tas_tax_class_id.value, tad_tax_class_id.value) IS NOT NULL, IF(Ifnull(tas_tax_class_id.value_id, -1) > 0, tas_tax_class_id.value, tad_tax_class_id.value), 0) AS `tax_class_id`, | |
1 AS `price_type`, | |
IF(IF(IF(Ifnull(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) IS NULL, 1, IF(IF(Ifnull(tas_special_from_date.value_id, -1) > 0, tas_special_from_date.value, tad_special_from_date.value) <= cwd.website_date, 1, 0)) > 0 | |
AND IF(IF(Ifnull(tas_special_to_date.value_id, -1) > 0, tas_special_to_date.value, tad_special_to_date.value) IS NUL |