Thursday, December 02, 2010

Tip::Pidgin and MSN connection issues

Typically you have errors such as :
The certificate for omega.contacts.msn.com could not be validated. The certificate chain is invalid.

Solution:

Assuming you are on Linux.

1) Delete the MSN related certificates.
==============
anil@localhost:~$ cd .purple/certificates/x509/tls_peers
anil@localhost:~/.purple/certificates/x509/tls_peers$ ls
api.oscar.aol.com contacts.msn.com login.live.com ows.messenger.msn.com
api.screenname.aol.com gmail.com login.yahoo.com rsi.hotmail.com
bos.oscar.aol.com omega.contacts.msn.com
anil@localhost:~/.purple/certificates/x509/tls_peers$ rm *live*
anil@localhost:~/.purple/certificates/x509/tls_peers$ rm *msn*
anil@localhost:~/.purple/certificates/x509/tls_peers$ rm rsi.hotmail.com
anil@localhost:~/.purple/certificates/x509/tls_peers$ rm login.live.com
================

2) In that particular directory, do a "wget"
$> wget http://bit.ly/dbLSzq -O omega.contacts.msn.com

3) In Pidgin, Accounts -> xxx.msn.com -> Disable Account
or Accounts -> xxx.hotmail.com ->Disable Account

4) Now enable the account in "Accounts"

Monday, October 25, 2010

Each page of PDF into separate PDF File (Splitting PDF)

This article is about splitting pdf files for FREE.




On Linux, you can do it very easily.




1) Install pdftk




$> sudo yum install pdftk




2) Make a copy of your original pdf file.




3) Run the following command

$> pdftk MY_ORIG_PDF_NAME burst




NOTE: the second parameter in the command is your pdf file name.




If you want to do the same on a Mac or Windows, just look here. http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/




Split PDF on Windows.

Split PDF on Mac.

Split PDF on Fedora/Ubuntu/Debian Linux.




References:



http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/



PDFTK Tutorial: http://www.linux.com/archive/feed/53701








Monday, July 12, 2010

Android Dev Tips

Tip 1: Import a sqlite DB from somewhere else (let us say db.sqlite)
tools$ ./adb push ~/android/db.sqlite /data/data/test.app/databases
1934 KB/s (443392 bytes in 0.223s)

Tip2:
While Activity.setContentView takes an id of a Layout, TabSpec.setContent takes an id of a View.

Tip 3: Android: Get the Application Version in an activity
PackageInfo info = getPackageManager().getPackageInfo( getPackageName(), 0 );
String version = info.versionName;

Tip 4: Android onNewIntent() is never called.

In the android manifest file for the activity, add the following attribute
android:launchMode="singleInstance"

Tuesday, July 06, 2010

FreeNode IRC CheatSheet

Q. How do I start a new channel on FreeNode?

Just join a channel. If it does not exist, it will be created for you.


Q. How do I register ChanServ to my channel on FreeNode?

/msg chanserv register #

Replace channel with your name of the channel.


Q. Set ChanServ bot on guard?

/msg chanserv set # guard on

KNetworkManager and VPN

Since Fedora 13, I have been unable to use the nm-applet on KDE. It seems like KNetworkManager is the default in KDE on Fedora 13.

Try to get the knetworkmanager-openvpn and knetworkmanager-vpnc packages installed on your fedora instance.

$> sudo yum install knetworkmanager-openvpn
$> sudo yum install knetworkmanager-vpnc

The nm-applet settings for vpn are all lost. So you will need to login to gnome to get those settings and input them into knetworkmanager.

But there are some pending bugs because the knetworkmanager vpn is not really working for me (and also a co-worker). Keeping fingers crossed to see if a future update will fix it.

Tuesday, June 29, 2010

Mobile Development Tips: Blackberry Application Development

Problem: ButtonField changelistener displays the standard menu (Show Keyboard, Switch Application, Close)

Solution: In the construction of the button field, use the CONSUME_CLICK style.
Eg: ButtonField mybutton = new ButtonField( "My", ButtonField.CONSUME_CLICK );

