Tuesday, July 14, 2009

Installing Eclipse Galileo on Ubuntu 9.04

Download Eclipse Classic SDK. Untar the package. Run eclipse.
wget http://d2u376ub0heus3.cloudfront.net/galileo/eclipse-SDK-3.5-linux-gtk.tar.gz
tar -zxvf eclipse-SDK-3.5-linux-gtk.tar.gz
cd eclipse
eclipse &

Some projects like Android are large enough that Eclipse's Java VM sometimes runs out of memory while compiling them. So we make a startup script for eclipse with command line parameters for increased Java heap size. Create a new file ~/bin/eclipse, and in that file, put:
#/usr/bin/bash
`~/bin/packages/eclipse3.5/eclipse -vmargs -Xms128M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=512M &> /dev/null` &

Lastly, make the file executable:
chmod u+x ~/bin/eclipse

Tuesday, June 30, 2009

Running Ubuntu 9.04 kernel on QEMU

Install QEMU
Download QEMU
Extract the package, build and install it.
cd qemu-0.10.5
./configure
make
make install

Build BusyBox
Download it here.
make defconfig
make menuconfig
make
make CONFIG_PREFIX=$bb_install_path install
In menuconfig goto 'Build Options' and set 'Build BusyBox as a static binary'.

Create rootfs image for QEMU
Create file image for rootfs.
Make ext2 filesystem.
Mount image to populate.
Copy BusyBox into mounted filesystem image
dd if=/dev/zero of=rootfs.img bs=1k count=100k
mke2fs -F -m 0 rootfs.img -t ext2
mount rootfs.img /mnt/qemu -t ext2 -o loop
rsync -a $bb_install_path /mnt/qemu

Then create the rootfs
cd /mnt/qemu
mkdir dev etc etc/init.d bin proc mnt tmp var var/shm
sudo chmod 755 . dev etc etc/init.d bin proc mnt tmp var var/shm

cd dev
sudo mknod tty c 5 0
sudo mknod console c 5 1
sudo chmod 666 tty console
sudo mknod tty0 c 4 0
sudo chmod 666 tty0
sudo mknod null c 1 3
sudo chmod 666 null

cd ../etc
echo "::sysinit:/etc/init.d/rcS" > inittab
echo "::askfirst:/bin/sh" >> inittab
sudo chmod 644 inittab

cd init.d
echo "mount -a" >> rcS
sudo chmod 744 rcS

cd ..
sudo echo "proc /proc proc defaults 0 0" >>fstab
sudo chmod 644 fstab

cd ~
sudo umount /mnt/qemu

Running the image on QEMU
You can find the vmlinuz image in /boot folder
Issue the command
qemu -kernel /boot/vmlinuz-2.6.28-11-generic -hda rootfs.img -append "root=/dev/sda"

Friday, June 19, 2009

Intel integrated graphics driver setting in Ubuntu 9.04

Activate UXA, use Option "AccelMethod" "UXA" in the Section "Device" in /etc/x11/xorg.conf
Section "Device"
Identifier "Configured Video Device"
Option "AccelMethod" "UXA"
EndSection
Logout and login for the changes to take effect. This setting gave a good video performance boost to my Ubuntu setup. The performance measured by 'glxgears' increased from 270 FPS to 560 FPS.

Tuesday, June 2, 2009

Mp3 Support in Amarok 2 on Ubuntu 9.04

Mp3 files were not playing in Amarok, even though they were playing on Rhythmbox and VLC. First I installed gstreamer0.10-plugins-ugly, but that did not solve the problem. Installing 'libxine1-ffmpeg' solved the problem.
sudo apt-get install libxine1-ffmpeg

Saturday, February 7, 2009

Installing Picasa on Ubuntu 8.10

The first instructions on Google's 'Command line configuration for APT' page are
Run this command as root:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
The problem I faced on Ubuntu is that you can't change user to root by using su - root. All you can do is prepend sudo in front of your commands. The above command calls gpg which makes modifications to files in /etc/apt folder. Even with sudo prepended to the wget command, I was getting the following error
gpg: no writable keyring found: eof
gpg: error reading `-': general error
gpg: import from `-' failed: general error

I didn't know how to use gpg. So I used a simple workaround. The wget command will modify three files in /etc/apt folder as well as create a new temporary file. So I modified the permissions of those files as well as the directory
cd /etc/apt
sudo chmod 777 trusted.gpg
sudo chmod 777 secring.gpg
sudo chmod 777 trustdb.gpg
sudo chmod 777 .

After changing the permissions you can run
sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
It will output OK to the shell. Now revert back the permissions on the files and folder
sudo chmod 644 trusted.gpg
sudo chmod 644 trustdb.gpg
sudo chmod 644 secring.gpg
sudo chmod 755 .

Next you can follow the instructions from Google's page as well as here. I have put these instructions for the sake of completeness, they are no different from the ones on Google.
Update apt-get
sudo apt-get update
Add the following rule to /etc/apt/sources.list, or if your distro has the /etc/apt/sources.list.d/ directory, add it to a file called google.list in that directory:
# Google software repository
deb http://dl.google.com/linux/deb/ stable non-free

Then use apt as usual.
sudo apt-get update
sudo apt-get install picasa

That was the workaround. Later on I found the solution. The wget command is piped to apt-key command. So the simple solution is to prepend sudo in front of apt-key command as well, and the whole command will succeed.
sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -