Skip to content

Instantly share code, notes, and snippets.

View EricSeastrand's full-sized avatar

Eric Seastrand EricSeastrand

View GitHub Profile
configure
set system package repository wheezy components 'main contrib non-free'
set system package repository wheezy distribution wheezy
set system package repository wheezy url http://http.us.debian.org/debian
commit
save
exit
sudo apt-get update
var products = [];
jQuery('.dottedlink:contains("Edit")').each(function(){
var $ = jQuery;
console.log($(this));
var row = $(this).closest('tr');
products.push({
'name' : row.find('td:eq(1)').text(),
'displayname' : row.find('td:eq(2)').text(),
'price' : row.find('td:eq(5)').text(),
@EricSeastrand
EricSeastrand / magento_1_create_admin.sql
Created August 14, 2018 14:30
Magento 1 Create Admin User DB queries
SET @LOGIN_PW = "password_goes_here";
SET @USERNAME = "username_goes_here";
SET @FIRSTNAME = "Test";
SET @LASTNAME = "Tester";
SET @EMAIL = 'delete_me@example.com';
SET @SALT = "rp";
SET @PASS = CONCAT(MD5(CONCAT( @SALT , @LOGIN_PW) ), CONCAT(":", @SALT ));
SELECT @EXTRA := MAX(extra) FROM admin_user WHERE extra IS NOT NULL;
@EricSeastrand
EricSeastrand / pma_install.sh
Last active March 31, 2020 20:15
Install PHPMyAdmin on an AWS Elastic Beanstalk EC2 instance
## To install, log into the server, download this file, and run as webapp user like:
# sudo -u webapp bash pma_install.sh
ALLOWED_IP='' # Put your public IP here... See whatismyip.com
PMA_VERSION=4.9.5
PMA_FILE="phpMyAdmin-$PMA_VERSION-english"
INSTALL_IN_DIR='pma'
cd /var/www/html
@EricSeastrand
EricSeastrand / disable_old_cartrules.sql
Created August 31, 2018 18:20
Magento 1: SQL query to disable old shopping cart price rules
UPDATE salesrule SET is_active=0 WHERE to_date<NOW() AND is_active=1;
@EricSeastrand
EricSeastrand / magento1_find_category_scope_overrides.sql
Last active March 1, 2019 15:54
Finds all the overridden values in storeview scopes for Magento 1 categories
-- Find overridden values
SELECT a.attribute_code, overrides.* FROM (
SELECT 'datetime', entity_id, store_id, attribute_id, `value` FROM catalog_category_entity_datetime WHERE store_id!=0 UNION ALL
SELECT 'decimal', entity_id, store_id, attribute_id, `value` FROM catalog_category_entity_decimal WHERE store_id!=0 UNION ALL
SELECT 'int', entity_id, store_id, attribute_id, `value` FROM catalog_category_entity_int WHERE store_id!=0 UNION ALL
SELECT 'text', entity_id, store_id, attribute_id, `value` FROM catalog_category_entity_text WHERE store_id!=0 UNION ALL
SELECT 'varchar', entity_id, store_id, attribute_id, `value` FROM catalog_category_entity_varchar WHERE store_id!=0
) AS overrides
LEFT JOIN eav_attribute a ON overrides.attribute_id=a.attribute_id
@EricSeastrand
EricSeastrand / shopify-twine-embed.liquid
Last active March 13, 2019 19:35
This Shopify "section" will allow you to add a Twine social feed to any sectioned page by entering the app ID.
{% assign urlParam_app = section.settings.appName | url_encode %}
{% assign urlParam_showNav = section.settings.includeNavBar | url_encode %}
{% case section.settings.loadingBehavior %}
{% when 'automatic' %}
{% assign urlParam_showLoadMore = 'no' %}
{% assign urlParam_autoload = 'yes' %}
{% when 'none' %}
{% assign urlParam_showLoadMore = 'no' %}
{% assign urlParam_autoload = 'no' %}
@EricSeastrand
EricSeastrand / magento-disable-extensions-by-glob.sh
Created April 8, 2019 13:33
Sed command to automagically disable a bunch of Magento 1 modules
sed -i'' -e's/active>true/active>false/' app/etc/modules/Mirasvit_*.xml
@EricSeastrand
EricSeastrand / tsm_to_csv.py
Last active September 1, 2021 23:59
Converts the TradeSkillMaster data that the addon downloads into a CSV file you can upload into a Google Sheet.
import re # Regex ... sadly...
import os
# Update your WoW path here..
tsm_file = "E:/World of Warcraft/_retail_/Interface/AddOns/TradeSkillMaster_AppHelper/AppData.lua"
desktop_path = os.path.expandvars('%USERPROFILE%/Desktop/')
csv_destination = desktop_path + '/tsm_data.csv'
@EricSeastrand
EricSeastrand / computer-control.user.js
Last active November 7, 2022 18:04
Browser side of my alexa skill
// ==UserScript==
// @name Computer Control Alexa Skill
// @namespace http://ericseastrand.com/
// @version 0.6
// @description Connects to a websocket server to listen for instructions like pausing media, searching youtube, etc..
// @author Eric Seastrand
// @match https://www.youtube.com/*
// @grant none
//@downloadURL https://gist.githubusercontent.com/willcodeforfood/c2320e6673e9137a581b66314807da46/raw/computer-control.user.js
// ==/UserScript==