Skip to content

Instantly share code, notes, and snippets.

View jonathonbyrdziak's full-sized avatar
🔥
Scaling Businesses with Marketing Technology

Jonathon Byrdziak jonathonbyrdziak

🔥
Scaling Businesses with Marketing Technology
View GitHub Profile
@jonathonbyrdziak
jonathonbyrdziak / chkconfigoff.text
Last active June 28, 2016 18:18
Disable CentOS Programs To Optimize Your Server
Curtousy of Magento Support Tutorials
http://magentosupport.help/knowledgebase/disable-centos-programs-to-optimize-your-server/
chkconfig acpid off
chkconfig anacron off
chkconfig apmd off
chkconfig atd off
chkconfig autofs off
chkconfig cpuspeed off
chkconfig cups off
@jonathonbyrdziak
jonathonbyrdziak / .htaccess
Created May 1, 2015 16:23
enabling cross domain fonts and css for cdn subdomains
# ----------------------------------------------------------------------
# CORS-enabled images (@crossorigin)
# ----------------------------------------------------------------------
# Send CORS headers if browsers request them; enabled by default for images.
# developer.mozilla.org/en/CORS_Enabled_Image
# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
# wiki.mozilla.org/Security/Reviews/crossoriginAttribute
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
@jonathonbyrdziak
jonathonbyrdziak / index.php
Created April 30, 2015 16:43
Working with Magento SSL behind a Load Balancer
/**
* EC2's load balancer sets these for us so we know we're secure,
* preventing Magento from performing a redirect loop.
**/
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ) {
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}
# one-liner for generating this: mysqldump --no-data -uroot magento1600 | nawk '{if(match($0, /CREATE TABLE `(.*)`/, matchesT)) { the_table = matchesT[1]; } if(match($0, /(CONSTRAINT .*),?/, matchesK) && the_table) { the_key = gensub(/,?$/, "", matchesK[1]); the_key = gensub(/^ */, "", the_key); print "ALTER TABLE `" the_table "` ADD", the_key ";"; }}'
ALTER TABLE `admin_rule` ADD CONSTRAINT `FK_ADMIN_RULE_ROLE_ID_ADMIN_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `api_rule` ADD CONSTRAINT `FK_API_RULE_ROLE_ID_API_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `api_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `api_session` ADD CONSTRAINT `FK_API_SESSION_USER_ID_API_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `api_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `catalog_category_entity_datetime` ADD CONSTRAINT `FK_CAT_CTGR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id

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:

@jonathonbyrdziak
jonathonbyrdziak / keywords-emails-pam.js
Last active October 25, 2018 20:05
Keywords you should not use in your emails
// My Giant List of Pricing Keywords
Ad
Auto email removal
Bulk email
Click
Click below
Click here
Click to remove
Direct email
Direct marketing
@jonathonbyrdziak
jonathonbyrdziak / keywords-geography.js
Last active August 29, 2015 14:19
My Giant List of Geography Keywords
// My Giant List of Geography Keywords
// magentosupport.help/knowledgebase/google-adwords-mastering-keywords/
Alabama
Birmingham
Montgomery
Mobile
Huntsville
Tuscaloosa
Alaska
Anchorage
@jonathonbyrdziak
jonathonbyrdziak / keywords-travel.js
Last active August 29, 2015 14:19
My Giant List of Transportation and travel Keywords
// My Giant List of Transportation and travel Keywords
// magentosupport.help/knowledgebase/google-adwords-mastering-keywords/
advisory
all inclusive
hotel
hotels
hostel
hostels
map
maps
@jonathonbyrdziak
jonathonbyrdziak / keywords-legal.js
Last active August 29, 2015 14:19
My Giant List of Legal Keywords
@jonathonbyrdziak
jonathonbyrdziak / keywords-products.js
Created April 20, 2015 04:45
My Giant List of Products & materials Keywords
// My Giant List of Products & materials Keywords
// magentosupport.help/knowledgebase/google-adwords-mastering-keywords/
aluminum
ceramic
cotton
fabric
glass
gold
iron