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
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 / disable mcafee endpoint protection.md
Last active Sep 7, 2020
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 / CategoryTreePathExportMagento.php
Last active Sep 4, 2020
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();
@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 / hdfs_file_cleanup_cron.sh
Created Oct 17, 2017
HDFS cron to delete old files in directory
View hdfs_file_cleanup_cron.sh
#!/bin/bash
now=$(date +%s);
days_to_keep=5
# Loop through files
hdfs dfs -ls /some_hdfs_directory | while read f; do
# Get File Date and File Name
file_date=`echo $f | awk '{print $6}'`;
file_name=`echo $f | awk '{print $8}'`;
@tegansnyder
tegansnyder / Magento-EE-Indexer-Status.sql
Created Aug 27, 2014
Get the Status of Magento Enterprise Indexers with MySQL
View Magento-EE-Indexer-Status.sql
SELECT `main_table`.`process_id`,
`main_table`.`indexer_code`,
'community' AS `indexer_type`,
`main_table`.`status`,
`main_table`.`started_at`,
`main_table`.`ended_at`,
`main_table`.`mode`,
IF(e.events IS NULL, 0, e.events) AS `events`
FROM `index_process` AS `main_table`
LEFT JOIN
@tegansnyder
tegansnyder / Using PHP ZTS (Zend Thread Safety) module and pthreads on PHP7 Webstatic Repo (Centos-RHEL).md
Last active Jul 29, 2020
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 / Upgrading Elastic Search to 2.3 - Steps I took.md
Last active Jun 2, 2020
Upgrading Elastic Search to 2.3 - Steps I took
View Upgrading Elastic Search to 2.3 - Steps I took.md

Details of steps I took on each node in a nine node ES cluster on RHEL7. These steps need to occur one node at a time, i.e. "rolling upgrade")

Step 1: Disable shard allocation

curl -XPUT "http://localhost:9200/_cluster/settings" -d'
{
  "transient": {
    "cluster.routing.allocation.enable": "none"
  }
}'
@tegansnyder
tegansnyder / MacOS Sierra - Custom PHP Compiled from Source with Threading and Custom ODBC Support.md
Last active May 8, 2020
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
View Install go 1.6 RHEl 7.md
# download latest https://golang.org/dl/
wget https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
tar xzvf go1.6.3.linux-amd64.tar.gz

# system wide install
sudo mv go /usr/local/

# add system wide path
You can’t perform that action at this time.