Skip to content

Instantly share code, notes, and snippets.

View mklooss's full-sized avatar

Mathis Klooß mklooss

View GitHub Profile
@mklooss
mklooss / shop2date_customers2magento.sql
Created September 27, 2012 07:57
get Customers from Shop2Date for Magento
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 September 28, 2012 13:22
Multistore Magento / File Owner Cache Problem
<?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 October 8, 2012 11:31
nginx Configuration Magento
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 October 18, 2012 06:39
Tartarus Create Backups Configs (with Froxlor)
#!/bin/sh
for profile in /etc/tartarus/webs/*.conf; do
/usr/sbin/tartarus $* "$profile"
done
@mklooss
mklooss / import.php
Created October 22, 2012 14:30
Magento MySQL Plain Attribute Option Import
<?php
$attribute_code = "attr_code";
$suffix = " cm";
$array = array(
"10","20","30"
);
/*do not change*/
@mklooss
mklooss / gist:4023540
Created November 6, 2012 08:46
Magento Delete Old Session Files
#!/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 October 12, 2015 19:48
MySQL Backups with mysqldumper
#!/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 November 19, 2012 10:33
Magento/Shopware DevServer remove Old files
#!/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 November 28, 2012 09:29
lighttpd sites enabled
# 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 October 13, 2015 12:08
Magento PayPal CronJob - Fraud False Positiv
<?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'));