27 Feb

Solving “Can’t locate File/Which.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)”

To solve this problem:

 Can't locate File/Which.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 
 BEGIN failed--compilation aborted

you just need to install perl-File-Which package:

yum install perl-File-Which
18 Aug

Workaround for ‘/usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one character’

There’s a bug in rpm package: https://bugzilla.redhat.com/show_bug.cgi?id=304121

It causes the following error while building rpm packages:

/usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one

As a workaround you can use this command:

rpmbuild -bb rpmbuild/SPECS/package.spec -D 'debug_package %{nil}'

It will disable building of debug package and that’s it.

29 Apr

Amazon PHP SDK installation on Centos (via pear)

Installation of dependencies:

yum install php-channel-aws.noarch php-channel-guzzle.noarch php-symfony2-EventDispatcher.noarch

Installation of the library itself:

pear install aws/sdk


[root@robo ~]# pear info aws/sdk
Release Type PEAR-style PHP-based Package
Name sdk
Channel pear.amazonwebservices.com
Summary Official PHP SDK for Amazon Web Services.
Description The AWS SDK for PHP enables PHP developers to
easily work with Amazon Web Services and build
scalable solutions with Amazon S3, Amazon
DynamoDB, Amazon Glacier, and more.
Maintainers Michael Dowling <[email protected]> (lead)
Jeremy Lindblom <[email protected]>
Ryan Parman <[email protected]> (developer,
Release Date 2013-03-18 17:30:25
Release Version 2.2.1 (stable)
API Version 2.2.1 (stable)
License Apache 2.0 (http://aws.amazon.com/apache2.0/)
Release Notes This release adds convenience features for the
Amazon S3 client, updates the Amazon RDS client
to use the latest API version, resolves an issue
with the Amazon EC2 client, and includes support
for additional regions and other enhancements.
Required Dependencies PHP version 5.3.3
PEAR installer version 1.4.0 or newer
Package guzzlephp.org/pear/Guzzle
Version 3.0.3 or newer
Extension curl
package.xml version 2.0
Last Modified 2013-04-16 16:10
Previous Installed - None -
[root@robo ~]#

Getting list of installed files (there are a lot of them):

 pear list-files aws/sdk

If it doesn’t work for you, try this way:

pear -D auto_discover=1 install pear.amazonwebservices.com/sdk
27 Mar

How to setup ionCube loader on Centos 6.4

If you need to install ionCube loader on Centos 6.4 you will need either to enable Atomic repository on your Linux box or to download their SRPM package and rebuild it.

Way 1

wget -q -O - http://www.atomicorp.com/installers/atomic |sh
yum install php-ioncube-loader

Way 2

rpm -ivh rpmbuild/RPMS/x86_64/php-ioncube-loader-4.2.2-2.art.x86_64.rpm
rpmbuild -bb ~/rpmbuild/SPECS/php-ioncube-loader-art.spec
rpm -ivh rpmbuild/RPMS/x86_64/php-ioncube-loader-4.2.2-2.art.x86_64.rpm


[root@sched ~]# php -v
PHP 5.4.13 (cli) (built: Mar 14 2013 08:57:49)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.
[root@sched ~]#
14 Mar

fail2ban setup on Centos

fail2ban is a simple daemon (written in Python, BTW) which monitors your Linux server logs and is able to prevent bruteforce attacks by adding bad IP addresses to iptables. This is a simple self reminder on how to setup it.

yum install fail2ban
vim /etc/fail2ban/jail.conf

If you want fail2ban to only notify you  (and not add them to iptables) modify the configuratio files this way:

action = sendmail-whois[name=SSH, [email protected], [email protected]]

It would be wise to add your IP addresses to be ignored:

ignoreip =


service fail2ban start

Enable auto start:

chkconfig fail2ban on

Now if somebody tries to brueforce your SSH you’ll get a mail.