Magento upgrade from 1.4, 1.5, 1.6, 1.7, or 1.8 to 1.9

NOTE: this upgrade process works the same way for Magento version 1.4, 1.5, 1.6, 1.7, 1.8, and 1.9

As many magento users will know, Magento is no fun to work with-- mainly due to poor community support (the developers help paying customers; i.e. Magento Enterprise ... Only payed support there... Great for business but bad for the average or beginning user...)

Anyhow...

So here's how we do it.

MAKE A BACKUP!

You can skip this step all together, however, please make a backup of everything prior to beginning the upgrade.

Create a test environment somewhere on your server (preferably away from your production installation)

Tags: how-to magento magento upgrade

HOW TO create a Gmail filter to automatically delete emails Older than X amount of days

Let's say you want to AUTOMATICALLY delete all "Promotional" emails from your Gmail after 90 days.

Step 1:

Go to Settings -> Filters -> Create a new filter

Step 2:

Type the following into "Has the words" field:

category:promotions older_than:90d

Step 3:

Click "Create filter with this search"

Step 4:

Select "Delete it" and finally click "Create filter" button... 

And... we're done!

The key here is older_than:90d, you can just as easily create whatever time-based filter you want with that.

Tags: gmail email

How to move an account from DirectAdmin to WHM/cPanel

If you tried using WHM's Transfer Tool on very large sites, you've probably got a timeout error.

To fix this, we'll need to do this through SSH (via root) what the Transfer Tools wasn't able to do itself.

STEP 1.

The Transfer Tool will create a /scripts directory--with all required scripts--at the base of your server, which we will use to create WHM/cPanel compatible backups.

The name of the script will look like the following: /scripts/pkgacct.YOUR_CPANEL_SERVER_NAME

Type the following to get the exact name:

Tags: Server Linux cpanel DirectAdmin transfer

Fix kernel panic error "task * blocked for more than 120 seconds"

If your server goes down, and you get a message like:

Feb 16 03:00:12 server kernel: INFO: task httpd:16101 blocked for more than 120 seconds.

Verify memory usage:

sar -r

Verify CPU usage:

sar -u

For me the culprit was CPU reaching %idle reaching 99.18

Tags: Linux kernel admin Troubleshooting

How to mass delete ALL twitter users you are following via Google Chrome

Step 1.

In Google Chrome, go to https://twitter.com/following

Step 2.

For PC hit Ctrl + Shift + J 
For Mac hit Cmd + Opt + J

Step 3.

Paste this code into the chrome console, hit enter, and wait for it to finish:

Tags: twitter

Drupal remove deleted fields from database

Install and enable Field SQL norevisions, and use it to delete any revisions you don't need. Also set it to disable revisions for content/entity types that you don't want revisions being made.

Note: For entity content types, drupal will automatically make revisions for each update, but won't allow you to revert to any of these revisions, so this is pretty pointless; plus for very large databases this can degrade performance.

Tags: Drupal drush

How to diagnose slow mysql performance

If you're experiencing slow mysql performance--top showing mysqld high cpu usage. This command will help you track down what's going on at that specific time.

mysql -e "show processlist"

Of course you should also check your log files:

Tags: mysql Server Linux

How to install drush on Godaddy cPanel hosting

If you're using godaddy cpanel hosting, you have 2 options of installing drush

1. drush version from drupal (which is NOT being updated anymore--unlike the latest github version).

or 2. (Preferred) Install the latest github version:

Go here to view instructions on how to install the latest version of drush from github.

Tags: cpanel godaddy drush Linux

How to convert database from innodb to InnoDB in phpMyAdmin?

In phpMyAdmin, click the "SQL" tab and paste the following in there--changing your_database to the actual database you want to change.

Tags: mysql Server admin

How to check if your drupal site was hacked (and how to fix it)

Install drupalgeddon on your server:

drush dl drupalgeddon

Install Site Audit:

drush dl site_audit --dev

Install Hacked:

drush dl hacked --dev; drush en hacked -y

Install Security Review:

drush en security_review -y

OPTIONAL: run all the above in a single line.

Tags: Drupal hack security drupalgeddon

How to install and use Malware Linux Detect (Maldet)

How to install Maldet

cd /usr/local/src/
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzf maldetect-current.tar.gz
cd maldetect-*
sh ./install.sh or sudo sh ./install.sh 

Tags: maldet Linux malware

Drupal Drealty How to fix Active Properties Set to 'active=0'

