Thursday, June 18, 2009
CentOS x64 bit: Installing Flash plugin for FF
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
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.
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.
Performance Tips
- Ensure HTML code is valid.
- Minimize number of nested tables.
- Never wrap entire body contents within a table.
- Move towards a CSS-based layout.
- Move JavaScript to the very bottom of document (right before the tag). If not possible, move JavaScript to the of document.
- Pay close attention to the size of objects and their locations?
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
Saturday, June 13, 2009
Classpath Helper
Friday, June 12, 2009
What is Google Wave?
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 the Apache httpd server to “pass” requests to Tomcat.
- 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:
To redirect local requests use the following command:
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j REDIRECT --to-port 8080iptables -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
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
Monday, June 1, 2009
Best Ajax Framework
- 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