Skip to content

Instantly share code, notes, and snippets.

View cmuench's full-sized avatar

Christian Münch cmuench

View GitHub Profile
@cmuench
cmuench / magento_list_available_totals.php
Created March 24, 2012 15:24
Little script to list all configured magento totals.
<?php
require_once 'app/Mage.php';
Mage::app();
$xml = Mage::getConfig()->getNode('global/sales/quote/totals');
$totals = array();
foreach ($xml->children() as $total) {
$totals[] = $total->getName();
@cmuench
cmuench / module_structure.txt
Created January 27, 2012 11:20
Puppet to install PHPStorm
modules
└── dev-tools
├── files
│   └── phpstorm.vmoptions
├── templates
│   └── phpstorm.desktop.erb
└── manifests
├── init.pp
└── phpstorm.pp
@cmuench
cmuench / jsmin.pp
Created January 27, 2012 09:59
Puppet file to install JS min / ubuntu
class dev-tools::jsmin {
exec { "download-js-min":
unless => "/usr/bin/test -d /usr/local/src/JSMin",
cwd => "/usr/local/src",
command => "/usr/bin/git clone https://github.com/douglascrockford/JSMin.git"
}
exec { "compile-js-min":
cwd => "/usr/local/src/JSMin",
command => "/usr/bin/gcc -o jsmin jsmin.c",
@cmuench
cmuench / .alias Datei
Created December 30, 2011 18:20
Magento Cache leeren
alias clear-magento-cache="rm -Rf var/cache/mage--*"
@cmuench
cmuench / AreaTest.php
Created October 15, 2011 12:17
Magento 2 Template
<?php
/**
* Auszug aus der Datei AreaTest.php im Verzeichnis dev/tests/integration/testsuite/Mage/Core/Model/App
* Im Test wird doe Store-Config über einen DocBlock definiert.
*/
//...
/**
@cmuench
cmuench / .htaccess
Created September 9, 2011 12:01
Magento - 404 Fehler nach Login in Adminbereich
# Tanks to Christian Kapitzke for magento .htaccess patch
#RewriteBase /
# Replace CUSTOM_ADMIN_NAME with your one's.
RewriteCond %{REQUEST_URI} !.*admin/CUSTOM_ADMIN_NAME.*
RewriteRule ^.*(CUSTOM_ADMIN_NAME.*) admin/$1 [L,NS,R=301]
@cmuench
cmuench / php.ini
Created June 29, 2011 09:11
xdebug config - PHP CLI
[xdebug]
xdebug.remote_enable = on
xdebug.remote_handle = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.idekey="netbeans-xdebug"
sudo smartctl -H /dev/sda
# Ausgabe:
#
# smartctl 5.40 2010-03-16 r3077 [x86_64-unknown-linux-gnu] (local build)
# Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
#
# === START OF READ SMART DATA SECTION ===
# SMART overall-health self-assessment test result: PASSED
@cmuench
cmuench / hdparm.sh
Created October 24, 2010 13:18
hdparm Settings
# Auslesen der Festplatten Einstellungen (sda für erste S-ATA Festplatte.
# Bitte hier bei IDE Platten hda, hdb usw. verwenden)
sudo hdparm -v /dev/sda
# Ausgabe:
#/dev/sda:
# multcount = 16 (on)
# IO_support = 1 (32-bit)
# readonly = 0 (off)
# readahead = 256 (on)
@cmuench
cmuench / local.xml
Created October 19, 2010 09:43
Magento File-Cache Backend Options
<?xml version="1.0"?>
<config>
<global>
<!-- Add cache backend options to your local.xml file in app/etc -->
<!-- BEGIN -->
<cache>
<backend_options>
<hashed_directory_level>1</hashed_directory_level>
<hashed_directory_umask>0777</hashed_directory_umask>