Archive

Archive for the ‘Linux’ Category

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/imagick.so’ – liblcms2.so.2: cannot open shared object file: No such file or directory in Unknown on line 0

September 18, 2014 Leave a comment

Not able to install imagick on CentOS, fedora or RHEL

liblcms2.so.2: cannot open shared object file

Install following packages in RHEL, fedora or CentOS

yum install lcms2

Categories: Centos, Linux Tags:

ILO monitoring with Zabbix

September 9, 2014 Leave a comment

ILO monitring can be done via ipmi checks, you need to install freeipmi on linux: yum install freeipmi

/usr/sbin/ipmi-sensors -D LAN2_0 -h 192.168.0.7 -u administrator -p PASSWORD -l USER -W discretereading –no-header-output –quiet-cache –sdr-cache-recreate –comma-separated-output –entity-sensor-names

output:

0,System Chassis 1 UID Light,OEM Reserved,N/A,N/A,’OEM Event = 0000h’
1,System Chassis 2 Sys. Health LED,OEM Reserved,N/A,N/A,’OEM Event = 0000h’
2,Power Supply 1 Power Supply 1,Power Supply,45.00,W,’Presence detected’
3,Power Supply 2 Power Supply 2,Power Supply,90.00,W,’Presence detected’
4,Power Supply 3 Power Supplies,Power Supply,N/A,N/A,’Fully Redundant’
6,System Board 1 Fan 1,Fan,29.40,%,’transition to Running’
7,System Board 2 Fan 2,Fan,29.40,%,’transition to Running’
8,System Board 3 Fan 3,Fan,30.58,%,’transition to Running’
9,System Board 4 Fan 4,Fan,30.58,%,’transition to Running’
10,System Board 5 Fan 5,Fan,25.87,%,’transition to Running’
11,System Board 6 Fan 6,Fan,13.72,%,’transition to Running’
12,System Board 7 Fans,Fan,N/A,N/A,’Fully Redundant’
14,Air Inlet Temp 1,Temperature,21.00,C,’OK’
15,Processor 1 Temp 2,Temperature,40.00,C,’OK’
16,Processor 2 Temp 3,Temperature,40.00,C,’OK’
17,Memory Module 1 Temp 4,Temperature,30.00,C,’OK’
18,Memory Module 2 Temp 5,Temperature,29.00,C,’OK’
19,Memory Module 3 Temp 6,Temperature,36.00,C,’OK’
20,Memory Module 4 Temp 7,Temperature,36.00,C,’OK’
21,Power Unit 1 Temp 8,Temperature,42.00,C,’OK’
22,Power Unit 2 Temp 9,Temperature,36.00,C,’OK’
23,System Board 1 Temp 10,Temperature,43.00,C,’OK’
24,System Board 2 Temp 11,Temperature,33.00,C,’OK’
25,System Board 3 Temp 12,Temperature,40.00,C,’OK’
26,System Internal Expansion Board 1 Temp 13,Temperature,33.00,C,’OK’
27,System Internal Expansion Board 2 Temp 14,Temperature,35.00,C,’OK’
28,System Internal Expansion Board 3 Temp 15,Temperature,34.00,C,’OK’

when you ensure that ipmi is enabled on your server, and basic check is working, lets go to zabbix and set it up.

In Zabbix create a host with ipmi interface, and in IPMI tab setup the parameters, bellow are screenshots

ipmi-zabbix-2

ipmi-zabbix-3

Categories: Linux, zabbix Tags: , ,

Find out which version of Centos/Red Hat/Fedora you are running

September 9, 2014 Leave a comment

bojan@veprina:~$ lsb_release -a

LSB Version:    :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID:    CentOS
Description:    CentOS release 6.4 (Final)
Release:    6.4
Codename:    Final

Categories: Centos, Linux

svn sync repo to local

If you need to sync for example public repository to local for purposes of backup or offline co, here is how to:

cd /data/repos/svn/
mkdir newrepo
NEWREPO=/data/repos/svn/newrepo/
echo ‘#!/bin/sh’ > $NEWREPO/hooks/pre-revprop-change
chmod +x $NEWREPO/hooks/pre-revprop-change
svnsync init file://$NEWREPO http://public.repo.url
svnsync sync file://$NEWREPO

