Abhishek Gupta

The Sun won’t set at NIT Durgapur !

Archive for May, 2009

At Sun IEC , Bangalore

Posted by abhiitechie on May 20, 2009

Sun’s India Engineering Center (IEC) occupies most of the Divya Shree Chambers building off Langford Road in Bangalore. I kept on telling everybody that is near M.G Road but in reality it is nothing like that




Lunch (always a major preoccupation with me) is provided at the 5th-floor canteen, which gets very crowded around 12:45,hence sometimes we need to book the conference room to have our lunch . There’s a buffet of both Vegetarian and its non counterpart for a reasonable sum of Rs 35 /- (Very very cheap as per Bangalore standards but just a bit expensive as per Kolkata standards.)




For a change we can order fresh fruits , as I saw for some ladies who prefered them for the dieting routine.


The Sun break rooms have a great selection of teas, including elaichi (cardamom), masala (what Americans call chai spice), and ginger. Plus a selection of other hot drinks – cocoa, instant coffee, and flavored mixes that I haven’t quite understood yet.


There’s a machine dispensing hot water and hot milk to mix these with. There is also brewed coffee, chocolate powder,tomato soup mix and powdered,badam milk and many more .


Now coming to the important part that is WORK . The very first day I got my Badge ready for which there was a photo session sort of arrangement at the ground floor near the data-center . For the first time in my life I felt very important .

For those of you who don’t know what a Badge is , I will like to tell that it is card like thing with my photo and other details and chip and a magnetic strip .It comes to use at the security gates where we need to show it a sensor and only then the door opens .Besides this is used when we need to use a Sun Ray machine ( Runs on Solaris 10 and has a SPARC architecture) , it is inserted into a slot inside the machine.


Its is a really nice environment around to work with caring and loving seniours and and lots of respect for every employee . The working time is flexible ,by flexible I mean there is no fixed working schedule and timing or anything like that . When you are done with your work you can can go home and sleep and if its like you prefer to work nights then you can work in the office during the nights. 

So I am kind of enjoying the experience as a Sun Intern and another news I have just heard that Sun IEC Bangalore will be celebrating its 10th birthday by throwing a huge party at a hotel called OTERRA at Electronic city and we are invited . So my next post will be on IEC 10 years of Engineering Excellence.


Posted in Personal, sun | Tagged: , , , , , , , , , , , , , , | 11 Comments »

JavaOne Coming to the OSUM Community

Posted by abhiitechie on May 18, 2009

As it is very difficult for everyone  to make the trip to San Francisco to attend JavaOne. That’s why special arrangements has been made to bring JavaOne to the Open Source University Meetup (OSUM) Community.  OSUM has scheduled a series of webinars which are previews of hands-on labs that will be conducted at JavaOne.

Check the OSUM events calendar for the complete schedule and RSVP today.

Posted in sun | Tagged: , , , , , , , , | Leave a Comment »

Viewing your server(Remote Desktop) with browser using VNC Java Applet

Posted by abhiitechie on May 18, 2009

VNC consists of two components. A server, which runs on the computer you want to remotely access, and a viewer, which runs on the computer you are sitting in front of. There are two important features of VNC:

  • The server and the viewer may be on different machines and on types of computer. The protocol which connects the server and viewer is simple, open, and platform independent.
  • No state is stored at the viewer. Breaking the viewer’s connection to the server and then reconnecting will not result in any loss of data. Because the connection can be remade from somewhere else, you have easy mobility.

So to get started with VNC you need to run a server, and then connect to it with a viewer. First of all, you have to download and install the software on the platforms you want to use.

VNC software requires a TCP/IP connection between the server and the viewer. This is the standard networking protocol on LANs, WANs, broadband and dialup ISP. Each computer has a unique IP address and may also have a name in the DNS. You will need to know the IP address or name of the server when you connect a viewer to it.

The VNC servers also contain a small web server. If you connect to this with a web browser, you can download the Java version of the viewer, and use this to view the server. You can then see your desktop from any Java-capable browser, unless you are using a proxy to connect to the web. The server listens for HTTP connections on port 5800+display number. So to view display 2 on machine ‘snoopy’, you would point your web browser at:


The applet will prompt you for your password, and should then display the desktop.

Posted in java, Personal | Tagged: , , , , , , , , , , , | 3 Comments »

Roumen Strobls Leaving Sun Microsystems Inc.

