How To: GNOME GMail Notifier

GNOME GMail (Google GMail) Notifier is an awesome tool for GNOME/Linux users if you are addicted to checking mails every few minutes. GMail Notifier solves a bit of your problems by notifying about multiple gmail accounts. One more plus point is that it can display GMail Notifications for new mails in accounts for which you are using Google Apps. Below is a step by step howto on installing and configuring GMail Notifier in Fedora (may apply to other distros as well).

Install GNOME GMail Notifier

You can download and install it from GNOME GMail notifier home page or just use yum

[root@fedora ~]$ yum install gnome-gmail-notifier

Launch Gmail Notifier

If installation was successful, go to Applications -> Internet -> Gmail Notifier.

GNOME Gmail Notifier

Open Preferences

Right click on Email icon in taskbar and click Preferences.

GNOME Gmail Notifier Select Prefreneces

Select Preferences

Set inbox update time to 1 minute. Check display notifications for new messages and errors. Also select a sound to play for new mails.

GNOME Gmail Notifier Prefreneces

Add GMail Account

Click Add on preferences window and add your GMail account.

GNOME Gmail Notifier Add GMail Account

Add Mail Account (Google Apps) (Optional)

If you don’t know what Google Apps is, leave this step. If you do know, then add your mail account.

GNOME Gmail Notifier Add Google Apps Account

Check Mail

If you can’t wait for 1 minutes to see GMail Notifier in action, just right click on email icon in taskbar and click Check Mail.

GNOME Gmail Notifier Check New Mails

Mail Notifications

Whenever you get a new mail, you’ll have bubble like the one in image below and a sound will also be played.

GNOME Gmail Notifier New Mail Notification

Enjoy the notifications ๐Ÿ™‚

 

How To: Install and Use Twython (Python Wrapper for Twitter API)

As promised in my previous post, here is a brief howto on getting started with twython. The main advantage of Twython over several other python (or any other language) wrappers for Twitter API is that it works even when you are behind your organizations proxy.

Download Twython

You can download latest version of twython from twython page on github. You can either clone using git (if you have git installed) or can click the download button.

Install Twython

Once you are done with extracting the downloaded tar file. Change directory to twython and run these command as root.

1
2
3
4
5
6
[root@fedora ~]$ git clone git://github.com/ryanmcgrath/twython.git
[root@fedora ~]$ cd twython/dist
[root@fedora dist]$ tar -xvzf twython-0.8.tar.gz
[root@fedora dist]$ cd twython-0.8/
[root@fedora dist]$ python setup.py build
[root@fedora dist]$ python setup.py install

Use Twython from Python Interpreter

