Skip to content

Instantly share code, notes, and snippets.

View steverobbins's full-sized avatar

Steve Robbins steverobbins

View GitHub Profile
@steverobbins
steverobbins / watchsize.sh
Last active August 29, 2015 14:04
Monitors a file's size and alerts you when it's stopped growing (useful if you need to wait for a long logging process to finish)
#!/bin/bash
if [ -z $1 ]
then
echo "Usage: watchsize <file>"
exit
fi
SIZELAST=0
SIZENOW=1
set @STORE_TO_COPY_FROM = 2;
set @STORE_TO_COPY_TO = 3;
insert ignore into cms_block_store
select block_id, @STORE_TO_COPY_TO
from cms_block_store
where store_id = @STORE_TO_COPY_FROM;
insert ignore into cms_page_store
select page_id, @STORE_TO_COPY_TO
# Magento
/app/etc/local.xml
/connect/package.xml
/downloader/.cache
/downloader/cache.cfg
/downloader/connect.cfg
/media
/robots.txt
/sitemap.xml
/var/*
@steverobbins
steverobbins / mamp-httpd.conf
Last active August 29, 2015 14:05
/Applications/MAMP/conf/apache/httpd.conf
NameVirtualHost *
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
ServerName 127.0.0.1.xip.io
UseCanonicalName Off
ServerAlias *.127.0.0.1.xip.io
<Directory />
/var/www/example.com/shared/var/log/*.log {
rotate 5
daily
nocompress
missingok
notifempty
nocreate
}
grep -l community app/etc/modules/* | xargs perl -pi -e 's/true/false/g'
curl -o n98-magerun.phar https://raw.githubusercontent.com/netz98/n98-magerun/master/n98-magerun.phar
chmod +x n98-magerun.phar
./n98-magerun.phar --root-dir=/var/www/example.com/current/ admin:user:create username username@example.com Password Steve Robbins Administrators
Get-Content dump.sql | Foreach-Object { $_ -replace 'DEFINER(.*)`magento-dbuser`@`localhost`','DEFINER$1`different-user`@`different-host`' } | Set-Content new.sql
<?php
final class Mage
{
// ...
public static function dispatchEvent($name, array $data = array())
{
$e = new Exception();
Mage::log(
$name . ': ' . implode(', ', array_keys($data)) . "\n"
[xdebug]
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.profiler_enable_trigger=1
zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"