Skip to content

Instantly share code, notes, and snippets.

Avatar
:bowtie:
Focusing

S.Cherepanov sergeycherepanov

:bowtie:
Focusing
View GitHub Profile
@sergeycherepanov
sergeycherepanov / flux.script
Created Jan 14, 2022
InfluxDB Cpu Normalized Value
View flux.script
loadAvarage = from(bucket: "v1_prod_magento")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "system")
|> filter(fn: (r) => r["_field"] == "load1")
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "load1")
nCpus = from(bucket: "v1_prod_magento")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
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)
View m1dumper.sh
#!/bin/bash
#
# headless run: bash <(curl -s -L 'https://bit.ly/m1dumper')
# or
# with specidic dump path: DUMPPATH=/tmp/magento1.sql.gz /bin/bash <(curl -s -L 'https://bit.ly/m1dumper')
set -x
set -e
[[ -f app/etc/local.xml ]] || { echo "Can't locate the 'app/etc/local.xml'"; exit 1; }
@sergeycherepanov
sergeycherepanov / script.sh
Created Mar 13, 2019
shallow update not allowed
View script.sh
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
View gist:9c0e71ff555eb9bb2ab1a96b7510bf18
# Akeneo Media
# location /media/ {
# if (!-f $request_filename) {
# rewrite / /index.php last;
# }
#}
# Magento 2 static files
location /static/ {
# Uncomment the following line in production mode
View es.patch
Index: distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java b/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java
--- a/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java (revision ef48eb35cf30adf4db14086e8aabd07ef6fb113f)
+++ b/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java (date 1610434469093)
@@ -350,10 +350,10 @@
UserException {
@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"
View OroCRM Api Wsse Authentification headers (php and javascript)
<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 / AdobeAMDFix.md
Created Nov 8, 2020 — forked from naveenkrdy/AdobeAMDFix.md
To fix adobe products crashes on AMD hackintosh
View AdobeAMDFix.md

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password if asked).

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