Monday, 30 October 2006

MythTV : How it flags commercial advertisements

MythTVMythTV is a Free Open Source digital video recorder project distributed under the terms of the GNU GPL. In a previous post, I had written about the features of MythTV and listed a number of MythTV sites which provide help in installing MythTV and configuring it to work on ones machine. MythTV is a GPLed software which allows one to watch TV on ones computer. It has capability to intelligently detect commercials in the TV programs and skip through them.

The result is an advertisement free program for your viewing pleasure. I have at times wondered about the technique used by MythTV to accurately detect the times when the ads come up and successfully skip them. It seems MythTV has a variety of tricks up its sleeves.

MythtvPVR - an unofficial site dedicated to MythTV personal video recorders has an interesting article which explains all the techniques used by MythTV to successfully flag all the commercial advertisements and skip through them to provide a non-interfering viewing of your favorite TV soaps.

Saturday, 28 October 2006

What is Free Software? - an interview with Richard M Stallman

In recent times, if you ask me to name one personality in the free software community who has been as much reviled as being adored, I would say it is Richard M Stallman - the father of GNU. He has been bashed in the media as much for his dedication towards furthering the cause of free software and his firm stand against DRM. I believe that if not for GNU and GPL, the Linux movement would have been a non-entity. It was GNU which provided the wings to Linux to soar up and meet the competition head on. In many ways GPL gave it the moral edge over the BSDs which are also released under a free license.

Recently Robin Good had the honor of putting up RMS at his apartment in Rome and he used this occasion to ask him a couple of questions regarding free software. And RMS was good enough to clarify his doubts. During the course of the interview, he asks the following question :

RG: To support those, who like me, favor change over the control exercised by large corporations and media, what are the type of actions that individuals can take?

Richard Stallman: I wish I knew.
This is the greatest political question of our time.
How can we put an end to the empire of the mega-corporations and restore democracy? If I knew I would be the savior of the world.
What I think I can tell is that the media are crucial.
The power of the corporate media enables truth to be suppressed and lies to be passed as truth.
You’ve probably heard that a half truth can be worse than a lie. A lot of the things that our government’s and media say are one-tenth truths, nine-tenths lies. And it doesn’t take many of them together to create a completely fictional world view...
So I recommend that people stop listening to the mainstream media. Don’t watch television news, don’t listen to news on the radio, don’t read news on ordinary newspapers. Get [your news] from a variety of web sites, which are not operated under the power of business money, and you have better chance of not being fooled by the systematic lies that they all tell, because they’re all being paid by the same people to tell the same lies. Or nine-tenths lies.
Read the rest of this interesting interview.

Thursday, 26 October 2006

A brief look at a couple of new features in Firefox 2.0

Firefox ver 2.0 was released a few days back and naturally it is loaded with a host of new features some of them prominent and many more rather subtle. I found this new version to be a huge improvement from the older 1.5.x version which is bundled with most Linux distributions. These are some of the new features in ver 2.0 of Firefox which I found really interesting.

New features in Firefox 2.0
A better theme - The new Firefox 2.0 theme and user interface has been subtly revamped to provide a better user experience. For example apart from the Bookmarks menu, you have got a History menu (previously named 'Go' menu) which lists not only the recently visited websites but also the recently closed tabs. You can also open your browsing history in a side bar using the 'Ctrl+H' hot key.

Built-in Phishing protection - Think of the last time you were confronted with an email supposedly from Paypal which provided a link which directed you to a seemingly valid webpage of paypal which was actually a spoof of the original page. This sort of social manipulations are popularly known as phishing attacks. Phishing is a form of identity theft that occurs when a malicious Web site impersonates a legitimate one in order to acquire sensitive information such as passwords, account details, or credit card numbers. Now Firefox has inbuilt phishing protection which provides a warning about the webpage you are visiting if it happens to be a known offender.

Fig: Firefox warns when you encounter a Phishing site

Enhanced search capabilities - One of the most convenient features of Firefox in my opinion is the search box at the upper right corner of the web browser. You type a search query in this box and press enter and your search results are displayed in the browser window. By default, it is set to Google search. But it also provides a drop down menu from which you can choose other search engines including Wikipedia and Websters Dictionary. In fact this search list is modifiable and Mozilla has a collection of diverse search sites which can be added to the search engine list. Of course, this is a feature which was available in previous versions of Firefox. What is new is that when you type in the search query, search term suggestions will automatically appear. There is also a revamped search engine manager which allows you to add, delete and re-order the search engines in the list.

Fig: Provides search term suggestions as you type in.

