Adjusting the language settings in spamassassin

To change the language settings of spamassassin edit the file user_prefs located at  /home/username/.spamassassin if it isn’t located there you need to create one.

We need to edit or add values ok_languages with the extra languages you would like to have in the two letter code.
This option is used to specify which languages are considered OK for incoming mail.

ok_languages all (allow all languages)
ok_languages en (only allow English)
ok_languages en ja hi (allow English, Japanese, and Hindi)

Continue Reading

Magento Installation SOAP error in loading WSDL

When you are trying to access the URL at http://www.example.com/api/soap/index/ , it gets redirected to http://www.example.com/index.php/api/soap/index/ you get the following error. But if you try to load the API directly, you get the WSDL as it should be in a XML format.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<
SOAP-ENV:Body>
<
SOAP-ENV:Fault>
<
faultcode>WSDL</faultcode>
<
faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.example.com/api/soap/index/wsdl/1/'</faultstring>
</SOAP-ENV:Fault>
</
SOAP-ENV:Body>
</
SOAP-ENV:Envelope>

There could be many reasons for this. But the issue with us for that particular issue is that www.example.com was not resolving from the server. A simple /etc/hosts entry in the server (poor solution) or making it resolve from the server should solve the issue.

Continue Reading

rar and unrar archives in linux

Rar archived files are very common these days and we have a solution for rar file extraction and compression in linux. To extract rar files we have the unrar application.

To use unrar to extract use the following commands:
unrar e <filename.rar> use this to unpack the rar file in current directory
unrar l <filename.rar> use this to list the files inside the archive
unrar x <filename.rar> use this to extract the files with the full path
unrar t <filename.rar> use this to test the integrity of archive

Now for those who wish to compress files into the rar archived format, we have the rar application and the following commands will come in handy:

rar a <desired filename.rar> <path of directory to archieve> use this to create a normal compressed rar archieve
rar a <desired filename.rar> <path to file1> <path to file2> <path to file3> … use this more multiple individual files to be archived into a sigle rar file.
rar a -p<password> <desired filename.rar> <path to dir or file> use this to password protect the rar files
rar a -m<level of compression 1-least 5-best> -v<size of each rar file> <desired filename.rar><path to dir or file> use this to split the file to a number of rar archived files of desired size.

Now to get all this and install the rar and unrar application, proceed with the following commands:

wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
cp rar unrar /bin

Continue Reading

YUMmy problem in Centos 5.3

This is a rare issue found in certain VPSes purchased recently. There will be no problem within the system but yum will refuse to function properly. No installations or updations will be possible with yum. All you get to see is a collection of error statements in the shell (upon running the yum command):

Loaded plugins: fastestmirror
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
File “/usr/bin/yum”, line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File “/usr/share/yum-cli/yummain.py”, line 229, in user_main
errcode = main(args)
File “/usr/share/yum-cli/yummain.py”, line 84, in main
base.getOptionsConfig(args)
File “/usr/share/yum-cli/cli.py”, line 184, in getOptionsConfig
enabled_plugins=self.optparser._splitArg(opts.enableplugins))
File “/usr/lib/python2.4/site-packages/yum/__init__.py”, line 191, in _getConfig
self._conf = config.readMainConfig(startupconf)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 754, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File “/usr/lib/python2.4/site-packages/yum/config.py”, line 824, in _getsysver
idx = ts.dbMatch(‘provides’, distroverpkg)
TypeError: rpmdb open failed

At the same time rpm is also not found to be working for any of the users reporting this issue. ‘rpm’ simply will not install any rpm packaged file. It will exit with no result.

To solve the issue execute the following commands as root:

#rm /dev/urandom
#mknod -m 644 /dev/urandom c 1 9
#yum clean all
#yum update all

Continue Reading

Howto find what distribution of Linux, you are running ?

I often compare different distributions of Linux with different flavors of icecream. Usually the comparison does click, for those who are confused with the versions and demands redhat linux on their desktop. Whenever I go to a home to install linux, they often want Redhat Linux. And it would my job to make them understand that we know their tastes better, when it comes to linux and end up in installing Ubuntu.

However in sysadmin profession, we logs into 100s of boxes every day. How do we know which version of Linux is installed and other details ? For debian based boxes, you check /etc/*version and redhat based boxes we do /etc/*release. But what about others and tons of flavors out there ?

Solution resides with Linux Standard Base, best explained at http://en.wikipedia.org/wiki/Linux_Standard_Base which is a joint project by several Linux distributions under the organizational structure of the Linux Foundation

Know the command lsb_release and find them all.

lsb_release –all

Linux tip for the day :)

Continue Reading

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later