Posts Tagged Linux

Ubuntu 9.04(Jaunty Jackalope)

As you all aware, ubuntu 9.04 has been release on last April. I’ve been delaying the upgrade for several weeks because of the exams, project, etc. Today, I decided to replaced my ubuntu 8.10 with the new version. There is also an upgrade option which will allow you to upgrade directly from 8.10, however I have some bad experience with upgrading. So, I decided to go for a fresh installation.

The installation was straight forward. The only major difference was that ext4 file system was available. I created a separate partition for my home directory, and used ext4 for that. So far, I can’t tell a real difference. The ext3 was working fine, I just installed ext4 to test it out. Ext4 didn’t give any problems yet, but not any advantages so far either. Installation process finished very quickly and the booting time has been improved (They have finally changed the usplash theme and the GDM theme).

Besides the booting time, the next major feature 9.04 adds is the new notification system. This replaces the gtk notification daemon. The new notifications looks really nice, however the spec doesn’t allow any actions for the notifications. This seems to be a problem because lot of applications are using notifications with actions. It wouldn’t be a big deal if notifications are just shown without the actions, but instead it shows a dialog box with buttons as actions.

I’m using two applications which use notifications with actions, emesene and mail-notification. Mail-notifications doesn’t have any option to remove actions in the configure box, however there is an option in the gconf settings. You can fire up the gnome configuration editor using “gconf-editor” and remove the actions from “/apps/mail-notification/popups/actions” key. Emesene uses a plugin called “LibNotify” for it’s notifications. The code for actions can be easily disabled by commentting relevant the code. Comment following lines(lines 231 – 240) in “plugins_base/LibNotify.py” using ‘#’ chars.

	#if execute == 'conversation':
	#    def on_notify_action(notification, action):
	#        self.controller.newConversation(None, data[0], data[1], True)
	#    notification.add_action('default', 'default', on_notify_action)

	#elif execute == 'mail':
	#    def openMail(notification, action):
	#        desktop.open(self.controller.hotmail.getLoginPage\
	#            (data[0], data[1], data[2]))
	#    notification.add_action('default', 'Open Mail', openMail)

Other than that, the dropbox daemon was not working initially. I manaully downloaded the propertiary daemon and extracted it to “~/.dropbox-dist”. However, even with that dropbox was not starting up properly at boot. It should start automatically with the nautilus – the extension was loaded properly but it wasn’t not spawning the deamon. I simply added the “~/.dropbox-dist/dropbox” to startup and that sloved the problem (Yes, I know that it’s not a good hack). I also installed “ubuntuone” which is very similiar to dropbox, but I haven’t played around it yet.

Tags: ,

Java Web Start in 64-bit Linux

If you are using 64-bit linux, you might have found out that jvm 64-bit version doesn’t have a java web start. (Update: Java Web Start is added to 64-bit package since the version 6u12) I don’t know any particular reasons for this, however jnlp files seem to be very simple. The jnlp file contains an url to a jar file, which we can download and run separately. I only tried this with topcoder arena – it works without any problems. Here is a python script for handling simple java web start files.

#!/usr/bin/env python

import xml.dom.minidom
from xml.dom.minidom import Node
import os,sys

if len(sys.argv) != 2 :
	print "Usage " + sys.argv[0] + " [jnlp file]"
	sys.exit()

doc = xml.dom.minidom.parse(sys.argv[1])

jnlp = doc.getElementsByTagName("jnlp")[0]
codebase = jnlp.getAttribute("codebase")

resources = jnlp.getElementsByTagName("resources")[0]
jar = resources.getElementsByTagName("jar")[0].getAttribute("href")

application = jnlp.getElementsByTagName("application-desc")[0]
main = application.getAttribute("main-class")
arguments = application.getElementsByTagName("argument")

cmd = ""

for a in arguments :
	cmd += " " + a.firstChild.data

filename = jar.split("/")[-1]

if not jar.startswith("http:") :
	jar = codebase + jar

os.system("wget -N "+jar)

os.system("java -jar " + filename + cmd)

Tags: , , ,

Nautilus Tabs

If you are a gnome user, you might have seen the TABs meme in gnome planet during GUADEC. Most of them are crazy mockups and if implemented totally useless(some are really funny). However, nautilus tabs is really useful and have been a long awaited feature. So today, I compiled the nautilus trunk and now I’m a happy user of nautilus tabs.

