Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathis Klooß mklooss

View GitHub Profile
View docker-imap-devel.sh
#/bin/bash
# running an test imap server for testing
docker run \
--name imap-devel \
-p 127.0.0.1:1143:143/tcp \
-p 127.0.0.1:1993:993/tcp \
-e MAILNAME=mail.example.com \
-e MAIL_ADDRESS=service@example.com \
@mklooss
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
mklooss / 1_magento_prepare_migration.md
Last active Dec 23, 2020
1_magento_prepare_migration.md
View 1_magento_prepare_migration.md

Get Attribute with unkown classes:

SELECT
    ea.attribute_code,
    eet.entity_type_code,
    ea.source_model
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
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 https://modpagespeed.com/doc/downstream-caching#ps-capabilitylist
# 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
mklooss / build-chroot-dir.sh
Last active Sep 14, 2020
chroot ssh builder
View build-chroot-dir.sh
# 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
mklooss / magento2-redis.sh
Last active Feb 17, 2021
magento2-redis.sh
View magento2-redis.sh
bin/magento setup:config:set \
--cache-backend=redis \
--cache-backend-redis-server=127.0.0.1 \
--cache-backend-redis-port=6379 \
--cache-backend-redis-db=1
bin/magento setup:config:set --page-cache=redis \
--page-cache-redis-server=127.0.0.1 \
--page-cache-redis-port=6379 \
--page-cache-redis-db=2
View pollux_roomservice_lineage-16.0.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<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
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
https://github.com/apache/incubator-pagespeed-ngx/wiki/Building-PSOL-From-Source
@mklooss
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
<?php
$emailData = [ ... ];
/* @var $transportBuilder \Magento\Framework\Mail\Template\TransportBuilder */
/* @var $transport \Magento\Framework\Mail\Transport */
$transport = $transportBuilder->getTransport();
if (isset($emailData['attachments']))
{