Thursday, August 30, 2012

Fullscreen YouTube in Chrome on Ubuntu

I have a dual monitor setup (Twinview) on Ubuntu 10.04 on Nvidia 550Ti. A few weeks ago, my YouTube video fullscreen mode started giving trouble. The full screen mode now tries to go to really full, trying to take up both the screen but only succeeding partially.

The full screen ends up taking one screen, and only shows half of the video and cuts out the other half. I was hoping that a driver update would fix it any day soon, but it never did.

Finally I had had enough and googled for a solution... and as expected, found that many others face the same challenge every day. Surprisingly, there is no good fix for this issue.

However, there is a semi-workaround. This chrome plugin (Multiple Monitor Full Screen) plays youtube video in full screen inside the browser. You can then maximize the browser to get to almost fullscreen... almost there.

Friday, August 10, 2012

Quest for a better programming font

This must be a recurring issue for Programmers...

Every time I find myself resetting / recreating a programming environment, I always have to change to a dark theme and struggle to find a good monospaced, antialiased font ( I am not sure if fonts themselves are antialiased as stored on disk, or are they massaged somewhere between the point they are on disk and before we see them on screen).

In my search, I even came across monospaced fonts which were not really monospace... Inconsolata is one of those (sample code snippet below where I have obscured non essential info)



However, I think I have found a font that works well...
The Bitstream Vera Sans Mono
http://www.dafont.com/bitstream-vera-mono.font

IDE designers... please include a default black background color theme.
I cant believe you all are using white background for your development (And if not, shame on you for giving us something you yourself don't use).

Monday, August 6, 2012

Audio Captchas

After a long histus, I went to LinkedIn, and was presented with the login page, which in addition to my credentials, also required me to fill in a Captcha.

I have seen many captchas, but this one has gone ridiculous. The text on at least one of the 2 words was completely unreadable, and despite refreshing 3-4 times, I could not feel confident I could pass the captcha test. Then came the moment of increased ridiculousness... I decided to try the audio captcha.

As the noise of the captcha started coming out from my speakers, I thought there was something wrong with my speakers - maybe a loose contact. I continued to believe this for the next 20 seconds or so... I hope this conveys what kind of audio noise the captcha made.

I found some measure of solace in the thought that my speakers are bad, rather than the other thought that they really expect me to find find English language words / alphabets in this soup and I am failing miserably. I am not sure if I will be able to detect a dog barking in that din. What if the captcha was "woof woof"?

The sound track can be described to be equivalent to being in a disco playing 4 loud tracks, all at the same time. Playing tracks you have never heard and now you are asked to decipher the lyrics of one of the songs. And you have to get it right the first time, because the thought of hearing it a second time is starting to give you a headache.

I am not trying to exaggerate... I could not confidently decipher a single word / alphabet of the audio captcha. I don't even know if it had words or alphabets. This is becoming ridiculous and needs a better solution.

Of course, I do understand why they want to make captchas difficult to solve by computers. But there has got to be a better way.


Thursday, August 2, 2012

Setting up a webserver with python server side

Time to install the lamp stack and mod_python on my Ubuntu 10.04 box...
Great news... its really easy. Just run...

sudo apt-get install tasksel
sudo tasksel install lamp-server


This installs apache2, mysql and php. It will ask you for the mysql root/admin password during the installation. So give it a password of your choice... this need not be your login password, but it can be same. Make it different to increase security.

Detailed instructions for setting up Apache, PHP and MySQL individually are given here... https://help.ubuntu.com/community/ApacheMySQLPHP


Once that is done, we now install mod_python into the apache2 web server and restart the server...

sudo apt-get install libapache2-mod-python
sudo service apache2 restart


Now, to create our own site by replacing the default site, we need to edit the apache2 configuration. (instructions from the above linked site)

To create a new site:
  1. Copy the default website as a starting point.
    • sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite 
  2. Edit the new configuration file in a text editor "sudo nano" on the command line or "gksudo gedit", for example: 
    • sudo gedit /etc/apache2/sites-available/mysite
  3. Change the DocumentRoot to point to the new location. For example, /home/user/public_html/
  4. Change the Directory directive, replace <Directory /var/www/> to <Directory /home/user/public_html/>
  5. Add python scripting support...
    •     <Directory /home/user/public_html/>
              Options Indexes FollowSymLinks MultiViews
              AllowOverride None
              Order allow,deny
              allow from all
              AddHandler mod_python .py
              PythonHandler mod_python.publisher
              PythonDebug On
          </Directory>
  6. You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites
  7. Save the file
  8. Restart apache
    • sudo service apache2 restart 
  9. Add a test python script into your new website
    • gedit /home/user/public_html/test.py



Wednesday, August 1, 2012

Building wxPython on Ubuntu pains

Tried installing wxPython from source... had a terrible time with the OpenGL libraries. Ofcourse, I cant do without OpenGL if we are to do any nice looking CS Experiments.

Ran into this error and banged my head against it many many times, until it took pity and gave way...


checking for -lGL... no
checking for -lMesaGL... no
configure: error: OpenGL libraries not available


The problem was that despite installing all kinds of OpenGL libraries, this error refused to go away.
After some more head banging, I found, that the /usr/lib/libGL.so was a sym link to nothing.

Deleteded the symlink and created a new one that pointed to an existing file.

sudo rm /usr/lib/libGL.so
sudo ln /usr/lib/libGL.so.295.59 /usr/lib/libGL.so

Problem solved for now...