Friday, July 31, 2009

Ubuntu from USB drive

I wanted to try out running Ubuntu from my USB drive (2GB). While I was searching for the right software, I came across UNetbootin utility. This utility is a lot simpler to use than the method provided in the Ubuntu site, a method that makes use of Win32 disk imager. The best part is, UNetbootin provides you options to create bootables from other operating systems like FreeBSD, NetBSD and other notable flavors of Linux.

UNetbootin is not an installable, its just one .exe file. You download the exe file and start it. It will prompt you for the version of OS you would like to burn in your USB. Once you select, it will automatically download the ISO image file and burn it for you. In case you happen to have the ISO image file available on your local hard drive, you can provide that path too.

Eclipse icons

Here is a complete list of icons that are used in Eclipse. It is very useful to understand all these icons as most of the time in the outline views only the icons are used to crisply denote what each member/method stands for.

Wednesday, July 29, 2009

Good JavaScript frameworks

This page provides you a list of top 5 JavaScript frameworks. Though I am not sure if they are the top 5, which is always arguable, I am very sure that those frameworks are good and useful.

Saturday, July 11, 2009

VirtualBox 3.0 freezes bug has been fixed

If you had been following my blog, I posted an issue earlier with VirtualBox 3.0 that under network load it freezes. That bug has been fixed in release 3.0.2. Please refer to the release notes of 3.0.2 for an update. I verified the fix by reinstalling the 3.0.2 version.

Troubleshooting network issues in VirtualBox

VirtualBox comes with built-in facility to trace the network packets. To enable tracing, you must first shutdown your VM. Then find out the VM's name or uuid. Please refer to my earlier post to find how to find uuid. Once you have the uuid of the VM, give the following command:

vboxmanage modifyvm a27473c0-d690-4c95-a48a-1c49d69a20e6
--nictrace1 on --nictracefile1 c:\temp\nictrace1.pcap

Replace my uuid with yours. I am enabling tracing on the NIC1. You will have to change the parameters appropriately if you would like to trace some other NIC. To make sure that your VM's tracing is enabled on the specified interface, give the following command:

vboxmanage showvminfo a27473c0-d690-4c95-a48a-1c49d69a20e6
VirtualBox Command Line Management Interface Version 2.2.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Name: Ubuntu8.10
Guest OS: Ubuntu
UUID: a27473c0-d690-4c95-a48a-1c49d69a20e6
Config file: C:\Documents and Settings\xxxx\.VirtualBox\Machines\Ubuntu8.10\Ubuntu8.10.xml
Memory size: 512MB
VRAM size: 12MB
Boot menu mode: message and menu
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
Hardw. virt.ext: on
Nested Paging: off
VT-x VPID: off
State: powered off (since 2009-07-11T18:45:41.000000000)
Monitor count: 1
3D Acceleration: off
Floppy: empty
SATA: disabled
IDE Controller: PIIX4
Primary master: D:\xxxx\VM\Ubuntu8.10-desktop-xVM\VDI\ubuntu-8.10-x86.vdi (UUID: 58a58064-e589-47c0-baba-de38fa62
1c80)
DVD: C:\PROGRA~1\Sun\XVMVIR~1\VBoxGuestAdditions.iso (UUID: 60b22ad4-50d1-4fb7-8097-862ce763df52)
NIC 1: MAC: 080027AC3BCE, Attachment: NAT, Cable connected: on,
Trace: on (file: c:\temp\nictrace1.pcap)
, Type: Am79C973, Reported speed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
UART 1: disabled
UART 2: disabled
Audio: enabled (Driver: DSOUND, Controller: AC97)
Clipboard Mode: Bidirectional
VRDP: disabled
USB: enabled


Once done, start your VM. The trace would be written to the file you have specified. You can use tcpdump or Wireshark to analyze the packets.

Make sure you disable the trace once you are done. Give the following command to disable tracing:
vboxmanage modifyvm a27473c0-d690-4c95-a48a-1c49d69a20e6 --nictrace1 off

The only limitation of using the trace facility is that you cannot turn on or off tracing while the VM is up and running. Thats a very serious thing if you run into some network issue in the middle of a session in your VM.