Posted by abhiitechie on May 18, 2009

He is the man behind all those brilliant screen casts and blog posts and loads of tutorials for both Netbeans and OpenSolaris. Finally he has decided to leave Sun but he will still stick on to Java and work for JavaOne

Here is what he writes in his blog http://blogs.sun.com/roumen/entry/leaving_sun)

“I have decided to quit Sun Microsystems. I spent amazing 5 years at Sun and I am very grateful for all I’ve learned with the company. Working on both NetBeans and OpenSolaris adoption was real fun so I leave with very mixed feelings.

I am going back to Java developer business and will be going to Java One with my new employer, so you will find me in the Java One pavilion area if you want to say hi. I wish my Sun colleagues good luck with their new adventures!

P.S. Thanks for all the beans.

Wish you all the best Sir . Keep enlightening us with your screencasts.

Posted in sun | Tagged: , , , , , , , | Leave a Comment »

OpenSolaris 2008.11 Mini-Book

Posted by abhiitechie on May 17, 2009

The Getting Started with OpenSOlaris 2008.11 mini-books were recentlyOpenSolaris released. They are available in English, Brazilian Portuguese, Spanish, Italian, German, Traditional Chinese, Simplified Chinese, Korean and Japanese.

You might notice that there is a difference between the content of these books. They are composed by three different documents, and only the ones in English, Simplified Chinese and Japanese have them all. All other languages have only one document.

The books have a pretty basic approach, so they are aimed at people who doesn’t have much experience with the OS. This makes them perfect to be indicated during basic courses and presentations.

It seems that the 2008.11 version of these mini-books will be available only in the digital format.


OpenSOlaris 2008.11 mini-book (English)

Posted in sun | Tagged: , , , , , , , , , , , , , | 1 Comment »

Regular Expressions in Javascript

Posted by abhiitechie on May 17, 2009

Here are some examples of using regular expressions for input validations in javascript.

var input = “hello222”;
var ok = false;

var dob_regex = /^([0-9]){2}(\/){1}([0-9]){2}(\/)([0-9]){4}$/;   // DD/MM/YYYY
var email_regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;  // email address
var username_regex = /^[\w.-]+$/;  // allowed characters: any word . -, ( \w ) represents any word character (letters, digits, and the underscore _ ), equivalent to [a-zA-Z0-9_]
var num_regex = /^\d+$/; // numeric digits only
var search_regex = “/hello/”;
var password_regex = /^[A-Za-z\d]{6,8}$/;  // any upper/lowercase characters and digits, between 6 to 8 characters in total
var phone_regex = /^\(\d{3]\) \d{3}-\d{4}$/;  // (xxx) xxx-xxxx
var question_regex = /\?$/; // ends with a question mark

