Thursday, April 25, 2013

Starting with Lumina 520 and windows 8

So I finally took the plunge. Got the new Lumia 520 with Windows 8. (In past I have had, blackberry,  iPhone 1.0 and Samsung Galaxy).  So this is my 4th Mobile OS in the few years.

I have never liked the blackberry and found it very tedious to use. iPhone and iOS when it came out was a revolutionary. People had to get and and rethink about mobile phones. I remember when I got it, I had significant opposition from many folks in my company (who kept advising me to get a Blackberry) and even after I used it, would keep comparing their BB to my iPhone. In today's date, I do not think there is any debate about who won the argument there.

After 4 years of iPhone I finally moved to Android. For one-third the price, I got better hardware than the iPhone had. But the OS (Android Gingerbread) was far from seamless experience you had with iPhone. Yes, most of the iPhone type of feature were there but it never came close to the UX of iPhone. The Android still functioned as a set of independent applications, while iOS worked as one device.

In the last 6 months, I have now seen the new Android Jelly bean (Micromax A110) and the iOS 6.1. (iPad 3.0). The difference of the two OS has vastly reduced. Android still functioned as a independent applications but the number of applications were much more seamless. On the other hand the number of free applications had increased significantly and almost anything you needed, you could find a free application. Lot of applications were using open-standards and hence it made interfacing with multiple devices much easier. On the other hand, the iPad experience was not as great. Basically, there were some new applications and feature from the time off iOS 1.0 but nothing significantly had changed. There was nothing really to talk home about. Yes, the number of iOS apps were huge but almost all them had a crappy lite version for free and for anything else you needed to pay.

So, when it came time to buy a new phone, I decided to go for Lumia 520 with Windows 8.0.
I always believed that Microsoft was a software powerhouse and it best fights with its back against the wall. However over the last 10 years the market dominance made it arrogant and it was more concerned with keeping its market share than building disruptive technology. Nokia on the other hand was a great hardware company. Their initial software was also great but they choose the wrong legacy Symbian OS.  Again with them also the market dominance had made their heads spin. I had a great friend in Nokia Product Management when I got the iPhone. I remember him trashing the iPhone with not enough features, not the right software, with limited form-factor etc. At the end none of them used the iPhone and were so caught up in their own Nokia world, they too forgot that the paradigms could change.

However when these two giants with their back against the mountain joined their hands, I was very hopeful about the products they will come out with. And truely I am not disappointed.

(More to come later)

Wednesday, October 5, 2011

Mangento exporting SQL issue

While exporting mySQL if you every get into the problem]


