Friday 22 January 2010

FileInputStream input = new FileInputStream("/tmp/1.xml");
FileChannel channel = input.getChannel();

// Create a read-only CharBuffer on the file
ByteBuffer bbuf = channel.map(FileChannel.MapMode.READ_ONLY, 0, (int) channel.size());
CharBuffer cbuf = Charset.forName("UTF-8").newDecoder().decode(bbuf);

Tuesday 5 January 2010

vmware tools, ubuntu 9.10 minimal virtual machine

First:
sudo apt-get install build-essential linux-headers-`uname -r` gcc make

Follow: http://langui.sh/2009/10/05/ubuntu-9-10-in-vmware/

We use the virtual kernel package
cd /usr/src/
sudo dpkg -i --force-depends open-vm-modules-2.6.31-14-generic-pae_2009.07.22-179896-2+2.6.31-14.48_i386.deb

The steps above upgraded the kernel but the vmware tools is compiled for the older kernel. Follow
http://www.kunthar.com/blogs/kunthar.php/grub2-switching-boot-order

to do a default boot from the older