Tuesday, November 6, 2012

Synergy problems

If you are using Synergy server on Windows 7, and the clients connect to the server properly, but the mouse refuses to move to the client window without any apparent reasons, the Scroll Lock key might be ON.

Turn it off and synergy will start working again.


Monday, October 8, 2012

Ubuntu: Sony laptops reboot on suspend

Does your Sony laptop reboot when you try to wake it from suspend sleep mode?
Are you running Ubuntu 12.04? Then this probably solves your issue... the catch is that it will cost you one more reboot.

Here goes
1. Edit the /etc/default/grub file.
sudo gedit /etc/default/grub
   
2. Find the line which says
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and change it to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_sleep=nonvs"

and save and close.

3. Update grub
sudo update-grub

This will take effect on next reboot. Enjoy.

Saturday, September 22, 2012

Network painfully slow on Ubuntu

If you are suddenly seeing a painfully slow network connection on Ubuntu, with lots of dropped packets, chances are that you recently upgraded the kernel and restarted the computer to use that kernel.

In my case, the problem was a bad ethernet Realtek driver, which was included with  (or chosen by) the new kernel(r8169). The solution is to patch the kernel to use the correct driver (r8168), which is free from this issue.

The steps to fix this issue are simple... ( source - this page )
  1. Download the Linux driver from here.
  2. Extract it somewhere.
  3. Run "sudo ./autorun.sh"
Enjoy the fast speed...

Monday, September 17, 2012

Playing with Phong shading

While going through an example in the OpenGL SuperBible 5, I came across the Phong lighting model. Its  one of the tricks which helps create those amazing 3D pictures.

Looking closer at the equations, I found that a bug in the specular lighting calculations, which is reported here... https://code.google.com/p/oglsuperbible5/issues/detail?id=47

Here is what a phong shaded sphere looks like...


Now, its time to play with the fragment shader a bit... added some trigonometric beauty (  cos(600*x)*exp(-pow(20*x, 2.0)) ) to the reflection point...

Math is fun.

Tuesday, September 11, 2012

Eclipse theme on Ubuntu

Changing the look and feel of Eclipse on Ubuntu 10.04...

Problems:
1. Eclipse defaults to a white background. We need themes.
2. It has unbelievably large tabs on the top... are they taking some tips from the IE behemoth? No... its just does not play well with Linux.

Solutions:
1. Open Help -> Eclipse Marketplace. Search for "theme" and install Eclipse Color Theme. Once installed and restarted, go to Window -> Preferences -> Appearance -> Color theme.... pick a color theme you like and rejoice.

2. On the terminal, say "gedit ~/.gtkrc-2.0" and in the resulting window, type....


style "compact-toolbar"
{
GtkToolbar::internal-padding = 0
xthickness = 1
ythickness = 1
}

style "compact-button"
{
xthickness = 0
ythickness = 0
}

class "GtkToolbar"   style "compact-toolbar"
widget_class "*<GtkToolbar>*<GtkButton>" style "compact-button"

Save and restart Eclipse. The tabs should now be smaller. You are welcome.

Thursday, September 6, 2012

MP3 tag editor


If you are like me and listen to audio books, chances are that the random ordering of the chapters / sections must have driven you mad at some point of time.

The audio books I have usually have their order specified clearly in their filenames. Of course, this ordering info has been irritatingly left out of the id3 tag.

Because of this, iTunes does a lousy job or ordering the items when they are added to the library. And it lacks a good way to edit the tags. I wished Steve Jobs had listened to audio books and faced this problem. He would have got it fixed.

However, I found this extremely useful id3 tag editor which allows me to edit the tags of many files at once. It allows me to derive the id3 track name from the file name in an intuitive and user friendly GUI. And its free... http://www.mp3tag.de/en/

You can also change the file names from the tag, or even from the filename itself. It doesn't get better than this.

Ubuntu 10.04 VirtualBox USB woes

I was setting up a Windows 7 64bit guest OS on a Ubuntu 10.04 host, just for running iTunes. I needed to get some audio books into the ipod. Of course, no USB devices showed up when Windows finally booted, displaying the message "no usb devices connected". I dont understand how it can say that so confidently, specially since I am sitting right here and looking at the ipod connected to the computer. Even Ubuntu sees that its connected. I suggest that the message be changed to "no usb devices identified"... or something similar... something which is not a blatant lie.

On google searching, I found that I needed to add my username to the vboxusers group. Can someone make that a default option when VirtualBox installs? I restarted VBox and Ubuntu. USB still does not work.

After another google search, I found that I needed to add my username to the lp group as well. Additionally, make sure you have the VBox downloaded from Oracle and not the one that comes with Ubuntu. The Ubuntu bundled VBox apparently does not have USB support. Mine was already downloaded from Oracle.

After this, USB works.... yayy.

Steps to get USB to work in VirtualBox...
1. Make sure you have installed VBox downloaded from Oracle.
2. Also install guest additions and extension pack. The extension pack is separately downloaded from the VirtualBox website.
3. Now, add your username to the groups vboxusers and lp. This is done in Top menu -> System -> Administration -> Users and groups -> Manage Groups -> Properties (for vboxusers and lp).
4. Restart computer. You might get away by restarting only VBox...

Enjoy