Monday, June 28, 2010

iphone4 antenna issues

Now that Apple has released iphone4, there are growing complaints from users about the Antenna.

Based on this story, Apple acknowledges the antenna issues.

Apple has responded with a statement:

"Gripping any mobile phone will result in some attenuation of its antenna performance, with certain places being worse than others depending on the placement of the antennas. This is a fact of life for every wireless phone. If you ever experience this on your iPhone 4, avoid gripping it in the lower left corner in a way that covers both sides of the black strip in the metal band, or simply use one of many available cases."

To mitigate this problem, it is best to get one of the cases for the phone. Not only with a case do you guard the phones from drops, but also the reception issue is solved.

Thursday, June 03, 2010

The BASEDIR environment variable is not defined correctly

Solution: in the bin directory, chmod +x *

Maven SureFire Plugin With Multiple Executions

Sometime it is desired to run a set of tests multiple times in the same module. When this need arises, it is best to make use of executions in the sure fire plugin.

Reference: Targeting maven-surefire-plugin to lifecycle phases (turn off "test" phase execution)

Wednesday, May 19, 2010

Echo Framework - Java RIA Framework

Contributed by Echo Framework expert Rakesh Vidhyadharan:



The Echo web application development framework is often referred to as
"the best kept secret" among the developers who are familiar with it.
Echo attempts to present a AWT/Swing type programming interface to
develop web applications. Echo and Zk seem to have been the earliest
proponents of this philosophy, which has since been adopted by GWT, Wicket
etc.

The current version of Echo is Echo3, which represents a more modern and
radical change from Echo2. Echo2 had been primarily a server rendering
system, that generated the entire HTML rsponse on the server. Echo3 on
the other hand delegates the rendering to a new Client Engine JS service
that is loaded by the browser when an application is first loaded. The
server still maintains the current state (the components currently displayed
on screen, and their respective state). During a client-server
interaction the server sends XML messages that indicate any rerendering
as well as the data necessary to display in the client components.

Echo API is now split into a pure client-side API that usually has a 1-1
mapping to their server side component API. With Echo3 it is now possible
to write a pure JS only rich web application, that uses traditional AJAX
XmlHttpRequest wrappers to interact with any web service. In fact the
server side components are rendered using these same client components
when the application is built using Java.

The Echo3 demo application (http://demo.nextapp.com/echo3csjs), as well as
the EchoPoint client test application (http://sptci.com/echopointclienttest/)
are examples of applications created purely using the Echo3 client-side API.

Unlike GWT, any language that runs within the JVM may be used to build
server-side Echo applications. Groovy and Scala in particular have been
used by regular Echo3 users to build rich internet applications. Similarly,
it is possible to use reflection and other dynamic features to reduce the
amount of boiler plate code that needs to be written to create a server-side
application.

References:
1. Presentation (http://sptci.com/products/articles/Echo2Presentation.pdf)
2. Developer Guide (https://echopoint.dev.java.net/files/documents/9134/103120/DeveloperGuide.pdf) - I wrote this for contributors to EchoPoint.

Friday, May 07, 2010

Zimbra: Import .ics into your calendar

By email, you may have received calendar invites and your mail just shows them as .ics attachments. The Zimbra calendar usually does not recognize these formats.

In this case:
1) Save the .ics attachment locally.
2) From within the Zimbra Web Client, select PREFERENCES, and then the CALENDAR tab.
3) Click the IMPORT heading, browse your file system to locate your .ics file and then click the IMPORT button.
4) In the resulting popup window, either select an existing calendar or create a new one to import the ICS events into.

Thursday, April 29, 2010

Skype SPAM Messages

If you have spam messages in Skype, you need to fix your settings:

1) Open Skype and click Tools - Options on the menu
2) Click privacy
3) Click Show advanced options
4) Allow Calls from 'only people in my contact list', Automatically receive video from 'no-one', show that I have video to 'no-one', Allow chats from 'only people in my contact list', Uncheck 'allow my status to be shown on the web'....

Sunday, April 25, 2010

