linux


I wanted to use sun java with ubuntu instead of openjdk. So I installed the latest package sun-java6-jdk (or sun-java5-jdk). The java command /usr/bin/java still points to openjdk though. This is where update-alternatives comes in. This is a pretty slick solution to the problem where multiple packages provide the same command. Like the case I had.

I only had to run a couple commands
update-alternatives --display java
This command tells me what of the commands installed is the highest priority. If I want sun java to be the highest priority then I just need to make the number higher. In my case the number for openjdk was 1061. So then I just ran the following command.
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-6-sun/jre/bin/java 1100
After this I run:

$ java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)

Quick and elegant solution. What more can you ask for. Linux is amazing when you know what to do.

I’m always learning new neat commands on Linux.

Sometimes I’ve been logged into a machine and wondered what distro and/or version of a distro is running.

The command I found that does the trick is

lsb_release -a

This should work on most recent distros such as ubuntu, redhat, or suse.

I found out about a neat tool to track how much traffic has gone out on any network interface in linux.

Its called vnstat. See where I found out about it here

It is almost hard to convey how nice it is to have useful error messages. This can be the difference between spending hours tracking down a problem and being able to solve a problem in five minutes.

I was trying to get ruby on rails setup on a new machine that didn’t have it setup originally and got it working except it was continually running my app in webrick instead of lighttpd. So I manually run ./script/server lighttpd. After doing this I get the useful message:

=> Booting lighttpd (use ‘script/server webrick’ to force WEBrick)
PROBLEM: Lighttpd requires that the FCGI Ruby bindings are installed on the system

So to fix the problem I simply have to run: apt-get install libfcgi-ruby1.8

This is a great example of why ruby on rails is great. Useful error message make a huge difference when you’re trying to solve problems.

On the same note though they still have room for improvement. The path to ruby was incorrect in my dispatch.fcgi file and the error message displayed makes it look like there was a problem with fcgi somehow rather than the path to ruby being incorrect.

I upgraded my laptop from breezy to dapper today. The biggest problem was getting X to work the right way again with my dual screen setup. I had to download a newer version of the ATI driver and manually configure things using aticonfig then hand editing the xorg.conf file. The GUI wizard that ATI provides with their driver doesn’t seem to work anymore. I’m not sure if this is caused by xorg 7.0 or something else. I did get everything else back up now though and it seems to be working well. This is the amazing thing about debian based distros. You can do full version upgrades without too much trouble. Doing this type of thing in many other linux distros or something like Windows usually causes many problems. We’ll have to see if I run into any other problems over time though. Does anyone else have anything good or bad to say about dapper so far?

I decided to move the server back to apache from lighttpd. This was mainly due to having more RAM on the server now. The other reason is that everything relies on apache. You don’t really realize this until you move away from it. All the open source packages though just expect that you have apache functionality for things like auth. Without these features it requires hacking for almost everything you want to install. I didn’t really want to hack these apps anymore just to get them to run. So this is why I moved back to apache. So far it has been a really easy move due to the vhost module I was able to install with. Everything just seems to work and the performane is still good too.

I had to setup eclipse to use an http proxy today. This is relatively easy to setup other than that it must be setup in several areas for different components. i.e. cvs ssh has its own proxy configuration. There is also no non-proxy list like there normally is in other apps. This means for the situation that I’m in where internal cvs servers don’t use the proxy will currently force me to chane the settings every time I want to work on each different project.

There should be one single place to configure proxies within eclipse and other apps. This shoud be a global setting for all network connections within the app and there should also be a list of hosts that will not use the proxy. Firefox is doing this the right way and other apps should follow suit.

I had to chown user.user ~/.vmware to get vmware to even run.

It still reports the error:

/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)
Everything appears to work at least for now though. What is the cause of this error?