Skip to content

Instantly share code, notes, and snippets.

Avatar
:bowtie:
Focusing

S.Cherepanov sergeycherepanov

:bowtie:
Focusing
View GitHub Profile
@sergeycherepanov
sergeycherepanov / setup.md
Created May 5, 2020 — forked from novemberborn/setup.md
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively
View setup.md

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

View magento_install_cli.sh
#/bin/bash
# windows only
# wsl -d docker-desktop
# sysctl -w vm.max_map_count=262144
# echo -e "vm.max_map_count = 262144" >> /etc/sysctl.d/00-alpine.conf
docker run -d --restart=always --name=magento24_es -p 9222:9200 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.6.2
composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition=2.4 magento24
View STEP-1.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
View akeneo_elastic.md

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"
View makerelease
#!/bin/bash
#
# Install dependencies:
# pip install markdown-to-json
#
#
# Usage: makerelease "branch1 branch2 ..."
#
set -e
View mysqldumper.sh
#!/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
percona-server-57/patches/10-memset_s.patch
View 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.
View mage2login.php
<?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%";
View magento2.custom.logger.php
<?php
class Example
{
/**
* @return \Psr\Log\LoggerInterface
*/
public static function getLogger()
{
static $logger;
if (!$logger) {
@sergeycherepanov
sergeycherepanov / blog.example.com.toml
Last active Jan 5, 2021
Traefik Systemd Example with letsencrypt
View blog.example.com.toml
# /etc/traefik/conf.d/blog.example.com.toml
[frontends.blog]
backend = "blog"
passHostHeader = true
entrypoints = ["https", "http"]
priority = 100
[frontends.blog.ratelimit]
extractorfunc = "client.ip"
[frontends.blog.ratelimit.rateset.rateset1]
period = "10s"