Thursday, July 09, 2009

Line color in PlotKit

I am experimenting with PlotKit tool. So far I am liking the simplicity of the library and the good documentation.

I was making use of the SweetCanvasRenderer to draw a line graph, as I was strictly following the quick start example. I wanted to draw two line graphs in the same canvas, each with different colors. But with the SweetCanvasRenderer it is not possible to change the line color, as it always overrides the strokeStyle property in the Context with white color. See the code below from SweetCanvas.js:
context.strokeStyle = Color.whiteColor().toRGBString();
If you would like to make use of SweetCanvasRenderer, still would like to have different colors for each of the lines, you will have to do it with little changes to the SweetCanvas.js file. Or you can consider making use of the BasicCanvasRenderer.

VirtualBox 3.0 freezes under network activity

*** Update on 07/11/2009 ***
The issue below has been marked as fixed. Refer to the release notes of 3.0.2 for a note on what has been fixed. I think now you can happily move back to VirtualBox 3.0 :-)

After installing the VirtualBox 3.0, I ran my Ubuntu under that. When I ran update manager, my VM kept freezing. I realized that not only with update manager, even with Firefox trying to download a huge file, the VirtualBox freezes. Looks like this a known issue and there is a bug artifact for this one. As of now, there is no fix available and there is no ETA as well when the fix will be available.

So I have happily reverted back to VirtualBox 2.2.4 version. I don't see that issue anymore.

Wednesday, July 08, 2009

Doing "View source" for JavaScript generated page

By JavaScript generated page I mean a page that is mostly constructed using JavaScript's document.write(...) statements. This is mostly the case when you make use of UI frameworks like YUI.

Recently one of my friends approached me to help him with trouble shooting a page which was developed using YUI. We spent some time trying to figure out how to view the source of the page that we were viewing. When we did a right click and "View source" in Firefox, all we saw was a bunch of JavaScript sources being included. Nothing more.

So here is how you can easily view the source. Install "Execute JS" plug in. Then load the page you would like to view source. Then you click on "Tools -> Open Execute JS". Then check the "Content Window" and choose the title of the window that you would like to view the source for. Now in the "JS-Code to execute", just type the following:
document.documentElement.innerHTML
Then click on "Execute". You will find the HTML Source of the page displayed in the bottom pane. Execute JS is pretty powerful that you can type any arbitrary expression and execute.

Hope that helps.

VT-x is not available error in VirtualBox 3.0

After installing the VirtualBox 3.0, when I started my Ubuntu VM, I got the error shown in the image on the right side.

The reason for this error is explained in this discussion thread. To recover from this error, follow these steps below:
  • Click on the OK button and come to the VirtualBox manager.
  • Click on the VM that threw this error and click on the System.
  • Click on the Processor tab and reduce the number of CPUs to 1.
  • Click on OK and save your changes.
  • Now start your VM by selecting it and clicking on Start button or just by double clicking on the VM.
Though the VirtualBox can support multiprocessor guest operating systems, to enable it you must have VT-x support from the underlying processor.

Tuesday, July 07, 2009

GMail is out of beta now

Hurray ... GMail is out of beta now. Read the official announcement in the Google blog.

VirtualBox 3.0 relased

VirtualBox 3.0 has been relased. You can download that from the product web site. I have upgraded and yet to try out my Ubuntu image in that.

Monday, July 06, 2009

bashreduce - a MapReduce system using command line tools

I came across this interesting reading in Linux Magazine about bashreduce. Sounds interesting. You will also find it useful to read about Richard Crowley's extensions to bashreduce.

KSplice - Thats what I had been looking for

The time has come to apply any critical kernel patches without rebooting the system. The tool that does this magic is called ksplice and shipped as a part of Ubuntu system (Jaunty). It would be a valuable part of any system that cannot afford to take a downtime. To learn more about ksplice, please read this Linux Magazine article.

Saturday, July 04, 2009

Why Python has both lists and tuples?

There is a FAQ entry that explains why Python has both list and tuple data types and what is the key difference between these two types.