Tuesday, August 22, 2017

Jenkins Pipeline code to run in a particular label


    node('TestLabel') {

        stage('Build') {
           
                echo 'Building..'
           
        }
        stage('Test') {
           
                echo 'Testing..'
           
        }
        stage('Deploy') {
           
                echo 'Deploying....'
           
        }

    }

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
extension=mongo.so

Restart apache
service httpd restart

Verify
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.

Tuesday, July 11, 2017

ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50556. Please use mysql_upgrade to fix this error.

I am getting the following error in mysql operation.

ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50556. Please use mysql_upgrade to fix this error.

Solution:

Login to the server
[root@blackmagic ~]# mysql_upgrade -u root -p
Enter password:

(Enter your password)

This will fix the issue and its solved.

Thursday, June 15, 2017

monit dead but pid file exists

When I tried to start monit process, I am getting the following error

monit dead but pid file exists

Issue is solved by the following setps:

1. Login to the server.
2. vim /etc/monit.conf
Remove the following line set statefile /var/monit/state
3. Restart monit

Click here to see the steps to solve - monit dead but subsys locked