Tuesday, May 15, 2012

socket:bind failed

Problem:  
 start festival -i --heap 2100000 --serverthen system gives error: socket:bind failed


Solution: 
run   killall -9 festival       several times(normally 4-5) till it says no process to kill

now run the mentioned command it will work

 
    

ORCA : TIMEOUT: something has hung. Aborting

Problem:
boss@cmj-lcg-dellap:~$ orca

** (orca:6754): WARNING **: Trying to register gtype 'WnckWindowState' as enum when in fact it is of type 'GFlags'

** (orca:6754): WARNING **: Trying to register gtype 'WnckWindowActions' as enum when in fact it is of type 'GFlags'

** (orca:6754): WARNING **: Trying to register gtype 'WnckWindowMoveResizeMask' as enum when in fact it is of type 'GFlags'
TIMEOUT: something has hung.  Aborting.


Solution:

Open
/var/lib/python-support/python2.5/orca/settings.py  or  /usr/lib/pymodules/python2.6/orca/settings.py  if none of the above exists then use$ locate settings.py and find the similar path  now inside settings.py  search for timeout you will gettimeoutTime=10  means default value is 10 change it to 30 save the file and now start orca.  

How to install sun-java or sun JDK/JRE in ubuntu

Problem:
Tried to install java using following command:

sudo apt-get install sun-java6-jdk
sudo apt-get install sun-java6-jre
 but got an error message as follows
reading package lists.... done
building dependency tree
reading state information .... done
package sun-java6-jdk is  not available
it has no installation candidate

The solution is :
For Ubuntu 10.04 LTS, the sun-java6 packages have been dropped from the Multiverse section of the Ubuntu archive. It is recommended that you use openjdk-6 instead.
If you can not switch from the proprietary Sun JDK/JRE to OpenJDK, you can install sun-java6 packages from the Canonical Partner Repository. You can configure your system to use this repository via command-line:
     sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
     sudo apt-get update   
     sudo apt-get install sun-java6-jre sun-java6-plugin
     sudo apt-get install sun-java6-jdk 
      sudo update-alternatives --config java
For Ubuntu 10.10, the sun-java6 packages have been dropped from the Multiverse section of the Ubuntu archive. It is recommended that you use openjdk-6 instead.
If you can not switch from the proprietary Sun JDK/JRE to OpenJDK, you can install sun-java6 packages from the Canonical Partner Repository. You can configure your system to use this repository via command-line:
     sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
     sudo apt-get update   
     sudo apt-get install sun-java6-jre sun-java6-plugin
        
      sudo apt-get install sun-java6-jdk
      sudo update-alternatives --config java

Source:  https://wiki.ubuntu.com/LucidLynx/ReleaseNotes#Sun%20Java%20moved%20to%20the%20Partner%20repository



If above does not work (for other version of ubuntu) then you can create local repository as follows:




cd ~/
wget https://github.com/flexiondotorg/oab-java6/raw/0.2.1/oab-java6.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh

and then run:
sudo apt-get install sun-java6-jdk
sudo apt-get install sun-java6-jre

Source :   https://github.com/flexiondotorg/oab-java6/blob/a04949f242777eb040150e53f4dbcd4a3ccb7568/README.rst

Monday, May 14, 2012

How to enable java in Firefox

How to enable java in Firefox:

Go to www.java.com -> Downloads
download self extracting tar.gz file  follow the instruction below:


working steps:
Source:     https://discussions.nessus.org/thread/4284 

1. Download the latest java runtime either from www.java.com -> Downloads    or    http://www.oracle.com/technetwork/java/javase/downloads/index.html  (for myself it was jre-7u3-linux-i586.tar.gz)



2. plac it in a folder /usr/local/java and extracted it using
 #tar zxvf jre-7u3-linux-i586.tar.gz



3.  #update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_04/bin/java" 1



4.  #update-alternatives --set java /usr/local/java/jre1.7.0_04/bin/java



