PHP strpos function not working – It does, just not the way you expect

strpos($needle,$hey_stack);  returns the exact the position of the the needle in the heystack.

The powerful/easy-to-use if(strpos(‘hey’,’hey world’)){//do something}else{//do something else} feature of PHP is also a major weakness if you do not fully understand how if statements in PHP work.

Continue reading “PHP strpos function not working – It does, just not the way you expect”

PHP Multi-thread Asynchronous Process Manager

PHP Multi-thread Asynchronous Process Manager

I have been build some background apps recently which need to do a lot of repetitions (think 100,000 times the same task which takes about 0.25 to 1 second to execute, of which most of it is waiting for the remote server to respond). Since these are daily and are not that server intensive it made sense to run them concurrently so instead of taking the good part of the day it just takes a few hours. I noticed on the proc_open page there was a very nice solution by Matou Havlena of havlena.net.

Continue reading “PHP Multi-thread Asynchronous Process Manager”

Password Hashing – With some smart salt

Password Hashing – With some smart salt

Basic hashing of passwords is poor. LinkedIn should have expected that one day that their password list would be stolen and when that happened it should have been hashed better so a standard dictionary could not reverse the passwords. Tthe LinkedIn passwords were leaked all over internet and with the help of crowd-sourced hackers the passwords were easily reversed back from SHA-1 hashes substrings to the plain text passwords. With tools like John the Ripper social hackers like Francois Pesce was able to reverse over 2 million LinkedIn passwords.

Continue reading “Password Hashing – With some smart salt”