Eclipse 3.5 (Ganymede) update issues

Solution 1: As described in the eclipse wiki link, please remove the mylyn update.


Solution 2
: This may work

Problem: Eclipse 3.5 software update does not work. You see errors such as "No repository information found".

Steps:

1) Help -> Install New Software -> Available Software Sites

2) Select all and then export it as bookmarks.xml

3) Now remove all the urls from the dialog box.

4) In a text editor of your choice, go into bookmarks.xml and add a "/" at the end of all the urls.

5) Now in the eclipse dialog, import this "bookmarks.xml".

6) Enable all the urls. (You need to click on the Enable button while having all the sites selected).

That's it. Now you will be able to get away from the errors.

Caveat: Every time you add in a new software site to update/install, remember to add in a "/" at the end of the url.

Monday, April 05, 2010

JMeter and Form Based Authentication

If you are struggling to load test a web application with FORM based authentication, then read along:


Step 1
: Save the following xml stream into a file called as formAuth.jmx

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">5</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
<longProp name="ThreadGroup.start_time">1270069345000</longProp>
<longProp name="ThreadGroup.end_time">1270069345000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">8080</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
</ConfigTestElement>
<hashTree/>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
<collectionProp name="CookieManager.cookies"/>
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
<stringProp name="CookieManager.policy">rfc2109</stringProp>
</CookieManager>
<hashTree/>
<HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="HelloJBoss" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">HelloJBoss/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSampler>
<hashTree/>
<HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Login" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="j_username" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">user${JBOSS_USER}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">j_username</stringProp>
</elementProp>
<elementProp name="j_password" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">password</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">j_password</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">HelloJBoss/j_security_check</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSampler>
<hashTree/>
<LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">true</boolProp>
<stringProp name="LoopController.loops">1000</stringProp>
</LoopController>
<hashTree>
<HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="HelloServlet" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">HelloJBoss/HelloServlet</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSampler>
<hashTree/>
</hashTree>
<HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="Logout" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">HelloJBoss/LogoutServlet</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
<boolProp name="HTTPSampler.auto_redirects">true</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
</HTTPSampler>
<hashTree/>
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename">/home/anil/jmeter/TestResults.jtl</stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="View Results in Table" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>true</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<fileName>true</fileName>
</value>
</objProp>
<stringProp name="filename">/home/anil/jmeter/ResultTable.jtl</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
<CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="Counter" enabled="true">
<stringProp name="CounterConfig.start">1</stringProp>
<stringProp name="CounterConfig.end">100</stringProp>
<stringProp name="CounterConfig.incr">1</stringProp>
<stringProp name="CounterConfig.name">JBOSS_USER</stringProp>
<stringProp name="CounterConfig.format"></stringProp>
<boolProp name="CounterConfig.per_user">false</boolProp>
</CounterConfig>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>



Step 2: Now go into JMeter GUI and import this test plan "formAuth.jmx"

Description:
* In this example, the web app is HelloJBoss.
* First we access the web application to establish the cookies etc.
* The initial servlet we are using is HelloJBossServlet after form auth.
* Once we are done with form auth, we do the log out.

Acknowledgements: Marcus Moyses gave me this file.



FORM BASED LOGIN USING APACHE HTTPCLIENT

If you are in need, look at the ClientLogin.

Sunday, April 04, 2010

Filing US Tax Returns for Free

Millions of American Residents, come March/April, look for ways to file their US Tax returns. The deadline as always in April 15th of each year for the previous calendar year.

This is how I do it:
* Federal Returns: I download the free desktop edition of Tax Act. Go to www.taxact.com to get it. This desktop version then allows you to e-file federal return for free.
* State Returns: My state, Illinois allows me free e-File. So I just do it from the IL Department of Revenue website. I am positive that many states of the US allow you to file tax returns.

Happy Stress Free Tax Return Filing.

Friday, March 19, 2010

ld-linux.so.2 eating memory

Scenario: Linux Desktop is very slow or lethargic.

Step 1: run top

