Monday, October 3, 2011

Configuring Perl in Ubuntu

Hi All,

This post explains how to configure perl in Debian based distros.

Open synaptic and search for perl and install it.

Issue this command first:

1. whereis perl
Copy the output of this command as your first bang line for your perl script.

Next perl -v command
This will issue which version of perl is being installed.

Then open gnome-terminal or your console and write this simple perl program. Copy as is.

#!/usr/bin/perl -w


print "hello world";

Name this file as a.perl. In the terminal run this command: perl a.perl


Enjoy,
Ananth S Gouri

Sunday, October 2, 2011

Sound on both loud speakers and headphones problem

Hi All,

I want to scold myself a lot for not using what I knew long time back... and being careless about the same....

Right the problem that most Ubuntu and Debian users faced was - whenever any sound was played from the distro's outputs - the sound would be heard in both the loudspeakers and as well as in the headphones..

I had seen this problem a long time back and I knew that we had some solutions to the same like using PulseAudio etc... But it would still work if and only if your kernel version was above 2.6.26

But then I had tried configuring pulseaudio but in vain... May be I had not done it properly or dont know...

Today luckily - I got both pulse audio and as well as this dual sound issue solved..

1. I have already written a post earlier as to how to solve the issue of non-playback using the options provided by pulse audio..

2. For the dual sound to work - please install kernel 2.6.32 or higher... (I have written a post as to how to install a new kernel and configure it... Please read my archives..)

Once installed - login to the new kernel and also install gnome-alsamixer through synaptic...

Now open the mixer using the command gnome-alsamixer from the terminal and in its settings.. make sure

1. You set the Master volume to middle
2. You set the PCM level to null

(You have a button to drag the levels - please use it... )

Now put on your headphones and rock... :)

Tc,
Ananth

Android Protector


Hi All,


I faced a very weird kind of problem today. I had been to a shuttle badminton tournament and while playing my match - I forgot my phone with my student who is a very good friend too. 

I came back home after losing the match :( and only then I remembered that I had left the phone with him. 

Though I have protected my opening menu screen with a password - my student knew the password since he was playing some games with it all day. 

Though I know my student very well and trust him too... since I was not at the screen - I started getting this feeling of what if he checks my mails, what if sees my messages and many other private stuff. 

He could even check my facebook profile. 

I did not realise and was dumb.. I changed my gmail password with the hope that it has to solve my problem to some extent. 

Ya it will solve your problem to some extent if your facebook account is linked to your gmail account. 

But what if you are using some other email to link to your facebook? 

After an hour or so I got back my mobile intact and I was scolding myself for having doubts at him  but also thought that anybody would get these doubts for a matter of fact and it was not something unusual in me... :)

So back home I tried to see if gmail app opens.. and to my shock it did.. Though I could not refresh for new mails since it asked for the changed password, any one who gets access can search over all gmail mails stored till then. 

It was only now that I wanted a permanent solution to this problem and I searched the market for a protector to gmail. 

Now I am happily using an application called "Protector by Alexander Kosenkov" The free version of this app allows you to set a password for protecting upto 8 applications on your android phone. 

The full version can be purchased on the market for a nominal $1 and removes the constraint put by the free version. 

This is a "must have" app if you are worried about the data you have on your phone. But don't forget to do these things on hand...

1. Set your recovery email before setting the password. This way if you forget the password - the password set will be sent to your email address. Please give a valid email address. 

2. Set some number as the password pin and this can be used to protect any app. 

3. Just click on add before you want to protect any new app. 

In the end don't forget this last step...

Don't buy the plugin before installing and trying out the free app... :)

Last but not the least... Now don't be dumb enough to give this pin too.... ;) :P

Tc and hope you can now safeguard your android phone...
Ananth S Gouri







Setting up PulseAudio in Debian Lenny

Hi All,

This post explains how to setup PulseAudio in Debian 6 in the most simplest manner and also the need for it...

Right...

Setting it up...

Its pretty simple.. Open your Synaptic Package manager and search for these 2 packages and install them...

1. gstreamer0.10-pulseaudio

2. pulseaudio

as root and also make sure you can solve all dependencies... Do mail me: ananth dot gouri at gmail dot com for any doubts solving dependencies problems...

So this sets up your PulseAudio... So how to make sure that your Pulse Audio redirects to old ALSA or OSS??

Open a terminal and hit this command:

pulseaudio --system=1 --high-priority=1 -D


This starts the pulse audio server with a high priority...

If this does not give you any errors (Denoted by E) then you have successfully started it...

So why PulseAudio??


The recent AlsaUtils used in distributions like Debian and Ubuntu had lots of issues due to the changes done in software... Some of them being..

1. If you are playing a youtube video - then you cant get back and play a song in your local system with sound to it
2. If you were playing a local mp3 - then if you go to youtube it wont play the sound..
3. You cant play more than 1 song in 2 different players locally...
4. You cant watch a video and hear to a song as well simultaneously...
5. You cant listen to the sound from your rear headphone slot and as well as from your front headphone slot in your latest supported CPUs...
6. You can also listen to sound coming out of your loud speakers even when your headphone is put up and not a loud speaker in your laptop audio out...

and many more...

Many people suggest the users to use the older alsautil package and many others also suggest using a GTK that would help to select a Default Hardware Sound Device....

The optimum solution to this problem is to install the PulseAudio and this would solve all these above problems...

Now you can play songs in more than 2 players simultaneously, play a youtube video and then close that window and start listening to a mp3 locally...

Now to solve the step 6.. If you check your Sound preferences - you can find something as Analog Output and Analog Headphones.. Just select the Headphone option...

You can as well give a permanent solution to this problem by telling - the pulse audio to overtake (automatically redirect to) ALSA or OSS if 2 or more sound outputs are needed by doing the following..

edit the file

/etc/pulse/client.conf and

uncomment the line

autospawn = yes

Enjoy,
Ananth