Saturday, March 7, 2009

Failure with boosting HDD performance

Today I've read an article at tuxradar.com with some Linux tips. In this article it is recommended to boots the performance of HDD. It is suggested to set options for root to defaults,relatime,data=writeback in /etc/fstab
So I did. Then rebooted and.. guess what? My Mandriva One 2009 failed to boot. Luckily this was not my first boot failure (and I guess not the last :D ). So, I had a SystemRescueCd an some live CDs at hand.
First of all I've checked man for mount to get some info about relatime and data=writeback options. There is nothing special with former, but the latter is not so easy to use. Changing default value requires passing additional kernel boot parameter. E.g. rootflags=data=journal. So modified the kernel row in my GRUB configuration file. But Mandriva still failed to boot. Then on some mailing list I've found that rootflags should go directly after root option. This did not helped either.
So, I changed all settings to original state. No faster HDD operations for me. At least for now...

P.S. Just curious whether guys at tuxradar.com actually try to apply theirs tricks themselves before urging others to do so.

Friday, February 20, 2009

Disabling Automounting HDD Aartitions in GNOME

I have a multiple Linux distros installed on my PC. And each of them has its own /boot partition. The most used Linux is Mandriva 2009.
It seems to me that things went wrong after I played a bit with gparted in Mandriva, but I'm not 100% sure. Anyway for unknown reason GNOME started mounting all partitions on the hard drive on my login.
Not only this slows down the login time. This is also really annoying. In a Linux world when you like OS to mount some partition you simply edit /etc/fstab. And when the Linux is messing you up it starts to stink like Windows...
The core problem is for sure in user settings in GNOME because it neither happens for other users nor for other desktop environments.
Playing with a GNOME Configuration Editor did not helped :(
I even started to consider to switch desktop environment to xfce. But after some more googling and reading man pages for fstab and mount I finally found the solution.
I simply added a following line for each partition I like to be not mounted:
/dev/sda2 /mnt/sda2 ext3 noauto,nouser 0 0
And it works! :)

Sunday, January 25, 2009

Making a microphone louder

Recently I've installed Mandriva 2009 on my aged desktop machine. And there (in Gnome) was a problem with microphone in Skype 2.0.0.72. In fact the microphone was very-very quiet.
The solution was easy: I've installed gnome-alsamixer, run it and checked "Mic Boost (+20bD)" option.

Saturday, November 1, 2008

Printing from Java with CUPS 1.3+

I had a problem with printing from the Java application on my Fedora 9. The problem was quite strange and reproducible on both Java 1.5. and 1.6. It was even more strange because it appeared only after I've updated my Fedora to version 9.
It turned out that the problem was on the level where Java meets CUPS 1.3+. There is a corresponding Sun's bug. There is no such problem for CUPS version lover than 1.3. It looks like Java had made too many assumption how CUPS should work... and CUPS guys changed some things in 1.3.
As always Google came with help and the solution was found.

Friday, October 31, 2008

Java 1.4 on Fedora 9

Recently I needed to work on a legacy Swing project written on Java 1.4. So, I've installed 1.4 JDK on my Fedora 9 and... got a following error:
/usr/java/j2sdk1.4.2_16/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory occurred
A little googling brought me to the Oracle forum post. The problem was that AWT requires the libXp package. After I've installed it the problem vanished :)

Friday, May 30, 2008

Java 1.6 on Mac... at last!

It is here. After 1.5 years. Java 1.6 on Mac. But... it is only for the Leopard and only for 64-bit Intel machines.
PPC, 32-bit Intel and Tiger folks are currently still out of the board.
There are two interesting facts regarding this Apple's release.
  1. It was not announced on Apple Developer Connection Java topics RSS. In fact that feed is useless. I'm still receiving here a bunches of 3 identical notifications about release notes for Java on Mac 10.5. The date when this document was published is 2007-10-31. Yeah, after 6 month Apple still reminds me (and the other subscribers of that feed) about such "news".
  2. Almost month passed since Java 1.6 on Mac release. And there is complete silence about this event on the Desktop community on java.net. This is rather strange - there was a lot of complains about long absence of this release (e.g. here and here).
Anyway, it's good it is here.

Wednesday, May 7, 2008

Running TestNG on NetBeans 6.0

TestNG is a great testing framework. And it's much more powerful than JUnit.
The problem for NetBeans 6.0 users is that there is no plugin for TestNG. I've spend a lot of time before I managed to run TestNG in a simple way. After some time I've figured out that the main obstacle is that NetBeans does not recognizes TestNG classes as test classes. And this was the key to success.
I've successfully run the tests using its command line and NetBeans Run feature. And it was done on the NetBeans Java SE bundle (the simplest one).
So, here are the simple steps to launch TaestNG on NetBeans:
  1. Project Properties -> Libraries. Compile-time libraries must contain testng-XXX.jar (where XXX is your TestNG version). Also Run-time libraries must contain the path to your compiled tests (if you put your test to default test directory, than the path to compiled tests should be build/test/classes).
  2. Create TestNG xml file(s). There are instructions how to build such file in the framework site. E.g. create testng.xml and put it in the project root.
  3. Project Properties -> Run. Create new configuration. You may name is testNG ;) Enter org.testng.TestNG as the Main Class. Put your TestNG xml file(s) as Arguments. Multiple xml files should be separated by space. Enter your project directory as Working Directory.
Congratulations! Now you can run your TestNG tests through NetBeans Run feature.

P.S. Even if there will be only one person on Earth who saves a few hours this post worth its writing.