localhost:~$ top
top - 13:41:13 up 4:24, 3 users, load average: 1.06, 1.61, 1.42
Tasks: 194 total, 4 running, 190 sleeping, 0 stopped, 0 zombie
Cpu(s): 30.6%us, 38.0%sy, 0.0%ni, 31.2%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3985164k total, 3945144k used, 40020k free, 3168k buffers
Swap: 8193140k total, 725012k used, 7468128k free, 220940k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1820 root 20 0 191m 28m 5760 R 77.7 0.7 93:39.78 Xorg
9030 anil 20 0 2722m 2.2g 1044 R 35.5 57.3 57:44.48 ld-linux.so.2
10521 anil 20 0 1045m 866m 1108 S 19.9 22.3 12:09.73 ld-linux.so.2


Step 2: In my case, I see that ld-linux.so.2 is eating a lot of memory.

Step 3:
$> ps -f -C ld-linux.so.2

UID PID PPID C STIME TTY TIME CMD
anil 9030 1 41 11:24 ? 00:58:48 /lib/ld-linux.so.2 /opt/Adobe/Reader8/Reader/intellinux/bin/acroread --display :0.0 -progressPipe 3 -exitPipe 4
anil 10521 10501 27 12:58 ? 00:12:51 /lib/ld-linux.so.2 /opt/Adobe/Reader8/Reader/intellinux/bin/acroread --display :0.0 -progressPipe 3 -exitPipe 4

Step 4: So Adobe Acrobat Reader is the problem.
Adobe Blog: http://blogs.adobe.com/acroread/2007/09/known_issues_with_adobe_reader_1.html

Step 5: Kill the PIDs for the ld-linux.so usage

Wednesday, March 17, 2010

To buy a new Apple Mac Book Pro

Q. Should I buy it at the Apple Store or Amazon?

It is better to buy it via Amazon for the following reasons:
* Amazon typically gives $50-150 discount on the MBP at checkout.
* Amazon does not charge taxes which depending on your US state of residence can mean $100-300.

What are the shipping costs from Amazon for Apple Macbook Pro?
* 1 day expedited is around $35
* 2 day expedited is around $20
* A week is free.

What are the downsides of buying it at Amazon?
You cannot get the laptop right when you buy it. You have to wait at least a day, as it has to be shipped to you.

Monday, March 15, 2010

skype crashes on fedora 12

1) Check which skype package is installed.

$> sudo rpm -qa | grep skype
skype-2.0.0.72-fc5.i586

2) Go to skype website and download the rpm for the latest skype
skype-2.1.0.81-fc10.i586.rpm

3) Uninstall the old version
$> sudo rpm -e skype-2.0.0.72-fc5.i586


4) Install the new version
$> sudo rpm -i skype-2.1.0.81-fc10.i586.rpm

After this, skype should be stable.

Sunday, March 14, 2010

Google App Engine Not Enabled In Eclipse

If you installed the Google Plugin for eclipse and you do not get the icons for GAE etc, then it is better to start with a clean resinstall of eclipse.

Step 1: Go to your home directory.

cd ~/.eclipse

Step 2: Delete all the folders here.

