LINUX

If you struggled to cope with disk I/O on virtual host machines which runs on Centos or RHEL, there is a great system performance tuning tool named TUNED, comes with different profiles. for installing tuned; yum install tuned -y starting the service permanently; service tuned start chkconfig tuned on service ktune start chkconfig ktune on […]

Deleting email from the exim queue is unfortunately not that simple. If you have a massive spammer in your system, you can clear the email originating from them with the command below. exim -bpru | tr ‘\n’ + | sed -e “s/++/=/g” | tr -d + | tr = ‘\n’ | grep “spammer@email.com” | awk […]

Sometimes when writing your bash scripts, you may need some information about the network, such as the IP addresses, both IPv4 and IPv6, broadcast addresses, netmasks and such. There are two very basic ways of getting the necessary information in Linux systems, you should either choose the ip addr show method, and parse what’s coming […]

Here’s a way to add JSON support for PHP on your CentOS server. yum install php-pear php-devel gcc make pecl install json cd /etc/php.d echo “extension=json.so” >> json.ini service httpd restart After these, you can easily check if it has been installed correctly. Either check your phpinfo() page or execute the following command.   php […]

mod_python is one of the easiest ways to use your Python Scripts as web pages. To install mod_python on your Centos 6 server, simply follow the steps below. We also recommend using our LAMP installer, this method can easily be implemented with our installer. To install mod_python, we need the EPEL repositories: rpm –import https://fedoraproject.org/static/0608B895.txt […]

People using Direct Admin usually do the mistake to install anything new by using the yum repositories. In fact, Direct Admin has a custom build method, so when you want to add something new to your system, you might need to recompile what’s allready installed. The same goes for the PHP-SOAP too. Yet don’t freak […]

Installation of IonCube Loader on any variaty of Linux is very simple. Just get the copy from ioncube webpage itself, http://www.ioncube.com/loaders.php We will download the 64-bit version for our example. Then extract the file, copy the shared object file that matches your PHP version to an appropriate folder. To learn your PHP version you can […]

rsync is a very useful tool when it comes to backing up multiple files from remote or local targets. Below are a few nice examples you can use. To backup the whole contents of your /home directory to let’s say a usb disk, use the following. rsync -av /home /media/usb_disk Note that this will create […]

Even though it’s easier to use yum, sometimes we need to compile PHP from source code. Below I’ll describe a method for compiling PHP 5.4.3 on CentOS, this works both on 5.x and 6.x and all the dependencies (except for PHP itself, of course ) will be retrieved via yum. After a fresh install of […]

rdesktop is the essential tool for Remote Desktop Management of Windows boxes using Linux as your local machine. It is sometimes crucial to be able to transfer files using rdesktop, especially when there isn’t any FTP service (or equivalent). Luckily rdesktop supports file transfer modes. Before connecting you the Windows box, let’s make a directory […]

Apache rewrite is an apache web server module which gives opportunity to change URL folders during opening of pages. At first it is hard to understand mod_rewrite but if you know what you are doing then it will become a usefull tool. You can reach the documents supplied by developer site located here: Apache Docs […]

BackupPC uses ssh and rsync to connect to the client hosts, backuppc user’s shared key must be distributed to client hosts in order log-in to the clients without password, you receive the error “filelist receive failed” as backuppc cannot log-in or cannot find rsync on the client. We assume that you already generated a private […]

Below I’ll describe a couple of nice methods to generate passwords using Python and Bash. Actually there are a lot of ways you can accomplish this especially with bash, but using the /dev/urandom file seems to be the most clever one. The /dev/urandom device doesn’t only generate read-friendly characters, so it’s best to filter out […]

[zimbra@ck]$ zmcontrol start Host mail.plugged.in Starting ldap…Done. Unable to determine enabled services from ldap. Enabled services read from cache. Service list may be inaccurate. Starting logger…Failed. Starting logswatch…ERROR: service.FAILURE (system failure: ZimbraLdapContext) (cause: javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) zimbra logger service is not enabled! […]

Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn’t work on compressed files. To overcome this, people usually advise to first  uncompress the file(s), and then grep your text, after that finally re-compress your file(s)… You don’t need to uncompress them in the first place. You can use […]

If you want to clear contents of a file in unix, you could just delete the file and recreate it. But there are much more simple alternatives. You can use echo method. To empty a file just enter the command below. I use my php_error.log file for example. echo -n > /home/base/logs/php_error.log That’s it. Your […]