Tuesday, August 15, 2017

Mongodb integration with PHP

In my CentOs box, i installed php5.5 and mongodb. Now i am getting the error
Mongodb is not enabled with PHP.

Solution to fix the issue.

Install gcc php-pear php-devel
yum install gcc php-pear php-devel php5-dev openssl-devel -y 

pecl install mongo
Cyrus SASL as "no"

vim /etc/php.ini

Restart apache
service httpd restart

php -m | grep -i mongo


323 packages excluded due to repository priority protections

When I run "yum update php*" operation, in CentOs i am getting the following error:

"323 packages excluded due to repository priority protections"

Solution to fix the issue:

This is because of the plugin "priorities" helps to solve this issue. Open the file
/etc/yum/pluginconf.d/priorities.conf  and change the value of enabled =1 to 0.

Execute  yum update php*

It works.

Thursday, August 10, 2017

jq - How we can use jq

jq - JSON processor. We can use this to parse a JSON file in bash scripts. Its an opensource and available in github. We can use this like our sed, awk and grep.

How we can install jq on Centos machine?

jq has no runtime dependencies as its written in C. We need to download and extract to use it. You can play around with jq from here.

wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
chmod +x ./jq
cp jq /usr/bin

Wednesday, July 12, 2017

How can we change from address in mutt

How can I change the from address in mutt?

Mutt is a mail client in Linux. By default the from address of the mail which is sent by muttrc will be the machine hostname. You can change that using the following steps.

1. Login to the server as root.
2. vi /etc/Muttrc
Update the file using the following.
set realname="Dennis Young"
set from="dennis.young@young.com"
set use_from=yes

3.Save the file

This helps to solve the issue.