Investigating What a Process is Actually Doing in Linux With strace

If you need to debug a process in a linux environment, the simplest yet very effective solution should be strace. It can be easily installed with “yum install strace” or “apt-get install strace” depending on the type of Linux you’re on. Here are some usage samples. First of all, if you don’t have a shortcut to strace, you… Read More »

Uncategorized

How to Open Links in a New Tab in Hesk 2.5.2

If you have used Hesk before, you must have mentioned that all links that were posted by users at the time of ticlet creation/reply were opening in new tabs. If you decide to update to 2.5.2 (I was using version 2.3 before), you will notice that all links will be opening in the current tab. If you want… Read More »

Uncategorized

configure: error: utf8_mime2text() has new signature – How to Resolve

If you’re getting this error while configuring PHP: configure: error: utf8_mime2text() has new signature You should use a simple solution to resolve this: yum install libc-client-devel.i686 and libc-client-devel.x86_64 This error usually appears when you’re trying to install IMAP support on a 64-bit system.

Uncategorized

SSL read: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure, errno 0

After another PHP recompilation I’ve started getting the following error while trying to access SSL websites with cURL: 56 SSL read: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure, errno 0 What does this mean and how to solve this issue? This means your cURL installation is trying to use the wrong number of SSL protocol. All you need to resolve this… Read More »

Uncategorized

How to add IMAP Support for PHP in Centos x64

If you need to install IMAP support for php on a 64-bit machine, it is not that simple. There are some additional steps you need to follow to make it working. First of all, you may try to reconfigure PHP. If you have Directadmin or any other control panel installed, you might have imap library installed. Just add… Read More »

Uncategorized

How to Show Only Duplicate Values From an Array With PHP

If you have an array with duplicate values, sometimes you might need to show only non-unique elements. Here is a short code in PHP that will allow you to do this. <? $arr=array_map(“trim”, file(“file.txt”)); $nonuniq=array_unique(array_diff_assoc($arr, array_unique($arr))); ?> This will return unique array of duplicates. If you need to show all duplicated values, use this code. <? $arr=array_map(“trim”, file(“file.txt”));… Read More »

Uncategorized

How to Get Paypal Account Balance via API – PHP Solution

If you need to verify your Paypal account balance for any reason, a simple script will help you to do this. First of all, you need to request API credintials, if you haven’t done this yet. A detailed instruction is available here. Actually interface is a bit different, but it still can be found under “My account” section.… Read More »

Uncategorized

How to Turn Off Remote Code Execution in php.ini

This is not a trick, but a must for server security. If you would like to limit your users’ ability to execute the code, located on remote servers, you should ensure your php.ini has the following lines: allow_url_fopen=Off allow_url_include=Off Of course, this will not save you from insecure code, but this is one of the first steps you… Read More »

Uncategorized