Sunday, June 24, 2007

HTML Expert

Check this HTML Expert:

Friday, February 16, 2007

Using Fiddler with Firefox

The only reason I ever used IE is for Fiddler tool in last 2 years. Now looking at Fiddler docs there seems to be way to use Fiddler with Firefox.

Here the steps:

1. Look for BrowserPAC.js in fiddler directory under "My Documents". (for me its C:\My Documents\Fiddler\Scripts\BrowserPAC.js)
2. Use "Automatic proxy configuration URL:" for Firefox and set the value to BrowserPAC.js full path (Tools --> Options --> Advanced --> Network --> Connection).


Wednesday, July 12, 2006

Why your Mom should Firefox2 Today

A Picture is worth 1000 words. Here is an examples on why you need and your Mom need to get Firefox2 today:


1) Anti-phishing: Checkout the email I received supposedly from Paypal.


On opening it in Firefox2 you get the warning right away:


2) Spell check integration: Firefox2 has an awesome spell check integration for all the forms filled:




So get yourself and your Mom Firefox2 today.

Friday, February 11, 2005

Got TiVo

Got TiVo yesterday. Java API being made available made me buy TiVo. I am already impressed by what I can do with my TiVo.
One problem is that the software on latest TiVo is still 5.3.x and 7.1 is required to use java api. So signed up to priority list and waiting for the upgrade to occur. (Was told this might take several weeks).

Sunday, December 19, 2004

JSSE: How to ignore CertificateException: Couldn't find trusted certificate"?

While testing SecureSocket code, sometimes you would need code to ingore certificate validation.
JSSE provides a simple way to do this by writing your own TrustManager. The below sample code lets you write simple clients ignore certificate validation:

01 
02 
03 import java.io.InputStream;
04 import java.io.OutputStream;
05 
06 import javax.net.ssl.SSLContext;
07 import javax.net.ssl.SSLSocket;
08 import javax.net.ssl.SSLSocketFactory;
09 import javax.net.ssl.TrustManager;
10 import javax.net.ssl.X509TrustManager;
11 
12 /*
13  * This example demostrates how to use a SSLSocket as client to
14  * send and recieve Data while ignoring the certificate validation.
15  */
16 
17 public class SSLClient {
18 
19     public static void main(String[] args) throws Exception {
20 
21         // Create a trust manager that does not validate certificate chains like the default TrustManager
22         TrustManager[] trustAllCerts = new TrustManager[]{
23             new X509TrustManager() {
24 
25                 public java.security.cert.X509Certificate[] getAcceptedIssuers() {
26                     return null;
27                 }
28 
29                 public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
30                     //No need to implement.
31                 }
32 
33                 public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
34                     //No need to implement.
35                 }
36             }
37         };
38 
39         // Let us create the factory where we can set some parameters for the connection
40         SSLContext sc = SSLContext.getInstance("SSL");
41         sc.init(null, trustAllCerts, new java.security.SecureRandom());
42 
43         SSLSocketFactory factory =sc.getSocketFactory();
44         SSLSocket socket =(SSLSocket)factory.createSocket(args[0], Integer.parseInt(args[1]));
45         socket.startHandshake();
46 
47 
48         OutputStream out = socket.getOutputStream();
49         InputStream in = socket.getInputStream();
50 
51         //Do- Fun stuff with I/O classes.
52     }
53 }

Mustang: 2 new methods in String class.

Two new helper methods are added to String class. The changes are described in bug#6189137.

1. boolean isEmpty() { return length() == 0; }
2. boolean contains(String s) { return indexOf(s) >= 0; }