Changing Language / Locale in CentOS

CentOS supports multiple languages

To change language in CentOS

  • Go to System>Administration>Language
  • Provide root password if not logged in as root
  • Select a language and click OK

You can also change language from login screen.

To start Language Selection tool from Terminal type

system-config-language

and provide root password.

Changing Locale

  • To see list of available locales type following in terminal

locale -a

  • Now to change the locale type

export LANG=<some_locale>

For Example to change to Japanese locale do the following

export LANG=ja_JP.utf8

Type locale in terminal to confirm the change.

This sets the locale to Japanese for CURRENT CONSOLE only.

Applications started from this console will open in Japanese locale, If you open a new console or start application from somewhere else then it will open in default system Language.

***glibc detected*** malloc(): memory corruption: 0x0916c100 *** error

 

 

Memory corruption error comes when you are doing something on memory which is not available.

Like Writing,Reading and freeing.

Some common examples are

  • Reading/writing to memory out of the bounds of a dynamically allocated array
  • Attempting to write a memory which was never allocated
  • Attempting to free a memory already freed
  • Writing to a freed memory
  • Writing to an unallocated memory

Fix:

  • Check the above common mistakes
  • Check all malloc() expressions in your code
  • Check if data is copied to an allocated memory whose allocated length is less than data(ex. in memcpy() statements)
  • This error usually comes while allocating memory to arrays like
pointer = (char *) malloc(strlen(Array_B));

the above statement overflows by 1 byte. You should use-

pointer = (char *) malloc(strlen(Array_B)+1);

to avoid any memory corruptions.

 

 

Install Java Plugin on Firefox ,CentOS [Linux]

Steps to manually install java plugin on firefox in CentOS and other Linux Distributions

 

  • Download JRE from Here
  • Extract the download file (See tutorial for .bin files)
  • Go to ‘plugins‘ directory in mozilla folder (/usr/lib/mozilla/plugins)
cd /usr/lib/mozilla/plugins
  • Create a Symbolic Link to libnpjp2.so (<JRE>/lib/i386/libnpjp2.so)
ln -s <JRE>/lib/i386/libnpjp2.so)

where <JRE> is path to your extracted JRE directory.

Remove any old symbolic links of java plugins present in plugins directory like libjavaplugin-oji.so

rm libjavaplugin-oji.so
  • Restart Firefox
  • Check if JRE has been properly installed from this Test Page (you can also type about:plugins in address bar and check if Java Plugin is installed)

Open .djvu file on CentOS (Linux)

DjVu is a file format designed primarily  to store scanned documents . It compresses documents to smaller size as compared to PDF files.

You can convert files to DjVu format with this  online tool.

Following Steps will help you install djvu viewer on CentOS and other Linux Distributions with yum install command.

To install djvu with yum you must have rpmforge.repo file in /etc/yum.repos.d/ directory.

If the file is not present then make a file named rpmforge.repo, open it with Text Editor and paste the following in it.

 

# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

 

Now install djvu viewer with following command

yum install djvulibre.i386

 

If the above does not work then search for djvu package with

yum search djvu

and install the library present with yum install.