For ubuntu 8.04, I had to compile, libgnome-2.23.4, intltool-0.40, gnome-desktop-2.23.4 and eel-2.23.4 before compiling nautilus svn trunk(svn://svn.gnome.org/svn/nautilus/trunk).

Tags: ,

Live iso(distro) without burning & partitioning

“A picture is worth a thousand words” – how about a live experience? If you digg around the internet a little bit, you’ll find hundred of distros lying around. Just like the distro’s site, explains why they are unique, and provides screenshots, most of those comes with a live CD. You’ll get a nice iso image, burn it, run it, and install it if you like.

But it’s annoying to burn a CD for each distro you are going to try. One option is to use a USB drive. Unfortunately, my USB flash drive is USB1.0 but my motherboard only allows me to boot from USB2.0 devices. Another options is to copy the files into a new partition, and install grub/syslinux on that partition – but It’s not a good idea to mess around with partitions.

After experimenting a little bit with the ISOs and grub configuration, I manage to boot the distro, from the file resides in a sub directory of root.

Note : I used following commands in Ubuntu 8.10 – the file locations might be different based on your distribution.

Puppy Linux

Puppy Linux

Puppy linux is a light weighted, very small distro, yet contains most of the important applications for the daily use. In my opinion, this is a nicely designed great distro. My network card and video card worked without giving any trouble, but the sound card failed.

This distro is specially designed aiming towards portable users, who will run the distro in either a USB or a CD. Puppy linux uses squashfs compressed files to keep it’s root file system, and the init scripts are searching for these files in all hard drives, cdroms, and usb drives. So the installation is really easy.

1. Download the image, and mount it to a directory.

sudo mount -o loop puppy-linux.iso /media/cdrom

2. Create a directory in your root partition and copy the files from iso.

sudo mkdir /puppy
sudo cp -r /media/cdrom/* /puppy/

3. Modify your grub config file(/boot/grub/menu.lst) pointing to the puppy kernel and initrd file. Here is the menu entry I added, you’ll have to change the root according to your disk configuration.

title		Puppy Linux
root		(hd0,0)
kernel		/puppy/vmlinuz
initrd		/puppy/initrd.gz
quiet

That’s it – you can reboot the computer, select Puppy Linux from grub and boot.

Good OS – gOS

gOS gOS

gOS is a distribution based on ubuntu designed for web 2.0 internet users (Latest version specially aims toward myspace users). I can’t really see a practicle advantage of using gOS, despite the fact that theming and dock is superb. Other than that, it’s just firefox bookmarks on desktop(dock).

The gOS root file system is also packed in a squashfs file, but the init scripts are different. So, the installation is bit tricky.

1. Mount the gOS image.

sudo mount -o loop gos-space.iso /media/cdrom

2. Then you’ll need the squashfs file, kernel and the initrd file.

sudo mkdir /gos
sudo cp /media/cdrom/casper/filesystem.squashfs /gos
sudo cp /media/cdrom/casper/vmlinuz /gos
sudo cp /media/cdrom/casper/initrd.gz /gos

(Note : You can also extract the squashfs file and make the process simpler, but that’ll require much more free space.)

3. When we do changes in the OS, we need those to be persistence. So, I choose to save changes on a file. Following commands will create a 500MB file, and format it as a ext3 drive.

sudo dd if=/dev/zero bs=1048576 count=500 of=/gos/filesystem.ext3
sudo mkfs.ext3 /gos/filesystem.ext3

4. Now we need to configure the init scripts to use our files for root file system. So, first extract the initrd file.

cd /tmp
cp /gos/initrd.gz ./
gunzip initrd.gz
mkdir content; cd content
cpio -i < ../initrd

Now you have the initramfs on /tmp/content

5. We need loop, squashfs, and unionfs drivers. Edit the "conf/modules" file and append following.

squashfs
loop
unionfs

6. The default init script will get the "root" kernel parameter and mount it as "/root" in initramfs. We need a script to remount our files. Create a file called gos in scripts/init-bottom and paste the following content. (gedit scripts/init-bottom/gos)

#!/bin/sh -e
# initramfs premount script for gos

PREREQ=""

# Output pre-requisites
prereqs()
{
	echo "$PREREQ"
}

case "$1" in
    prereqs)
	prereqs
	exit 0
	;;
esac

mkdir /realroot
mount --move ${rootmnt} /realroot
mkdir /sqroot
mount -o loop /realroot/gos/filesystem.squashfs /sqroot
mkdir /extroot
mount -o loop /realroot/gos/filesystem.ext3 /extroot
mount -t unionfs -o dirs=/extroot:/sqroot none ${rootmnt}

Make the file executable.

chmod a+x scripts/init-bottom/gos

7. Create a new initrd file, and replace the old file.

cd /tmp/content
find . | cpio --quiet --dereference -o -H newc | gzip > ../initrd.gz
cp /tmp/initrd.gz /gos/initrd.gz

8. Edit your grub config file(/boot/grub/menu.lst) to boot from it. You'll need to change the devices according to your disk configuration.

title		gOS
root		(hd0,0)
kernel		/gos/vmlinuz root=/dev/sda1 rw quiet single
initrd		/gos/initrd.gz
quiet

First time we have to boot in the single user mode and configure the system.

9. Before rebooting, we need to create a fstab. To do that, we have to mount our ext3 filesystem.

mkdir /tmp/gos
sudo mount -o loop /gos/filesystem.ext3 /tmp/gos
sudo mkdir /tmp/gos/etc

10. Copy the following content into /tmp/etc/fstab. (/dev/sda5 should be your swap partition - check your /etc/fstab)

unionfs	/	unionfs rw 0 0
tmpfs	/tmp tmpfs nosuid,nodev 0 0
/dev/sda5	none            swap    sw              0       0

11. Now reboot your computer and select "gOS" from grub. It'll boot into single user mode(called maintenance mode in ubuntu). Once you get into shell, create a user, and configure your X. There are two nice wizards, you can just follow those.

user-setup
dpkg-reconfigure xserver-xorg

12. Reboot back to your main OS and edit the grub - simply remove the "single" parameter. (You can also mount the root partition within the gOS single user mode, and change grub)

title		gOS
root		(hd0,0)
kernel		/gos/vmlinuz root=/dev/sda1 rw quiet
initrd		/gos/initrd.gz
quiet

Now, reboot and enjoy. This process is obviously bit long, and not perfect. So, if you are going to keep using that distro, I recommend you install it on a separate partition.

Tags: , , ,

Freedom of choice…

Every human has four endowments – self awareness, conscience, independent will and creative imagination. These give us the ultimate human freedom… The power to choose, to respond, to change.” – Stephen R. Covey

Here is a list of choices I made :

Operating System : Linux

There are lot of reasons why you should use linux : easy access to software, no viruses/adware, fast, possibility of configuring every bit. There is also a long list reasons why you shouldn’t run linux, which I don’t agree with most of them, except some great Windows only(may be Mac supported) software like Photoshop; and few drivers.

Desktop : GNOME
Simple elegant interface. Pretty stable.

Gnome Desktop

Window Manager : compiz (compiz-fusion)
Rather than the cool 3D effects, there are some really useful plugins in compiz. For example : Expo, Scale.

Expo Plugin Scale Plugin

Web Browser : Firefox 2
Firefox 3 has some great fixes on critical bugs like memory leaks, but there is one flaw. Some of the plugins I’m using are not available/stable for Firefox 3. So, I’ll stick to Firefox 2 for few more months.

Mail Client : Thunderbird
I’m not a heavy user of the desktop mail clients. I only use thunderbird for one of my mail accounts. There is no specific reason I’m choosing thunderbird over evolution, just like the interface.

IM : piding / emesene
Pidgin is one of the best multi protocol IM clients available in linux(kopete is also nice). Depicts the fact it supports many protocols, that’s only basic features. Most of my friends are using MSN network, and emesene is capable of handling those, and thousand times better than the crappy aMSN interface.

VOIP : Skype
Just one word : clear

IRC : xchat
Nice interface.

File Transfer (ftp/sftp) : Filezilla/GVFS
If I’m using a separate client for file transfer, that would definitely filezilla, but it’s much easier to mount the shares directly using GVFS and use it like a local directory.

Word Processing : abiword
It’s a light weighted, really fast word processor. Even though it’s light weighted, all necessary features are there.

Graphics : Adobe Photoshop
Yes, Adobe Photoshop, that’s the best I’ve ever seen. I never got along with gimp. Anyhow, I rarely mess with graphical stuff, yet I still miss Photoshop.

Text Editor/IDE : gedit
Simple, clean interface and have syntax highlighting. I can survive without an integrated debugger.

GEdit

Video Player : mplayer/vlc
Those will play almost anything.

Audio player : banshee
Banshee has a nice audio library management features. Similar artists + cover info rocks.
Worth mentioning : one of the best media library management softwares I’ve seen is Windows Media player.

Twitter Client : twitux
Very stable, with many features. twhirl is stunning, but adobe AIR still doesn’t support tray icons on linux.

File Sharing : bittorrent
The content is reliable – well you have to read the comments.

Torrent client : azureus
Many features + plugins. I’m using the webui plugin, with auto start init script. (If you are curious, there is a azureus command line option : –ui=console)

Email Service : gmail / Google apps
It’s the cool ajax interface. The usage of conversations instead of individual mails is also remarkable. I’m using google apps to handle my gunathilake.com domain.

RSS Reader : Google Reader
Easy to use. Rather than a desktop RSS client, I can access it from anywhere. When I’m at somewhere with an internet connection killing time, I always have something to do. The sharing feature is handy too.

Photo sharing : Picasa
It’s the desktop application – It’s easier to upload.

Blogging platform : wordpress
Wordpress is a solid, easy to use platform. From a developers point of view, it’s internal structure is amazing.

Bookmarking : foxmarks
I tried to use social bookmarking sites like del.icio.us. But I don’t bookmark much, so I just use the firefox builtin bookmarking. I don’t want to experience losing my bookmarks again, that’s why I’m using foxmarks.

Web Developer plugins : firebug / web developer toolbar
Just check the plugins – you’ll see.

Virtualization : VirtualBox
I’m using VirtualBox to access IE to test sites. VirtualBox has nice integration features like free mouse.

VirtualBox

What I read
Except reading my friends blogs, here are few feeds from my RSS reader.

  • Techcrunch – I believe they have spies all over the world. Anything related to startups, it’s over there. Easy to keep track of what’s happening on the internet.
  • Linux today – Everything related to linux/open source
  • Gnome planet – Some nice content over there, related to gnome.
  • ReadWriteWeb – This is like techcrunch. Techcrunch gives you more news, this will give you analysis/comparisons.
  • Smashing Magazine – A source to get inspired – collections of creative work all over the internet.

Tags: , , ,

Get Adobe Flash playerPlugin by wpburn.com wordpress themes