tag:blogger.com,1999:blog-66608642024-03-13T19:55:07.930-07:00My ThoughtsThis blog is an representation of my work and share my views in areas of Eclipse, Java and Linux(Ubuntu).Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-6660864.post-44380307122153855612011-02-16T10:08:00.000-08:002011-02-16T10:08:54.096-08:00Configuring Squid on Ubuntu 10.10I recently upgraded my box to Ubuntu 10.10 and ran into problems with starting squid (Version 2.7.STABLE9-2ubuntu5).<br />
<br />
I finally debugged and fixed the problem. The steps are as follows:-<br />
<ul><li>Getting squid.conf right</li>
</ul><div style="margin-left: 0.79in;">The default user (and group) for running squid is 'squid'. This is not present in configuration.<br />
<br />
I also ran into problems with configuration of squid.pid file.The default location is /var/run/squid.pid , where an non root user cannot create file. So i moved it to /var/run/squid directory.<br />
<br />
The changes to /etc/squid/squid.conf are listed below.</div><pre class="shell" name="code"><div style="margin-left: 0.79in;">cache_effective_user squid
cache_effective_group squid
pid_filename /var/run/squid/squid.pid</div></pre><ul><li>Fixing the file permissions and create directories</li>
</ul><div style="margin-left: 0.79in;">We need to set the file permissions for squid configuration, log folders to squid:squid and also create the directory /var/run/squid</div><div style="margin-left: 0.79in;">The shell commands are:-</div><pre class="shell" name="code"><div style="margin-left: 0.79in;">sudo chown squid:squid /etc/squid/squid.conf
sudo mkdir /var/run/squid
sudo chown -R squid:squid /var/run/squid
sudo chown -R squid:squid /var/log/squid</div></pre><ul><li>Starting squid.</li>
</ul><div style="margin-left: 0.79in;">The squid on ubuntu 10.10 is triggered using service command. Start squid and check logs in /var/log/squid</div><pre class="shell" name="code"><div style="margin-left: 0.79in;">sudo service squid start</div></pre><br />
You should see the squid running....<br />
<br />
<a href="http://www.amazon.com/Squid-Definitive-Guide-Duane-Wessels/dp/0596001622?ie=UTF8&tag=mytho0eb-20&link_code=bil&camp=213689&creative=392969" imageanchor="1" target="_blank"><img alt="Squid: The Definitive Guide" src="http://ws.amazon.com/widgets/q?MarketPlace=US&ServiceVersion=20070822&ID=AsinImage&WS=1&Format=_SL160_&ASIN=0596001622&tag=mytho0eb-20" /></a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=mytho0eb-20&l=bil&camp=213689&creative=392969&o=1&a=0596001622" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /><a href="http://www.amazon.com/Ubuntu-10-10-Essentials-ebook/dp/B00486UDCW?ie=UTF8&tag=mytho0eb-20&link_code=bil&camp=213689&creative=392969" imageanchor="1" target="_blank"><img alt="Ubuntu 10.10 Essentials" src="http://ws.amazon.com/widgets/q?MarketPlace=US&ServiceVersion=20070822&ID=AsinImage&WS=1&Format=_SL160_&ASIN=B00486UDCW&tag=mytho0eb-20" /></a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=mytho0eb-20&l=bil&camp=213689&creative=392969&o=1&a=B00486UDCW" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" />Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com1tag:blogger.com,1999:blog-6660864.post-31401174274299925832008-04-11T12:02:00.000-07:002008-04-12T01:28:59.453-07:00Making your Project IDE IndependentEvery wondered about getting to build your project within ide and still maintain an single build system.<br /><br />As a java developer, you would always use some ide like eclipse, intellij, netbeans...etc. And still would like to have an ability to build at command line. Most people have started thinking of 'ant' by now. But ant doesn't solve all the problem. Ant based build systems have the following problems.<br /><ol><li> Ant build would not coexist with ide incremental build support</li><li>Dependency in ant cannot be imported into ide.<br /></li></ol>Let us now welcome maven, I am not going to fight about the difference of ant and Maven. But just look at how good the interaction of Maven is with the ide. For the sack of illustration, I would look at my favourite ide, eclipse<br /><br />We have two important eclipse plugin for maven available :-<br /><ol><li>Maven eclipse IDE plugin</li><li>Eclipse Maven Plugin (Google Summer contest)<br /></li></ol><br /><span style="font-weight: bold;">Maven IDE Plugin </span><a href="http://m2eclipse.codehaus.org/"><span>M2Eclipse</span></a><br /><br />This is a mature stable plugin with basic Maven support. This provides basic integration for Maven and allows uses to run maven targets from eclipse<br /><br /><span style="font-weight: bold;">Google Maven Plugin. </span><a href="http://code.google.com/p/q4e/"><span>q4e</span></a><br /><span style="font-weight: bold;"><br /></span>This Maven Plugin was originally started as a google summer code project and is now adopted by Eclipe foundation. This would be the foundation for official eclipse plugin for maven. This is still under quite a lot of active development, but still contain quite rich interaction of Maven. The last release was 0.5.0 which contains quite a few good features. This is worth a look once.<br /><br /><br /> Coming back to eclipse Maven interaction, what makes maven an excellent tools is that maven seamlessly integrates into the ide. An Maven based build system can run from command line and using the ide without any major change.<br /><br /> The Maven dependency are seamlessly added to eclipse project, and hence the enduser need to only define its maven dependency, without touching eclipse dependency definition. As a result, when the project is build from command line, the dependencies would continue to be present. This single point configuration of dependency makes development and build management exceptionally easy.<br /><br />Important distinction that i want to make is using maven goal eclipse:eclipse for building eclipse project definition from maven pom.xml file. This approach doesn't create since point configuration, since you would modify eclipse project files at some point and that would lead to pom.xml and project files getting out of sync.<br /><br /><br />Maven plugins are available for major ides, so same can be repeated for other environments.<br />Try it your self and see the difference.Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com1tag:blogger.com,1999:blog-6660864.post-67072709942853517752007-12-15T10:38:00.000-08:002007-12-15T12:09:22.733-08:00Eclipse Bangalore Camp: Mylyn PresentationI was presenting at the Eclipse Bangalore Camp last week. i talked about Mylyn at this presentation. i am user of mylyn for long, and totally love it.<br /><br />Mylyn,an eclipse plugin is lying the foundation for the next generation IDE. i would say Task focussed IDE, is a fundamental shift in the way ppl are going to use eclipse.<br /><br />I would recommended any one doing serious development in eclipse to look at <a href="http://www.eclipse.org/mylyn">mylyn.</a> This can revolutionize the way you work !.<br /><br />So friends, go and get plugged in .. <br /><br /><div style="width:425px;text-align:left" id="__ss_204494"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=test-1197748238127877-2"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=test-1197748238127877-2" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"><a href="http://www.slideshare.net/?src=embed"><img src="http://static.slideshare.net/swf/logo_embd.png" style="border:0px none;margin-bottom:-5px" alt="SlideShare"/></a> | <a href="http://www.slideshare.net/saurabh_arorain/test-204494" title="View 'Introduction to Mylyn' on SlideShare">View</a> | <a href="http://www.slideshare.net/upload">Upload your own</a></div></div>Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0tag:blogger.com,1999:blog-6660864.post-60089861730966599492007-11-25T08:57:00.000-08:002008-12-10T11:54:58.370-08:00Upgrading to Ubuntu 7.10 (Hard disk based upgrade)I had installed 7.06 and used for around 4 months. It was the first time have used on Linux outside the fedora world. I found it great and had reviewed it earlier. It was my time to catch on the Ubuntu 7.10 band wagon and i did it just 2 days after the release. Since then i have been testing my way in this Ubuntu land.<br /><br />Today, i am sharing the iso image based upgrading, using my hard disk to upgrade. The steps for the upgrade are as follows:-<br /><br /><ol><li>Download the Ubuntu alternate CD</li> i downloaded the ubuntu-7.10-alternate-i386.iso image<br /><br /><li>Keep the iso on your unused partition</li> <br /> When i say unused partition, i mean any disk partition which would not change during the upgrade process. In my case, i used my windows partition which i mounted read only (ntfs) in Ubuntu 7.06.<br /><br /><li>Back up all necessary data.</li><br /><li>Mount the iso image.</li><br />I kept the iso image on my windows partitions and mounted the iso image from the same.<br /><br />>mount -o loop ubuntu-7.10-alternate-i386.iso /ubuntugutsy<br /><br /><li>Run the cdromupgrade script from the mounted iso</li><br /> <br /> >sudo /ubuntugutsy/cdromupgrade<br /> <br /> When running the cdrom upgrade, the system would ask for permissions to download latest updates from the Internet. i would recommended you to download the same.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1pbg8V2JlbJO-hAuLAABcuFblP8NOCQUfQ67jFnXo7pF-zpbWPyF5GbedTsng_d_Jl9Ofhp6UGEVFq0USHNmxw56ArnjPWUrs5waiAhcnhUUWq3QhM5fiH2REuA1cakaZ6Gx8Ow/s1600-h/Screenshot-gutsy.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1pbg8V2JlbJO-hAuLAABcuFblP8NOCQUfQ67jFnXo7pF-zpbWPyF5GbedTsng_d_Jl9Ofhp6UGEVFq0USHNmxw56ArnjPWUrs5waiAhcnhUUWq3QhM5fiH2REuA1cakaZ6Gx8Ow/s320/Screenshot-gutsy.gif" alt="" id="BLOGGER_PHOTO_ID_5136828580853429890" border="0" /></a><br /><br />In case of using latest updates, the upgrade process to handle to additions problems. Firstly, it would handle packages which may not be included in the cdrom but are upgraded in 7.10 repository . At the same time, it would also install latest version (if any) of software available on cdrom also. This would make your life easier later on.<br /><br /><li> Go through the upgrade and enjoy the new Ubuntu 7.10.</li></ol>Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0tag:blogger.com,1999:blog-6660864.post-35843648746747116942007-10-17T23:00:00.000-07:002007-10-17T11:19:49.641-07:00Using Tessarct-ocr with Ubuntu and Gutsy<p>In my <a href="http://saurabhblog.blogspot.com/2007/09/i-am-back-with-my-ubuntu-journey.html">previous posts</a>, I talked about installing tesseract-ocr on Ubuntu, I played and spent some time with it. It seems to have failed on my assessment. I don’t want to blame ocr program for it. It my be that I may not have configured it correct. I have read a number of entries on tesseract-ocr on Ubuntu. And feel it may be just my configuration and scanning problem. I would spend some time later next month to see if I can figure it out. More later on the same.</p><br /><p>I would take this opportunity to talk about upcoming ubuntu 7.10 (Gutsy). I looked at the <a href="http://www.ubuntu.com/testing/710rc#head-e4e55438b65b90bb7edfd2c52488d554e502863a">release notes</a> for 7.10 Release candidate and I would like to point out few things I am waiting for:-</p><br /><ul><li><a href="http://www.ubuntu.com/testing/710rc#head-2d0811b3b8c817b91088ff553930e10e4fc04fc5">xrandr support </a></li></ul><br /><p>It would make dual display easier to configure (with the help of Graphical configuration tool for X) and projector friendly .Although I regularly use Ubuntu with <a href="http://saurabhblog.blogspot.com/2007/09/working-in-ubuntu-world-i-have-been.html">dual monitor</a> at home, I have failed to use a projector with Ubuntu 7.06. Hopefully xrandr would change it.</p><br /><ul><li><a href="http://www.ubuntu.com/testing/710rc#head-2f507f27632bb60f4cb2aa8768085e1d41bf5e48">Plug and play support for Printer</a></li></ul><br /><p>As a windows user at work, I am used to plug and play support for all kinds of device. Something which doesn’t happen as effective in Ubuntu. The plug and play support for printer is great work in the right direction. Let’s see how it works.</p><br /><br /><script type="text/javascript" src="http://www.ubuntu.com/files/countdown/dist/display.js"></script>Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com2tag:blogger.com,1999:blog-6660864.post-26798657302837294232007-10-02T07:47:00.000-07:002007-10-02T07:53:37.764-07:00<strong>Ubuntu(7.04) and Eclipse.</strong><br /><br /><p> Today, let us talk about<a href="http://www.eclipse.org/downloads/" target="eclipse"> eclipse 3.3</a> on Ubuntu. Being an Java Programmer, eclipse plays an important role in my life.</p><br /><em>Installing Java</em><br /><p> I have installed<a href="https://help.ubuntu.com/community/Java" target="_parent"> JDK 1.6</a> from the <a href="http://www.ubuntu.com/community/ubuntustory/components" target="multiverse">multiverse repository</a> for Ubuntu 7.04 . The process involves downloading sun-java6-jdk package from the multiverse repository. </p><br /><em>Installing eclipse</em><br /><p>I downloaded eclipse archive from the eclipse site, unzipped it and executed the eclipse binary. It easily detected the jdk and worked great. Performance was also good.</p><br /><p>All was not over, once i started with some serious memory hogging stuff using <a href="http://www.eclipse.org/gmf/" target="gmf">GMF</a> on eclipse, the ide started to crash. This happened a number of times, i tried increasing the memory but it didn't help. Finally, after a lot of searching i found refers to issue in the jdk with reference to <a href="http://dertompson.com/index.php/2007/01/10/permgenspace-problems-with-eclipse-in-jdk6-too/" target="perm">perm space</a>. It seems some people have successfully resolved it my increasing perm size, but it didn't work for me. </p><br /><p> I finally decided to install jdk 1.5, the jdk 1.5 package is sun-java5-jdk , and it ships jdk 1.5.0_11 on (Ubuntu 7.04). And switched the default java to 1.5 using <a href="https://help.ubuntu.com/community/Java#head-fef9352fb26820bb774df978180c9dd3a60e777b" target="update">update-alternatives</a> command.The perm space issues are resolved in 1.5.0_8, so the later versions worked perfectly. Once i upgraded and started using the new jdk with eclipse i have not faced the permspace issues. </p><br /> <p>Eclipse on Ubuntu gives me good performance, specially good behaviour in compiling large projects.</p>Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0tag:blogger.com,1999:blog-6660864.post-76677887667172082402007-09-30T07:39:00.000-07:002007-09-30T07:46:48.371-07:00<span style="font-weight:bold;">Ubuntu Journey</span><br /><br /><br />I am back with my Ubuntu Journey. After talking about my experience with support of some devices in Ubuntu last week. I would continue my discussion with the support of my printer.<br /><br />I recently bought brand new <span style="font-style:italic;">HP F2120 All-in-One printer</span>. An excellent piece of hardware for my home use. Its printing , copying and scanning support fits well in my day to day home use needs.<br />The printer ships with custom drivers for windows on a CD. And obviously the linux drivers are not available. I wanted to setup the printer in Linux and interesting it failed to work initially. I was also interested in setting it up as a scanner with the xsane tool.<br /><br />I searched and found hplib package is required for this printer. I installed hplib using apt-get and it worked !<br /><br />Pretty soon, I would try to blogging using optical character recognition(OCR). I have already installed tesseract-ocr based on the recommendation on the web.Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com2tag:blogger.com,1999:blog-6660864.post-73145309137827155122007-09-04T07:03:00.000-07:002007-09-09T10:13:22.580-07:00<strong>Working in Ubuntu World</strong><br /><br />I have been around 15 days in Ubuntu, it means both kind of good and bad.<br /><br /><span style="font-style: italic;">Good.</span><br /><ul><li>I connected my Canon Digital Camera, and i easily downloaded my photos, something i never did successfully earlier.</li></ul><ul><li>I am able to play most of the media files, quite a large improvement.</li></ul><ul><li>My eclipse ide works great on Ubuntu. I have to still figure out how to manage multiple java version. </li></ul><br /><span style="font-style: italic;">Bad</span><br /><br />I think the one and most important bad for me in the X configuration domain. I have been used to gui based X configuration for years now in fedora and redhat. Ubuntu doesn't have a proper X configuration Util. The non-gui stuff is non-intuitive , it takes ages to surf the web for right configurations.<br /><br />I have had problems twice with X, once while using the projector and again with Configuration of Dual Monitor. Probably, Some how i am biased towards the fedora's gui dual head configuration.<br /><br />I have finally found the configuration that works for my Dell D600 Laptop. I would have to say that Ubuntu forums did help me a lot to reach this working version.Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0tag:blogger.com,1999:blog-6660864.post-23283384502189994512007-08-15T03:18:00.000-07:002008-12-10T11:54:58.812-08:00I finally decided to restart my Blog , today ;-) . The best think i can think about to talk today is the new <a href="http://www.ubuntu.com/"><span class="blsp-spelling-error" id="SPELLING_ERROR_0">Ubuntu</span> 7.04 Desktop Edition</a>.<br /><br />I recently installed the <span class="blsp-spelling-error" id="SPELLING_ERROR_1">Ubuntu</span>, after being an Fedora user for 5 yrs. I use Linux whenever i can in my profession as an java programmer. During college we used it extensively to do our project work, in both C and java.<br /><br />I have been following the <span class="blsp-spelling-error" id="SPELLING_ERROR_2">redhat</span> and fedora distributions for 7 yrs now.I feel <span class="blsp-spelling-error" id="SPELLING_ERROR_3">Ubuntu</span> is gone a long way in making my life simple. I am particularly impressed by:-<br /><ul><li> Boot time </li><li> Hardware support</li></ul> I haven't explored a lot so cannot comment a lot about it. But i did use the following tips to make the stuff better.<br /><br /><ol><li> Setup <span class="blsp-spelling-error" id="SPELLING_ERROR_4">tmpfs</span> on /<span class="blsp-spelling-error" id="SPELLING_ERROR_5">tmp</span></li> <p>I have used it in Fedora also, this would help a lot.</p><li> Install <span class="blsp-spelling-error" id="SPELLING_ERROR_6">smBackup</span> for system backup.</li><br /><li>change <span class="blsp-spelling-error" id="SPELLING_ERROR_7">vm</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_8">swappiness</span> value to 10</li><p>i have a 2GB ram, i would be evaluating it before making it 0 ;-)</p></ol>S<span class="blsp-spelling-corrected" id="SPELLING_ERROR_9">creenshot</span> of my new <span class="blsp-spelling-error" id="SPELLING_ERROR_10">Ubuntu</span> desktop<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbPlbY7zWEYELGTlQrDfsnaXWFKWScdg92HapppI5Wq1AgHeOTM6ih6-3VhyphenhyphenhQt6ZNBzetVTNZDfegl0avploT5o4eo0qKJz1cY7C26Ywb5kLMFcwsxZT-7P5BNSyxIzfBpNeXDQ/s1600-h/Screenshot.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbPlbY7zWEYELGTlQrDfsnaXWFKWScdg92HapppI5Wq1AgHeOTM6ih6-3VhyphenhyphenhQt6ZNBzetVTNZDfegl0avploT5o4eo0qKJz1cY7C26Ywb5kLMFcwsxZT-7P5BNSyxIzfBpNeXDQ/s320/Screenshot.gif" alt="" id="BLOGGER_PHOTO_ID_5098870201452447938" border="0" /></a>Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com6tag:blogger.com,1999:blog-6660864.post-1083847518296321382004-05-06T05:45:00.000-07:002007-09-30T07:22:47.206-07:00I was just getting under the eventing support in java from a developer persepective. I wanted to define my own eventing system for a asynchronous response problem.<br /><br />An good Tutorial on swing eventing is <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/">Lesson: Writing Event Listeners</a>.<br />The important classes in this case are :-<br /><ul><li>EventListener</li><li>EventObject</li></ul>The above classes are well explained in User defined Event Listeners Article. But the story doesn't end here,<br />the other eventing classes that i saw are the following:-<br /><ul><li>javax.swing.event.EventListenerList</li><li>java.util.EventListenerProxy</li><br /></ul><br /><br />Now the important point is that both EventListerList and EventListenerProxy can play an important role in the implementation of the java based eventing solution.<br /><br />So why are they not defined in java.util.* or say java.util.events.* ?<br /><br />It seems a Generic Eventing Base has never been of importance to JDK Developers. (A possible project !!).<br /><br /><br />I leave you thinking for the same.Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0tag:blogger.com,1999:blog-6660864.post-1080110085317428402004-03-23T22:34:00.000-08:002007-09-30T07:22:47.215-07:00My First Blog on JAXBWell processing the uddi v2 schema with JAXB is not straightforward. <br />JAXB tries to map each element, complextype, simpletype into a jaxb class. And v2 xsd contains some of these elements with the same names. As a result, it leads to an overlap in names of generated classes and hence you see the Error messages.<br /><br />To overcome this problem, we need to customize the JAXB using Customization of JAXB Bindings.<br />See the Sample Code Nsure Uddi Project at Forge .<a href="http://forge.novell.com/modules/xfmod/sample/index.php?group_id=1025&sampleid=397"> Binding for JAXB Code Generations of uddiv2.xsd<br /></a><br /><br /><br />The customization above handles the issue of duplicate class names. which results in the error reported.<br /><strong>Note: </strong>You need to include the above customization while generating the JAXB classes. <br /><br />Anonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0tag:blogger.com,1999:blog-6660864.post-1080027098536620192004-03-22T23:31:00.000-08:002007-09-30T07:22:47.221-07:00My New BlogAnonymoushttp://www.blogger.com/profile/12601360127220344294noreply@blogger.com0