Video appears BLUE after upgrading to Karmic Koala?

I suppose that this only happens with NVIDIA cards. Yesterday I just upgraded to Karmic Koala and today I discovered that even though everything seemed normal, video playback appears in false color and in a shade of blue, like this:

john-locke-false-color.png

I tried to play with the NVIDIA X-Server Settings and I discovered that the Hue parameter under X Server XVideo Settings had a value close to -1000, instead of 0 which is the normal:

x-server-settings.png

If you click the Reset Hardware Settings button all values return to the default (0) and your video will appear in true color again:

john-lock-true-color.png

To open  the NVIDIA X-Server Settings go to: System → Administration → NVIDIA X-Server Settings.

Certainly this is rather a work-around than a solution, but it allows you to watch video until a bug fix is released.

Posted in Uncategorized | 1 Comment

Oracle: Select top rows from an ordered result set

Oracle provides the ROWNUM pseudo-column to allow someone limit up the number of returned rows in a SELECT statement. However, you should be cautious when using ROWNUM in combination with an ORDER BY clause.

For example, consider the following table:

ColumnName
30
40
50
60
70
80
90

We can easily select the first three (unordered) rows, like this:

SELECT * FROM TableName WHERE ROWNUM <= 3;

ColumnName
30
40
50

Or we can even select the entire data set in descending order, like this:

SELECT * FROM TableName ORDER BY ColumnName DESC;

ColumnName
90
80
70
60
50
40
30

But, how about selecting the three highest values? A common pitfall is trying something like this one:

SELECT * FROM TableName WHERE ROWNUM <= 3 ORDER BY ColumnName DESC;

But this will falsely and not surprisingly return this result this:

ColumnName
50
40
30

What did go wrong? The answer is simple. At first, Oracle select the first three rows from the table in their natural order of occurance. They happen to be 30, 40 and 50. Then, Oracle sorts up the result set and returns it.

Intuitively, someone would think that the sorting and the row limit should occur in the reverse order, and that’s correct. This is the proper way to do it:

SELECT * FROM (SELECT * FROM TableName ORDER BY ColumnName) WHERE ROWNUM <= 3;

ColumnName
90
80
70

In general, when you have an ordered result set, and you want to select only the first N rows of it, this is the syntax you should use:

SELECT * FROM (SELECT * FROM … ORDER BY …) WHERE ROWNUM <= N;

Posted in Uncategorized | 8 Comments

Ubuntu: Google Earth Error code: 29

Are you getting this error after Google Earth’s splash screen?

google-earth-error.png

The you are possibly on a freshly installed 64-bit system and you haven’t yet installed the lib32nss-mdns package. Run this command:

sudo apt-get install lib32nss-mdns

and then try to run Google Earth again, should be working now.

Posted in Uncategorized | Leave a comment

VirtualBox: How to change the UUID of Virtual Disk (vdi)

Copying the image of Virtual Disk (.vdi file) is a convenient way to duplicate the disk, in cases you want to avoid re-installing an operating system from scratch.

However, simply copying the .vdi file into another location will make a verbatim copy of the virtual disk, including the UUID of the disk. If you try to add the copy in the Virtual Media Manager, you will get an error like this:

virtualbox-error.png

In this case, you have to do the following:

giannis@giannis-laptop:~$ VBoxManage internalcommands setvdiuuid /path/to/virtualdisk.vdi
VirtualBox Command Line Management Interface Version 2.2.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

UUID changed to: 9e89fe14-d010-469e-a737-cd65218c4acb

Since the old UUID is replaced with a new one, you can now add and use the virtual disk.

Please note, that you wouldn’t have to follow this procedure if you had used the clonevdi function to copy the virtual disk image, in the first place. The clonevdi function makes sure that the new disk image will have its own unique UUID.

The syntax of the clonedvi goes like this:

$ VBoxManage clonevdi Master.vdi Clone.vdi

Posted in Uncategorized | 26 Comments

Ubuntu: Firefox opens without window decoration

If your Firefox suddenly starts to open without window decoration, run this command:

gedit `find ~/.mozilla -name localstore.rdf`

Try to locate the part of the file that looks like this:

<RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
width="1280"
height="1024"
screenX="0"
screenY="0"
sizemode="maximized" />

The order and values may vary in your computer but that does not matter.

Now go ahead and completely erase either the width or the height line. Like this:

<RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
width="1280"
screenX="0"
screenY="0"
sizemode="maximized" />

Then save the file. The problem should be fixed now.

Posted in Uncategorized | Leave a comment

How to enable Hibernate in Windows XP

