Skip to content

Instantly share code, notes, and snippets.

View sergeycherepanov's full-sized avatar
:bowtie:
Focusing

S.Cherepanov sergeycherepanov

:bowtie:
Focusing
View GitHub Profile
@sergeycherepanov
sergeycherepanov / akeneo_elastic.md
Last active October 13, 2020 23:05
akeneo_elastic

Run elastic

docker run -d --restart=always --name=akeneos_es -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:6.5.4

Enable JDBC api and update index settings

curl -X POST 'http://localhost:9200/_xpack/license/start_trial?acknowledge=true'
curl -X PUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{"index.max_docvalue_fields_search" : "10000000"}' -H "Content-Type: application/json"
curl -X PUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{"index.max_result_window" : "10000000"}' -H "Content-Type: application/json"
@sergeycherepanov
sergeycherepanov / makerelease
Last active April 6, 2020 08:32
makerelease
#!/bin/bash
#
# Install dependencies:
# pip install markdown-to-json
#
#
# Usage: makerelease "branch1 branch2 ..."
#
set -e
@sergeycherepanov
sergeycherepanov / mysqldumper.sh
Last active October 2, 2021 07:43
mysqldumper
#!/bin/bash
# set -x
set -e
#
# Usage: ./mydump.sh -h 127.0.0.1 -u root -p root mydb --skip-table-data-like "sales_%" --skip-table-data-like "quote%" | gzip > /tmp/databasename.sql.gz
#
POSITIONAL=()
MYSQL_IGNORE_TABLE_DATA_LIKE=()
MYSQL_IGNORE_TABLE_LIKE=()
MYSQL_CLI=$(which mysql)
@sergeycherepanov
sergeycherepanov / percona-server-57-patches-10-memset_s.patch
Created May 29, 2019 17:28
percona-server-57/patches/10-memset_s.patch
From 3779fed6a7668f41fae23a5a338de1a4505b68d4 Mon Sep 17 00:00:00 2001
From: Laurynas Biveinis <laurynas.biveinis@gmail.com>
Date: Mon, 14 Jan 2019 15:13:14 +0200
Subject: [PATCH] Fix PS-5328 (fil0crypt.h:123:7: error: 'memset_s' was not
declared in this scope on illumos)
memset_s in C11 is only guaranteed to be available if
__STDC_LIB_EXT1__ is defined by the implementation and if user defines
__STDC_WANT_LIB_EXT1__, which we didn't do. Thus add the latter define
to CMake default defines, before the feature checks.
<?php
namespace mage2login;
use Magento\Customer\Model\ResourceModel\CustomerRepository;
use Magento\Customer\Model\Session;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\State;
if (!isset($_REQUEST['id']) || !is_numeric($_REQUEST['id'])) {
echo "Usage: {$_SERVER['REQUEST_URI']}?id=%CUSTOMER_ID%";
@sergeycherepanov
sergeycherepanov / magento2.custom.logger.php
Last active May 12, 2019 11:27
magento2 custom logger
<?php
class Example
{
/**
* @return \Psr\Log\LoggerInterface
*/
public static function getLogger()
{
static $logger;
if (!$logger) {
<?php
/**
Extension url: https://github.com/runkit7/runkit7
*/
runkit_function_copy('curl_exec', 'curl_exec_orig');
function curl_exec_redefined($ch) {
if (!is_resource($ch)) {
@sergeycherepanov
sergeycherepanov / script.sh
Created March 13, 2019 18:29
shallow update not allowed
Here's what I ended up doing - it worked perfectly. Note that I was moving from my old host (Bitbucket) to my new one (Gitlab). My comments are above the commands:
# First, shallow-clone the old repo to the depth we want to keep
git clone --depth=50 https://...@bitbucket.org/....git
# Go into the directory of the clone
cd clonedrepo
# Once in the clone's repo directory, remove the old origin
git remote remove origin
@sergeycherepanov
sergeycherepanov / magento1_fastdump.sh
Created January 3, 2019 14:55
magento1_fastdump.sh
#!/bin/bash
host=$1
user=$2
password=$3
dbname=$4
[[ -f /tmp/${dbname}_tables.txt ]] && rm /tmp/${dbname}_tables.txt
mysql -N "-h${host}" -u${user} -p${password} -e "show tables like 'sales\_%';" ${dbname} >> /tmp/${dbname}_tables.txt
@sergeycherepanov
sergeycherepanov / php56brew.patch
Last active December 27, 2018 14:15
php56brew.patch
diff --git a/acinclude.m4 b/acinclude.m4
index 168c465f8d..6c087d152f 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -441,7 +441,11 @@ dnl
dnl Adds a path to linkpath/runpath (LDFLAGS)
dnl
AC_DEFUN([PHP_ADD_LIBPATH],[
- if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then
+ case "$1" in