Saturday, December 16, 2006

Java SE 6 Trouble Shooting Guides

Ever since I tried Java back in 2000, I have felt a little uncomfortable about the not-so-powerful and not-so-intuitive set of tools accompanying JDKs. That was one of the reasons why I didn't pursue my interests seriously in programming in Java. But the notions are changing and I mean it.

From the hoopla going on about Java SE 6, I was tempted to try that. Hence you might be seeing some Java SE 6 specific posts in future too. There are a lot of powerful tools (jhat and jmap for instance) that are bundled in this SE for the pleasure of the system programmer.

I came across this excellent list of tutorials when I was browsing through Mandy Chung's blog. She is the person leading the Java Management & Monitoring Tools API (java.lang.management) effort. You would find this list of tutorials extremely useful. Though most of them are specific to Java SE 6, I guess some of them should be applicable to earlier JSEs too.

Wednesday, December 13, 2006

Issue of CRLF chars

I faced a very weird problem while I was trying to find log, check out or update files from the CVS repository. The following error message was flashed on the screen:
[myuserid@localhost java]$ cvs log .
myuserid@mycvshost's password:
cvs-1.11.17_p2 log: Logging .
: No such file or directoryopen directory /cvsroot/my/repository
cvs-1.11.17_p2 log: skipping directory
myuserid@mycvshost's password:
" but pserver says "/cvsroot/my/repository"/my/repository

I could sense that this might be related to some CRLF (Carriage Return-Line Feed) issue, as all the error lines seem to be starting with what look like end of string delimiters (":" or "\""). So to further clarify my doubt I redirected the output to a file and this is the exact error message I was getting:

cvs-1.11.17_p2 log: Logging .
cvs-1.11.17_p2 log: cannot open directory /cvsroot/my/repository^M: No such file or directory
cvs-1.11.17_p2 log: skipping directory
Protocol error: Root says "/cvsroot/my/repository^M" but pserver says "/cvsroot/my/repository"

Gotcha! You see those "^M" chars? I figured what was the problem. I had checked out all the files in my Win XP workstation, and FTPed the entire tree to my Linux box. That caused the whole issue!

