Skip to content

Instantly share code, notes, and snippets.


Mathis Klooß mklooss

View GitHub Profile
# running an test imap server for testing
docker run \
--name imap-devel \
-p \
-p \
-e \
-e \
mklooss / magento1_fix_auto_increment.sql
Created Dec 3, 2020
Magento1 issues with out of range value_id
View magento1_fix_auto_increment.sql
DELETE FROM catalog_product_entity_datetime WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity);
DELETE FROM catalog_product_entity_datetime WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);
DELETE FROM catalog_product_entity_decimal WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity);
DELETE FROM catalog_product_entity_decimal WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);
DELETE FROM catalog_product_entity_int WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity);
DELETE FROM catalog_product_entity_int WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);
DELETE FROM catalog_product_entity_text WHERE entity_id NOT IN (SELECT entity_id FROM catalog_product_entity);
mklooss /
Last active Dec 23, 2020

Get Attribute with unkown classes:

FROM eav_attribute AS ea JOIN eav_entity_type AS eet ON(eet.entity_type_id=ea.entity_type_id)
WHERE source_model IS NOT NULL
AND source_model NOT IN (
mklooss / pagespeed-requirement.vcl
Last active Oct 5, 2020 — forked from section-io-gists/pagespeed-requirement.vcl
Using the PageSpeed module alongside Varnish, you will need to configure Varnish to handle PageSpeed optimizations.
View pagespeed-requirement.vcl
# Note: You will want to add the snippet: `include "pagespeed-requirement.vcl";` above your `vcl_recv` in the default.vcl file.
sub vcl_recv {
call pagespeed_capability_detection;
# Function derived from requirements here
# Additional detection logic for crawlers, tablet and mobile devices.
sub pagespeed_capability_detection {
if (req.http.User-Agent ~ "(?i)Chrome/[3][2-9]+\.|Chrome/[4-9][0-9]+\.|Chrome/[0-9]{3,}\.|Firefox/([6-9][5-9]|\d{3,})\.") {
mklooss /
Last active Sep 14, 2020
chroot ssh builder
# Chroot Builder
cp -RLv /etc/ca-certificates /home/testing/etc/
cp -RLv /etc/ssl /home/testing/etc/
cp -Lv -vf /etc/{passwd,group,hostname,resolv.conf} /home/testing/etc/
LBIN="bash ls cp mc mv pwd dircolors mkdir rm chmod id patch diff awk rsync whoami ssh git git-receive-pack git-shell git-upload-archive git-upload-pack openssl hostname wget curl nice gzip gunzip xz unxz zip unzip lsof mysql mysqldump sed tar less ping mtr nslookup dig jpegoptim jpegtran guetzli cwebp optipng pngquant gif2webp zopflipng"
for f in $LBIN; do
WHICH=$(which $f)
mklooss /
Last active Feb 17, 2021
bin/magento setup:config:set \
--cache-backend=redis \
--cache-backend-redis-server= \
--cache-backend-redis-port=6379 \
bin/magento setup:config:set --page-cache=redis \
--page-cache-redis-server= \
--page-cache-redis-port=6379 \
View pollux_roomservice_lineage-16.0.xml
<?xml version="1.0" encoding="UTF-8"?>
<project clone-depth="1" name="fusion3-common/proprietary_vendor_sony" path="vendor/sony" remote="github" />
<project name="fusion3-common/android_device_sony_pollux" path="device/sony/pollux" remote="github" />
<project name="fusion3-common/android_device_sony_pollux-common" path="device/sony/pollux-common" remote="github" />
<project name="fusion3-common/android_device_sony_fusion3-common" path="device/sony/fusion3-common" remote="github" />
<project name="LineageOS/android_device_sony_common" path="device/sony/common" remote="github" />
<project name="fusion3-common/android_kernel_sony_apq8064" path="kernel/sony/apq8064" remote="github" />
<project name="LineageOS/android_hardware_sony_DASH" path="hardware/sony/DASH" remote="github" />
<project name="LineageOS/android_hardware_sony_thermanager" path="hardware/sony/thermanager" remote="github" />
mklooss / remove_Temando_Shipping.sql
Last active May 12, 2020
Remove Temando_Shipping from Magento2!
View remove_Temando_Shipping.sql
DELETE FROM eav_attribute WHERE attribute_code IN('ts_dimensions_length', 'ts_dimensions_width', 'ts_dimensions_height', 'ts_packaging_type', 'ts_packaging_id', 'ts_country_of_origin', 'ts_hs_code');
DROP TABLE temando_order;
DROP TABLE temando_quote_collection_point;
DROP TABLE temando_collection_point_search;
DROP TABLE temando_order_collection_point;
DROP TABLE temando_quote_pickup_location;
DROP TABLE temando_pickup_location_search;
DROP TABLE temando_order_pickup_location;
View 0_Building_Pagespeed_Static_File_for_NGINX.txt
mklooss / magento2.3-send-mail-with-attachments.php
Created Mar 26, 2020
Magento 2.3 Mail Transport add Attachments
View magento2.3-send-mail-with-attachments.php
$emailData = [ ... ];
/* @var $transportBuilder \Magento\Framework\Mail\Template\TransportBuilder */
/* @var $transport \Magento\Framework\Mail\Transport */
$transport = $transportBuilder->getTransport();
if (isset($emailData['attachments']))