Useful Endeca Tips and Commands

Fix “Failed to obtain lock” error

./runcommand.sh LockManager releaseLock update_lock
When you accidentally CTRL+C a running process or an error occurred, The flag will remain on the EAC and you need to release it before you can run a baseline process again. This command will do the trick.

Update your configuration

./runcommand.sh --update-definition
If you have edited your AppConfig.xml or any Configuration files at /config/script you need to update your configuration for your changes to be applied. The command above will let you update your definition without restarting the platform services nor force you to execute initialize_services.sh

Don’t use --equivopt dgidx flag

this dgidx flag is used to compute dimension value equivalence classes to minimize the index size, however this adds up to the indexing phase time. This flag has been deprecated starting Endeca 6.4.0. We used this before for saving some disk space but upon removal on 6.4.0 it took down our Dgidx process from 7 hrs to 45 minutes with no threads specified and down to 25 mins with 16 threads.

Maxing your Dgidx --threads

Maxing out your available CPU Cores for Dgidx’ disposal will do wonders. The speed won’t exponential based on the number of cores because –threads flags are only used on the indexing phase of Dgidx, but if you need faster execution time Add this flag.

Note: This post will be updated if i encountered other useful commands on Endeca 6.1.x or 6.4.x search platform. Some of the tips are available on the Oracle perf guide, I’ve rewritten it here based on my own experience and for easier archive retrieval.

Check how many cores your linux server has

If you want to check how many cores your linux server has enter the following command to your terminal

cat /proc/cpuinfo

This command will output a lot of information of your server’s cpu. If you don’t want the extra information the command below will serve you just right

cat /proc/cpuinfo | grep process | wc -l

Magento – Enabling Paypal on One page checkout in the PH

Paypal option is not showing on the one page checkout, Configurations are correct and errors are not appearing.

I changed the default currency to USD and The paypal button suddenly appeared. This concludes that Magento’s Paypal does not support Philippines natively.

To fix the problem you need to add PHP to the supported currencies.

Edit /app/code/core/Mage/Paypal/Model/Config.php

and add ‘PH’ to the array of support country codes

<?php

    /**
     * Merchant country supported by PayPal
     *
     * @var array
     */
    protected $_supportedCountryCodes = array(
'AE','AR','AT','AU','BE','BG','BR','CA','CH','CL','CR',
'CY','CZ','DE','DK','DO','EC','EE','ES','FI','FR','GB',
'GF','GI','GP','GR','HK','HU','ID','IE','IL','IN','IS',
'IT','JM','JP','KR','LI','LT','LU','LV','MQ','MT','MX',
'MY','NL','NO','NZ','PH','PL','PT','RE','RO','SE','SG',
'SI','SK','SM','TH','TR','TW','US','UY','VE','VN','ZA',
'PH');

Remote editing with Sublime Text and sshfs

I was allocated to a big new project and i am required to edit my codes remotely. I’ve always finished a project or two using VIM on remote servers but now i would like to change my old habits and write codes with sublime. This guide will teach you how to use your Linux machine and Sublime Text  to edit your codes remotely.

sshfs (SSH Filesystem)

sshfs mounts and help you edit directories and files on your remote server.

1. First you  need to install sshfs

On Debian, Ubuntu  or Linux Mint

sudo apt-get install sshfs

On RHEL / CentOS

# yum install fuse-sshfs

2. Mount your remote folder to your local directory

 # mkdir -p /mnt/ssh # sshfs kalmario@10.28.5.121:/data/project_folder/ /mnt/ssh/ 

3. Open your Sublime and open directory /mnt/ssh

 

Disclaimer: This method is working great on me because my remote server is just a build away. I’ll try it on a rackspace server which is a continent away from me and post if the lag time is still manageable and not irritating.

Case Sensitive string search on MySQL

Quick reference post to search string with case sensitivity.

MySQL String search is case-insensitive by default. Using BINARY on the WHERE clause forces MySQL to check its binary Collation which tries to match its character code rather than its string value; meaning “A != a” when using BINARY.

SELECT * FROM TABLE WHERE BINARY column = 'ABcdEFG';

The BINARY operator casts the string following it to a binary string. This is an easy way to force a comparison to be done byte by byte rather than character by character. BINARY also causes trailing spaces to be significant.

Reference: http://dev.mysql.com/doc/refman/5.0/en/charset-binary-op.html

How can twitter earn money

Twitter has a 140 character limitation which is imposed early on. 20 characters reserved for a twitter username and 140 for the text, this feature has been loved this feature. Money however will be become problematic sooner or later, they tried several steps monetizing their site by showing promoted spo on the trending widget, but still the dollars are not coming.

They are trying to create a billion dollar from their collosal userbase but twitter is not like facebook. Facebook has this targeted ads that is based on demographics and the user likes and users on fb has this culture of changing its UI every now and then. Twitter on the other site was promoted by early adopters that was passed by words to non-geeks. They never had a drastic UI change in the past and their users will not like it because they expect that twitter to be just the same old interface they have loved, Simple and no clutter.

Regarding monetization my idea is to have a pro-account or a credit based policy. If they could charge twitter power users for the service they will earn a lot. SMS has been charged per successful text message and earns more directly proportional to the volume of SMS. They could have a limit of 50 tweets per day or less for free accounts and let users that exceeds the limit to buy the service for 200 tweets a day or even unlimited tweets they will earn bucks and we’ll see less clutter on your twitter feed. I know you have a friend where they posts almost anything they do, what they eat.

more money for the company, less annoyance on your feed. Win! Win!

Endeca Search Platform

Endeca Search Platform is a commercial solution that’s also used by many companies around the world, mostly for e-commerce websites. It doesn’t rely on algorithms but it tries to emulate a “conversation” between user and your data.

Endeca features the use of unstructured data and business intelligence. Search engines help your user refine to the things they want to search using multi-facet categorization.

We have implemented multiple merchandising rules and search pre-processor using this engine.

There are several ways to merchandise a product in your Endeca Search Engine. One good example is the “Boost or Bury” feature that lets you define what products do you want to put on top of the search result or bury in the deepest of your results. This is a good tool for your sales team to push fast selling products on top. Our default ranking is computed based on the average sales but this tool makes merchandising customization by website page a breeze.

Example
1. Boost all “Nike” products when user is on the “Running Shoes” Page
2. Bury all results with Rating < 50 and Boost all records that is flagged as free shipping

Endeca has been acquired by Oracle last October 2011 and as of now the old endeca portal/documentation is now closed. The oracle portal and oracle communities is alive and kicking but i’m missing the old cool/chillax/helpful environment of endeca community. The portal was easy to use and will show you relevant search results and documentation is the best.

Sublime 2 Useful tips and Resources

Learn your sublime shortcuts

https://www.shortcutfoo.com/app/tutorial/sublimetext

Tips for beginners

http://blog.alainmeier.com/post/27255145114/some-things-beginners-might-not-know-about-sublime-text

Zen-Coding

plugin for high-speed HTML, XML, XSL (or any other structured code format) coding and editing
http://code.google.com/p/zen-coding/

Lorem Ipsum Generator

https://github.com/mrmartineau/Placeholders

Git

https://github.com/kemayo/sublime-text-2-git

Sublime Api Reference

http://www.sublimetext.com/docs/2/api_reference.html