Skip to content

Instantly share code, notes, and snippets.

View pauldonnelly's full-sized avatar

Paul Donnelly pauldonnelly

View GitHub Profile
--
-- Magento 1.9.0.1-2 Reset Categories
--
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_category_anc_categs_index_idx`;
TRUNCATE TABLE `catalog_category_anc_categs_index_tmp`;
TRUNCATE TABLE `catalog_category_anc_products_index_idx`;
TRUNCATE TABLE `catalog_category_anc_products_index_tmp`;
@pauldonnelly
pauldonnelly / Remove Items from wp_head()
Created November 17, 2014 15:13
Remove Items from wp_head()
/* Remove Items from wp_head() */
remove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds
remove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed
remove_action('wp_head', 'rsd_link'); // Display the link to the Really Simple Discovery service endpoint, EditURI link
remove_action('wp_head', 'wlwmanifest_link'); // Display the link to the Windows Live Writer manifest file.
remove_action('wp_head', 'index_rel_link'); // index link
remove_action('wp_head', 'parent_post_rel_link'); // prev link
remove_action('wp_head', 'wp_generator'); // Display the XHTML generator that is generated on the wp_head hook, WP version
remove_action('wp_head', 'rel_canonical');

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@pauldonnelly
pauldonnelly / nGrok
Created October 24, 2014 11:40
nGrok
Setup Localhost as site.ttl.ngrok.com
Open CMD and Type:
To Run: ngrok -subdomain site.ttl 80
To Run with Auth: ngrok -subdomain site.ttl -httpauth "Username:Password" 80
@pauldonnelly
pauldonnelly / MYSQL Import DB
Created October 24, 2014 11:30
MYSQL Import DB
mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < backup/data.sql
@pauldonnelly
pauldonnelly / Get Directory Size
Created October 24, 2014 11:30
Get Directory Size
du -sh
du -sh /etc/
du -sh /etc /home/ /securebackup/
@pauldonnelly
pauldonnelly / Remove .svn folders-Files
Created October 24, 2014 11:30
Remove .svn folders and files
Find all .svn folders beginning from current directory
find . -type d -name .svn
Pass these directories directly to rm command
rm -rf `find . -type d -name .svn`
@pauldonnelly
pauldonnelly / Check Linux Version
Created October 24, 2014 11:29
Check Linux Version
cat /proc/version
@pauldonnelly
pauldonnelly / Add a new user with root access
Created October 24, 2014 11:29
Add a new user with root access
sudo useradd -G GROUPNAME USERNAME
sudo passwd USERNAME
Enter Password
Repeat Password
sudo adduser USERNAME root
Add to multiple groups
useradd -G foo,bar,foobar USERNAME
@pauldonnelly
pauldonnelly / Create Password Protected Directory
Created October 24, 2014 11:28
Create Password Protected Directory
Go to or Create Directory (mkdir DIRECTORY)
1. htpasswd -c .htpasswd USERNAME
2. Enter Password twice
3. Type pwd to get current path + Copy
4. Create or Open .htaccess file - nano .htaccess
5. Insert:
AuthUserFile path/in/point/3/.htpasswd
AuthType Basic