To rectify that, do a dos2unix on all the files under each of the CVS directories. A simple script to do this task is given below:
for dir in `find . -name CVS -type d` ; do
dos2unix $dir/*
done

Remember: We are not doing a dos2unix on all the source files in those directories, rather we do dos2unix only on the CVS related files. Keep this in mind.

Tuesday, December 12, 2006

Java Platform Performance

I came across Java Platform Performance book while I was searching for something else. Thought this would be an interesting reading.

Thursday, December 07, 2006

Empty VMWare SCSI disks

We had a heated discussion in our team today. One of my teammates was complaining that the existing 8 GB disk (the .vmdk file) that he had attached to his VMWare Player was running out of space. Hence he needed a work around for that. Remember that all of us only have a VMWare Player, not a VMWare Workstation using which you can create a hard disk image. I suggested him a hack.
  • Copy the existing .vmdk file. Give it a new name.
  • Add that file as the next SCSI drive in your VWWare configuration file (.vmx file). You can do it easily by editing your .vmx file in notepad.
  • Start your virtual OS. In his case it was RH Linux.
  • Format the newly added disk. (mke2fs /dev/sdb).
You are done. You have another 8 GB of storage. But still I was not happy about this hack. What in case he exhausts all this 8 GB soon. So I was searching the Internet. My objective is simple: I have an up and running VMWare virtual OS where I would like to add a new SCSI drive of whatever size I want.

Well! Forever For Now gives empty SCSI disks for your VMWare player in three different sizes. Added to that, you also get a bunch of good tips-and-tricks that are very useful. Go ahead and give it a try!

Forever For Now site also gives a lot of other articles that are useful too. You might find it an interesting reading to go through their web site.

Thursday, November 16, 2006

Nationwide data - richest, most taxed, etc.

If you are looking for a nationwide information database, for casual browsing or for the application that you are developing, you can turn to NationMaster web site. Its pretty good. They maintain a lot of useful information on each nations. And they keep their site updated (thats what I guess, don't blame me!) with latest publications from CIA etc.

Microsoft Windows PowerShell is out

To compete with Unix style shells (really?), the Windows PowerShell is out for you to try. As per the information available in the web site, the PowerShell comes with more than 130 standard command line tools, that will make the automation job of every administrator a breeze.

What more, all these tools have been made to have a standard and consistent interface. Why such an insistence on this? Do you know that there is tskill.exe and taskkill.exe? Though both of them apparently seem to be doing the same business, they are not. The first is a subset of the other and the way you specify the arguments is also a little different. Go ahead ... try now! Like these, there are a couple of more anomalies too. I guess MS is known for such kind of inconsistent interface, at least when it comes to command line interface. Hence it is understood and appreciated when MS says all these tools have a common consistent interface.

A Common Lisp eBook

You may love Common Lisp, or you may not. The author of the book Practical Common Lisp seems to be bubbling with all positive testimonies to make you try Common Lisp.

At least for me, from the Emacs learner's perspective, I think this book would tend to be good reference material.

After all, there is nothing wrong in giving a language a try.

Tuesday, November 14, 2006

eBooks on LDAP

I was desperately searching for good books on LDAP, both for understanding as well as programming. I came across the Redbooks web site of IBM, where they maintain an impressive collection of good eBooks. What is more, most of the books can be downloaded in pdf form free of cost. I downloaded and started reading Understanding LDAP book.

Monday, November 13, 2006

Palisade - A good resource for security articles

I recently came across Palisade web site. Instantly, I liked the contents in the web site and thought of sharing it with the readers. Hopefully you would find it useful too.

Tuesday, November 07, 2006

ThreadJack - A threading library in C++

There is an open source initiative from Japan to provide a threading library, that would look exactly like the threading model of Java. You can find the details of the project here.

One of the advantages that I see, as it is stated in the site, is that a person with good Java programming back ground doesn't have to spend time learning the threading model of different platforms. This library promises to give a uniform threading model across different operating systems.

Icon next the URL in IE and FireFox

Many a times I have wondered how some of the sites have an icon appearing before their URL in the address bar. But for some reason there is no icon appearing if I visit my personal page. I recently figured the answer for this while visiting this site. There was a side note appearing in that site, taking me to the Microsoft's article on how to make this icon appear. Hope you would find this useful and interesting.

Apart from that, I find ZYTRAX site extremely useful in many ways. They have excellent tutorials on LDAP and DNS. There is a lot more to read about from that site.

Friday, November 03, 2006

Interesting discussion on C/C++ being efficient

I came across this blog through reddit. The title is: The "C is Efficient" Language Fallacy. You will find the discussion below the blog entry more interesting and thought provoking than the article itself. Especially a few comments by billb make a lot of sense, really a lot of sense.


Sunday, October 29, 2006

Advice to a startup CEO - By Jeff Richards

From the blog of Jeff Richards, this one is truly worth reading. He gives a seven points advice to a startup CEO.

Friday, October 27, 2006

Wow! Thats what I was looking for!

If you are a web admin, or a web developer, or a person learning about the web technologies out of curiosity, this is the best place for you. The owner of the site (David?) maintains a cool list of tools, tutorials and other references. You just get what you are looking for.

Here it is again: http://siteadminstuff.com/all.html

Thanks to whoever is the owner of the site.

Listing down all the Active Directory Servers in a domain

I am new to Windows world. Hence please do correct me if you find any terminology to be incorrect than the standard ones. I would be more than glad to stand corrected.

I am learning about the LDAP and Active Directory servers. We all know that for logging into a domain, active directory (AD) service for that domain is used. But how does the windows running in your workstation find out which AD to be contacted?

After we click on the login button, a name service look-up is performed with the following details:

Request type: SRV
URL: _ldap._tcp.domainname

This NS look-up command will return a bunch of servers, and one of them will be used to authenticate the user. Each of the blocks in the response will have the port in which the server is listening as well. Replace domainname above with the actual domain name in which you would like to find out the active servers.

Okay, thats the theory part. Now hands on. Try these commands in your workstation and convince yourself with the results.
nslookup This will start the nslookup process. The two commands entered below are in the nslookup prompt ">".
set q=srv
_ldap._tcp.domainname Replace domainname with the actual domain that you would like to perform look-up.

There is an excellent tutorial available on Active Directory architecture, which might be of good help in terms of understanding what AD is.

Thursday, October 26, 2006

PHP vs Ruby vs Python vs Perl

You might find this survey to be interesting. In summary, more and more new code is written in PHP. But more and more new projects are being initiated in Ruby and Python.

One trend is very strong: Perl is witnessing a steep fall in new lines of code, active developers and new projects.

Wednesday, October 25, 2006

Top 10 Certifications

There is a survey out on Internet, with the Top 10 certifications in the world. You can read the complete list here. Topping the list is "Red Hat Certified Engineer." I can observe that information security is taking a prominent position in the software community. This is a good sign, at least for me, as I am an information security person ;-)

Another chapter in Programming Pearls

Managed to steal some time to read another chapter in Programming Pearls. As always, it was truly a refreshing experience.

Here is a question that I wanted to share:
You are given a huge array of unsorted numbers (32 bit integers) in a file. Let us say there are 4 billion numbers in that file. It is obvious that some numbers are missing (why?). How will you find out the first missing number?
Provide your answer(s) with explanation about space and time complexities.

Yesterday it was Top Coder Single Round Tournament 324. But they had made a typo when they announced the results. Instead of "SRM 324", they had announced the results with title "SRM 234." I managed to answer the 250 points and 1000 points problems. And I successfully challenged a 250 points solution as well. Still I don't know why my ranking went down, instead of going up. You can view my ranking here.

Firefox 2 - Officially released

I tried it and its really good. Though there is no noticeable difference apart from look and feel, the Firefox site boasts a lot of things.

I think one of the coolest features that are added to this edition is spell check on text input boxes. I am not sure if there is any other browser that provides this feature, at least none of the browsers that I use provides this feature.

There is another feature called "Caret Browsing" in Firefox (I think its around there for sometime). Its really useful when you wish to move around or copy and paste from a web site that offers more textual content. You have to press F7 when you are in a web page to enable caret browsing. You can use your mouse to move here and there and select contents. It will really be helpful for Unix people who are more used to using key boards to move around.

I would suggest you to refer to the key board short cuts page in the help section of Firefox browser. There are better ways to move around across tabs, selecting tabs randomly, etc.

One of the controversies that I think Firefox might run into might be the integration of anti-phishing features with Firefox and enabling them by default. Its not very trivial to appreciate. As per Firefox documentation, Firefox periodically collects information from net (from what source?) and verifies the sites that you visit against the list that it has. In case if the site you visit is present in the list of phishing sites, you would be prevented from visiting that site.

Okay. Enough of product advertising. A trivia about this release of Firefox. There is a news on the net that Internet Explorer team from Microsoft has sent a cake congratulating the shipping of Firefox 2. I am not sure how authentic this information is though!