This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cpe.entity_id, cpe.sku | |
FROM catalog_product_entity as cpe | |
LEFT JOIN catalog_category_product as ccp on cpe.entity_id = ccp.product_id | |
WHERE category_id IS NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT sku, catalog_product_entity_media_gallery.value | |
FROM catalog_product_entity_media_gallery | |
RIGHT OUTER JOIN catalog_product_entity ON catalog_product_entity.entity_id = catalog_product_entity_media_gallery.entity_id | |
WHERE catalog_product_entity_media_gallery.value is NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cpe.sku, hie.profile, hie.updated_at FROM ho_import_entity as hie | |
LEFT JOIN catalog_product_entity as cpe ON cpe.entity_id = hie.entity_id | |
WHERE hie.updated_at < NOW() - INTERVAL 2 MONTH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Ansible role test shim. | |
# | |
# Usage: [OPTIONS] ./tests/test.sh | |
# - distro: a supported Docker distro version (default = "centos7") | |
# - playbook: a playbook in the tests directory (default = "test.yml") | |
# - role_dir: the directory where the role exists (default = $PWD) | |
# - cleanup: whether to remove the Docker container (default = true) | |
# - container_id: the --name to set for the container (default = timestamp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add secrets as environment variables | |
export $(egrep -v '^#' /run/secrets/* | xargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert all environment variables with names ending in _FILE into the content of | |
# the file that they point at and use the name without the trailing _FILE. | |
# This can be used to carry in Docker secrets. | |
# Source: https://github.com/grafana/grafana-docker/pull/166/files | |
for VAR_NAME in $(env | grep '^[^=]\+_FILE=.\+' | sed -r "s/([^=]*)_FILE=.*/\1/g"); do | |
VAR_NAME_FILE="$VAR_NAME"_FILE | |
if [ "${!VAR_NAME}" ]; then | |
echo >&2 "ERROR: Both $VAR_NAME and $VAR_NAME_FILE are set (but are exclusive)" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load variables from .env | |
if [ -f .env ]; then | |
export $(cat .env | xargs) | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Tobias Schifftner, @tschiffnter | |
# | |
# Usage: | |
# bash fail2ban-cleanup.php <fail2ban.sqlite3> | |
FILE=${1:-"/var/lib/fail2ban/fail2ban.sqlite3"} | |
[ -f "$FILE" ] || { echo "$FILE not found"; exit 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chore: Trigger major release for previous commits | |
BREAKING CHANGE: Did some stuff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function loadCsvFileToArray($filepath) | |
{ | |
$resource = fopen($filepath, 'r'); | |
$columns = fgetcsv($resource, null, ',', '"'); | |
$collection = []; | |
while($data = fgetcsv($resource, null, ',', '"')) { | |
$row = array_combine($columns, $data); |