Hibernate option is not available by default in Windows XP. Follow this instructions to make Hibernate option available in your Turn Off Computer dialog.

Please note that in order to use Hibernate,  the S4 System State (Hibernation) must be supported by your computer’s ACPI implementation, othewise you cannot do anything about it.

Go to Start → Settings → Control Panel. Make sure to open the Classic View, and open Power Options:

control-panel.jpg

When the Power Options Properties dialog appears, check if there is a tab labeled Hibernate. It should be the last one:

power-options.jpg

If you are not able to see the Hibernate tab, then Hibernation is probably not supported in your computer…

On the other hand, if you have a Hibernate tab, that’s good news. Open the Hibernate tab and make sure to check the Enable Hibernation checkbox:

hibernate-tab.jpg

Click the Apply or OK button to make the changes take effect.

Now, the next time you want hibernate, in the Turn Off Computer dialog, press and hold down the Shift Key. The Stand By option will change to Hibernate whilst you hold the Shift Key pressed:

standby-hibernate.gif

With the Shift Key down click on Hibernate.

Posted in Uncategorized | 47 Comments

Private: Firefox scrolling sucks in Gmail on Ubuntu but works like a charm in XP

They say a picture is worth a thousand words, and maybe a short video clip is worth a thousand pictures… Anyway, just watch this video and let the pictures speak for themselves… :-)

“This video demonstrates the inability of Firefox to offer a smooth scrolling in the Gmail page when having open chat box attached to the main page. In the video we can see that even when I stop moving the mouse wheel Firefox keeps trying to catch up with the overwhelming amount of unhandled events. Sometimes GNOME detects Firefox as “not responding” and the windows gets gray. In the second half, we can see tha same page with the same chat boxes open only this time we run Firefox under Windows XP, which in turn run within VirtualBox, not even on real hardware. We can see that in Windows XP Firefox handles the mouse wheel events in a blink of an eye and never gets late. This is not fresh news. I have noticed this behavior since version 6.10 of Ubuntu, when I started using Ubuntu as an every-day OS. The computer is Core2 at 2.8GHz with 4 gigs of RAM running 64-bit of Ubuntu 8.10. I hope to see this fixed in the near future. It is *really* annoying.”

Posted in Uncategorized | 4 Comments

Ubuntu: pressing PrtScn takes too long to take screenshot.

If lately you have been experiencing a short delay when trying to take screenshots by pressing the Print Screen button (PrtScn), it’s most likely because of a delay setting in the screenshot accessory.

Go to Application → Accessories→ Take Screenshot. You should get this window:

take-screenshot.png

Change the delay setting to 0. You should have to take a dummy screenshot for the change to take effect. After you do that, when you press the PrintScreen button you will be getting screenshots without the delay.

Posted in Uncategorized | Leave a comment

How to "unlock" a secured PDF file

This is article describes how to “unlock” a secured PDF file, and gain full access to print it, modify it, and copy selected portions of text from it, without paying anything to buy any of this (so called) “pdf cracking software”.

You are going to need the help of the Evince Document Viewer that comes with Ubuntu Linux. If you are already using Ubuntu Linux, good for you! If you are not using it, you can ask a friend of yours with Ubuntu installed to help you. Otherwise, you can dive in deep water and try the Live CD that will do the job for you (no installation required).

A “secured” PDF file will look like this if you open it in Adobe Reader:

midsun.png

Boot in your Ubuntu Linux (or boot from the Live CD if you don’t want Ubuntu Linux installed). Open your locked PDF from Ubuntu using the standard document viewer, Evince. From the menu go to File → Print… From the printers list select Print to File:

midsun-print.png

Enter the output filename and make sure that you have selected PDF as Output Format. Click Print and you will get a verbatim copy of the original file, only this time it will be free of any restrictions. This is one more practical example that demonstrates how Ubuntu Linux can significantly improve your life…

Posted in Uncategorized | 52 Comments

VirtualBox does not send Control key events to guest OS.

Now that’s a strange one.

This is the case: you run Windows XP as a guest operating system in VirtualBox in your Ubuntu box. However, VirtualBox refuses to send events for the Control key (for example, if you press Ctrl-N Windows XP will just receive ‘N’).

It is possible that the problem is caused by a feature of Ubuntu rather than a bug in VirtualBox. Specifically you have to make sure that you have unchecked the Show position of pointer when the Control key is pressed.

Go to System → Preferences → Mouse → General. Make it look like this:

locate-pointer.jpg

Showing the position of the pointer is neat feature but it seems that you have to live without it if you want Control key events to be passed in your VirtualBox guests…

Posted in Uncategorized | 12 Comments