Skip to content

Instantly share code, notes, and snippets.

@angelflo
angelflo / ElephantData.php
Created March 23, 2018 16:40 — forked from kanduvisla/ElephantData.php
Observer to strip <p> tags for Magento 2 in pages and static blocks
<?php
namespace Elephant\CFParent\Helper;
class ElephantData extends \Magento\Framework\App\Helper\AbstractHelper
{
public function __construct(
\Magento\Framework\App\Helper\Context $context,
array $data = []
@angelflo
angelflo / countries_block.sh
Created February 5, 2018 07:34
IPSet block country
#!/bin/bash
# Description: Uses IPSET and IPTABLES to block full countries from accessing the server for all ports and protocols
# Syntax: countries_block.sh countrycode [countrycode] ......
# Use the standard locale country codes to get the proper IP list. eg.
# countries_block.sh cn ru ro
# Will create tables that block all requests from China, Russia and Romania
# Note: To get a sorted list of the inserted IPSet IPs for example China list(cn) run the command:
# ipset list cn | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
# #############################################################################
# Defining some defaults
@angelflo
angelflo / ipset-country
Created February 5, 2018 07:20 — forked from mkorthof/ipset-country.md
Block countries using iptables + ipset + ipdeny.com
#!/bin/sh
# ipset-country
# Block countries using iptables + ipset + ipdeny.com
# run this script from cron, e.g. /etc/cron.daily
# to run on boot you can also add it to e.g. /etc/rc.local
# please note: this script will insert an iptables REJECT
@angelflo
angelflo / my.cnf
Created January 30, 2018 09:09 — forked from yvoronoy/my.cnf
MySQL Magento Config
[mysqld]
## After edit config you have to remove log files and restart mysql server
## because after changing innodb-log-file-size you should recreate ib_logfiles
## Stop MySQL server
## rm /data/dir/ib_logfile*
## Run MySQL server
##Table open cache under MacOS and MySQL 5.6 should be 250.
##Otherwise you will get error MySQL server has gone away
##table-open-cache = 250