Step 3: Now you do not have any plugins etc. Start fresh by updating Galileo (http://download.eclipse.org/releases/galileo) and then GAE.

Wednesday, March 10, 2010

OpenJDK on Fedora

Now, you are not sure if OpenJDK is installed on fedora or not. So you can try to install it. If it is already installed, nothing.

Step 1: We will try to install OpenJDK6 on fedora

If you are root, then do this:
$> yum install java-1.6.0-openjdk

else, if you have sudo rights, then

home $> sudo yum install java-1.6.0-openjdk


Step 2: Where is OpenJDK installed on fedora?


If you do not know the rpm name, try to do step 1 above to install. That will give you the rpm name.

$> sudo rpm -ql java-1.6.0-openjdk-1.6.0.0-34.b17.fc12.x86_64

/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java
....

Friday, March 05, 2010

Android Development 101

Assume you have Eclipse 3.5 installed.

Step 1: Download the Android SDK. It is usually tgz for linux.
Step 2: Install the Android plugin for eclipse.
http://developer.android.com/sdk/eclipse-adt.html

Step 3: Open Eclipse and Create a AVD (Android Virtual Device)
=========================================
To create an AVD with the AVD Manager:

1. Select Window > Android SDK and AVD Manager, or click the Android SDK and AVD Manager icon (a black device) in the Eclipse toolbar.
2. In the Virtual Devices panel, you'll see a list of existing AVDs. Click New to create a new AVD.
3. Fill in the details for the AVD.
Give it a name, a platform target, an SD card image (optional), and a skin (HVGA is default).
4. Click Create AVD.
================================

Step 4: Now create a new Android project. File -> New -> Android - >Android Project. Choose a target.


Testing on your phone :-
Best is to have the Android Development Phone 2 (ADP2).

Then to debug your application from Eclipse onto the phone.
1) Set up your ADP2 or your device to USB connect with your computer.
2) Make your application "debuggable". You need to do this in the android manifest.
3) Eclipe Run -> Run As -> Android Application


Note: To set up ADP2 on Fedora/Ubuntu, do the following:

$> sudo vi /etc/udev/rules.d/51-android.rules.
UBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

$> $ sudo chmod a+r /etc/udev/rules.d/51-android.rules.

Wednesday, February 03, 2010

Package skype-2.1.0.81-fc.i586.rpm is not signed

Workaround:
/etc/yum.repos.d$ sudo mv skype.repo skype.repo.bak

Update:
$> sudo yum update

Putback:
/etc/yum.repos.d$ sudo mv skype.repo.bak skype.repo

/var is full and needs cleanup

Step 1: Determine which folder in /var is full (Clean /var)