Improved tab browsing - This is one of the most visible, new feature in Firefox 2.0. Unlike earlier when all the tabs had a single close button positioned on the right hand corner, now you have a close button for each tab a.k.a Opera style which makes it easier to manage. All new windows are automatically opened in new tabs. Earlier when you had innumerable tabs opened at the same time, the tabs used to spill over beyond the viewing area and there was no easy way to manage the tabs. Not so this time. When the number of tabs increase, Firefox automatically makes available a navigator in the tab pane area on both sides which can be used to get to the non-visible tabs. But the one improvement which I like so much is the undo close tab functionality. This works as follows. Suppose you have closed a tab accidentally and you forgot the address of the webpage. In the new version of Firefox, it is a simple case of just right clicking on any tab and selecting the option "Undo Close Tab" and the tab which you accidentally closed will be opened with the prior website loaded.

Fig: Close button on each tab.

Resuming your browsing session - This is another feature which I find really useful. If at all your computer just rebooted while you were seriously checking out a couple of websites in Firefox maybe because of a power fluctuation or a surge (has happened to me a number of times), the next time you open Firefox, it will offer to resume the previous browsing session and you can continue from where you had left.

Previewing and subscribing to Web feeds - Prior to ver 2.0, even though there was a facility to subscribe to web feeds (RSS,Atom...), if you needed any further functionality, you had to depend on extensions. Now though, this feature has been significantly revamped. You can preview the web feed before you subscribe to it. What is more, you can opt to subscribe using Live feeds (default in Firefox) or any of the other web services that handles RSS feeds such as bloglines, Google reader, My Yahoo or one of your own.


Fig: Enhanced feeds subscription

Inline spell checking - Firefox 2.0 comes with inline spell checking functionality. What this means is that when you enter text in a form element such as a text area, Firefox underlines the mis-spelled words in real time. And the user need just place the mouse cursor on the highlighted word and right click to receive a number of suggestions to the mis-spelled word.

Fig: On the go spell checking of form elements

Improved Add-on manager - Firefox 2.0 has merged the add extensions dialog and add themes dialog into one integrated tool.

Support for JavaScript 1.7 - This is a new addition to Firefox. There is a good article on what is new in JavaScript 1.7 at Mozilla Developer Center.

Installing Firefox 2.0 in any Linux distribution

I use a fail safe recipe in installing Firefox 2.0 in GNU/Linux and it works without fail which ever be the distribution. There is nothing to it really, just download the Linux version of Firefox 2.0 from the official website and unpack it in the directory /opt (You will need root access though). Once it is unpacked, you can create a link on your Desktop to the Firefox binary in the /opt/firefox location. The beauty of this method is that the new version of firefox will co-exist with the firefox version which was installed by default in your Linux distribution. Not only that it will also use all the bookmarks and extensions which you have installed in the older version of firefox as long as they are compatible with the new version.

As I stated earlier, the latest version of Firefox has a lot to offer in terms of added features which imparts a new meaning to the word convenience.

Wednesday, 25 October 2006

Book Review: Building Flickr Applications with PHP

Building Flickr Applications using PHPPHP, one of the most popular server side scripting languages has become the de facto standard in developing many of the high traffic websites around the world. Not surprisingly, many projects have grown around this language which aids the web developer to integrate more and more third party products by way of maps, imaging applications and more into the website. Flickr is one of the most popular photo sharing web application which heralded the dawn of the Web 2.0. It allows one to easily upload, manage and share photos online with others. And Yahoo (the current owners of Flickr) have released a set of open APIs which allow any web developer to seamlessly integrate Flickr on their websites.

The book "Building Flickr Applications with PHP" authored by Rob Kunkle and Andrew Morton is a unique book which aims to lessen the learning curve associated with developing Flickr applications with PHP. The book, all of 9 chapters spanning around 200 pages is targeted at photographers, bloggers and web designers who would like to make greater use of the photos they have stored in their Flickr account.

To integrate Flickr on ones website, it is imperative to first have a good feel of the Flickr interface. In the first two chapters, the authors give a sound understanding of the Flickr interface. We get to know about different ways by which it is possible to categorize the photos and understand the Flickr terminology such as tags, sets and groups, ways in which you can post Flickr photos on to your blog right from the Flickr interface and more. These two chapters give a sound understanding of the core functionality of Flickr.

Phlickr is an open source PHP 5 library which acts as an interface between the PHP based website and the Yahoo Flickr API. This book uses this library to integrate Flickr with ones websites. The third chapter of this book walks one through the installation and configuration of Apache web server, PHP and Phlickr API on ones machine.

In the fourth chapter the authors give a brief run down of the essential PHP syntax which will help a PHP beginner to brush up his knowledge in the language.

