I smell some conspiracy here. Need to check out Soumitra Sen's story.
Sen courted trouble as Receiver - J. Venkatesan - copied from hindu
For the beleaguered Justice Soumitra Sen of the Calcutta High Court, trouble started in 1983, when the Steel Authority of India Ltd. filed a money suit in the court against the Shipping Corporation of India for sale of Periclase Spinal Bricks lying at the Bokaro Steel Plant.
On April 30, 1984, the court appointed Justice Sen, who was a lawyer at that time, as a Receiver to make an inventory, sell these goods, and keep the proceeds until the case was decided. Between April 1, 1993 and June 1, 1995, he received the sale amount of Rs. 33.23 lakh.
In 1996, though he was entitled to keep only five per cent, Rs 1.66 lakh, towards remuneration, he kept the entire money in a fixed deposit with ANZ Grindlays (which later merged into Standard Chartered) and later transferred it to Lynx India Ltd, a company authorised by the RBI.
On January 20, 1997, another High Court Bench directed Mr. Sen to be the Receiver in another case and to keep Rs. 70 lakh for distribution among workers of Calcutta Fans. But he deposited this amount also in Grindlays Bank. Between May 14, 1997 and August 6, 1997, he issued several cheques to the workers.
On February 26, 1997, he deposited Rs. 25 lakh (from out of Rs. 70 lakh) with Lynx India, which sank. The shortfall was made up by taking Rs. 25 lakh from the SAIL money and depositing it in the Calcutta Fans account
On February 27, 2003, the SAIL filed an application in the High Court asking the Receiver to return the entire sales proceeds and render true and faithful accounts. He failed to do so until he was appointed judge on December 3, 2003.
On August 3, 2004, the High Court appointed a new Receiver, without asking Justice Sen to refund money lying with him till then.
Subsequently on February 15, 2005 when the matter was posted before another judge, he issued notice to Justice Sen for return of the money. On June 30, 2005 after the High Court ordered an enquiry, it came to light that Justice Sen, as Receiver, never filed any accounts, though he was required to do so every six months.
On November 1, 2005 he deposited Rs. 5 lakh. On April 10, 2006, the court directed him to repay Rs. 57.65 lakh, which included an interest of Rs. 26.26 lakh. Justice Sen went on leave and on his return, he was not allotted judicial work. Between June 27, 2006 and September 5, 2006, he repaid Rs. 40 lakh and on November 21, 2006, he repaid the balance amount.
On September 25, 2007, a Division Bench quashed single judge's order and expunged remarks. The Bench held that there was no material to hold that Justice Sen had misappropriated any amount or made any personal gain.
But on a report from the then Chief Justice of the High court, the then Chief Justice of India K.G. Balakrishnan formed a three-member committee to probe the charge
In February 2008, the in-house committee, found Justice Sen guilty of breach of trust and misappropriation. It said he did not have any honest intention since he mixed the money received as Receiver with his personal money. There was misappropriation, at least temporary, of the sales proceeds.
Acting on the report, he was asked to resign or to seek voluntary retirement, but he declined.
In August 2008, the then CJI, K.G. Balakrishnan, asked Prime Minister Manmohan Singh to initiate removal proceedings against Justice Sen for his misconduct.
On February 27, 2009, 58 MPs of the Rajya Sabha moved a motion seeking Justice Sen's removal.
On March 4, 2009, the Chairman of the Rajya Sabha appointed a probe panel headed by the then Supreme Court judge, B. Sudershan Reddy.
On September 10, 2010, the committee held him guilty on two counts — misappropriation of money and misrepresentation of facts to the High Court — and recommended his removal.
On August 18, 2011 the Rajya Sabha voted the resolution to remove Justice Sen.
Monday, September 05, 2011
Monday, August 08, 2011
Boot options for Macbook
You want to try ubuntu or want to boot from live cd. here are options.
Products Affected
MacBook Pro, MacBook Air, MacBook, iMac, Mac mini, Mac Pro
Keystroke Description
Press C during startup Start up from a bootable CD or DVD, such as the Mac OS X Install disc that came with the computer.
Press D during startup Start up in Apple Hardware Test (AHT).
Press Option-Command-P-R until you hear two beeps. Reset NVRAM
Press Option during startup Starts into Startup Manager, where you can select a Mac OS X volume to start from. Note: Press N to make the the first bootable Network volume appear as well.
Press Eject, F12, or hold the mouse or trackpad button Ejects any removable media, such as an optical disc.
Press N during startup Attempt to start up from a compatible network server (NetBoot).
Press T during startup Start up in Target Disk Mode.
Press Shift during startup Start up in Safe Boot mode and temporarily disable login items.
Press Command-V during startup Start up in Verbose mode.
Press Command-S during startup Start up in Single-User mode.
Press Option-N during startup Start from a NetBoot server using the default boot image.
original link
http://support.apple.com/kb/ht1533
Products Affected
MacBook Pro, MacBook Air, MacBook, iMac, Mac mini, Mac Pro
Keystroke Description
Press C during startup Start up from a bootable CD or DVD, such as the Mac OS X Install disc that came with the computer.
Press D during startup Start up in Apple Hardware Test (AHT).
Press Option-Command-P-R until you hear two beeps. Reset NVRAM
Press Option during startup Starts into Startup Manager, where you can select a Mac OS X volume to start from. Note: Press N to make the the first bootable Network volume appear as well.
Press Eject, F12, or hold the mouse or trackpad button Ejects any removable media, such as an optical disc.
Press N during startup Attempt to start up from a compatible network server (NetBoot).
Press T during startup Start up in Target Disk Mode.
Press Shift during startup Start up in Safe Boot mode and temporarily disable login items.
Press Command-V during startup Start up in Verbose mode.
Press Command-S during startup Start up in Single-User mode.
Press Option-N during startup Start from a NetBoot server using the default boot image.
original link
http://support.apple.com/kb/ht1533
Tuesday, August 02, 2011
Jungle Tourism Should Stop!
Last weekend I visited Kanheri caves at National Par, Borivali Mumbai.
It was great to visit this spot in the Monsoon. Great view of Real Forest amidst Mumbai which is known to have Jungle of Concrete. It was amazing to see so many Caves in such interiors of Dense forest. One does not stop wondering about people, who carved these beautiful caves and managed to Stay with Tigers and wild beasts aroung.
But something was not great! which is crowd of Mumbaikars Gathered there to Enjoy the monsoon and Small Waterfall near caves. With this beauty around, Indian Junta who dont miss to create a crowd at any chance provided, Why will they spare this Spot.
While watching the Monkeys sitted on tree branches, I felt the rage amongst them, some scared, some aggressive staring helplessly at Vehicles, Crowd of People who encroached on their own piece of land. These animals are owners of jungle, with curious tourists visiting these, What they want is just enjoy the beauty of the space, Click some pictures of their own, to get some instant fame on their Facebook Walls or some just to have fun in Wild.
How it will feel to you if you asked to stay in a home made of Glass and have people around you watching all your movements.
Todays NDTV showing some guy fighting to stop Tourism in jungle. Though It brings lots revenue for Forrest department to maintain jungle well, Tourism is helping to increase pollution in jungle, killing many creatures under vehicles.
I Support this unknown guy in his Cause,
Please Stop this Jungle Tourism!
In the words of Ravindranath Tagore
Into that heaven of freedom, my Father, let "our jungles" awake.
It was great to visit this spot in the Monsoon. Great view of Real Forest amidst Mumbai which is known to have Jungle of Concrete. It was amazing to see so many Caves in such interiors of Dense forest. One does not stop wondering about people, who carved these beautiful caves and managed to Stay with Tigers and wild beasts aroung.
But something was not great! which is crowd of Mumbaikars Gathered there to Enjoy the monsoon and Small Waterfall near caves. With this beauty around, Indian Junta who dont miss to create a crowd at any chance provided, Why will they spare this Spot.
While watching the Monkeys sitted on tree branches, I felt the rage amongst them, some scared, some aggressive staring helplessly at Vehicles, Crowd of People who encroached on their own piece of land. These animals are owners of jungle, with curious tourists visiting these, What they want is just enjoy the beauty of the space, Click some pictures of their own, to get some instant fame on their Facebook Walls or some just to have fun in Wild.
How it will feel to you if you asked to stay in a home made of Glass and have people around you watching all your movements.
Todays NDTV showing some guy fighting to stop Tourism in jungle. Though It brings lots revenue for Forrest department to maintain jungle well, Tourism is helping to increase pollution in jungle, killing many creatures under vehicles.
I Support this unknown guy in his Cause,
Please Stop this Jungle Tourism!
In the words of Ravindranath Tagore
Into that heaven of freedom, my Father, let "our jungles" awake.
Friday, July 15, 2011
Linode - RAM, Disk resize, Linode upgrade
We are using linode.com for hosting. So far they have provided very good service and support is quick.
We started with basic version of Linode380. and as we are getting more load on server we wanted to increase capacity.
There are multiple ways to increase capacity..
1) We can buy extra RAM/Hard disk.
2) We can upgrade to New Linode.
3) Buy One more linode and redo setup on new linode.
We chose 3rd option as 1st was costly and in 2nd one, we are not sure abt what will happen to our data in upgrade process.
also we wanted to upgrade our Operating system also.
After that we experimented some things on Old Server, here are observations..
1. Resize RAM (in case you upgrade only RAM)
You just need to reboot your system. You will see extra RAM added after reboot.
2. Resize Disc
no data loss and downtime 5min, system need to shutdown, then you resize disk and reboot. After reboot, you will see disk capacity increased.
3. deploy New linux distribution
We have Ubuntu 9 server installed, We wanted to use Ubuntu 10.04, after deploying new distribution, it automatically created partiition and deployed new Ubuntu there. We have our old data intact in old deployment.
4. upgrade from 512Linode to 768Linode # TBD on 15/07/2011
1. System shutdowns
2. Auto Migration of OS happens - it takes around 5-10 minutes for full migration. Data remains intact. but better have backup
feel free to ask if you need clarification on any point.
We started with basic version of Linode380. and as we are getting more load on server we wanted to increase capacity.
There are multiple ways to increase capacity..
1) We can buy extra RAM/Hard disk.
2) We can upgrade to New Linode.
3) Buy One more linode and redo setup on new linode.
We chose 3rd option as 1st was costly and in 2nd one, we are not sure abt what will happen to our data in upgrade process.
also we wanted to upgrade our Operating system also.
After that we experimented some things on Old Server, here are observations..
1. Resize RAM (in case you upgrade only RAM)
You just need to reboot your system. You will see extra RAM added after reboot.
2. Resize Disc
no data loss and downtime 5min, system need to shutdown, then you resize disk and reboot. After reboot, you will see disk capacity increased.
3. deploy New linux distribution
We have Ubuntu 9 server installed, We wanted to use Ubuntu 10.04, after deploying new distribution, it automatically created partiition and deployed new Ubuntu there. We have our old data intact in old deployment.
4. upgrade from 512Linode to 768Linode # TBD on 15/07/2011
1. System shutdowns
2. Auto Migration of OS happens - it takes around 5-10 minutes for full migration. Data remains intact. but better have backup
feel free to ask if you need clarification on any point.
Thursday, June 30, 2011
Cat5-Cat6 difference
The most obvious difference is their transfer capability. CAT5 has four pairs of twisted copper wire and supports up to 100m of Fast Ethernet (100Mbps) transfers. Although CAT5 has four twisted pairs, it only makes use of two pairs. CAT6 also has four pairs of twisted copper wire which supports Gigabit Ethernet (1000 Mbps) of up to 100m. Unlike CAT5, CAT6 takes advantage of all four pairs. CAT6 has a 2x transfer rate compared to CAT5 but due to the higher price tag of CAT6, it isn't used alot yet.
There is also CAT5e (enhanced). Like CAT6 is makes use of all four pairs but it isn't quite as fast at transferring as CAT6 but does support Gigabit Ethernet so is a popular choice.
There is also talk of CAT7, but thats going beyond your question.
Hope thats of some help.
This is repost from http://www.ozzu.com/hardware/cat5-cat6-cable-t34232.html
There is also CAT5e (enhanced). Like CAT6 is makes use of all four pairs but it isn't quite as fast at transferring as CAT6 but does support Gigabit Ethernet so is a popular choice.
There is also talk of CAT7, but thats going beyond your question.
Hope thats of some help.
This is repost from http://www.ozzu.com/hardware/cat5-cat6-cable-t34232.html
Office LAN design using Common Sense and expenses
In the past I always wonder how lan is designed.
but recently got chance to put lan setup in office.
We moved to quite big place with around 25 people sitting capacity.
I first thought to put 24 connectors
2 * 8 port switch- Rs.1900 (950*2)
1 24 port switch - Rs. 3800
--------------
wall jacks - 250* 24
labour - 300 per jack
we used Cat 6 cable instead of Cat-5 cable (still need to figure out difference)
Cat 6 100mtr cable - Rs. 2800
Cat 5 100mtr cable - Rs. 1900
Our electrician was not available so We called some electrician to do wiring work but he asked 3500. We tried to negotiate with him to take 2700 for work but he didnt want to negotiate. so we fell back to our trusted guy. He did whole work in just Rs. 1700
so It was going out of budget as we are only 8 people team so I reduced total jacks to 10 and cost got reduced accordingly.
Total cost was Rs. 11000 (including labour and material cost to setup lan with 10 pcs)
here comes interesting part lan designing, please refer to lan diagram attached.
Office has 2 floors, Basement and ground floor. Challenge was to keep everyone on single LAN also provide additional lan for ground floor.
but recently got chance to put lan setup in office.
We moved to quite big place with around 25 people sitting capacity.
I first thought to put 24 connectors
2 * 8 port switch- Rs.1900 (950*2)
1 24 port switch - Rs. 3800
--------------
wall jacks - 250* 24
labour - 300 per jack
we used Cat 6 cable instead of Cat-5 cable (still need to figure out difference)
Cat 6 100mtr cable - Rs. 2800
Cat 5 100mtr cable - Rs. 1900
Our electrician was not available so We called some electrician to do wiring work but he asked 3500. We tried to negotiate with him to take 2700 for work but he didnt want to negotiate. so we fell back to our trusted guy. He did whole work in just Rs. 1700
so It was going out of budget as we are only 8 people team so I reduced total jacks to 10 and cost got reduced accordingly.
Total cost was Rs. 11000 (including labour and material cost to setup lan with 10 pcs)
here comes interesting part lan designing, please refer to lan diagram attached.
Office has 2 floors, Basement and ground floor. Challenge was to keep everyone on single LAN also provide additional lan for ground floor.
Wednesday, June 29, 2011
Installing MySQLdb with Python 2.6 on Mac OSX10.5
It seemed easy but took quite time for me to install MySQLdb library on Python on Mac Osx 10.5
here are 2 links which saved day for me..
http://stackoverflow.com/questions/3061277/python-mysql-wrong-architecture-error
I have a fresh MacBook Air, and I managed to get MySQLdb working by doing the following: (Snow Leopard 10.6.6, preinstalled Python)
uname -a
Darwin Braindamage.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
Download the MySQL 32-bit dmg file from mysql pages, Install it.
Add the following lines to your ~/.profile (or ~/.bash_profile):
PATH="/usr/local/mysql/bin:${PATH}"
export PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
export VERSIONER_PYTHON_PREFER_64_BIT=no
export VERSIONER_PYTHON_PREFER_32_BIT=yes
http://stackoverflow.com/questions/1448429/how-to-install-mysqldb-python-data-access-library-to-mysql-on-mac-os-x
here are numerous step-by-steps on how to build and install the MySQLdb libraries. They often have subtle differences. This seemed the most popular to me, and provided the working solution. I've reproduced it with a couple of edits below
Step 0: Before I start, I assumed that you have MySQL(32 bit version) and Python installed on the mac.
Step 1: Download the latest MySQL for Python adapter from SourceForge.
Step 2: Extract your downloaded package:
tar xzvf MySQL-python-1.2.2.tar.gz
Step 3: Inside the folder, clean the package:
sudo python setup.py clean
COUPLE OF EXTRA STEPS, (from this comment)
Step 3b: Remove everything under your MySQL-python-1.2.2/build/* directory -- don't trust the "python setup.py clean" to do it for you
Step 3c: Remove the egg under Users/$USER/.python-eggs
Step 4: Originally required editing _mysql.c, but is now NO LONGER NECESSARY. MySQLdb community seem to have fixed this bug now.
Step 5: Create a symbolic link under lib to point to a sub-directory called mysql. This is where it looks for during compilation.
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
Step 6: Edit the setup_posix.py and change the following
mysql_config.path = "mysql_config"
to
mysql_config.path = "/usr/local/mysql/bin/mysql_config"
Step 7: In the same directory, rebuild your package (ignore the warnings that comes with it)
sudo python setup.py build
Step 8: Install the package and you are done.
sudo python setup.py install
Step 9: Test if it's working. It works if you can import MySQLdb.
python
>>> import MySQLdb
One final hiccup though is that if you start Python from the build directory you will get this error:
/Library/Python/2.5/site-packages/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.5/site-packages/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg/_mysql.pyc, but XXXX/MySQL-python-1.2.3c1 is being added to sys.path
This is pretty easy to Google, but to save you the trouble you will end up here (or maybe not... not a particularly future-proof URL) and figure out that you need to cd .. out of build directory and the error should disappear.
As I wrote at the top, I'd love to see this answer generalised, as there are numerous other specific experiences of this horrible problem out there. Edit away, or provide your own, better answer.
here are 2 links which saved day for me..
http://stackoverflow.com/questions/3061277/python-mysql-wrong-architecture-error
I have a fresh MacBook Air, and I managed to get MySQLdb working by doing the following: (Snow Leopard 10.6.6, preinstalled Python)
uname -a
Darwin Braindamage.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
Download the MySQL 32-bit dmg file from mysql pages, Install it.
Add the following lines to your ~/.profile (or ~/.bash_profile):
PATH="/usr/local/mysql/bin:${PATH}"
export PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
export VERSIONER_PYTHON_PREFER_64_BIT=no
export VERSIONER_PYTHON_PREFER_32_BIT=yes
http://stackoverflow.com/questions/1448429/how-to-install-mysqldb-python-data-access-library-to-mysql-on-mac-os-x
here are numerous step-by-steps on how to build and install the MySQLdb libraries. They often have subtle differences. This seemed the most popular to me, and provided the working solution. I've reproduced it with a couple of edits below
Step 0: Before I start, I assumed that you have MySQL(32 bit version) and Python installed on the mac.
Step 1: Download the latest MySQL for Python adapter from SourceForge.
Step 2: Extract your downloaded package:
tar xzvf MySQL-python-1.2.2.tar.gz
Step 3: Inside the folder, clean the package:
sudo python setup.py clean
COUPLE OF EXTRA STEPS, (from this comment)
Step 3b: Remove everything under your MySQL-python-1.2.2/build/* directory -- don't trust the "python setup.py clean" to do it for you
Step 3c: Remove the egg under Users/$USER/.python-eggs
Step 4: Originally required editing _mysql.c, but is now NO LONGER NECESSARY. MySQLdb community seem to have fixed this bug now.
Step 5: Create a symbolic link under lib to point to a sub-directory called mysql. This is where it looks for during compilation.
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
Step 6: Edit the setup_posix.py and change the following
mysql_config.path = "mysql_config"
to
mysql_config.path = "/usr/local/mysql/bin/mysql_config"
Step 7: In the same directory, rebuild your package (ignore the warnings that comes with it)
sudo python setup.py build
Step 8: Install the package and you are done.
sudo python setup.py install
Step 9: Test if it's working. It works if you can import MySQLdb.
python
>>> import MySQLdb
One final hiccup though is that if you start Python from the build directory you will get this error:
/Library/Python/2.5/site-packages/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /Library/Python/2.5/site-packages/MySQL_python-1.2.3c1-py2.5-macosx-10.5-i386.egg/_mysql.pyc, but XXXX/MySQL-python-1.2.3c1 is being added to sys.path
This is pretty easy to Google, but to save you the trouble you will end up here (or maybe not... not a particularly future-proof URL) and figure out that you need to cd .. out of build directory and the error should disappear.
As I wrote at the top, I'd love to see this answer generalised, as there are numerous other specific experiences of this horrible problem out there. Edit away, or provide your own, better answer.
Friday, June 24, 2011
Ubuntu - set Server time to UTC
Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date
Wednesday, June 08, 2011
mod_rewrite to another server
We have hosted our company blog at blogspot.
We wanted to have blog hosted on org website. as people should not leave our website.
First solution was to host blog with some blog engine like wordpress.
Second solution I thought it might be possible to use apache mod-rewrite to internally redirect http://screen-magic.com/blog to
our screen-magic.blogspot.com
I never did it. but I started by websearching. Apache mod rewrite it bit tricky. You never know whats happening.
after several unsuccessful attempts and pemutation and combinations finally got it work.
here is the solution
Options -Indexes FollowSymLinks MultiViews
AllowOverride all
Options +FollowSymLinks
RewriteEngine on
RewriteRule blog http://screen-magic.blogspot.com/ [P]
Order allow,deny
allow from all
Here is working demo
Click to see ScreenMagic Blogs
We wanted to have blog hosted on org website. as people should not leave our website.
First solution was to host blog with some blog engine like wordpress.
Second solution I thought it might be possible to use apache mod-rewrite to internally redirect http://screen-magic.com/blog to
our screen-magic.blogspot.com
I never did it. but I started by websearching. Apache mod rewrite it bit tricky. You never know whats happening.
after several unsuccessful attempts and pemutation and combinations finally got it work.
here is the solution
Options -Indexes FollowSymLinks MultiViews
AllowOverride all
Options +FollowSymLinks
RewriteEngine on
RewriteRule blog http://screen-magic.blogspot.com/ [P]
Order allow,deny
allow from all
Here is working demo
Click to see ScreenMagic Blogs
Friday, May 06, 2011
Salesforce : Non-selective query against large object type (more than 100,000 rows) - Solved
We are customizing SMS Magic package to enable feature for customer where he wants SMS's received
in inbox to be autolooked up in Contacts and should get attached to particular contact.
This is very easy in normal case.
You add lookup field on Incoming SMS object and lookup mobilenumber in Contacts using SOQL. and
assigns lookup field with matching Contacts's Id. I wrote the code and written test cases and everything was good
contactList = [select Id, OwnerId, Name from Contact where MobilePhone = :senderMobileNumber];
till I tried sending actual SMS to his org though SMS went thru to his inbox
but Contact lookup failed.
Now I was stuck. I enabled debug logs and tried to see whats happening and got this.
System.QueryException: Non-selective query against large object type (more than 100,000 rows) . Consider an index filter.
And I was clueless. I tried to search across salesforce forum but every one was stuck on it. I even told my colleague, this seems impossible lets refund client if we have charged him.
Someone suggested on discussion forum, that you need to add index using external_field but Contact is standard object so it was not possible.
then I tried adding another filter
contactList = [select Id, OwnerId, Name from Contact where MobilePhone != null and MobilePhone = :senderMobileNumber];
but thing didnt work.
but sometime later, I thought lets give a try with SOSL.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_sosl_examples.htm
I tried following :-
List<List<SObject >>searchList = [FIND :senderMobileNumber RETURNING Contact ];
contactList = ((List<Contact>)searchList[0]);
object.Contact__c = contactList[0].Id;
it worked beautifully without any issue.
Another solution for this as per Salesforce documentation is as follows:
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm
I didnt try this solution. It should also work.
in inbox to be autolooked up in Contacts and should get attached to particular contact.
This is very easy in normal case.
You add lookup field on Incoming SMS object and lookup mobilenumber in Contacts using SOQL. and
assigns lookup field with matching Contacts's Id. I wrote the code and written test cases and everything was good
contactList = [select Id, OwnerId, Name from Contact where MobilePhone = :senderMobileNumber];
till I tried sending actual SMS to his org though SMS went thru to his inbox
but Contact lookup failed.
Now I was stuck. I enabled debug logs and tried to see whats happening and got this.
System.QueryException: Non-selective query against large object type (more than 100,000 rows) . Consider an index filter.
And I was clueless. I tried to search across salesforce forum but every one was stuck on it. I even told my colleague, this seems impossible lets refund client if we have charged him.
Someone suggested on discussion forum, that you need to add index using external_field but Contact is standard object so it was not possible.
then I tried adding another filter
contactList = [select Id, OwnerId, Name from Contact where MobilePhone != null and MobilePhone = :senderMobileNumber];
but thing didnt work.
but sometime later, I thought lets give a try with SOSL.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_sosl_examples.htm
I tried following :-
List<List<SObject >>searchList = [FIND :senderMobileNumber RETURNING Contact ];
contactList = ((List<Contact>)searchList[0]);
object.Contact__c = contactList[0].Id;
it worked beautifully without any issue.
Another solution for this as per Salesforce documentation is as follows:
http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm
I didnt try this solution. It should also work.
Thursday, March 10, 2011
Apple Gyan: How to tell if your Intel-based Mac has a 32-bit or 64-bit processor
# Choose About This Mac from the Apple () menu in the upper-left menu bar, then click More Info.
# Open the Hardware section.
# Locate the Processor Name.
4. Compare your Processor Name to information below to determine whether your Mac has a 32-bit or 64-bit processor.
Processor Name 32- or 64-bit
Intel Core Solo 32 bit
Intel Core Duo 32 bit
Intel Core 2 Duo 64 bit
Intel Quad-Core Xeon 64 bit
Dual-Core Intel Xeon 64 bit
Quad-Core Intel Xeon 64 bit
for much beautiful page :
http://support.apple.com/kb/ht3696
# Open the Hardware section.
# Locate the Processor Name.
4. Compare your Processor Name to information below to determine whether your Mac has a 32-bit or 64-bit processor.
Processor Name 32- or 64-bit
Intel Core Solo 32 bit
Intel Core Duo 32 bit
Intel Core 2 Duo 64 bit
Intel Quad-Core Xeon 64 bit
Dual-Core Intel Xeon 64 bit
Quad-Core Intel Xeon 64 bit
for much beautiful page :
http://support.apple.com/kb/ht3696
Thursday, February 24, 2011
MySQL setup
When you install mysql server, on your system, you need to some basic things so
taht you can seamlessly access it from any other machine.
1) By default, root user is created without password for Mysql server.
2) From Server , you can connect to MySQL Server using commandline mysql client.
using user root
$ mysql -u root -p
do not enter any password.
3) by default, MySQL Server is binded locally because of this you can not access it from other machines.
You need to comment out following in /etc/mysql/my.cnf
#bind-address = 127.0.0.1
4) Still with root, you can not access mysql server from remote machine, solution to this is to create a user with sufficient permissions.
mysql> CREATE USER 'magic'@'localhost' IDENTIFIED BY 'magic123'
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'magic'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER 'magic'@'%' IDENTIFIED BY 'magic123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'magic'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
I did this mysql setup for number of times but still everytime I go to following link http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
Disclaimer:
This post is for my own reference.
taht you can seamlessly access it from any other machine.
1) By default, root user is created without password for Mysql server.
2) From Server , you can connect to MySQL Server using commandline mysql client.
using user root
$ mysql -u root -p
do not enter any password.
3) by default, MySQL Server is binded locally because of this you can not access it from other machines.
You need to comment out following in /etc/mysql/my.cnf
#bind-address = 127.0.0.1
4) Still with root, you can not access mysql server from remote machine, solution to this is to create a user with sufficient permissions.
mysql> CREATE USER 'magic'@'localhost' IDENTIFIED BY 'magic123'
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'magic'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE USER 'magic'@'%' IDENTIFIED BY 'magic123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'magic'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
I did this mysql setup for number of times but still everytime I go to following link http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
Disclaimer:
This post is for my own reference.
HOWTO - Apache2 + Subversion + SSL
We wanted to install Subversion which can be accessed using HTTP protocol while searching on google, we got to nice article at
http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav
Here are details...
I needed install Apache2 + Subversion and i have searching for info, etc. and now i'm decide to create this tutorial, i hope you like!
Here we go:
INSTALL APACHE2
To install apache2 run that command:
Code:
sudo apt-get install apache2
(if you want also install php and mysql just follow this Link)
After you will install subversion:
Code:
sudo apt-get install subversion
(in that moment doens't exist the pre-buil binary of the last version (1.2.1), but when it's out you can simple upgrade )
To use svn with apache you need install libapache2-svn:
Code:
sudo apt-get install libapache2-svn
Now is better restart apache :
Code:
sudo /etc/init.d/apache2 restart
If you don't want SSL go to the last instructions (dav_svn.conf configurations, and users accounts).
Run:
Code:
a2enmod ssl
Add "Listen 443" to /etc/apache2/ports.conf:
Code:
sudo gedit /etc/apache2/ports.conf
Run:
Code:
apache2-ssl-certificate
Create a new SSL configuration file:
Code:
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/myown-ssl
Edit myown-ssl file:
Code:
sudo gedit /etc/apache2/sites-available/myown-ssl
Change:
Code:
NameVirtualHost *
to
Code:
NameVirtualHost *:443
and
Code:
to
Code:
Add before :
Code:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
Run:
Code:
a2ensite myown-ssl
Restart Apache:
Code:
sudo /etc/init.d/apache2 restart
Last instruction:
Edit dav_svn configuration file and follow the instructions:
Code:
sudo gedit /etc/apache2/mods-available/dav_svn.conf
Restart apache:
Code:
sudo /etc/init.d/apache2 restart
Create SVN folder:
Code:
sudo svnadmin create /srv/svn
sudo chown -R www-data:www-data /srv/svn
sudo chmod -R g+ws /srv/svn
Create the users account file:
Code:
sudo htpasswd2 -c /etc/apache2/dav_svn.passwd svnuser
(after asks for a password)
Test SVN:
Code:
svn import .bashrc https://localhost/svn/testfile -mlogentry
That is all!!!
For the SSL instructions i have follow this Tutorial.
About how using SVN see the official SVN book here or visit the official website (Link).
Any error, please report! (and not only in the istructions but also in the english...)
http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav
Here are details...
I needed install Apache2 + Subversion and i have searching for info, etc. and now i'm decide to create this tutorial, i hope you like!
Here we go:
INSTALL APACHE2
To install apache2 run that command:
Code:
sudo apt-get install apache2
(if you want also install php and mysql just follow this Link)
After you will install subversion:
Code:
sudo apt-get install subversion
(in that moment doens't exist the pre-buil binary of the last version (1.2.1), but when it's out you can simple upgrade )
To use svn with apache you need install libapache2-svn:
Code:
sudo apt-get install libapache2-svn
Now is better restart apache :
Code:
sudo /etc/init.d/apache2 restart
If you don't want SSL go to the last instructions (dav_svn.conf configurations, and users accounts).
Run:
Code:
a2enmod ssl
Add "Listen 443" to /etc/apache2/ports.conf:
Code:
sudo gedit /etc/apache2/ports.conf
Run:
Code:
apache2-ssl-certificate
Create a new SSL configuration file:
Code:
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/myown-ssl
Edit myown-ssl file:
Code:
sudo gedit /etc/apache2/sites-available/myown-ssl
Change:
Code:
NameVirtualHost *
to
Code:
NameVirtualHost *:443
and
Code:
to
Code:
Add before
Code:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
Run:
Code:
a2ensite myown-ssl
Restart Apache:
Code:
sudo /etc/init.d/apache2 restart
Last instruction:
Edit dav_svn configuration file and follow the instructions:
Code:
sudo gedit /etc/apache2/mods-available/dav_svn.conf
Restart apache:
Code:
sudo /etc/init.d/apache2 restart
Create SVN folder:
Code:
sudo svnadmin create /srv/svn
sudo chown -R www-data:www-data /srv/svn
sudo chmod -R g+ws /srv/svn
Create the users account file:
Code:
sudo htpasswd2 -c /etc/apache2/dav_svn.passwd svnuser
(after asks for a password)
Test SVN:
Code:
svn import .bashrc https://localhost/svn/testfile -mlogentry
That is all!!!
For the SSL instructions i have follow this Tutorial.
About how using SVN see the official SVN book here or visit the official website (Link).
Any error, please report! (and not only in the istructions but also in the english...)
Tuesday, February 08, 2011
Product FAQ
• Is my product compelling to our target customer?
• Have we made this product as easy to use as humanly possible?
• Will this product succeed against the competition? Not today’s competition, but the competition that will be in the market when we ship?
• Do I know customers that will really buy this product? Not the product I wish we were going to build, but what we’re really going to build?
• Is my product truly differentiated? Can I explain the differentiation to a company executive in two minutes? To a smart customer in one minute? To an industry analyst in 30 seconds?
• Will the product actually work?
• Is the product a whole product? How will customers actually think about and buy the product? Is it consistent with how we plan to sell it?
• Are the product’s strengths consistent with what’s important to our customers? Are we positioning these strengths as aggressively as possible?
• Is the product worth money? How much money? Why? Can customers get it cheaper elsewhere?
• Do I understand what the rest of the product team thinks is good about the product? Is it consistent with my own view?
From SVPG guide
• Have we made this product as easy to use as humanly possible?
• Will this product succeed against the competition? Not today’s competition, but the competition that will be in the market when we ship?
• Do I know customers that will really buy this product? Not the product I wish we were going to build, but what we’re really going to build?
• Is my product truly differentiated? Can I explain the differentiation to a company executive in two minutes? To a smart customer in one minute? To an industry analyst in 30 seconds?
• Will the product actually work?
• Is the product a whole product? How will customers actually think about and buy the product? Is it consistent with how we plan to sell it?
• Are the product’s strengths consistent with what’s important to our customers? Are we positioning these strengths as aggressively as possible?
• Is the product worth money? How much money? Why? Can customers get it cheaper elsewhere?
• Do I understand what the rest of the product team thinks is good about the product? Is it consistent with my own view?
From SVPG guide
Tuesday, January 25, 2011
MySQL - Restart - AutoInc resets to zero
I noticed fact recently that MySQL Table autoincrement Id value resets to zero, if table is empty.
solution to this is, you can reset the counter to
mysql> ALTER TABLE tbl AUTO_INCREMENT = 1000;
solution to this is, you can reset the counter to
mysql> ALTER TABLE tbl AUTO_INCREMENT = 1000;
Wednesday, January 19, 2011
Crontab/Cron analyzed - not working issues
It has now become routine job to write shell scripts to schedule jobs on server. (Ubuntu)
Although its routine, still sometime we got stuck with same issues. so I thought lets write a small article
to type out common errors I made.
1) Path -
By default, in cron environment, no Path is defined, so you can not even run simplest of shell file with simple
command like 'date'
you need to define
PATH=/home/sandip/bin:/bin:/sbin:/usr/bin:/usr/sbin/$PATH
your script testCronFile.sh can reside in /home/user/bin. it should have 755 perms.
chmod 755 testCronFile.sh
additionally to make sure that Script is executing.
you can do it using following 2 ways..
1) sudo tail -f /var/log/syslog
You would see something like following..
Jan 19 10:08:01 localhost CRON[11593]: (root) CMD (testCronFile.sh)
2) In testCronFile.sh, You can include line like
echo "Testing Shell file" >> /home/sandip/cron.log
so after execution of script, cron.log file would get created with "Testing Shell file" written in it.
for accessing files under root permission from cron, use sudo
$ sudo crontab -e
You can add comments, if you have something else regarding cron files.
Although its routine, still sometime we got stuck with same issues. so I thought lets write a small article
to type out common errors I made.
1) Path -
By default, in cron environment, no Path is defined, so you can not even run simplest of shell file with simple
command like 'date'
you need to define
PATH=/home/sandip/bin:/bin:/sbin:/usr/bin:/usr/sbin/$PATH
your script testCronFile.sh can reside in /home/user/bin. it should have 755 perms.
chmod 755 testCronFile.sh
additionally to make sure that Script is executing.
you can do it using following 2 ways..
1) sudo tail -f /var/log/syslog
You would see something like following..
Jan 19 10:08:01 localhost CRON[11593]: (root) CMD (testCronFile.sh)
2) In testCronFile.sh, You can include line like
echo "Testing Shell file" >> /home/sandip/cron.log
so after execution of script, cron.log file would get created with "Testing Shell file" written in it.
for accessing files under root permission from cron, use sudo
$ sudo crontab -e
You can add comments, if you have something else regarding cron files.
Tuesday, January 04, 2011
MySQL export large data from command promt to CSV file
If you can cope with table-at-a-time, and your data is not binary, use the -B option to the mysql command. With this option it'll generate TSV (tab separated) files which can import into Excel, etc, quite easily:
% echo 'SELECT * FROM table' | mysql -B -uxxx -pyyy database
Alternatively, if you've got direct access to the server's file system, use SELECT INTO OUTFILE which can generate real CSV files:
SELECT * INTO OUTFILE 'table.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table
Courtesy:
Stack Overflow
http://stackoverflow.com/questions/467452/dump-a-mysql-database-to-a-plaintext-csv-backup-from-the-command-line
% echo 'SELECT * FROM table' | mysql -B -uxxx -pyyy database
Alternatively, if you've got direct access to the server's file system, use SELECT INTO OUTFILE which can generate real CSV files:
SELECT * INTO OUTFILE 'table.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table
Courtesy:
Stack Overflow
http://stackoverflow.com/questions/467452/dump-a-mysql-database-to-a-plaintext-csv-backup-from-the-command-line
Tuesday, September 28, 2010
Story of Elephant
A king had 17 elephants. Then the king died. He had three sons. According to his will, the first son was entitled to one-half of the number of elephants, the second to one-third, and the third to one-ninth. The size of the share couldn't be changed. As 17 is an odd number, and difficult to share among the three, they were unable to find a solution to the challenge. Fortunately for them, a wise man was passing through their country. He was an old friend of their father's as well. The young men described their predicament and asked for his help. The wise man asked them not to worry and set about solving the problem immediately.
He added his elephant to the 17 elephants; they were now 18. He separated 9 elephants or one-half of 18, and gave them to the first son. The second son was given six elephants or one-third of 18. Lastly, the third son was given two elephants, two being one ninth of 18. The total number of elephants given away was 17 (9+6+2). The eighteenth elephant left was that of the wise man who took his elephant back and left, with everybody happy and satisfied. The last elephant is like maya: it came to solve a problem, and having solved it, it removes itself from the scene, leaving no trace of its previous presence.
flicked this story from :
http://timesofindia.indiatimes.com/life-style/spirituality/speaking-tree/Indefinable-nature-of-maya/articleshow/6636437.cms
I see this wise man as Entrepreneur and last elephant as his Efforts to make things better and no emotions attached.
He added his elephant to the 17 elephants; they were now 18. He separated 9 elephants or one-half of 18, and gave them to the first son. The second son was given six elephants or one-third of 18. Lastly, the third son was given two elephants, two being one ninth of 18. The total number of elephants given away was 17 (9+6+2). The eighteenth elephant left was that of the wise man who took his elephant back and left, with everybody happy and satisfied. The last elephant is like maya: it came to solve a problem, and having solved it, it removes itself from the scene, leaving no trace of its previous presence.
flicked this story from :
http://timesofindia.indiatimes.com/life-style/spirituality/speaking-tree/Indefinable-nature-of-maya/articleshow/6636437.cms
I see this wise man as Entrepreneur and last elephant as his Efforts to make things better and no emotions attached.
Monday, August 09, 2010
30 Books Everyone Should Read Before They’re Thirty
30 Books Everyone Should Read Before They’re Thirty
I read 6 out of these... 24 to go and 2 years remaining..need lot to catch.
1. Siddhartha by Hermann Hesse
2. 1984 by George Orwell
3. To Kill a Mockingbird by Harper Lee
4. A Clockwork Orange by Anthony Burgess
5. For Whom the Bell Tolls by Ernest Hemingway
6. War and Peace by Leo Tolstoy
7. The Rights of Man by Tom Paine
8. The Social Contract by Jean-Jacques Rousseau
9. One Hundred Years of Solitude by Gabriel García Márquez
10. The Origin of Species by Charles Darwin
11. The Wisdom of the Desert by Thomas MertonThe Wisdom of the Desert by Thomas Merto
12. The Tipping Point by Malcolm Gladwel
13. The Wind in the Willows by Kenneth Graham
14. The Art of War by Sun Tzu
15. The Lord of the Rings by J.R.R. Tolkien
16. David Copperfield by Charles Dickens
17. Four Quartets by T.S. Eliot
18. Catch-22 by Joseph Heller
19.The Great Gatsby by F. Scott Fitzgerald
20 The Catcher in the Rye by J.D. Salinger
21. Crime and Punishment by Fyodor Dostoyevsky
22. The Prince by Niccolo Machiavelli
23. Walden by Henry David Thoreau
24. The Republic by Plato
25. Lolita by Vladimir Nabokov
26. Getting Things Done by David Allen
27, How To Win Friends and Influence People by Dale Carnegie
28 Lord of the Flies by William Golding
29, The Grapes of Wrath by John Steinbeck
30. The Master and Margarita by Mikhail Bulgak
I read 6 out of these... 24 to go and 2 years remaining..need lot to catch.
1. Siddhartha by Hermann Hesse
2. 1984 by George Orwell
3. To Kill a Mockingbird by Harper Lee
4. A Clockwork Orange by Anthony Burgess
5. For Whom the Bell Tolls by Ernest Hemingway
6. War and Peace by Leo Tolstoy
7. The Rights of Man by Tom Paine
8. The Social Contract by Jean-Jacques Rousseau
9. One Hundred Years of Solitude by Gabriel García Márquez
10. The Origin of Species by Charles Darwin
11. The Wisdom of the Desert by Thomas MertonThe Wisdom of the Desert by Thomas Merto
12. The Tipping Point by Malcolm Gladwel
13. The Wind in the Willows by Kenneth Graham
14. The Art of War by Sun Tzu
15. The Lord of the Rings by J.R.R. Tolkien
16. David Copperfield by Charles Dickens
17. Four Quartets by T.S. Eliot
18. Catch-22 by Joseph Heller
19.The Great Gatsby by F. Scott Fitzgerald
20 The Catcher in the Rye by J.D. Salinger
21. Crime and Punishment by Fyodor Dostoyevsky
22. The Prince by Niccolo Machiavelli
23. Walden by Henry David Thoreau
24. The Republic by Plato
25. Lolita by Vladimir Nabokov
26. Getting Things Done by David Allen
27, How To Win Friends and Influence People by Dale Carnegie
28 Lord of the Flies by William Golding
29, The Grapes of Wrath by John Steinbeck
30. The Master and Margarita by Mikhail Bulgak
30 Books Everyone Should Read Before They’re Thirty
30 Books Everyone Should Read Before They’re Thirty
Subscribe to:
Posts (Atom)