Sometimes drealty doesn't properly set RETS status properties marked as "Active", "Pending Sale", or "Backup Offer" as 'active=1'. Any property marked as 'active=0' will NOT display, no matter what 'rets_status' is marked as.

We can fix that by running this SQL query in phpMyAdmin:

UPDATE `drealty_listing` SET `active`='1'
WHERE `rets_status`='Active' or `rets_status`='Pending Sale' or `rets_status`='Backup Offer' ;
Tags: Drupal drealty

Magento: How to add an external stylesheet or javascript

Add an external stylesheet to magento using local.xml 

Create/edit the following:

app/design/frontend/PATH/TO/YOURTHEME/layout/local.xml

Make it look like so--should be self explanatory...

Tags: javascript CSS magento theme

Magento Mega Menu: Responsive Custom Menu MOD

Magento Mega Menu : Responsive Custom Menu MOD

Here is a modded Responsive Custom Menu I just did, adding named menu classes and positioning the custom block element above the menu items.

Why?

Original menu didn't have any unique class identifiers for menu items--it was partially unique, but nothing you can actually use to style any individual menu item.  Also I thought it made sense to have the custom block ABOVE the menu listing. After all, any custom element you want to show is likely going to be more important than the regular menu listing.

If you're interested in this, then simply download the attached Navigation.php or copy/paste over the following app/code/commmunity/WP/CustomMenu/Block/Navigation.php:

How to install PECL runkit

Here's a proper way of installing PECL runkit on centos.

cd /usr/local/src/
git clone https://github.com/zenovich/runkit.git
cd runkit
phpize
./configure
make
make install

Now edit your php.ini

XBMC Confluence Flat Skin (MOD) - Modern / Flat design

Alright... Kinda off topic.

XBMC is my favorite media center, and the default skin Confluence is pretty dated--i.e. the icons/interface haven't been updated in forever.

I did try other skins, but mouse support wasn't anywhere near as good as the default skin Confluence--I use a logitech touch mouse and no keyboard.

Anyhow...

Tags: xbmc skin Design

How to easily apply a patch to a drupal module or file

A quick way to apply a patch to a drupal file or module is as follows:

cd locations/of/module/
#or
cd locations/of/file/
wget https://www.drupal.org/files/issues/some.patch
cat some.patch | patch -p1

That's it.

Tags: Drupal modules patch

Increase Limit of Drupal Views Exposed Group Filters sort order