ERROR 1064 (42000) at line 688: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE,
  KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
  KEY `FK_CATALO' at line 9

and the mySQL is 
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE

You need to replace all such instance by 

UNIQUE KEY `IDX_BASE` USING BTREE(`entity_type_id`,`entity_id`,`attribute_id`,`store_id`)

Tuesday, October 4, 2011

How to making Linux multihomed to connect to 2 ISP

To make my Ubuntu Server on more robust I have connected it to 2 ISP so that I can have redundant last mile. Also one of my ISP gives me unlimited bandwidth while the other is costlier but more reliable.

1.
To make your linux server multihomed, I am assuming that you have atleast 2 network interfaces. In my case both are ethernet (eth0 and eth1)

2. 
Make sure both the networks are working individually up by setting it on /etc/network/interface
sudo vi /etc/network/interface

#Loopback
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.200.100
        netmask 255.255.255.0
        metric 100
        gateway 192.168.200.6

auto eth1
iface eth1 inet static
        address 192.168.201.100
        netmask 255.255.255.0
        metric 200
        gateway 192.168.201.5

Now if you go to your terminal, you should be able to
>ip route show
192.168.201.0/24 dev eth1  proto kernel  scope link  src 192.168.201.100
192.168.200.0/24 dev eth0  proto kernel  scope link  src 192.168.200.100
default via 192.168.200.6 dev eth0  metric 100
default via 192.168.201.5 dev eth1  metric 200

With this if your eth0 goes down, your eth1 will take over and vice-versa.
But this is still a long way from making your network multihoned where your can do load balancing.

All you need to do is to add  multihop route in your /etc/rc.local
ip route append default scope global nexthop via 192.168.200.6 dev eth0 weight 5 nexthop via 192.168.201.5 dev eth1 weight 1

USB for Ubuntu Server

Ubuntu Server does not come with auto-mount for USB.
You will need to install the light weight usbmount

sudo apt-get install usbmount

Tuesday, September 20, 2011

Checking what files to checkin in SVN

Coming from rational Clearcase background, I always like to check which files I need to checkin and which files I would like to revert back.

First I check all files that have been added but not necessarily been added into the svn archive.
svn status | grep "^?" | awk '{ print $2} 

For the files that need to achieved do this manually.  For all other files you should save these in a tar and delete them. Most often these are files
svn status | grep "^?" | awk '{ print $2} >not-needed.txt

At this point you may want to remove the directories which are cached or not under source control

tar cxvfa  not-needed.tgz -T not-need.txt 
cat not-needed.txt | xarags rm -rf $1


Finally for all files that are now modified, I like to make sure they are really needed. Do a diff and make sure the code is correct.

svn status | grep "^[AM]" | awk '{if ($2=="S" || $2=="+") print $3; else print $2;}'



Sunday, September 11, 2011

In magento I have been jumping over all the directories to be able to see the code. Half my life was being spent on CDing.

Then I found this easy script
http://www.huyng.com/archives/quick-bash-tip-directory-bookmarks/492/

Basically it allows you to do a save on any alias and then go to the alias.

The script is basically very simple and can be easily used in any bash shell by adding it to .bashrc or .bash_aliases (for sake of completion)

# Bash Directory Bookmarks
alias m1='alias g1="cd `pwd`"'
alias m2='alias g2="cd `pwd`"'
alias m3='alias g3="cd `pwd`"'
alias m4='alias g4="cd `pwd`"'
alias m5='alias g5="cd `pwd`"'
alias m6='alias g6="cd `pwd`"'
alias m7='alias g7="cd `pwd`"'
alias m8='alias g8="cd `pwd`"'
alias m9='alias g9="cd `pwd`"'
alias mdump='alias|grep -e "alias g[0-9]"|grep -v "alias m" > ~/.bookmarks'
alias lma='alias | grep -e "alias g[0-9]"|grep -v "alias m"|sed "s/alias //"'

However there is now a better script which helps you save the names in more readable format and then go to that. For that you should look up the script yourself.
http://www.huyng.com/bashmarks-directory-bookmarks-for-the-shell/


Magento: How to change Title, Sescription and Keywords in static pages

Magento is fairly SEO friendly but for certain pages, it does not allow you to change the Title, Description or the keywords. Some of these pages are very important for Google crawls such as Search terms, Advanced search, Contact us, Sitemaps etc. There are other pages such as accounts etc, which also set the default keywords, however I do not care if they are crawled by Google as they are customer specific.

You can set all of these by making simple changes the layout XML files and the block functional file.
1.
We have to create the functions setDescription and setKeywords in .../app/code/core/Mage/Page/Block/Html/Head.php  (Remember it always best to make a copy of this file in .../app/code/local/Mage/Page/Block/Html/Head.php).

    /**
     * Set description element text
     *
     * @param string $description
     * @return Mage_Page_Block_Html_Head
     */
    public function setDescription($description)
    {
        $this->_data['description'] = $description;
        return $this;
    }


    /**
     * Set Keywords element text
     *
     * @param string $keywords
     * @return Mage_Page_Block_Html_Head
     */
    public function setKeywords($keywords)
    {
        $this->_data['keywords'] = $keywords;
        return $this;
    }



2. 
Let us take Advanced Search for example and see how we can make these changes. In layout/catalogsearch.xml

 After <label>Advanced Search Form</label>
        
        <reference name="head">
        <action method="setForcedTitle"><title>%TITLE%Vyom search</title></action>
        <action method="setDescription"><description>%DESCRIPTION%</description></action>
        <action method="setKeywords"><keywords>%KEYWORDS%</keywords></action>
        </reference>


Make sure you clear your cache before checking the changes. Similarly, find the right XML file and whichever static page you want to make the changes.