Archive for the ‘ Miscellaneous ’ Category

Ntpdate Not syncing time correctly – Xen Host

I came across a situation where ntpdate would not sync the time correctly in a Xen Virtual machine. The time was 10 minutes ahead of what it was supposed to be. Apparently , you need to force it to not use the dom0’s clock.

vi /etc/sysctl.conf
xen.independent_wallclock = 1
sysctl -p

NFS Version 4 Export

Install the required Packages:

yum install nfs-utils nfs4-acl-tools portmap

Export the folder to share:

echo "/folder/to/share  IpAddressToShareWith(rw,no_root_squash,async,fsid=0)" >> /etc/exports

Map NFS User for ownership:

vi /etc/idmapd.conf

Domain=YourDomain.com

 

 

Nobody-User=apache Nobody-Group=apache

Iptables Rule :

iptables -A INPUT -p tcp -m tcp --dport 2049 -j ACCEPT

Start / Restart Services :

service nfs start
service rpcidmapd restart
service portmap start

SSL Root Certificate update in Linux for curl

When you use curl in Linux machines to make remote calls to SSL sites, you need to have latest root certificates installed. Recently I came across a situation where the newer root certificate were not available and so the remote call suddenly started failing.

First, you will have to find the location of your certificate files :

curl-config --ca

Now, you download the latest bundle to the path found from above , which usually is /etc/pki/tls folder

curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt

 

You can check whether the curl call works by sample command given below :

curl --verbose --cacert ./certs/verisign-intermediate-ca.crt --head https://remotesite.com/

Reset A2Billing admin password

echo "update cc_ui_authen set pwd_encoded = '410fc6268dd3332226de95e42d9efa4046c5463769d7493b85e65cfa5c26362dc2455cc23c0bc5831deb008def4ab11a9eaa9b76ba3f377da134f39ec60dd758' where login='root'" | mysql -pPASSWORD DATABASE

 

This will reset username and password to : root/changepassword

Perl Issues and Solutions

Display The Include paths for perl :

perl -e 'print join("\n", @INC);'

View Cpan Configuration:

cpan>o conf

Find perl module’s Path:

perl -MList::Util -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'