My original post: Exposed filters group: increase weight sort count (#delta)

This still hasn't been fixed at the time of this writing. So here we go...

Sort breaks, and does unpredictable sorting, if you use more than 20 options. E.g. say you have have an exposed grouped filter with a price drop down of more than 20 options, sorting will not work after 20 items, it will always spit out a different order than what you specify.

The fix

Edit the following Views module file:

sites/all/modules/views/handlers/views_handler_filter.inc

Look for this:

Tags: Drupal Views module

Change Exim SMTP banner in DirectAdmin for PHP mail

Change the PHP mail SMTP Sender banner

To Change the "Sender" info we have to do the following:

cd /usr/local/directadmin/data/templates/custom/
cp /usr/local/directadmin/data/templates/virtual_host2.conf /usr/local/directadmin/data/templates/custom/
cp /usr/local/directadmin/data/templates/virtual_host2_secure.conf /usr/local/directadmin/data/templates/custom/
sed -i 's/`USER`@`DOMAIN`/no-reply@`DOMAIN`/g' ./virtual_host2*.conf
echo "action=rewrite&value=httpd" >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d

Optimized Apache 2.4 httpd.conf

Here is my optimized Apache 2.4.x httpd.conf:

Credits: gregrickaby/The-Perfect-Apache-Configuration: https://github.com/gregrickaby/The-Perfect-Apache-Configuration

NOTICE: Adjusted the <ifmodule filter_module=""> portion, to be compatible with Apache 2.4.

Before:

FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html

After:

Tags: apache Linux apache 2.4 admin

Speed up and secure Apache SSL encryption.

By default apache loads a bunch of encryption protocols. Most of which either are insecure and/or slow.

The location of these settings are based on DirectAdmin's Apache 2.4.x, however, you should easily be able to locate them in your apache .conf files.

vi /etc/httpd/conf/extra/httpd-ssl.conf

Set Apache to only use the fastest and best encryption algorithms.

Now comment out the default SSL settings and add new ones as shown below:

Tags: apache SSL security performance

DirectAdmin blacklisted and whitelisted IP

Recently my IP address was blacklisted by directadmin on my own server.  Here's a how-to that may save you time, in case you're unable to login to DirectAdmin.

Start DirectAdmin in debug mode

cd /usr/local/directadmin
killall -9 directadmin
./directadmin b2000

Now try to log into directadmin. You should see the reason why you are unable to. For me it was "Blocking blacklisted IP xxx.xx.xxx.xxx"

Tags: DirectAdmin Linux Administration

How to install GraphicsMagick with GMagick PHP extension

Let's install GraphicsMagick!

wget http://sourceforge.net/projects/graphicsmagick/files/latest/download
tar xvfz NAMEOFFILE
cd GraphicsMagick-x.x.x
./configure --enable-shared
make
make install

Let's test it.

gm version 

If you get this error:

Tags: Linux admin GraphicsMagick imagemagick

How to install Apache Solr 4.6 with Apache Tomcat 7, for use with Drupal

Here's the 2014 version on how-to install Apache Solr 4.10, alongside Apache Tomcat 7, to help out with things like Drupal faceted search.

Ok... let's do this.

Install Java 1.7

yum install java-1.7.0-openjdk
# or
aptitude install java7-jdk



Done--that was quick.

Install Tomcat 7

Get the latest version of Tomcat here:


http://tomcat.apache.org/download-70.cgi

How to install a new drive in Linux larger than 2TB with proper alignment

Let's assume that we already have a primary physical drive in our system (HDD or SDD), and have added a second drive to our box, which we need to partition and mount automatically on boot.

Here's how to that:

Let's see what physical drives we have installed in our server:

ls /dev/sd*

Since this is our 2nd drive, you should see /dev/sdb.

Example:

Tags: Linux HDD ssd admin fdisk parted performance

How to fix Linux error "read-only file system"

Recently our /etc/fstab got screwed up preventing us from SSH-ing into the server after a reboot. So we were given KVM access to our server.

Once seting up Java to allow unsigned certificates--hint: under the Java Control Panel click the "Security" tab, and slide the "security level" to the bottom "Medium" . We were then greated with a message:

'give root password for maintenance or press ctrl+d to continue"

Come to find out CTRL-C and CTRL-V doesn't work, you have to type the pass by hand--this was very tedious since my root pass is extremely complex.

So once in I soon realized that the system was mounted as "read-only"; meaning that you couldn't make any changes to it; or in other words, completely useless at this state.

Tags: Linux admin fstab java KVM

New Linux Server Checklist (2014 Edition)

These are some of the basic things I do when I setup a new server

Get the latest directadmin.conf values

With each version of DirectAdmin, new configuration values are introduced that you may not know about. To see ALL these values do the following:

/usr/local/directadmin/directadmin c | sort -n

You can essentially copy/paste the entire results into your /usr/local/directadmin/conf/directadmin.conf replacing anything else in there.

Make sure you CAPITALIZE the SSL=1 value, because lowercase ssl=1 will not work.

Setup DirectAdmin with an SSL certificate

source: http://help.directadmin.com/item.php?id=15

If you don't own a certificate, you can create your own:

/usr/bin/openssl req -x509 -newkey rsa:2048 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9000 -nodes
chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem
Tags: how-to Linux Server checklist best-practice

Deny recursive DNS lookups in named (in newer or older versions of BIND)

For security reasons, it's recommended to disable recursive DNS lookups. Here is how:

Find out your named version

named -v

If your BIND version is at least 9.x then insert the following, between options { }:

Tags: named bind Linux admin

How to install CSF (ConfigServer Security & Firewall) with DirectAdmin

cd /usr/local/src
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

Now login as Admin into directadmin, and click the link at the bottom left ConfigServer Firewall&Security

You'll probably want to add your WAN IP here--you can find out what it is here: http://www.ip-secrets.com/

Then add your WAN IP into Quick Allow column.

Tags: CSF firewall security Linux Server admin DirectAdmin

DirectAdmin how to set an external email server for Domain Pointers

If you ever created domain pointers in DirectAdmin, you may have wondered how to set the domain pointer NOT to process email locally.

For instance say you have PRIMARYDOMAIN.com as the main domain under your DirectAdmin account--and it is set NOT to process emails locally, but rather have an external email server handle that; Under MX Records you un-checked "Use this server to handle my emails. If not, change the MX record and uncheck this option". So now you decided to create a "domain pointer" under that same account for another domain SECONDARYDOMAIN.com ... You set the proper MX records for this domain pointer under DNS settings, pointing to the external mail server, and think you're all good to go...

Tags: exim DirectAdmin Linux Administration