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
<pre>
<?php
$username = 'admin';
$key = 'd525e743ee692632b52a05570444aa537e06a8cc';
$created = date('c');
$nonce = substr(md5(time()), 0, 16);
$sha1 = sha1($nonce . $created . $key, true);
$digest = base64_encode($sha1);
echo "user: {$username}" . PHP_EOL;
@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"
diff --git src/auto/configure src/auto/configure
index 907ec6c..cb65afd 100755
--- src/auto/configure
+++ src/auto/configure
@@ -11834,6 +11834,7 @@ else
# include <stddef.h>
#endif
#include <signal.h>
+#include <bits/sigaction.h>
@sergeycherepanov
sergeycherepanov / setup.md
Created May 5, 2020 17:47 — forked from novemberborn/setup.md
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@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 / STEP-1.aml
Last active January 15, 2020 12:25
SSDT-USB.aml
DefinitionBlock ("SSDT-USB.aml", "SSDT", 1, "sample", "USBFix", 0x00003000)
{
// "USBInjectAllConfiguration" : override settings for USBInjectAll.kext
Device(UIAC)
{
Name(_HID, "UIA00000")
// "RehabManConFiguration"
Name(RMCF, Package()
{
// XHC overrides for 100-series boards
@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
/**
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 / 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
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%";