Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Stay'n cold in Minnesota

Tegan Snyder tegansnyder

💭
Stay'n cold in Minnesota
View GitHub Profile
@tegansnyder
tegansnyder / PATCH_SUPEE-5994_EE_1.11.0.0_to_EE_1.14.1.0_v1-2015-05-14-07-04-12.sh
Created May 15, 2015
PATCH_SUPEE-5994_EE_1.11.0.0_to_EE_1.14.1.0_v1-2015-05-14-07-04-12.sh
View PATCH_SUPEE-5994_EE_1.11.0.0_to_EE_1.14.1.0_v1-2015-05-14-07-04-12.sh
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@tegansnyder
tegansnyder / nest-quote-csv-regex-fix
Created Apr 28, 2015
Fix A CSV with nest quotes
View nest-quote-csv-regex-fix
(?<!^)(?<!",)(?<!\d,)"(?!,")(?!,\d)(?!$)(?!,-\d)
View ham.md

HAM

Out of these late experiments arose one of the most important capabilities of the Amiga, one absolutely key to its status as the world’s first multimedia PC. In the Amiga’s low-resolution modes of 320 X 200 and 320 X 400, Denise was normally capable of displaying up to 32 colors chosen from a palette of 4096. Miner now came up with a way of displaying any or all 4096 at once, using a technique he called “hold and modify” (HAM) whereby Denise could create the color of each pixel by modifying only the red, green, or blue component of the previous pixel.

HAM

http://en.wikipedia.org/wiki/Ham_%28chimpanzee%29

@tegansnyder
tegansnyder / hhvm_rhel7.md
Last active Aug 29, 2015
Building HHVM on RHEL 7
View hhvm_rhel7.md

Make sure you are sudo user before proceeding.

sudo -s
# rhel option rpms repos needed
subscription-manager repos p--enable=rhel-7-server-optional-rpms
# packages needed
yum install -y git svn cpp make autoconf automake libtool patch memcached \
bzip2 gcc-c++ cmake wget boost-devel mysql-devel pcre-devel gd-devel \
@tegansnyder
tegansnyder / 404.md
Last active Aug 23, 2017
Checking for 404s in Apache log
View 404.md

Get a list of 404s in the accesslogs:

sudo -s
grep "HTTP/1.1\" 404" /var/log/httpd/access_log | awk '{print $7 } ' | sort | uniq -c | sort -n > 404s.txt

another way

cut -d'"' -f2,3 /var/log/httpd/access_log | awk '$4=404{print $4" "$2}' | sort | uniq -c | sort -rg > 404s.txt
@tegansnyder
tegansnyder / remove customers and orders.sql
Created Jan 15, 2015
Magento - Remove Customers and Orders from Enterprise
View remove customers and orders.sql
###
###
### ORDERS
###
###
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
View magento_date_fields_format.php
<?php
include 'app/Mage.php';
Mage::app();
// start store emulation
//$store_id = 17;
//$appEmulation = Mage::getSingleton('core/app_emulation');
//$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($store_id);
echo Mage::getSingleton('catalog/product_option_type_date')->getConfigData('date_fields_order');
@tegansnyder
tegansnyder / remove_attributes_inchoo_social_connect.php
Created Jan 13, 2015
Remove Inchoo Social Connect customer attributes
View remove_attributes_inchoo_social_connect.php
<?php
include 'app/Mage.php';
Mage::app();
// remove incho social connect customer attributes
$codes[] = 'inchoo_socialconnect_gid';
$codes[] = 'inchoo_socialconnect_gtoken';
$codes[] = 'inchoo_socialconnect_fid';
$codes[] = 'inchoo_socialconnect_ftoken';
$codes[] = 'inchoo_socialconnect_tid';
@tegansnyder
tegansnyder / compare values across stores.sql
Created Dec 9, 2014
Compare a product values across stores
View compare values across stores.sql
SELECT * FROM (
SELECT * FROM (
SELECT 'int' as t, catalog_product_entity_int.* FROM catalog_product_entity_int WHERE store_id IN (1,13) AND entity_id = 22205
ORDER BY store_id
) s
UNION ALL
SELECT * FROM (
SELECT 'datetime' as t, catalog_product_entity_datetime.* FROM catalog_product_entity_datetime WHERE store_id IN (1,13) AND entity_id = 22205
ORDER BY store_id
) s
@tegansnyder
tegansnyder / debugging reindex locks mysql commands.md
Created Dec 2, 2014
Useful Mysql Commands for Debugging Magento Reindex Locks
View debugging reindex locks mysql commands.md

Sometimes you may have a run away reindex process that aborted due to a MySQL connection error of some sorts. It may be useful to use the following MySQL commands to aid in debugging.

Determining if a lock exists

Magento Enterprise labels the reindex lock via the constant REINDEX_FULL_LOCK in app/code/core/Enterprise/Index/Model/Observer.php

SELECT IS_FREE_LOCK('mydatabase_name.reindex_full')

Returns 1 is specified lock is free and can be acquired, 0 if it’s in use, NULL if an error occurs.

Determing the thread that is holding the lock

You can’t perform that action at this time.