Skip to main content

Why 09/11 Happened to USA

Few days ago I watched on history channel an documentary about Berlin Blockade in 1948. On Jun 24, 1948 Soviets started total blockade of Western part of Berlin, with goal to spread their control over whole city. All communitations were blocked, and citizens of West Berlin were faced with lack of food, medicine and fuel for upcoming winter.

American response was quick, and starting from Jun 25 they launched a massive airlift using both civil and military aircrafts that flew supplies into the Western Berlin. Aircrafts were fly by volunteers, mostly by experienced WWII pilots who flew day and night, sometimes without sleep. Landing on improvised Berlin airport was very hard (especially during bad weather) – many brave pilots died during this mission.

One of the pilots involved in this mission was Gail Halvorsen. One day during pause between two flights he gave a few sticks of chewing gum to some children watching the planes from outside the base. Wanting to give them more, he promised to drop more candy from his plane the next day. And really, during next flight, soon before landing Halvorsen dropped candy attached to parachutes to children below.

His actions were soon noticed by the press and gained widespread attention. A wave of public support led to donations which enabled Halvorsen and his crew to drop 850 pounds of candy. By the end of the airlift, around 25 plane crews had dropped 23 tons of chocolate, chewing gum, and other candies over various places in Berlin. The action may have had a substantial impact on the postwar perception of Americans in Germany, and it is still pointed to as a symbol of German-American relations.

Yesterday was 09/11, 5 years after terrorist attack on United States. I see many people are looking for cause, why that happend to USA, why USA was picked as a target and why USA is no longer an icon of freedom in modern world.

Not sure about all causes, but I am sure that one of the reasons is that US advocated their freedom in Vietnam, Cambodia, Iraq, Serbia etc. with bombs and not with candies.

Spam Carma 2

If you run Word Press based blog, and getting a lot of spam comments on it, this plugin is right for you.

Unlike other spam killers (like Akismet plugin which behave badly with non english comments), Spam Carma 2 kills 100% of spam, and never have a problems with regular comments.

Spam Carma 2 contains several spam filters, where restriction for each of them can be set to higher or lower level. For example, there is a Stopwatch which make sure commenter has been on page for a certain number of seconds before commenting, Javascript Payload which embed a few Javascript commands in comment form (users with JS turned off only receives a small penalty) and plenty of other stuff like captcha check which is displayed only if commenter is not recognized as normal user.

Since I’ve installed it, Spam Carma killed more than 300 spam commenters without actually stopping any regular comment!

Curl HTTP Client

Frequently, in my daytime job I have to fetch data from various url’s, either by sending get or post request, binding to different IP address etc. Long time I used my own socket based HTTP class, although I wasn’t quite happy with perfomances and various other things with it. I already used curl cli tool (mostly for debugging purposes), but didn’t really liked it’s php api, so I’ve decided to take some spare time and make some kind of oop wrapper for it, which should be easier to use for easy stuff like sending get/post request etc.

I use this class several months since then, and it evolved over time whenever I needed some new feature. Since various of my colleagues found it very usefull (some of them even sent me new methods for it), I’ve decided to put it out for public. Recently I submitted a code to, and today got confirmation that class is officially approved.

Update 03/01/2007
New version 1.1 released with new features: fetch into file, upload, proxy etc.

Update 15/02/2008
New version 1.2 released with few bug fixes. New features are ability to send post string as string argument in send_post_data method, ability to accept gzipped content, close curl session etc.

Update 25/03/2013
Version 2.0 released. Pretty much the same features as old versions, but with updated code in order to match latest PHP changes. Code will be regularly updated on github.

You can download class and example files directly from gitgub

Here are few usage examples.

 * @version 2.0
 * @package
 * @copyright © 2013
 * @author Dragan Dinic 


$curl = new Curl_HTTP_Client();

//pretend to be Firefox 19.0 on Mac
$useragent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0";

//uncomment next two lines if you want to automatically manage cookies
//which will store them to file and send them on each http request
//$cookies_file = "/tmp/cookies.txt";

//Uncomment next line if you want to set credentials for basic http_auth
//$curl->set_credentials($username, $password);

//Uncomment next line if you want to set specific referrer

//if you want to send some post data
//form post data array like this one
$post_data = array('login' => 'pera', 'password' => 'joe', 'other_foo_field' => 'foo_value');
//or like a string: $post_data = 'login=pera&password=joe&other_foo_field=foo_value';

//and send request to Result page is stored in $html_data string
$html_data = $curl->send_post_data("", $post_data);

//You can also fetch data from somewhere using get method!
//Fetch html from url
$html_data = $curl->fetch_url("");

//if you have more than one IP on your server,
//you can also bind to specific IP address like ...
//$bind_ip = "";
//$curl->fetch_url("", $bind_ip);
//$html_data = $curl->send_post_data("", $post_data, $bind_ip);

//and there are many other things you can do like

//use proxy

//get http response code for last request
//$http_code = $curl->get_http_response_code();

//get last http request duration in sec
//$duration = $curl->get_request_duration();

Google Page Creator

Don’t know about you, but I have difficulties to follow up with all services Google announce almost each day. GMail, GMap, GTalk, GCal, GSpreadsheets, … and lately we got Google Page Creator.

Google Page Creator is another one Web 2.0 application, which allow us to create Web Pages in a snap. Like with others simmilar tools, you don’t have to know html or any other technology, all you need is your browser and little creativity. Unlike other tools Page Creator is very easy to use (thanks to very good Ajax implementation), so in as little as 5 minutes you can come up with your new Web Site. Such site will be indexed by google shortly, and will be hosted free on address like:

You can see results of my 5 minute Page Creatoru session here :)