Skip to content

Instantly share code, notes, and snippets.

💭
Stay'n cold in Minnesota

Tegan Snyder tegansnyder

💭
Stay'n cold in Minnesota
Block or report user

Report or block tegansnyder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Preventing-Puppeteer-Detection.md

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@tegansnyder
tegansnyder / Magent_Product_Category_Query.sql
Created Dec 6, 2013
Query to retrieve all product ids and the category they belong to in Magento.
View Magent_Product_Category_Query.sql
SELECT `e`.entity_id, `at_category_id`.`category_id`
FROM `catalog_product_entity` AS `e`
LEFT JOIN `catalog_category_product` AS `at_category_id`
ON (at_category_id.`product_id`=e.entity_id)
@tegansnyder
tegansnyder / find-products-without-images.sql
Created Jan 16, 2014
Magento - finding products without images. Raw SQL.
View find-products-without-images.sql
SELECT *
FROM `catalog_product_entity` AS a
LEFT JOIN `catalog_product_entity_media_gallery` AS b ON a.entity_id = b.entity_id
WHERE b.value IS NULL
@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active Nov 6, 2019
Disable McAffee Endpoint Protection OSX
View disable mcafee endpoint protection.md

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@tegansnyder
tegansnyder / MacOS Sierra - Custom PHP Compiled from Source with Threading and Custom ODBC Support.md
Last active Oct 29, 2019
MacOS Sierra - Custom PHP Compiled from Source with Threading and Custom ODBC Support
View MacOS Sierra - Custom PHP Compiled from Source with Threading and Custom ODBC Support.md

I recently got a new Macbook Pro and wanted to document how I setup my PHP environment. I like full control of how PHP is built and I usually build it from source. I do this because I often add custom extensions and modules not found in the common PHP OSX installers. If your looking for a easier method than building from source try https://php-osx.liip.ch/.

NOTE: This post assumes you are running a fresh install of MacOS Sierra 10.12.16 with System Integrity Protection disabled. If you don't know how to disable it just boot into recovery mode and open a terminal and type csrutil disable, or google search it :) This post also assumes you are using Zsh instead of Bash shell. If you are using Bash you can replace anytime you see ~/.zshrc with ~/.bashrc.

First lets get some of the prerequisites. Start by grabbing the command line tools neccessary:

xcode-select --install
@tegansnyder
tegansnyder / Using PHP ZTS (Zend Thread Safety) module and pthreads on PHP7 Webstatic Repo (Centos-RHEL).md
Last active Sep 26, 2019
Using PHP ZTS (Zend Thread Safety) module and pthreads on PHP7 Webstatic Repo (Centos/RHEL)
View Using PHP ZTS (Zend Thread Safety) module and pthreads on PHP7 Webstatic Repo (Centos-RHEL).md

BECOM SUDO USER:

sudo -s

INSTALL WEBSTATIC REPO FOR CENTOS/RED HAT 7:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
@tegansnyder
tegansnyder / category-path-skus-query.md
Created Nov 20, 2014
List the Magento Skus and the Category Paths they belong in
View category-path-skus-query.md

Find a list of magento sku's and the category paths they belong in via MySQL query.

SELECT product_id, sku, catid, cce.path FROM (
    SELECT entity_id as product_id, category_id as catid FROM (
        SELECT `e`.entity_id, `at_category_id`.`category_id` 
        FROM `catalog_product_entity` AS `e` 
        LEFT JOIN `catalog_category_product` AS `at_category_id`
        ON (at_category_id.`product_id`=e.entity_id)
    ) sub_query
) final_query
@tegansnyder
tegansnyder / Magento Admin Backend.md
Last active Aug 6, 2019
Magento Custom Admin Backend
View Magento Admin Backend.md

You can set your own custom Magento admin URL in:

System -> Configuration -> [ADVANCED] -> Admin -> Admin Base URL

NOTE: Make sure you have added a ServerAlias directive to your virtual host configuration for backend.domain.com and that you have a SSL cert or wildcart setup for HTTPS traffic on that subdomain or you will lock yourself out the admin.

Rules for your .htaccess file to prevent duplicate urls and redirect directly to admin dashboard:

View Flushing DNS cache macOSX Sierra.sh
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say flushed
@tegansnyder
tegansnyder / CategoryTreePathExportMagento.php
Last active Jun 22, 2019
Export Category Tree and Paths for Magento
View CategoryTreePathExportMagento.php
<?php
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
Mage::app();
$category = Mage::getModel ('catalog/category');
$tree = $category->getTreeModel();
$tree->load();
You can’t perform that action at this time.