Skip to content

Instantly share code, notes, and snippets.

Avatar

Mathis Klooß mklooss

View GitHub Profile
@mklooss
mklooss / shop2date_customers2magento.sql
Created Sep 27, 2012
get Customers from Shop2Date for Magento
View shop2date_customers2magento.sql
SELECT
email,
"base" as _website,
CASE country
WHEN "DE,DEU,276:Deutschland" THEN "eu"
WHEN "AT,AUT,040:Österreich" THEN "eu"
WHEN "CH,CHE,756:Schweiz" THEN "ch"
WHEN "BE,BEL,056:Belgien" THEN "eu"
WHEN "CY,CYP,196:Zypern" THEN "eu"
WHEN "CZ,CZE,203:Tschechien" THEN "eu"
@mklooss
mklooss / gist:3799823
Created Sep 28, 2012
Multistore Magento / File Owner Cache Problem
View gist:3799823
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@mklooss
mklooss / gist:3852036
Created Oct 8, 2012
nginx Configuration Magento
View gist:3852036
location / {
index index.html index.php;
try_files $uri $uri/ @handler;
expires 5h;
}
location ^~ /media/ {
expires max;
}
location ^~ /skin/ {
expires max;
@mklooss
mklooss / tartarus_backups.sh
Created Oct 18, 2012
Tartarus Create Backups Configs (with Froxlor)
View tartarus_backups.sh
#!/bin/sh
for profile in /etc/tartarus/webs/*.conf; do
/usr/sbin/tartarus $* "$profile"
done
@mklooss
mklooss / import.php
Created Oct 22, 2012
Magento MySQL Plain Attribute Option Import
View import.php
<?php
$attribute_code = "attr_code";
$suffix = " cm";
$array = array(
"10","20","30"
);
/*do not change*/
@mklooss
mklooss / gist:4023540
Created Nov 6, 2012
Magento Delete Old Session Files
View gist:4023540
#!/bin/bash
# delete files older than 14 days
DIR=/var/www/magento/var/session/
/usr/bin/find $DIR -depth -mtime +14 -exec rm -rf '{}' \;
@mklooss
mklooss / mysqldumper.sh
Last active Oct 12, 2015
MySQL Backups with mysqldumper
View mysqldumper.sh
#!/bin/sh
# MySQL Account Data in ~/.my.cnf
BACKUPDIR="/home/backups/sql";
DBFILTER="(information_schema|performance_schema|mysql|dev|tmp|froxlor|test)";
MYSQLDUMP="$(which mysqldump) -e --opt --skip-add-locks";
DIRNAME=`date +%Y-%m-%d`;
MYSQL=$(which mysql);
TAR=$(which tar);
GZIP=$(which gzip);
@mklooss
mklooss / dev_delete_cache.sh
Created Nov 19, 2012
Magento/Shopware DevServer remove Old files
View dev_delete_cache.sh
#!/bin/bash
echo "delete: Old Log Files"
if [ -d /var/customers/logs ]; then
touch /var/customers/logs
/usr/bin/find /var/customers/logs/ -depth -mtime +7 -exec rm '{}' \;
fi
SEARCH_DIR=/var/customers/webs
for web in $SEARCH_DIR/*; do
BASENAME=`basename $web`
@mklooss
mklooss / 99-sites-enabled.conf
Created Nov 28, 2012
lighttpd sites enabled
View 99-sites-enabled.conf
# File in: /etc/lighttpd/conf-available/99-sites-enabled.conf
include_shell "/usr/local/share/lighttpd/include-sites-enabled.pl"
@mklooss
mklooss / PaypalFraud.php
Last active Oct 13, 2015
Magento PayPal CronJob - Fraud False Positiv
View PaypalFraud.php
<?php
class PaypalFraud
{
const PAYPAL_FRAUD_LOG = "paypal_cron_fraud.log";
public function changeFraudStatus()
{
$collection_of_orders = Mage::getModel('sales/order')->getCollection();
$collection_of_orders->addFieldToFilter('status',array('fraud', 'payment_review'));