Skip to content

Instantly share code, notes, and snippets.

View tshabatyn's full-sized avatar

Taras Shabatyn tshabatyn

View GitHub Profile
@tshabatyn
tshabatyn / confirm.Makefile
Created February 3, 2023 16:37 — forked from Pierstoval/confirm.Makefile
"confirm" action for your Makefile
# To use the "confirm" target inside another target,
# use the " if $(MAKE) -s confirm ; " syntax.
mycommand:
@if $(MAKE) -s confirm ; then \
execute_your_command_here ; \
fi
.PHONY: mycommand
# The CI environment variable can be set to a non-empty string,
@Pierstoval
Pierstoval / confirm.Makefile
Last active March 7, 2024 09:34
"confirm" action for your Makefile
# To use the "confirm" target inside another target,
# use the " if $(MAKE) -s confirm ; " syntax.
mycommand:
@if $(MAKE) -s confirm ; then \
execute_your_command_here ; \
fi
.PHONY: mycommand
# The CI environment variable can be set to a non-empty string,
@ydenyshchenk
ydenyshchenk / urlRewriteReindex.php
Last active April 12, 2017 20:20
Magento 2 URL Rewrite full reindex
<?php
/*
###############################################
WARNING: this script truncates url rewrite tables and generates system url rewrites;
ALL CUSTOM URL REWRITES WILL BE DELETED
###############################################
*/
const BATCH_SIZE = 5;
@aabumuslimov
aabumuslimov / Magento1 indexers healthcheck
Last active March 9, 2017 10:17
Magento1 indexers healthcheck
SELECT m.metadata_id, m.table_name, m.changelog_name, IF(ccd.value = 1, "On Save", "Scheduled") AS "Mode", m.version_id AS "Processed version", v.version_id AS "Changelog version"
, CAST(v.version_id AS SIGNED) - CAST(m.version_id AS SIGNED) AS "Behind"
FROM (
(SELECT "enterprise_url_rewrite_redirect_cl" AS changelog_name, "index_management/index_options/redirect_url_rewrite" AS path, version_id FROM enterprise_url_rewrite_redirect_cl ORDER BY version_id DESC LIMIT 1)
UNION (SELECT "cataloginventory_stock_status_cl", "index_management/index_options/product_price_and_stock", version_id FROM cataloginventory_stock_status_cl ORDER BY version_id DESC LIMIT 1)
UNION (SELECT "catalogsearch_fulltext_cl", "index_management/index_options/fulltext", version_id FROM catalogsearch_fulltext_cl ORDER BY version_id DESC LIMIT 1)
UNION (SELECT "enterprise_url_rewrite_category_cl", "index_management/index_options/category_url_rewrite", version_id FROM enterprise_url_rewrite_category_cl ORDER BY version_id DESC LIMIT 1)
UNION
@terry-heinel
terry-heinel / checkDockerDisks.sh
Created January 30, 2017 22:56 — forked from robsonke/checkDockerDisks.sh
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"
@kandy
kandy / bootstrap.php
Created December 13, 2016 08:15
db profiler
<?php
// add to bootstrap.php
register_shutdown_function(function (){
if (strpos(@$_SERVER['HTTP_ACCEPT'], 'text/html') !== false) {
/** @var \Magento\Framework\App\Resource $adapter */
$adapter = \Magento\Framework\App\ObjectManager::getInstance()
->get('Magento\Framework\App\ResourceConnection');
// composer.phar require "jdorn/sql-formatter:1.3.*@dev"
// require_once '/home/user/.composer/vendor/jdorn/sql-formatter/lib/SqlFormatter.php';
/** @var Zend_Db_Profiler $profiler */
@davidalger
davidalger / sysadmin-shortcuts.md
Last active February 2, 2024 09:17
sysadmin-shortcuts

list listening ports

sudo lsof -nP -iTCP -sTCP:LISTEN
sudo netstat -plunt

flush DNS on Mojave

sudo killall -HUP mDNSResponder

immediately sleep displays

@yvoronoy
yvoronoy / my.cnf
Last active December 22, 2022 17:57
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