Static vs Non-static methods in PHP: what is faster?

Posted by Stanislav Furman on May 4, 2014
What is faster? Comparison of static and non-static class methods in PHP.

Apple has iWatch already in production, report says

Posted by Stanislav Furman on April 30, 2014

Apple has iWatch already in production, report says

According to China Times Apple has already started produciton of the long-rumored wearable computer watch known as the iWatch.

Apple has never officially announced a new wearable device characteristics. However, the company's CEO Tim Cook hinted that it would not be similar to "smart glasses" idea. According to media reports, the device will be have the look of an average dimension bracelet width of with color touchscreen.

It's been said that IWatch release was scheduled for the summer 2014, so it is more-llikely that some of the components for the gadget are ready. Components are typical for various devices such as MP3-players. However, this information is not sufficient to predict the shape of the future gadget.

Regular expressions? What's that?

Posted by Stanislav Furman on April 29, 2014

Apparently, the person who wrote this code has never heard about regular expressions. :)

$find = str_replace(",", "", $find);
$find = str_replace(".", "", $find);
$find = str_replace("/", "", $find);
$find = str_replace(" ", "", $find);
$find = str_replace("-", "", $find);
$find = str_replace("+", "", $find);
$find = str_replace("#", "", $find);

Please, never repeat this! :)

IE users risk having their computers hacked and taken over

Posted by Stanislav Furman on April 28, 2014


There is a major security whole affecting several versions of Internet Explorer has been discovered recently. 

Microsoft has announced that Internet Explorer versions from IE6 to IE11 are all vulnerable to a glitch that could be used by hackers to get remote access to a victim’s PC.

"On completion of this investigation, Microsoft will take the appropriate action to protect our customers, which may include providing a solution through our monthly security update release process, or an out-of-cycle security update, depending on customer needs." , - Microsoft stated in their official press release.

According to W3Schools web browser usage stats this security issue may affect on 1 from 10 Internet users.

Unix shell commands to detect a DDoS attack and its source

Posted by Stanislav Furman on April 25, 2014

5 unix shell commands to detect a DDoS attack

Hello Coders!

In this article I'd like to show you a few handy Unix shell commands that would help you to detect if your server is (was) under DDoS/DoS attack. However, keep in mind, that protection from DDoS attacks is quite complex and if you are dealing with a massive DDoS attack, you would need to contact your IPS or Hosting Provider (i.e. 1&1) for assistance. 

So. What do we work with? We can do some analysis based on your Apache access log data. Assuming you have a standard Apache access log, and you are running your website on Unix. Let's now get the total number of requests per day:

## Get number of requests per day:

awk '{print $4}' access.log | cut -d: -f1 | uniq -c

This will display you a list the total number of HTTP requests per day. See if you have any unusual increses comparing to other days. Now see the total number of requests per hour for a specific date (April 25th in this example):

Continue reading

This password is already in use. Old school security fail.

Posted by Stanislav Furman on April 23, 2014

Believe you or not but such fails have been seen! :)

Hopefully, these days you won't see such a message anywhere. LOL


RIP Nokia? Microsoft renames Nokia to Microsoft Mobile

Posted by Stanislav Furman on April 21, 2014


There is a lot of sources saying that Microsoft will rename Nokia to Microsoft Mobile when the deal is closed. It is not officially confimed yet, but looks like it's going there.

Honestly, I don't get why would they make such a decision. Nokia is world-wide known brand. A very good brand.

Anyhow, RIP Nokia. It's sad to see how old good brands die.


What Is the Heartbleed Encryption Bug?

Posted by Stanislav Furman on April 11, 2014

Redis: How to delete keys matching a pattern

Posted by Stanislav Furman on April 10, 2014

Sometimes you might want to purge a set of similar Redis keys in one shot. So far, standard Redis "DEL" command does not allow to remove keys using patterns. However, there is a trick to do this action. Execute the following command in bash:

redis-cli -h [host] -p [port] KEYS "prefix:*" | xargs redis-cli DEL

Seems clear? Wait a minute! What if you use multiple databases (keyspaces) and need to remove keys from a database different from default (0) one? No problem there! Here is the solution:

Continue reading

Backward version compatibility in PHP web application

Posted by Stanislav Furman on February 17, 2014
How to handle backward PHP version compatibility in your web application