It is only from the 5th chapter onwards that one is introduced to the meat of the topic. In this chapter, with the aid of example code, the authors explain how to display a Flickr photo and all its properties on ones website coded using PHP. This chapter also introduces two Phlickr library classes Phlickr_Photo and Phlickr_AuthedPhoto which play an important role in displaying the photos from Flickr website.

The next chapter titled "Getting Organized: Working with Flickr Photo Sets" is an extension of the previous chapter where in one gets to know how to organize the photos using sets and groups. What is interesting is that each section in this chapter is a how to do it section which contain the desired PHP code with an explanation of how it works.

Chapter 7 reveals another dimension to this whole project by introducing the simpleXML - the PHP 5 interface which allows one to easily search through and find data from an XML file. This chapter also explains how to access the Flickr tags, search through them, and even assign new tags while uploading the photos to the Flickr website all this using PHP.

RSS feeds and syndication form the basis for the 8th chapter. RSS is a lightweight XML schema which allows websites to present structured data about content they have posted. This chapter analyzes the different types of RSS such as the ver 1.0, 2.0 and the atom XML.

The last chapter solves tasks such as batch adding of photos to Flickr account, searching and displaying the group photos, showing a random photo from a particular group, displaying the RSS data in a user readable format, showing the latest photos from a group and so on.

Book Specifications
Name : Building Flickr Applications with PHP
ISBN : 1-59059-612-9
Authors : Rob Kunkle & Andrew Morton
Publishers : Apress
No. of Pages: 200
Price : Check the latest price at Amazon Store or compare prices.
Rating: Very Good
Category: Beginner to advanced. Good buy for bloggers and personal website owners who would like to integrate their Flickr photos seamlessly on to their websites.

This is a nice book which explains how to integrate one of the most popular Web 2.0 successes - namely Flickr - seamlessly into ones website using PHP. Even though the book is relatively small and concentrates on a niche topic, the authors have done a pretty good job of walking through all the necessary steps in a precise and clear manner.

Sunday, 22 October 2006

A brief look at Slackware 11.0

When you hear the name Slackware, you are at once transported to a world where Linux users feel more at home in setting the configurations by editing ordinary text files. In fact the credo of Slackware is to keep it as simple as possible. In popular speak, it is known by the acronym KISS (Keep It Simple Stupid). When I use the word simple, I mean simple in relation to a person who is already well versed in the use of Linux. So you won't find any Slackware specific memory hogging GUI front-ends to set up simple day to day configuration parameters. Apart from the ones provided by KDE - the default desktop of Slackware, you will not find any GUI helper apps as are common in other popular Linux distributions.

Another aspect of Slackware which has amazed me is that the whole project is the outcome of the efforts of one person - Patrick Volkerding. He has designed Slackware around the idea that the system should be a complete installation kept updated with any official patches. I couldn't help thinking that perhaps Patrick had been an avid user of one of the BSDs before he started the Slackware project and had been swayed enough to make Slackware as similar to the BSD which also consider the kernel together with the tools bundled with it as a single entity.

The latest version of Slackware is ver 11.0 which was released a couple of weeks back. Blame it on my internet connection, but in the past, I have had difficulties in downloading the ISOs of Slackware but this time round, I was successful in downloading and burning Slackware 11.0 on to the CDs. The whole Slackware distribution will fit into 3 CDs. If you do not care about X, then you can easily manage with just the first CD which contain a collection of Linux kernels and all the command line tools. But if you want to install KDE, you will need the second one. The third CD contain miscellaneous packages such as the language packs. It is prudent to download all the three CDs even though the installer bundled with Slackware will allow you to pick and choose between packages.

And while talking about the installer, Slackware comes bundled with a text based installer which is very similar to that found in FreeBSD. That means, you have a master menu which contain sub-menus to execute different functions. Such as a menu for partitioning the hard disk, a menu to format the disk, one for setting up and turning on swap, one to start the copying of packages to the hard disk and so on. And once all the tasks are completed, you are placed back into the master menu. The whole process is quite intuitive for anybody who has prior experience in installing an OS using a text installer. Of course unlike other Linux distributions, when you boot the computer using the first CD, you are put into a root shell and you have to type the command 'setup' to initiate the Slackware installation process.

I chose the full install since I had with me all the 3 CDs and within a little time all the packages were installed on one of the partitions on my machine which took around 4.0 GB space. Oh yeah, Slackware still bundles with it the LILO boot loader when most Linux distributions have graduated to the more user friendly Grub. Since I already had Grub installed in the MBR on my machine, I chose to edit the grub menu to include Slackware instead. During the installation, Slackware correctly detected the Windows NTFS and Fat32 partitions on my drive and prompted me for the path where I wanted it to be mounted.

The default kernel in Slackware is still the battle worn time tested 2.4 series (2.4.33.3) but you can also opt for the latest 2.6 (2.6.17.13) version of kernel at the time of installation by entering the command 'huge26.s' at the boot prompt.

