Skip to content

Instantly share code, notes, and snippets.

View mcjwsk's full-sized avatar

Dariusz Maciejewski mcjwsk

View GitHub Profile
@mcjwsk
mcjwsk / MySQL Replication Check
Created March 11, 2022 10:45 — forked from OliverBailey/MySQL Replication Check
Just a simple Mysql Replication Health Check script I wrote. You can put this in a cron.
#!/bin/bash
### VARIABLES ### \
EMAIL=""
SERVER=$(hostname)
MYSQL_CHECK=$(mysql --login-path=mysql_login -e "SHOW VARIABLES LIKE '%version%';" || echo 1)
STATUS_LINE=$(mysql --login-path=mysql_login -e "SHOW SLAVE STATUS\G")"1"
LAST_ERRNO=$(grep "Last_Errno" <<< "$STATUS_LINE" | awk '{ print $2 }')
SECONDS_BEHIND_MASTER=$( grep "Seconds_Behind_Master" <<< "$STATUS_LINE" | awk '{ print $2 }')
IO_IS_RUNNING=$(grep "Slave_IO_Running:" <<< "$STATUS_LINE" | awk '{ print $2 }')
@mcjwsk
mcjwsk / .bash_profile
Last active January 8, 2019 08:34 — forked from pablete/.bash_profile
Change iTerm2 profile (ie: background color) when SSHing into another machine
# Changing iTerm2 color in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas)
# Adapted from https://gist.github.com/porras/5856906
# 1. Create a theme in your terminal setting with the name "SSH" and the desired colors, background, etc.
# 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;))
# 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to
# "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with
# the SSH colors)
function tabc() {
local name=$1; if [ -z "$name" ]; then name="Default"; fi # if you have trouble with this, change
@mcjwsk
mcjwsk / change-dropdown-attribute-to-multiselect.sql
Last active March 29, 2017 12:01 — forked from dinhkhanh/change-dropdown-attribute-to-multiselect.sql
Magento change dropdown attribute to multiselect
UPDATE eav_attribute SET
entity_type_id = 4,
attribute_model = NULL,
backend_model = 'eav/entity_attribute_backend_array',
backend_type = 'varchar',
backend_table = NULL,
source_model = NULL,
frontend_model = NULL,
frontend_input = 'multiselect',
frontend_class = NULL
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
index 6c815ed68827dded619ecac227eda53ec860abf6..aa8e7d3812d7179fc254b47cbacbf89295a8a3f0 100644
--- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
+++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
@@ -278,13 +278,17 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract
$this->_dataSourceModel->cleanBunches();
while ($source->valid() || $bunchRows) {
+ //if the row scope isn't default we aren't finished with this entity
+ if ($startNewBunch && $source->valid() && !$this->_isRowScopeDefault($source->current())) {