Amazon Links

Wednesday, February 16, 2011

Configuring Squid on Ubuntu 10.10

I recently upgraded my box to Ubuntu 10.10 and ran into problems with starting squid (Version 2.7.STABLE9-2ubuntu5).

I finally debugged and fixed the problem. The steps are as follows:-
  • Getting squid.conf right
The default user (and group) for running squid is 'squid'. This is not present in configuration.

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.

The changes to /etc/squid/squid.conf are listed below.
cache_effective_user squid cache_effective_group squid pid_filename /var/run/squid/squid.pid
  • Fixing the file permissions and create directories
We need to set the file permissions for squid configuration, log folders to squid:squid and also create the directory /var/run/squid
The shell commands are:-
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
  • Starting squid.
The squid on ubuntu 10.10 is triggered using service command. Start squid and check logs in /var/log/squid
sudo service squid start

You should see the squid running....

Squid: The Definitive GuideUbuntu 10.10 Essentials

Friday, April 11, 2008

Making your Project IDE Independent

Every wondered about getting to build your project within ide and still maintain an single build system.

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.
  1. Ant build would not coexist with ide incremental build support
  2. Dependency in ant cannot be imported into ide.
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

We have two important eclipse plugin for maven available :-
  1. Maven eclipse IDE plugin
  2. Eclipse Maven Plugin (Google Summer contest)

Maven IDE Plugin M2Eclipse

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

Google Maven Plugin. q4e

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.


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.

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.

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.


Maven plugins are available for major ides, so same can be repeated for other environments.
Try it your self and see the difference.

Saturday, December 15, 2007

Eclipse Bangalore Camp: Mylyn Presentation

I 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.

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.

I would recommended any one doing serious development in eclipse to look at mylyn. This can revolutionize the way you work !.

So friends, go and get plugged in ..

Sunday, November 25, 2007

Upgrading 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.

Today, i am sharing the iso image based upgrading, using my hard disk to upgrade. The steps for the upgrade are as follows:-

  1. Download the Ubuntu alternate CD
  2. i downloaded the ubuntu-7.10-alternate-i386.iso image

  3. Keep the iso on your unused partition

  4. 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.

  5. Back up all necessary data.

  6. Mount the iso image.

  7. I kept the iso image on my windows partitions and mounted the iso image from the same.

    >mount -o loop ubuntu-7.10-alternate-i386.iso /ubuntugutsy

  8. Run the cdromupgrade script from the mounted iso


  9. >sudo /ubuntugutsy/cdromupgrade

    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.



    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.

  10. Go through the upgrade and enjoy the new Ubuntu 7.10.

Wednesday, October 17, 2007

Using Tessarct-ocr with Ubuntu and Gutsy

In my previous posts, 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.


I would take this opportunity to talk about upcoming ubuntu 7.10 (Gutsy). I looked at the release notes for 7.10 Release candidate and I would like to point out few things I am waiting for:-



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 dual monitor at home, I have failed to use a projector with Ubuntu 7.06. Hopefully xrandr would change it.



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.



Tuesday, October 02, 2007

Ubuntu(7.04) and Eclipse.

Today, let us talk about eclipse 3.3 on Ubuntu. Being an Java Programmer, eclipse plays an important role in my life.


Installing Java

I have installed JDK 1.6 from the multiverse repository for Ubuntu 7.04 . The process involves downloading sun-java6-jdk package from the multiverse repository.


Installing eclipse

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.


All was not over, once i started with some serious memory hogging stuff using GMF 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 perm space. It seems some people have successfully resolved it my increasing perm size, but it didn't work for me.


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 update-alternatives 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.


Eclipse on Ubuntu gives me good performance, specially good behaviour in compiling large projects.

Sunday, September 30, 2007

Ubuntu Journey


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.

I recently bought brand new HP F2120 All-in-One printer. 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.
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.

I searched and found hplib package is required for this printer. I installed hplib using apt-get and it worked !

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.

Tuesday, September 04, 2007

Working in Ubuntu World

I have been around 15 days in Ubuntu, it means both kind of good and bad.

Good.
  • I connected my Canon Digital Camera, and i easily downloaded my photos, something i never did successfully earlier.
  • I am able to play most of the media files, quite a large improvement.
  • My eclipse ide works great on Ubuntu. I have to still figure out how to manage multiple java version.

Bad

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.

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.

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.

Wednesday, August 15, 2007

I finally decided to restart my Blog , today ;-) . The best think i can think about to talk today is the new Ubuntu 7.04 Desktop Edition.

I recently installed the Ubuntu, 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.

I have been following the redhat and fedora distributions for 7 yrs now.I feel Ubuntu is gone a long way in making my life simple. I am particularly impressed by:-
  • Boot time
  • Hardware support
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.

  1. Setup tmpfs on /tmp
  2. I have used it in Fedora also, this would help a lot.

  3. Install smBackup for system backup.

  4. change vm.swappiness value to 10
  5. i have a 2GB ram, i would be evaluating it before making it 0 ;-)

Screenshot of my new Ubuntu desktop

Thursday, May 06, 2004

I 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.

An good Tutorial on swing eventing is Lesson: Writing Event Listeners.
The important classes in this case are :-
  • EventListener
  • EventObject
The above classes are well explained in User defined Event Listeners Article. But the story doesn't end here,
the other eventing classes that i saw are the following:-
  • javax.swing.event.EventListenerList
  • java.util.EventListenerProxy



Now the important point is that both EventListerList and EventListenerProxy can play an important role in the implementation of the java based eventing solution.

So why are they not defined in java.util.* or say java.util.events.* ?

It seems a Generic Eventing Base has never been of importance to JDK Developers. (A possible project !!).


I leave you thinking for the same.

Tuesday, March 23, 2004

My First Blog on JAXB

Well processing the uddi v2 schema with JAXB is not straightforward.
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.

To overcome this problem, we need to customize the JAXB using Customization of JAXB Bindings.
See the Sample Code Nsure Uddi Project at Forge . Binding for JAXB Code Generations of uddiv2.xsd



The customization above handles the issue of duplicate class names. which results in the error reported.
Note: You need to include the above customization while generating the JAXB classes.