1. Check that there are at least 3 numeric characters in input
if ( input.match(/d/g) == null ) {
ok = false;
} else if ( input.match(/d/g).length < 3 )  {
ok = false;
} else {
ok = true;
2. Check that the input has a minimum of 8 characters
if ( input.length >= 8 ) {
ok = true;
3. Check that the input is in a correct date format (DD/MM/YYYY)
if ( dob_regex.test(input) ) {
ok = true;
4. Check that the input is in a correct email format (username@example.com)
if ( email_regex.test(input) ) {
ok = true;
5. Check that the input matches the specified username format
if ( username_regex.test(input) ) {
ok = true;
6. Check that the input contains only numeric characters
if ( input.match(num_regex) ) {
ok = true;
7. Search for a specific word in the input
if ( input.search(search_regex) != -1 ) {
ok = true;
8. Check that the input matches the specified password format
if ( input.match(password_regex) ) {
ok = true;
9. Check that the input matches the specified phone number format
if ( input.match(phone_regex) ) {
ok = true;
10. Check that the input is a question (ends with a question mark)
if ( question_regex.test(input) ) {
ok = true;

Posted in Personal, web | Tagged: , , , , | 6 Comments »

Programming Forums that will always help

Posted by abhiitechie on May 17, 2009

Java  Forums


imageSun forums Sun’s official Java forums

imageDZone Forums 

PHP Forums


image  PHP freaks 

image PHP Builder forums

image  Devshed php development forums

image Weber forums

MySQL Forum


RoR  Forums

image Rails forum

 image  Ruby forum

For all kind of programming Q and A.




Posted in java, mysql, Personal | Tagged: , , , , , , , , , , , | Leave a Comment »

Developing iphone apps using Java

Posted by abhiitechie on May 17, 2009

It’s a channel on google about Education and Tech talks and in this tech talks will be talked about object c, java, apps and cross compiling. You can see the Google tech talk here

Posted in Uncategorized | Tagged: , , , , , , , , | 4 Comments »

Finally some success porting OpenVPN

Posted by abhiitechie on May 15, 2009

Today has been quite  eventfull and productive for me . I finally found some success with my project . I am trying to port a software called OpenVPN .OpenVPN is a full-featured open source SSL VPN solution that accommodates a wide range of configurations, including remote access, site-to-site VPNs, Wi-Fi security, and enterprise-scale remote access solutions with load balancing, failover, and fine-grained access-control.

When I tried to build it from source I faced some difficulties getting the configure run. After a bit of research I got that working with the –disable lzo option . So this was the first dependency resolved for me . Then on doing make there was error compiling a file called tun.c . Researched again and found that for a 64 bit platform like open solaris I need to have the tun kernel module to compile the file tun.c and that to I had to make some changes inside the Makefile.in of the tun source adding the option -m64 for the 64 bit open solaris

Then I faced the error gcc not found while building the package tun 1.1 . As we kno gcc is not present by default in a Solaris system and is taken care of by Sun Studio compilers but the package in hand was hellbent on a gcc . So what I did is I again edited the file Makefile.in and replaced the CC entry with cc instead of gcc . Then it showed -Wall is an illegal option with cc so without thinking much I just removed it and crossed my fingers while making it and finally the tunnel driver was successfully installed and with the tunnel driver in the environment the dependencies of OpenVPN was also resolved .

Now it was the time for me making the Spec file from scratch for the OpenVPN source package. The preamble section was done easily without much trouble . Then I wrote the %prep section and kept it simple . Then there was the tough task of writing the %build section and I included all the dependency option of configure and with the help of someone in the mailing list I was able to write the %build section

%install was straight forward without any complicacies .

%file was the best . After lots of asking , mailing , head-scratching and research even that was done .

I kept my fingers crossed and executed pkgtool on the spec I wrote and guess what it passed .

Submitted my passed to the Source juicer site for the final test . It is still waiting to get validated may be by tommorow I will be able to see the results .

One important thing to be noted is that before submitting the spec to the juicer the license , vendor and copyright directives must be included as it is checked for also the .copyright file need to be uploaded along with the .spec file to the juicer . So the syntax check was done and it said OK .

Here is the spec I wrote :#OpenVPN (TM) — An Open Source VPN daemon

#Copyright (C) 2002-2008 OpenVPN Technologies, Inc.

%include Solaris.inc

Name:                openvpn
Summary:             OpenVPN is a full-featured open source SSL VPN solution.
Version:             2.0.9
License:             GPL license version 2
Group:               SSL VPN
Vendor:             OpenVPN
URL:                 http://openvpn.net/
Source:              http://openvpn.net/release/openvpn-2.0.9.tar.gz

SUNW_BaseDir:        %{_basedir}
SUNW_Copyright:      %{name}.copyright
BuildRoot:           %{_tmppath}/%{name}-%{version}-build
%include default-depend.inc

%package root
Summary:                 %{summary} – / filesystem
SUNW_BaseDir:            /
%include default-depend.inc
Requires: tun

# OpenSolaris IPS Manifest Fields
Meta(info.porter):  Abhishek Gupta < A.Gupta@sun.com >

OpenVPN is a full-featured open source SSL VPN solution that accommodates a wide range of configurations, including remote access, site-to-site VPNs, Wi-Fi security, and enterprise-scale remote access solutions with load balancing, failover, and fine-grained access-controls. Starting with the fundamental premise that complexity is the enemy of security, OpenVPN offers a cost-effective, lightweight alternative to other VPN technologies that is well-targeted for the SME and enterprise markets.

%setup -q -n openvpn-%version


export CFLAGS=”%optflags”
export LDFLAGS=”%{_ldflags}”

./configure –prefix=%{_prefix} \
–disable-lzo  \
–disable-crypto \





%defattr (-, root, root)

* Friday 15 May , 2009 – A.Gupta@sun.com
– initial version

Posted in sun | Tagged: , , , , , , , , , , , , , , , , , | 2 Comments »