Below is a direct copy paste lines from my interpreter. See how things are working (learning by doing).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[saini@bordeaux ~]$ python
Python 2.6 (r26:66714, Mar 17 2009, 11:44:21) 
[GCC 4.4.0 20090313 (Red Hat 4.4.0-0.26)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> # first of all, import twython module
>>> import twython
>>> # Authenticate your twitter account with your twitter username
... # and password with twitter.setup method.
>>> client = twython.setup('Basic','myusername','mypassword')
>>> client.authenticated
True
>>> #Lets update our current status on twitter with some cool message.
>>> client.updateStatus('Testing #twython. The coolest #TwitterAPI :)')
>>> # Now go and check your current status on twitter. Surprised!!!
>>> # Get your or anyone's followers
>>> client.getFollowersIDs(screen_name='gofedora')
>>> # Output truncated.
>>> # Get help for any function.
>>> print client.createFriendship.__doc__
createFriendship(id = None, user_id = None, screen_name = None, follow = "false")
 
	Allows the authenticating users to follow the user specified in the ID parameter.
	Returns the befriended user in the requested format when successful. Returns a
	string describing the failure condition when unsuccessful. If you are already
	friends with the user an HTTP 403 will be returned.
 
	Parameters:
		** Note: One of the following is required. (id, user_id, screen_name)
		id - Required. The ID or screen name of the user to befriend.
		user_id - Required. Specfies the ID of the user to befriend. Helpful for disambiguating when a valid user ID is also a valid screen name. 
		screen_name - Required. Specfies the screen name of the user to befriend. Helpful for disambiguating when a valid screen name is also a user ID. 
		follow - Optional. Enable notifications for the target user in addition to becoming friends. 
>>>

So now you are ready to do wonders with twython. Write your own code and blog/brag about it ๐Ÿ™‚

 

How To: Recover Deleted Files in Linux Using Photorec

Frequently I get messages like “I have accidentally deleted my project. Is there any way to recover it in Linux?” or “I worked really hard on that program and managed to deleted it right before submission ๐Ÿ™ How do I recover?”. Well I didn’t really have any idea on “How to actually recover deleted files in Linux”.

A few days back I was designing the new logo for Videocache in Inkscape. After finishing the design, I saved the svg file carefully. And deleted other images which I embedded in the logo. A few moments later I realized that I just screwed up myself by deleting all those files as the svg file is now good for nothing.

I searched a lot on recovering files in Linux but in vain. Then a friend (bitgeek) told me about Photorec. I managed to recover all the files using photorec. I thought it would be a good idea to let others know and spread a good word about Photorec. Below is a step by step howto on using Photorec to recover your files.

What is Photorec?

From Photorec website,

PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (thus, its ‘Photo Recovery’ name) from digital camera memory. PhotoRec ignores the filesystem and goes after the underlying data, so it will still work even if your media’s filesystem has been severely damaged or re-formatted.

For This HowTo

Lets say I had a file download_arrow.png in /home/saini/Desktop which I have removed accidentally. Login as root and create a directory recover which will be used to store all the recovered files.

Install testdisk/PhotoRec

Photorec comes as a part of testdisk package in Fedora (I hope its same for other distributions as well). Use yum to install testdisk.

[root@fedora-tips ~]$ yum install testdisk

Launch Photorec

Once you are done with installation. Open a terminal and launch photorec (as root).

[root@fedora-tips recover]$ photorec

Select Hard Disk

If you have more than one hard disk in your system, select the one from which you have deleted the file(s).

PhotoRec Hard Disk Selection

Select Partition Type

If your hard disk has Linux partitions, then select [Intel].

PhotoRec Partition Selection

Select Filetype Option

Move to [File Opt] and press enter. Here you can disable all file types by pressing ‘s’ . Use space to toggle the check button. Now since we removed a png file, we are going to check only png file type.

PhotoRec Filetype Selection

Select Options

Photorec also has a list of different options. Under normal circumstances you don’t need to modify them

PhotoRec Option Selection

Select Partition

Move the selector to the partition from which you have removed the file. Then press enter on search.

PhotoRec Partition Selection

Select Filesystem Type

If you are using Linux, its going to be ext2/ext3/ext4. So the default selection is file.

PhotoRec Partition Selection

Select Space for Analysis

Select free if you didn’t write to that partition after removing the particular file otherwise select whole.

PhotoRec Space Selection

Select a Directory to Recover Files

Now select the path where the recovered files will be stored. Then press ‘Y’.

PhotoRec Recovery Directory Selection

Recovery Progress

Photorec will show how many files it has recovered.

PhotoRec Recovery Progress

All recovered file will be stored in the directory selected above. Open them in a file browser and you’ll get the removed file there. I hope this howto will help you recovering files you accidentally delete ๐Ÿ™‚

 

How To: Install ATI Catalyst (fglrx) Drivers

Note: This How To is valid up to Catalyst Driver version 10.1.
Note: With minor changes this How To may work for other Linux distributions like Mandriva, Suse, Ubuntu, Red Hat, Cent OS etc.

Following the suggestions in comments on my last post about ATI Catalyst (fglrx), I tried to reinstall ATI drivers version 9.8 and finally it worked. I thought of noting down the the process in few simple steps which anyone can follow and get the drivers working on Fedora 11 with latest kernel versions.

Step 1 : Update Kernel, Install kernel-devel

Huge thanks to Richard Lloyd and mxyzptlk2063 for pointing this out.
This step is not necessary. You may like to stick to the kernel version you already have. In case you want the latest kernel, just use yum to get the latest kernel.

Note: Do not forget to update the kernel-devel package as well as its needed to compile the fglrx kernel module.

DONT UPDATE THE KERNEL. Instead stick to whatever kernel version you have. If you have 2.6.30.*, you are unlucky ๐Ÿ™ Get a kernel version 2.6.29.* and install the kernel-devel for the same.

With Catalyst Driver version 9.10 you can update kernel to latest version before installing the Drivers.

[root@fedora ~]$ yum update kernel
[root@fedora ~]$ yum install kernel-devel

Step 2 : Download Drivers

Download the ATI Catalystโ„ข 9.8 Proprietary Linux x86 Display Driver from ATI/AMD website.

Step 3 : Install Drivers

Install the drivers that you have downloaded using the following command.

[root@fedora ~]$ bash ./ati-driver-installer-9-8-x86.x86_64.run

Step 4 : Check Installation Result

Check the /usr/share/ati/fglrx-install.log file for result of installation. If there are no errors, proceed to the next step.

Note: You may see lines like this at the end of file

You must change your working directory to /lib/modules/fglrx
and then call ./make_install.sh in order to install the built module.
– recreating module dependency list
– trying a sample load of the kernel modules
done.

You can ignore these lines happily if they don’t contain any error message. You don’t really need to execute the command mentioned in those lines.

Step 5 : Blacklist radeon and radeonhd kernel modules

Add these lines to /etc/modprobe.d/blacklist.conf.

blacklist radeon
blacklist radeonhd

Step 6 : Generate initial Xorg configuration file

Note: This step is optional with Catalyst Driver version 9.10, but it wont harm even if you execute this.

You have to generate the initial xorg.conf file which will use fglrx as display device.

[root@fedora ~]$ aticonfig --initial

Step 7 : Modify xorg.conf

Open your /etc/X11/xorg.conf file and add the following line to “Device” section (the one with fglrx as driver)

Option "SWCursor" "true"

Step 8 : Reboot

Reboot your machine. And you’ll have the latest ATI Catalyst drivers working on your Fedora 11 ๐Ÿ™‚

Step 9 : Testing

You can test your newly installed drivers and get the performance benchmarks for your graphics card using the commands below.

[saini@fedora ~]$ glxgears
[saini@fedora ~]$ fgl_glxgears

My graphics card is ATI Radeon HD 3200 (256MB, Onboard) and I get 1500FPS with glxgears and 300FPS with fgl_glxgears.

In case you messup things somewhere, you can uninstall the fglrx drivers using the following command

[root@fedora ~]$ /usr/share/ati/fglrx-uninstall.sh
 

How To: Wireless LAN with Broadcom BCM4312 in Fedora 11

Fedora 11 does have support for Broadcom wireless drivers, but it didn’t really work out on a friend’s laptop. Finally we got it working and I thought I’ll just note the steps down. Below are the three easy steps you need to take to make it work properly.

Step 1

Install needed packages

[root@fedora ~]$ yum install broadcom-wlย  wl-kmod

Step 2

Once the packages are installed successfully, reboot your laptop.

Step 3

Use the following command

[root@fedora ~]$ system-config-network

And add a new wireless device wlan0 or whatever you want by filling the required fields properly. If you want the device to be managed by NetworkManager, you can do so while editing the device you just added.

Activate the device. And you are on wifi ๐Ÿ™‚