User name and password is asked, exploring the posibility to add user to skip u/p prompts.

Categories: Linux

bind querlog

add this to your named.conf to enable more detail logging of whats your nameserver used to resolve.

 

logging {
        channel default_debug {
                file “data/named.run”;
                severity dynamic;
        };
        #test
        channel querylog{
                file “/var/named/chroot/var/log/querylog”;
                severity debug 10;
                print-category yes;
                print-time yes;
                print-severity yes;
        };
        category queries { querylog;};
};

Categories: Linux

802.1x auth on linux.

yum install wpa_supplicant

configuration: /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

interface configuration: /etc/sysconfig/network-scripts/ifcfg-eth0

###domain credentials for RealGarant
###user: username
###pass: Jy0wvJay
DEVICE=”eth0″
NM_CONTROLLED=”yes”
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=”System eth0″
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IEEE_8021X_EAP_METHODS=PEAP
IEEE_8021X_IDENTITY=”DOMAIN\\username”
IEEE_8021X_PASSWORD=Jy0wvJay
IEEE_8021X_CA_CERT=/root/new-CA.cer
KEY_MGMT=IEEE8021X
HWADDR=08:00:27:01:F8:C6
IEEE_8021X_INNER_AUTH_METHODS=MSCHAPV2
IPADDR=192.168.11.73
PREFIX=27
GATEWAY=192.168.11.65
DNS1=192.168.10.111
DNS2=192.168.20.111
LAST_CONNECT=1396438390

wpa_supplicant -Bw -Dwext -i eth0 -c /etc/wpa_supplicant.conf
Categories: Linux

search and replace for string in file

January 4, 2013 1 comment

sed -i 's/old-word/new-word/g' *.txt

Categories: Linux, OS X

find disk uuid

December 27, 2012 Leave a comment

ls -l /dev/disk/by-uuid/

output:

total 0
lrwxrwxrwx. 1 root root 10 Dec 26 15:39 1cf41136-4eb3-400d-be36-a0b90fb87b8e -> ../../sda1
lrwxrwxrwx. 1 root root 10 Dec 26 15:39 232e01ec-3e89-4fa2-bbbe-c010dd41e429 -> ../../dm-0
lrwxrwxrwx. 1 root root 10 Dec 26 15:39 e95ea07d-b3c3-4b34-bd9f-4aadabbc679f -> ../../dm-1

Categories: Linux, OS X Tags: , ,

piix4_smbus force_addr=0xaddr

December 3, 2012 Leave a comment
piix4_smbus 0000.00.07.0: SMBus base address uninitialized - upgrade bios or use force_addr=0xaddr

This error is caused by VM having no smbus but Ubuntu always trying to load the module. It doesn’t affect anything but is a bit annoying – to fix: –

1. Check module is being loaded: –

lsmod | grep i2c_piix4

2. If so, blacklist it in /etc/modprobe.d/blacklist.conf, by adding the following to the end of the file :-

blacklist i2c_piix4

3. Update the initramfs

update-initramfs -u -k all

thanks to finster
Categories: Linux

add plone to startup /etc/init.d

November 21, 2012 Leave a comment

script that needs to be placed in /etc/init.d/ with permisions to execute chmod +x

chkconfig –add plone
chkconfig plone on

its chkconfig compliant

#!/bin/sh
 #chkconfig: 2345 95 20
 # description: script for plone making a service, not official solution.
 # processname: plone
start () {
 echo -e "Starting plone..."
# start daemon
 sudo -u plone /usr/local/Plone/zinstance/bin/plonectl start
 RETVAL=$?
 if [ $RETVAL = 0 ]
 then
 echo "done."
 else
 echo "failed. See error code for more information."
 fi
 return $RETVAL
 }
 stop () {
 # stop daemon
 echo -e "Stopping plone...\n"
sudo -u plone /usr/local/Plone/zinstance/bin/plonectl stop
 RETVAL=$?
if [ $RETVAL = 0 ]
 then
 echo "done."
 else
 echo "failed. See error code for more information."
 fi
 return $RETVAL
 }
case "$1" in
 start)
 start
 ;;
 stop)
 stop
 ;;
 *)
 echo $"Usage: plone {start|stop}"
 exit 3
 ;;
 esac
exit $RETVALexit $RETVAL
Categories: Linux