As far as window managers are concerned, Slackware bundles with it a total of seven window managers which includes KDE 3.5.4, Xfce 4.2.3.2, Fluxbox, Blackbox, WindowMaker, Fvwm2 and Twm. But if you are a die hard Gnome user, then you will be disappointed though because Pat has long since discarded Gnome for its perceived difficulty in maintenance.

Slackware follows the BSD style init scripts
One note worthy fact about Slackware is its adoption of the BSD style init scripts over the System V init scripts more commonly embraced by the rest of the Linux distributions. What it translates for the Slackware user is simplicity in enabling and disabling services. You do not have to dirty your hands by changing the sym-links as you do in System V init scripts.

For example, say I want to enable the firewall in Slackware when it is booting up. All I have to do is move to the /etc/rc.d/ directory and set the executable bit of the file rc.firewall. And the next time Slackware boots up it will have the firewall up and running. On a similar note if you want to disable the firewall, then just unset the executable bit of the file rc.firewall. But that is not all. The contents of the rc.firewall file are in the same format as the iptables rules you enter in the command line which makes it quite easy to maintain in the long run. There is no iptables-save or iptables-restore for you.

Similarly for loading any extra drivers in the Linux kernel, you enter the module name in the liberally commented rc.modules file. For each service that is available in the system, there is a corresponding rc.<servicename> bash script in the /etc/rc.d/ directory and depending upon whether the executable bits are set or unset, Slackware chooses to start/stop the service during system startup.

Useful configuration scripts in Slackware
Earlier I had mentioned the obvious lack of any Slackware specific GUI front-ends. Well, it was more of a white lie ;-). Even though there are no GUI front-ends for configuration, there are a collection of curses based programs (scripts) which you can use to set up and configure a variety of features in Slackware including setting up networking. Some of them that I am aware of are as follows:
  • netconfig - A menu based program that will help in configuring your network.
  • pppsetup - A menu based program that helps in connecting to the Internet via a dial up modem.
  • xwmconfig - Choose your default window manager.
  • liloconfig - Setup and install LiLO to the boot drive.
  • xorgcfg - Setup the configuration for X Windows. It will automatically generate the xorg.conf file which is saved in the /etc/X11/ directory.
  • alsaconf - Automatically detects the sound cards and configures the sound.
More over, Slackware specific tools like Swaret, Slapt-get - a clone of apt-get and Slackupdate make it easy to keep the system updated with the latest security patches or even upgrade the entire system to a new version.

I have been using Slackware for a couple of weeks now and I am definitely impressed with the ease with which you can configure it. And I have started to really like this distribution. I did face some issues once I finished installing Slackware. Like I had to modify the xorg.conf file to get my mouse wheel to work also I had to run alsaconf to get sound to work properly. But nothing serious which warranted any drastic action.

Even though Slackware does not bundle Gnome with it, there is a separate project called Dropline Gnome which provide Slackware specific packages of the latest version of Gnome. Another site which caters to the Slackware crowd is linuxpackages.net which is a repository of Slackware packages.

Slackware is one of the oldest Linux distributions out there. And over the years, it has consistently kept pace with the changes. All the software bundled with Slackware 11.0 is the latest version - for instance Vim 7.0 is included, so is Firefox 1.5.0.7. And this is a remarkable feat since it is a project borne off the efforts of one man - Patrick Volkerding.

Saturday, 21 October 2006

Interesting tips to designing effective websites

Anybody who runs a website will be faced at one time or another to redesign his site. I have myself tried my hand at redesigning this site with varying degrees of success - though you can plainly see that there is a lot of scope for improvement.

But does designing websites require following a series of pre-charted steps ? Or is it a process which require little if any planning - one where you just jump in and start modifying the code ?

It appears that most, beautifully designed websites are the result of careful planning and forethought. Designing websites can be divided into 9 separate steps. Them being :
  1. Know what you're doing.
  2. Know what the site needs to do.
  3. Know what the site's visitors want.
  4. Get a good picture of the personality and style of the web site.
  5. Sketch out highly successful scenarios.
  6. Organise views into a site map.
  7. Sketch the essential features & look - This is the time you use a graphics software such as Gimp. But using only pen and paper is also equally effective.
  8. Map your visitors' attention.
  9. Arrange the visual elements to work together.
You can read the details of each step at this well written article at Web design from scratch - a beautiful site with good articles pertaining to web design.

And if you are wondering which is a good book to pick up the essential skills in XHTML, CSS and Javascript which are pre-requisites for mastering the art of web design - I would highly recommend you check out the book Web Design in a Nutshell which is well into its third edition having sold over 200,000 copies so far.