Kenno’s OpenNote

Pidgin – old version of libpurple and unknown protocol

Posted in Debian by kenno on July 10, 2009

Aaaahhh… I fixed the Pidgin problem with Unknow protocol just 5 minutes after the previous post was made. I’m going to write how I found out the problem and how it has been fixed. If you’re interested, keep reading.

In the previous post, I mentioned that I would removed the Pidgin package completely including its configuration file (# apt-get –purge remove pidgin.) I did and followed by re-installation of Pidgin, unfortunately, it didn’t fix anything.

Then I checked the About dialog (Help -> About), and I noticed the libpurple 2.5.4 under Pidgin 2.5.6. This must be the source of the problem! But I remember libpurple has been upgraded to 2.5.6 and it said so in Aptitude. So what could be possibly wrong?

Screenshot-About Pidgin

A while back, I have installed Pidgin from source code, however I was quite sure that it has been properly removed — I went into the Pidgin source and execute # make uninstall.Well, according to this Bug #385639, libpurple is still present in /usr/local/

kenno@san7:/usr/local/lib
$ ls
finch                      libpurple.so.0      pkgconfig  site_ruby
gnt                        libpurple.so.0.5.4  purple-2   xemacs
libpurple-client.so.0      perl                python2.4
libpurple-client.so.0.5.4  pidgin              python2.5
kenno@san7:/usr/local/lib

So, I need to remove these unwated libraries manually:

kenno@san7:/usr/local/lib
$ sudo rm libpurple*

Now, let’s run Pidgin again…and… that’s it. The problem has been fixed!
Screenshot-Add Account2

For the record, I have upgraded Pidgin to 2.5.8 (unstable package at the time of this post is written) and everything works as expected. Now, I’m back to a happy Pidgin user.

Tagged with: ,

Pidgin – Protocol Unknown (FIXED)

Posted in Debian by kenno on July 10, 2009

Update: The problem has been fixed. Please see the above post.

A few weeks ago, Pidgin could not connect to Yahoo messenger server because Yahoo was changing its protocols. At the time, the Pidgin was at version 2.5.5. Then that Yahoo connection problem has been fixed in version 2.5.7 and newer of Pidgin.

Anyway, Pidgin is acting up again. This time I’m not sure what is going on, and it didn’t seem other people are experiecing the same problem – Protocol Unknown for all types of accounts.

Screenshot-Pidgin-Accounts

Suppose if I want to add a new account, nothing could be selected from the drop down list. Normally, you should be able to choose if you want to add Yahoo messenger or MSN protocols.

Screenshot-Pidgin-Add Account

I tried to remove Pidgin 2.5.8, re-install 2.5.6, it didn’t work. Then I tried to re-install 2.5.8 and the Unknow Protocol still presents. Next, I’m going to remove Pidgin (with its configuration) and hopefully I can use it again.

At the moment, I’m using Kopete 0.70.4 temporarily to connect to MSN messenger. However, it doesn’t seem to connect to Yahoo messenger either. But, I’m not going to investigate why or how to solve it.

If anyone knows how to fix this Pidgin unknown protocol problem, please share.

Tagged with: ,

PHP: number of days between two dates

Posted in Tips by kenno on July 4, 2009

It’s Saturday, what am I doing in front of the computer? I should be out and enjoy life. ^o^

A colleague asked to customize a theme for his blog using WordPress. Because I didn’t have any good plan this Saturday, learning PHP sound like a logical and useful choice. Well, I bribed myself with a bottle of Tui.

Then, I found an interesting PHP related post by Chorn Sokun entitled “PHP date diff“. The author was trying to calculate the number days between two give dates. At the end of the post, he asked “What would you do instead?”

Here is my answer.


< ?php
/*
 * Function to calculate the number of days between
 * two given dates.
 * Assumption:
 *              $date2 > $date1
 *              Date format: mm/dd/yyyy e.g.: 31/07/2009
 * Author: kenno
 * Date: July 4, 2009
 */
function number_of_days($date1, $date2) {
	$date1Array = explode('/', $date1);
	$date1Epoch = mktime(0, 0, 0, $date1Array[1],
					$date1Array[0], $date1Array[2]);

	$date2Array = explode('/', $date2);
	$date2Epoch = mktime(0, 0, 0, $date2Array[1],
					$date2Array[0], $date2Array[2]);

	$date_diff = $date2Epoch - $date1Epoch;
	return abs($date_diff / 60 / 60 / 24);
}

echo number_of_days("04/7/2009", "12/7/2009"); // 8
?>

Now, it’s my turn to ask. How could I make it better? How would you do it? :)

Update:

Added the abs( ) to round up the number of days to integer as suggested by Sokun.

Tagged with:

Import photos from iPhone without iPhoto

Posted in HowTo, Mac by kenno on July 3, 2009

So how do you transfer your photos from the iPhone 3G to your laptop running OS X if you don’t have iPhoto app? — Easy, just use the buit in app called Image Capture.

The app can be run from: Finder -> Applications -> Image Capture

Image Capture Screenshot

Now, you can either download some or all photos by clicking on either one of the bottons as shown in the screenshot. Remember that you should have the iPhone connected to your copmuter, otherwise you would see the message saying the no device found or connected.

Credit: How do I get photos off my Apple iPhone?

Tagged with: , ,

Remove Universal Access Preference icon from Gnome panel

Posted in Debian, Unix/Linux by kenno on June 23, 2009

One of the advantages of using GNU/Linux operating system is that you hardly have to restart it. I have Debian on my laptop and it’s been running for months, until last night. It crashed and froze. Anyway, that’s not the main point this post was written.

After restarting, I saw this new icon in the Gnome top panel (the third icon from the right):

universal_preference

Well, for the start, I don’t know what it is and I don’t think I will have a need for it either. So I wanted to remove it, but right click on this icon would do nothing. Left clicked on it would give me some setting option, but nowhere does it mention how to remove it.

Thanks to the tip from Ubutu Forum, someone has found a solution. Basically, you need to go the “Keyboard Preferences” and untick the “Accessibility features can be toggled  with keyboard shortcuts“.

The following is the step by step guide:

On Debian, from the menu panel, click on System -> Preferences -> Keyboard (alternatively, you can just type gnome-keyboard-properties from the Terminal)

Screenshot-Keyboard Preferences

Then, untick or uncheck the Accessibility features can be toggled  with keyboard shortcuts and click on Close button. The undesired icon shall disappear.

Credit: How to remove universal access from notification area

Tagged with: , , ,