$> sudo du -csh /var/*

Now you need to dive deeper to figure out the culprits.

Typically the /var/log may be full or contains a lot of log messages. Get rid of the large log files.

Step 2:If your /var/cache/yum is large/full and needs cleanup (Clean /var/cache/yum).

$> sudo yum clean packages

If this does not bring the size of the folder down.
$> sudo yum clean all

Step 3: If you have upgraded Fedora via preupgrade, then your /var/cache/yum/preupgrade folder is large. (Clean /var/cache/yum/preupgrade)

$>sudo rm -fr /var/cache/yum/preupgrade*

Thursday, January 28, 2010

Error: elementGetText() function expects text only elment but START_ELEMENT was encountered

If you see the following exception,
====================================================================
javax.xml.stream.XMLStreamException: ParseError at [row,col]:
Message: elementGetText() function expects text only elment but START_ELEMENT was encountered.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getElementText(Unknown Source)
at com.sun.xml.internal.stream.XMLEventReaderImpl.getElementText(Unknown Source)
at javax.xml.stream.util.EventReaderDelegate.getElementText(Unknown Source)
=====================================================================

it means that your STAX based parser is not handling the embedded xml properly. Your parser is expecting a regular text element and doing XMLEventReader.getElementText() call.

Solutions:
1) Bad: You can convert all "<" of your embedded xml to & l t ; (characters brought together).
2) Good: Let the parser peek at the next event and see if it is embedded xml and handle properly.

Scott McNealy's Last Memo to Sun Employees

As usual, the greatness reeks in every word written by Scott. Kudos to him.

Text picked up from: CNET

================================
Subject: Thanks for a great 28 years
Date: Tue, 26 Jan 2010
From: Scott McNealy
To: [all Sun employees]

Gang,

When I interviewed many of you for employment at Sun over the years, one commitment often made was that things will change above, below, and around you faster than any place you have ever been. Looks like this was one area we exceeded plan for 28 years. While it was never the primary vision to be acquired by Oracle, it was always an interesting option. And this huge event is upon us now. Let's all embrace it with all of the enthusiasm and class and talent that we have to offer.

This combination has the potential to put Sun, its people, and its technology at the center of yet another industry and game-changing inflection point. The opportunity is well-documented and articulated by Larry and the Oracle folks. Not much I can add on this score. This is a very powerful merger. And way better than some of the alternatives we were facing.

So what do I say to all of you, now this is happening?

It turns out that one simple message to the large and diverse Sun community is actually quite hard to craft. Even for a big mouth who is always ready with a clever quip. The community includes our resellers and customers, our current and former employees, their friends and families who supported our employees on their mission to change the industry, our investors, our supply and service partners, students and educators, and even our competitors with whom we often collaborated.

But let me try. Though nothing I could write comes close to matching the unbelievably strong and positive emotions I have for you all. See, I never was able to master dispassion. I truly loved starting, running, and living Sun. And the last four years have not been without serious withdrawal. And the EU approval rocked me more than it should have.

So, to be honest, this is not a note this founder wants to write. Sun, in my mind, should have been the great and surviving consolidator. But I love the market economy and capitalism more than I love my company.

And I sure "hope" America regains its love affair with capitalism. And except for the auto industry, financial industry, health care, and some other places (I digress), the invisible hand is doing its thing quite efficiently. So I am more than willing to accept this outcome.

And my hat is off to one of the greatest capitalists I have ever met, Larry Ellison. He will do well with the assets that Sun brings to Oracle.

What we did right and wrong at Sun over the years might make for interesting reading. However, I am not a book writer. I am a husband, father of four, and a builder and leader of people who want to make a difference.

But spare me a bit of nostalgia. Not of the mistakes we made, and lord knows I made a ton. But of the things we did right and well.

First and foremost, Sun innovated like crazy. We took it to the limit (see Eagles). And though we did not monetize our inventions as well as we could have, few companies have the track record in R&D that we had over the last 28 years. This made working at Sun really cool. Thanks to all of you inventors and risk takers who changed how we live.

Sun cared about its customers. Even more than we cared about our own company at times. We looked at our customer's mission as more important than ours. Maybe we should have asked for more revenue in return, but our employees were always ready to help first. I love this about Sun, which I guess makes me a good capitalist, if not a great capitalist.

Sun did not cheat, lie, or break the rule of law or decency. While we enjoyed breaking the rules of conventional wisdom and archaic business practice, and for sure loved to win in the market, we did so with a solid reputation for integrity. Nearly three decades of competing without a notable incident of our folks going off course morally or legally. Not all executives and big companies are bad. Really. There are good companies out there. Special thanks to all of my employees for this. I never had to hide the newspaper in shame from my children.

Sun was a financial success. We paid billions in taxes, salaries, purchases, leases, training, and even lawyers and accountants for devastatingly cumbersome SOX and legal compliance (oops, more classic digression). Long-term and smart investors made billions in SUNW. And our customers generated revenue and savings using our equipment in countless ways. Many employees started families, bought homes, and put them through school while working at Sun. Our revenues over 28 years exceeded $200B. Few companies make it to the F200. We did. Nice.

Sun employees had way more fun than any other company. By far. From our dress code ("You must!") to beer busts to our April Fools' pranks to SunRise to our quiet enjoyment at night of a long, hard, well-done day of work, no company enjoyed "work" more than Sun. Thanks to all of our employees past and present for making Sun such a blast.

I could go on for a long time reminiscing about the good and great stuff we did at Sun, but just allow me one last one. We shared. Not the greatest attribute for a capitalist. But one I could not change and was not willing to change about Sun while I was in charge. We shared in the success of Sun with our resellers. With our employees through stock options, SunShare, beer busts, and the like (for as long as Congress would allow) and through our efforts to keep as many of them on board for as long as possible during the inevitable down cycles. With our partners through the Java Community Process, through our open-source collaborations, and licensing strategies. With our customers through our commitments to low barriers to exit. Sun was never just about us. It was about we. And that may be a bit of the reason we are where we are today.

But I have few regrets (see Sinatra's "My Way") and will always look back at Sun and its gang with only pride. Enormous pride. You are the best this industry ever had, though few outside of Sun recognized it.

And what we are about will live on in Sparc, Solaris, Java, our products, and our spirit. Well past everyone's recollections of what we did together. I will never forget, though.

Oracle is getting a crown jewel of the technology industry. They will do great things with Sun. Do your best to support them, and keep the Sun spirit alive and well in the industry. Our children will be better for it.

Thanks for the off-the-charts support to everyone who ever carried a Sun badge, used our products, or helped our company through the years.

And thanks to my wonderful wife, Susan, who gave this desperado (see Eagles) a chance to choose the Queen of Hearts before it was too late.

Someday, hopefully, you will all get to see or meet her and my other life's works named Maverick, Dakota, Colt, and Scout. If you do, perhaps you will understand why I stepped back from the CEO role four years ago. And why I feel like the luckiest guy in the whole world.

My best to all of you, and remember:

Kick butt and have fun!

Scott
===================================================================


The legacy of this great memo will live on!!!

Monday, January 25, 2010

"The type java.lang.Object cannot be resolved." with Eclipse

There can be many cases for this:

1) You have lost .classpath and other eclipse files. If you use maven, then do "mvn eclipse:eclipse:.

2) Your .classpath may contain (org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java5) Just remove that to yield

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

Wednesday, January 20, 2010

Eclipse Issues on Fedora 12

Now if you are facing issues with eclipse on Fedora 12, you need to do the following depending on how you start eclipse.

You will need to export GDK_NATIVE_WINDOWS=true before you start eclipse.

Relevant eclipse bug: https://bugs.eclipse.org/bugs/show%5Fbug.cgi?id=291257



If you use command line to start eclipse
:

Create a script that looks as follows:

#!/bin/sh
export MOZILLA_FIVE_HOME=/usr/lib/mozilla/
export ECLIPSE_HOME=/opt/IBM/eclipse
export GDK_NATIVE_WINDOWS=true
$ECLIPSE_HOME/eclipse $*


If you use a Desktop shortcut under KDE (Dolphin)
:

Then in the Properties dialog, under the application tab do the following:

export GDK_NATIVE_WINDOWS=1; /opt/eclipse/eclipse -showlocation -data /home/xxx/workspace

Please do not forget to the rename the workspace directory propertly. Also verify whether your eclipse installation directory is /opt/eclipse or change it accordingly.

Tuesday, January 12, 2010

Fedora: smartmontools = 1:5.38-2.fc9 is needed by (installed) smartmontools-config-1:5.38-2.fc9.x86_64

When you see this error, it means that you have some bad dependencies.

==============
Downloading Packages:
Running rpm_check_debug
ERROR with rpm_check_debug vs depsolve:
smartmontools = 1:5.38-2.fc9 is needed by (installed) smartmontools-config-1:5.38-2.fc9.x86_64
Complete!
===============

Remedy:
You need to clean up bad deps using package-cleanup:

anil@localhost:~$ sudo package-cleanup --problems
Setting up yum
Loaded plugins: dellsysidplugin2, refresh-packagekit
Reading local RPM database
Processing all local requires
Missing dependencies:
Package smartmontools-config-5.38-2.fc9.x86_64 requires smartmontools = 1:5.38-2.fc9
Package libflashsupport-000-0.5.svn20070904.i386 requires libcrypto.so.7
Package libflashsupport-000-0.5.svn20070904.i386 requires libssl.so.7

anil@localhost:~$ sudo rpm -e smartmontools-config-5.38-2.fc9.x86_64
anil@localhost:~$ sudo package-cleanup --problems
Setting up yum
Loaded plugins: dellsysidplugin2, refresh-packagekit
Reading local RPM database
Processing all local requires
Missing dependencies:
Package libflashsupport-000-0.5.svn20070904.i386 requires libcrypto.so.7
Package libflashsupport-000-0.5.svn20070904.i386 requires libssl.so.7

anil@localhost:~$ sudo rpm -e libflashsupport-000-0.5.svn20070904.i386


anil@localhost:~$ sudo package-cleanup --problems
Setting up yum
Loaded plugins: dellsysidplugin2, refresh-packagekit
Reading local RPM database
Processing all local requires
No problems found
=====================================