Skip to content

Instantly share code, notes, and snippets.

View mikebranderhorst's full-sized avatar

Mike Branderhorst mikebranderhorst

  • Deo Volente Research
  • The Netherlands
View GitHub Profile
@chales
chales / cache-warmer-3.sh
Last active January 19, 2022 14:01
A couple of simple options to parse sitemap.xml to warm the cache or for other actions such as generating memory_profiler checks.
# This can be added to your cron job to run right after Drupal's cron or combine them into a single command so
# that it automatically executes when the cron run completes.
wget -q http://www.example.com/sitemap.xml -O - | egrep -o "http://www\.example\.com[^<]+" | wget -q -i - -O /dev/null --wait 1
@peterjaap
peterjaap / Mage_Catalog_Model_Resource_Url_getProduct.php
Last active May 4, 2017 06:09
Modified Mage_Catalog_Model_Resource_Url::_getProduct function. This function now contains a boolean that you can set to switch between rewriting the URL's for ALL products and rewriting only the URL's of products that are visible. Idea inspired by Alan Storm's blog on Scaling Magento - http://alanstorm.com/scaling_magento_at_copious
<?php
protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId)
{
$products = array();
$websiteId = Mage::app()->getStore($storeId)->getWebsiteId();
$adapter = $this->_getReadAdapter();
if ($productIds !== null) {
if (!is_array($productIds)) {
$productIds = array($productIds);
#!/bin/sh
#
# @author Matt Korostoff <[email protected]>
#
# @internal start varnish on port 80, switch apache to 8000
#
# @category apache
#
# @copyright Licensed under the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
#!/bin/sh
#
# @author Matt Korostoff <[email protected]>
#
# @internal stop varnish, restart apache on port 80
#
# @category apache
#
# @copyright Licensed under the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
#!/bin/sh
#
# @author Matt Korostoff <[email protected]>
#
# @internal stop and then restart varnish
#
# @category apache
#
# @copyright Licensed under the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
@lymanlai
lymanlai / mysqldump-cron.sh
Last active February 10, 2020 13:17
this script will mysqldump your db daily, weekly and monthly. and it will only keep three of them, while doing the fourth backup, it will delete the first one first.
#!/bin/bash
#author Lyman Lai
#date 2013-12-30
#source http://002.yaha.me/item/22728a58-c967-46d5-93eb-2649d684a9aa/
MYSQL_USER="yourname"
MYSQL_HOST="localhost"
MYSQL_PASSWORD="yourpassword"
MYSQL_BIN="$(which mysql)"
@peterjaap
peterjaap / magento-testing-scenarios.md
Last active May 13, 2025 08:03
Magento testing scenarios

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
@MikeWilkie
MikeWilkie / local.xml
Last active November 28, 2018 04:47
Magento – Disable Excessive Logging and Reporting in app/etc/local.xml
<?xml version="1.0"?>
<!-- license -->
<config>
<global>
<!-- global config -->
</global>
<frontend>
<events>
<!-- disble logs -->
<controller_action_predispatch>
@dergachev
dergachev / Docker-forward-ssh-agent.sh
Created May 15, 2014 17:51
Allows SSH Agent forwarding into docker container
# NB: the line with SSH_AUT_SOCK allows SSH Agent forwarding into docker container
# NB: umask 002 makes all newly created files group-writable
docker-run-with-agent:
docker run -t -i \
-v `pwd`/source:/srv/docker-jekyll/source/ \
-v `pwd`/deploy:/srv/docker-jekyll/deploy \
-v `dirname $(SSH_AUTH_SOCK)`:`dirname $(SSH_AUTH_SOCK)` -e SSH_AUTH_SOCK=$(SSH_AUTH_SOCK) \
-p 4000:4000 \
dergachev/docker-jekyll \
/bin/bash -c "umask 002; $(cmd) $(args)"
@kubaceg
kubaceg / databaseBackup.sh
Last active May 1, 2017 11:32
n98Magerun magento database backup script, creates daily, weekly and monthly dumps
#!/bin/bash
#CONFIG
backupDir='/mnt/backup'
magentoDir='/var/www/magento/htdocs'
magerunPath='/usr/bin/n98-magerun.phar'
#NUMBER OF DAYS TO KEEP BACKUPS
dailyKeepDays=7
weeklyKeepDays=30