Very interesting problem with cacti and mysql strict mode!

It was very interesting as my cacti installation began failing today. For no apparent reason. I noticed CPU usage and CPU temperature going through the roof as PHP script ran by cacti was stuck in some infinite loop or active wait state. It seemed to query database non stop without sleeping or anything and it was not doing anything either.

I looked in error log and there was nothing, looked in access log of monitored server ... nothing again. Finally i looked into cacti log and found tons of messages like this:

How to automate testing of a mobile domain redirections with jmeter

There are many ways to implement mobile version of your website but easiest and probably cleanest one is to use mobile subdomain.

Once you have your mobile website you want to implement an automated test suite to be able to regression test the functionality after every release. You also want the test suite to be easy to configure and run it against test environment. In perfect world you want the test suite to run as part of the continous integration setup. Jmeter allows for all of that and is free. As a huge fan of jmeter i recommend you download it and play around with it as soon as possible.

In this article I describe how to create a test suite for mobile website redirects, you can also download my jmeter test plan and customise it to test your own websites.

How to build a jmeter plugin utilising groovy

This is just a very short and simple example of how to build a jmeter plugin. Jmeter is awesome and allows you to extend it by adding all sorts of components. What i wanted to do was to have separate test plans and reuse the configuration variable sets. My use case is that i want to have set of global settings with ability to override some of them with additional config files.

How to build jmeter from sources in eclipse

Jakarta jmeter is an awesome tool. I deeply encourage to experiment with it. If you want to see more details on how it is implemented or write your extension it may be worth compiling it from sources on your machine.

Here is a quick guide how to setup a eclipse project and what to do to build jmeter from sources and run it locally.

How to properly secure remote API calls over SSL from PHP code

Lets make something clear from the very start: JUST BECAUSE THERE IS https:// IN THE URL OF THE REMOTE SERVICE IT DOES NOT MEAN THE CONNECTION IS SECURE!

I am sorry for the tone of this post but i am enraged by how popular this issue is online. If you ask why i suggest a little experiment.

Steps to follow

  • Change your host file settings to point something like www.somedomain.com to your development server
  • Create a self signed certificate for this domain and setup a https virtual host to serve it on local IP or alias
  • Put a test file on that URL

How to check if you have PAX in your linux kernel - address space randomization

I guess most of people have heard of address space randomization and linux kernel patches that provide that. PAX is a project that has been running for years and it is an awesome way to reduce risk of buffer overflow attacks on your linux server. The great thing about it is that it makes it harder to execute most common buffer overflows system-wide.

Announcing first release of mobile skin for my blog

I know it is not really anything special in our times to have mobile skin of your blog or website but it is still a nice thing to have. I am sure that there are tons of ready to use plugins for the software that i am using but i wanted to play around a bit myself and learn some new library. My blog is my little sandbox any way so i prefer to learn on it and make mistakes here than in real work.

How to structure a Zend Framework application and it's dependencies

I have been thinking a bit recently how to manage dependencies and how to structure Zend Framework based applications to make the code less coupled, more testable and less dependent on the global scope.

I don't mean to be negative but I am not too happy about the web application structure that most articles and books present. In Zend Framework world controller seems to be the place when things get done. Controller is the workhorse and this is where all the logic seems to be buried. It also seems to me that model in MVC is reduced to database integration but there is no services layer for some reason. Where ever you look you will see the same examples with controller doing all the work and models being simple Zend_Db_Table or Zend_Db_Table_Row instances. You will not see business logic focused classes, Controller or DB Model, thats all you can choose from.

Review - Pro Zend Framework Techniques: Build a Full CMS Project


I think it is not a really bad book as it provides quite a good introduction to Zend Framework. Especially with a lack of any good Zend Framework literature i guess it may be still worth to read it.

I would not recommend it to people who work with Zend Framework already. You will probably not find a lot of new information in it. If you are starting your journey with Zend Framework or with MVC in general i guess you may benefit from the book quite a lot.

Book also provides some nice foundation for the CMS design. So if you decided that Drupal is not good enough and you want to spend months writing your own CMS then you may want to check out this book :)

Constructor in an interface and inheritance, what are the rules?

I saw a post recently and it got me thinking, should constructor of a child class follow the signature of its parent? My gut feeling was telling me it should not really matter. Constructor is not part of the Interface nor part of the public API that object exposes (not a class).

On the other hand i like the rule of least surprise and I like to have arguments in same order across the API (if it makes sense).

Author suggests that it is a good idea to use same arguments lists in exceptions derived from \Exception. I don't really think its a bad idea i am just wondering does it have anything to do with inheritance as the article suggests (i think the argumentation is not very accurate in this case).

Google maps API version 3 is easier to use than ever before

Google APIs are one of the best that is not a secret but seems like Google Maps are even nicer and easier to use in the 3rd version. I just had a look on the APIs last Thursday night and noticed that a few things are even better than before. Let me show a simple example and a few easy features you can use to put a Google map on your website in a matter of an hour!

PHP type hints cause catchable fatal error when argument is null

It is funny how often you can get caught by surprise that PHP is not Java. I have been using type hints in PHP for a long time but somehow i did not came across that for a long time.

If you have a method that type hints the parameter you wont be able to pass null in as in PHP null is not just unknown value but it is also a type.

How to compile PHP 5.2 extensions on Mac 10.6 snow leopard with MAMP and a 64 bit CPU

It is a bit frustrating that i have to use mac and can not just use the same system that we have in production but well, that is the standard now. So to make the best of it you have to adapt and learn how to deal with operating system issues ;)

I found it a bit tricky to compile PHP extensions like PECL memcache or whatever on my mac for a few reasons. My mac comes with PHP 5.3 and i need to run my site on 5.2 that i got from MAMP. In addition i have 64 bit system that runs PHP in 32 bit mode so i have to tell compiler to use 32 bit mode only.

Review - Sun Tzu Art Of War


It has been a long time since i read any non technical book. I was tempted to read this one for a long time so i did. It is a very strange book but also very inspirational.

First of all there is a lot of debate over the translation so each translator puts his own twist on how it should be interpreted. Second of all there is confusion who actually wrote the original text.

It is a very different read than anything i have read before. Interesting in a way but not really easy nor fun as text is much more difficult than i am used to. I thought the book would have more of psychological aspect and discipline than actual tips on how to deploy your troops. I hoped for a bit more philosophy and little bit less warfare ;-)

Review - Agile Software Development: Principles Patterns...


To make it short and clear, I liked the book a lot. From a very begining it is clear that author has a vast experience in software design and development.

There are a few bits that really stand out.

First of all I loved the chapter showin pair programming and minimal effort principles. It is really fun to read and shows some very interesting observations.

Syndicate content