May 2013
1 post
8 tags
How to gracefully handle cache expiration
I received few inquires for a technical run down of how Memcached wrapper handles expiration of keys.
When I first read about this concept, it was pretty hard to understand since most of the sources were way too technical (the fact that English is my second language probably did not help either) for somebody who just entered word of ‘holy crap! you can store stuff in memory’.
I...
April 2013
2 posts
21 tags
Store your application files in Memcached pool...
This package provides a way to store your application files in Memcached pool with automatic
parsing using eval() upon retrieval.
I wrote this after trolling a friend of mine how storing files in Memcached is faster than including
them from disk, so while there are definite uses for this under right circumstances make sure you understand
what you are doing.
Performance
First let’s...
New version of Memcached Wrapper for PHP 5
I updated my Memcached wrapper and moved away from a static approach to a more dynamic approach that supports multiple pools (as some of you requested).
Also the wrapper will now pass any direct methods to the extension, so you get exactly the same functionality as you do using Memcached with a benefit of a smart caching layer.
If you still need a static version of the wrapper you can find it...
February 2013
4 posts
6 tags
Retrieving default billing and shipping...
I recently got to play around with Magento (eCommerce platform based on Zend Framework) and had to figure out
default billing and shipping information for all of our current clients.
Apparently developer community build around Magento is pretty amateurish judging by technical discussions
that are found on their forums.
When I looked up how to retrieve default address information, the...
7 tags
Simple framework wrapper for Amazon's AWS SDK for...
If you interact with any of Amazon’s Web Services using PHP you should be using their SDK.
It’s very powerful and pretty simple to get started with.
In my case I did not want to checkout their whole repository into my frameworks namespace and decided to use .phar file they provided as
an alternative.
To me, using a .phar file for third party libraries kind of makes sense if...
January 2013
1 post
August 2012
2 posts
9 tags
Updated PHP 5 client for Cloud Servers(tm) by...
Just a quick announcement that I updated my PHP 5 client for Cloud Servers(tm) API.
Some of the major fixes include retry limiting for authentication requests, support for updated response codes (especially for server/image requests) and better examples.
Code was also updated to conform to PSR-2 and phpDocumentator 2.
Grab the latest version...
11 tags
A re-factored plug-n-play PHP 5 client for...
I have pretty high standards when it comes to code and felt like the current PHP 5 library that Twilio offered did not really fit well with modern frameworks.
So I decided to rewrite it, if you have your own framework and looking for a cleaner Twilio client make sure give this a try.
Features
Direct plug-in-play integration with PHP 5 based frameworks
Namespace utilization, ability to piggy...
December 2011
1 post
July 2011
4 posts
10 tags
Q&A: Can you demonstrate how to perform binary...
I decided it’s time to start posting (interesting) questions I receive from time to time; today’s question will be about binary search in PHP.
Since it seems that there are multiple of discussions on this subject within Java/C++ community mostly leaving PHP programmers in the dark.
In layman’s terms (using numbers as example) binary search takes an array of sorted numbers,...
6 tags
Facebook: Jerry Cain Updated JavaScript SDK and...
Facebook released updated Roadmap SDK/OAuth 2.0, you can read more about it here: http://developers.facebook.com/blog/post/525/
I will keep a close eye on it, since the change-set will affect my php-sdk patch:
http://alekseykorzun.com/post/6925234287/integrating-facebooks-social-plug-ins-with-facebook-php
Highlights:
July 22:
Updated JavaScript SDK available
Migration setting changes
...
9 tags
High scalability and MySQL's NOW() don't mix
When developers optimize their applications, the usage of NOW() and other dynamic MySQL methods is often overlooked.
The problem with using NOW() (and other identical methods) that the query will always be dynamic, which means that there will be no cache record within the database.
So every single request that invokes dynamic time operations/etc queries will be treated as a completely fresh...
June 2011
8 posts
6 tags
Final revision of Google.com pushed (12:00AM EST)
Google just pushed final revision to their home page and search results. (12:00AM EST)
9 tags
Integrating Facebook's Social Plug-ins with...
I made a quick modification to Facebook’s PHP SDK (v.3.0.0) that seamlessly integrates new token format that Facebook’s social plug-ins utilize.
No need to settle for older (v2.2.x) version of SDK or create dirty work arounds in order to retrieve and pass token data to PHP.
Grab it from: https://github.com/AlekseyKorzun/php-sdk
Here is a diff if you just want to patch v.3.x SDK on...
11 tags
Why are you still using Facebook's legacy...
Usually when developers focus on page load times, things like third party API’s are often overlooked or simply ignored (it works, why should I re-implement this?!).
Today I noticed that one of the web sites I visit still used old Javascript SDK offered by Facebook. To my surprise that seemed to be a very common trend: http://www.google.com/&q=%22Cross-domain+Receiver+Page%22
In some...
6 tags
phpAudit v1.0
phpAudit is a simple shell script that scans PHP files for possible security risks.
I made this script to speed up verification of third party PHP libraries/code (so a random fork of XYZ API library does not send your credentials to a third-party server via a sneaky method).
Usage:
Make sure script has execution permissions (chmod a+x phpAudit) and simply run:
./phpAudit...
8 tags
13 tags
Senate.gov has been hacked; 87 year old security...
LulzSecurity has announced that they managed to successfully gain entry into Senate.gov’s web server(s).
Observations
Based on data that was released we can make following observations:
SSHD daemon allowed connections outside of the internal network.
Single machine hosted multiple web-sites; which means that a successful attack on one of the neglected web sites would grant full...
8 tags
Bug fix Monday: SPLFixedArray issue has been...
Felipe Pena has committed a proper fix to address a pesky object storage issue within SPLFixedArray I stumbled upon.
http://bugs.php.net/bug.php?id=54609
10 tags
High performance content hosting with Lighttpd
Today, I will share a (slightly outdated) presentation I wrote on content hosting.
It will demonstrate some optimization techniques for FreeBSD and Lighttpd that I have successfully used to serve a large number of requests on http://www.imagesocket.com.
If you have any questions, please feel free to contact me!
(If you are unable to view embedded content, please give this a try: )
May 2011
7 posts
nickel-nickel-nine asked: I LOVE YOUR CAR. im in the process of finding one to buy and want to make it look somewhat like yours. thanks for the awesome pics!
9 tags
1 tag
8 tags
Debugging Apache/PHP/* crashes on FreeBSD OS
I will focus on Apache/PHP as this is a primary technology stack I interact with but you can freely apply principals demonstrated to debug other applications.
There are two ways to debug an application, the easiest approach is to simply wait for it to crash and generate a core dump that can work with. Another way is to use a real time debugging tool such as truss to monitor process from the...
9 tags
Serializing/unserializing of nested objects with...
Teddy Grenman has released a proper fix for serialization of nested objects I previously wrote about.
You can grab 1.1.2-DEV version (as of right now) that includes the fix here: https://github.com/igbinary/
If you are running FreeBSD, upgrading is simple as:
cd /usr/ports/converters/igbinary
git clone https://github.com/igbinary/igbinary.git
cd igbinary/
phpize && ./configure...
5 tags
Issues with IgBinary serializer + PECL-Memcached
If you already have or plan on having nested set of PHP objects (collections, etc), it’s best to avoid using SERIALIZER_IGBINARY directive and stick to SERIALIZER_PHP for now.
Teddy Grenman (IgBinary lead) responded rather quickly to a bug report I submitted on the development group, so I will keep you guys posted.
View this issue on PHP’s bug tracker:...