Thursday, June 18, 2009

CentOS x64 bit: Installing Flash plugin for FF

Download flash plugin from http://labs.adobe.com/downloads/flashplayer10.html

then in terminal:


$ tar -xf libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz
$ sudo cp libflashplayer.so /usr/lib64/mozilla/plugins/

Restart firefox-64 bit.

fxd2tbina4

Wednesday, June 17, 2009

IE vs Firefox in Progressive Rendering

Progressive rendering is the act of displaying each object as it is downloaded. Both IE and FF supports progressive rendering; but, they differ on how they render tables.

Internet Explorer 7

When Internet Explorer renders a , it downloads all the objects within the table before displaying it. This is required so that Internet Explorer can render the table with the correct width for each column.

Mozilla Firefox

On the other hand, Firefox renders all objects progressively regardless if it's in a table. That is to say - each object is displayed as soon as it is downloaded.

What You Can Do To Improve Performance

Performance Tips
  1. Ensure HTML code is valid.
  2. Minimize number of nested tables.
  3. Never wrap entire body contents within a table.
  4. Move towards a CSS-based layout.
  5. Move JavaScript to the very bottom of document (right before the tag). If not possible, move JavaScript to the of document.
  6. Pay close attention to the size of objects and their locations?
The Key Is To Understand

By knowing each browser's strengths and weaknesses, you can build a better design. A good design will never make the reader wait.


Eclipse look and feel for swing applications

This is what you were looking for. There is an open source API called SWT(Standard Widget Toolkit) by eclipse. A GUI framework for Swing user interfaces. You can see the list of swt widgets here http://www.eclipse.org/swt/widgets/. Using this framework we can build application like eclipse look and feel.

Saturday, June 13, 2009

Classpath Helper

How to find unused Jar libs in a huge application?

I think this tool(classpath helper) answers, http://classpathhelper.sourceforge.net/

Friday, June 12, 2009

What is Google Wave?

Google Wave is a new communication service previewed today at Google I/O. "A wave is equal parts conversation and document, where people can communicate and work together with richly formatted text, photos, videos, maps, and more."

The service seems to combine Gmail and Google Docs into an interesting free-form workspace that could be used to write documents collaboratively, plan events, play games or discuss a recent news.

Thursday, June 11, 2009

Running tomcat on port 80 as non-root

  • Use IPtables. This requires a kernel version of 2.4.x or higher. If you’re running an older version of the kernel take a look at IPChains and consider a command something like: ipchains -I input --proto TCP --dport 80 -j REDIRECT 8080

    The IPtables solution allows Tomcat to run as an independent server as a non-privileged user and listen on port 80. IPtables will redirect all requests coming in on port 80 to port 8080 or whatever port you have Tomcat running under.The first step for this solution is to make sure your firewall allows TCP requests on port 8080 (or whatever port your Tomcat configuration has specfied). Essentially you need to duplicate all the firewall rules you have configured for port 80 since you will be redirecting those requests to 8080. The second step is to use the iptables command (usually installed by default on linux distributions) to redirect all packets on port 80, to port 8080. Here is a an example of the command you would use to do this:

    iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j REDIRECT --to-port 8080

    To redirect local requests use the following command:iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-port 8080
    This is handy if you’re running Tomcat on your workstation and debugging an application that’s required to run on port 80.
  • Use rinetd. rinetd is a dedicated port redirector program that receives a packet and redirects it to a different port or address. Since rinetd redirects packets after they’ve gone through IPtables, this solution can be used for local and non-local requests.There are two things you should consider when using rinetd. First, rinetd cannot be used to redirect FTP requests because FTP requires more than one socket. Secondly, rinetd makes all packets appear as though they originated from the local machine. This obviously will impact things like web server logs and setting permissions based on IP address.Although rinetd has these side effects, using a combination of iptables and rinetd may be another option but seems like a more complicated solution from a debugging and maintenance perspective.

Saturday, June 6, 2009

Installing self-signed ssl certificate

1. Generate an RSA key for signing the certificate:
openssl genrsa -out mykey.pem 2048

2. Generate a certificate using the new key:
openssl req -new -x509 -key mykey.pem -out mycert.pem -days 365

Enter your name, organization name and address as prompted.
In this example, we've created a key file, mykey.pem, and a self-signed certificate. Normally, you want a certificate from a "certificate authority" or CA. 
3. Since the certificate is in PEM format, convert it to PKCS12 for Tomcat:
openssl pkcs12 -export -in mycert.pem -inkey mykey.pem -out mycert.p12 -name tomcat

You MUST specify an export password! Tomcat expects one.

4. Keep the “mycert.p12” file you will need it to configure in tomcat server.xml.

5. Edit $CATALINA_HOME/conf/server.xml and uncomment the SSL connector tag.
Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="false" proxyPort="443"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12"
keystoreFile="/opt/openssl-0.9.8g/mycert.p12"
keystorePass="*****" />"

Google's Page Speed

Google has released a Firefox add-on called Page Speed. It integrates with another add-on, Firebug, and is aimed at web developers trying to make their pages faster. “Page Speed is a tool we’ve been using internally to improve the performance of our web pages,” 

Also see YSlow, another Firebug add-on (this time by Yahoo) that “analyzes web pages and suggests ways to improve their performance”.

Monday, June 1, 2009

Best Ajax Framework

There are lot of ajax frameworks out there, my pick is

  • Dojo  Provides more features and widgets but customization is harder
  • YUI -  has well documented code and detailed tutorial.
  • GWT - Google's framework :-)
  • SweekDev Ria - Has more features and performance overheads