Enable and Configure  (Source:   http://java.com/en/download/help/linux_install.xml#selfextracting)

Firefox or Mozilla
To configure the Java Plugin follow these steps:
1. Exit Firefox browser if it is already running.
2. Uninstall any previous installations of Java Plugin.
Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, remove the symbolic links to any other versions and create a fresh symbolic link to the new one.
3. Create a symbolic link to the libnpjp2.so file in the browser plugins directory
Go to the plugins sub-directory under the Firefox installation directory
cd <Firefox installation directory>/plugins
Create the symbolic link

ln -s <Java installation directory>/lib/i386/libnpjp2.so      libjavaplugin_oji.so

Note: If you are upgrading your Java version then before creating new symbolic link you should remove old symbolic link to enable latest downloaded Java.

To remove old symbolic link:
type cd <Firefox installation directory>/plugins
rm libjavaplugin_oji.so

Example
If Firefox is installed at this directory:
/usr/lib/<Firefox installation directory>
And if the Java is installed at this directory:
/usr/java/<Java installation directory>
Then type in the terminal window to go to the browser plug-in directory:
/usr/lib/<Firefox installation directory>/plugin
Enter the following command to create a symbolic link to the Java Plug-in for the Mozilla browser.
ln -s /usr/java/<Java installation directory>/lib/i386/libnpjp2.so   libjavaplugin_oji.so


4. Start the Firefox browser, or restart it if it is already up.

In Firefox, type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that Java Console is there.

Test Installatio
check if java applet is enabled in the browser by using the following link

In that webpage, in the LIVE box, it should display
“This web browser can indeed run Java applets”
wait for some time for the display to come.
 



Wednesday, November 16, 2011

How to install gcc 4.1?

Qs:The default gcc version in Ubuntu 10.04 LTS and 10.10 is gcc 4.4. However some programs depend on gcc 4.1.1 or gcc 4.1.2. Here’s how to install and setup gcc 4.1.3 in Ubuntu 10.04/10.10 which also works if one program need gcc 4.1.1/4.1.2 to run.

Solution:
The default gcc version in Ubuntu 10.04 LTS and 10.10 is gcc 4.4. However some programs depend on gcc 4.1.1 or gcc 4.1.2. Here’s how to install and setup gcc 4.1.3 in Ubuntu 10.04/10.10 which also works if one program need gcc 4.1.1/4.1.2 to run.

Install Gcc 4.1

gcc 4.1.3 is available default in Ubuntu 10.04/10.10 official repository, just run the command in Applications -> Accessories -> Terminal:

sudo apt-get install gcc-4.1

If you absolutely want gcc 4.1.1, refer to ubuntuforums.org.

Set gcc 4.1 as default version

After that, use this command to list installed gcc in your Ubuntu:

ls /usr/bin/gcc*

and use this command to check which is default:

gcc -v

1.) Now, add alternatives for gcc:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.1 30

run this command which lists available versions, then type a number to set default.

sudo update-alternatives --config gcc

There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

Selection Path Priority Status
————————————————————
0 /usr/bin/gcc-4.4 40 auto mode
* 1 /usr/bin/gcc-4.1 30 manual mode
2 /usr/bin/gcc-4.4 40 manual mode

2.) add alternatives for g++, i486-linux-gnu-gcc, and i486-linux-gnu-g++ and set 4.1 as default:

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 40
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.1 30
update-alternatives --config g++

update-alternatives --install /usr/bin/i486-linux-gnu-gcc i486-linux-gnu-gcc /usr/bin/i486-linux-gnu-gcc-4.4 40
update-alternatives --install /usr/bin/i486-linux-gnu-gcc i486-linux-gnu-gcc /usr/bin/i486-linux-gnu-gcc-4.1 30
update-alternatives --config i486-linux-gnu-gcc

update-alternatives --install /usr/bin/i486-linux-gnu-g++ i486-linux-gnu-g++ /usr/bin/i486-linux-gnu-g++-4.4 40
update-alternatives --install /usr/bin/i486-linux-gnu-g++ i486-linux-gnu-g++ /usr/bin/i486-linux-gnu-g++-4.1 30
update-alternatives --config i486-linux-gnu-g++


Source: http://ubuntuguide.net/how-to-install-and-setup-gcc-4-1g4-1-in-ubuntu-10-0410-10

Eroor in installation of speech tools

Error:make[2]: *** [matrix_i_t.o] Error 1 make[1]: *** [inst_tmpl] Error 2 make: *** [base_class] Error 2

Solution: 1. gcc 4.1 should work fine. please try it if you'll have problems and
suggest a patch. Also I'd be glad if you'll find a time to checkout
speech_tools and festival from svn and try to build them:

svn checkout http://svn.berlios.de/svnroot/repos/festlang/trunk/festival

svn checkout
http://svn.berlios.de/svnroot/repos/festlang/trunk/speech_tools

They should build fine. If not, please report about problems.

Source: http://lists.berlios.de/pipermail/festlang-talk/2008-October/001213.html