Posts published in December 2012

Pingback-php: a library for performing Pingback calls in an easy-way

Today I’m pleased to announce another library that I made. Pingback-php is a library for performing Pingback requests in a simple way. Pingback-PHP is compliant with the Pingback 1.0 standard specification.

A quick example:

If you want to inform to this article that you have referenced it from one of your posts by using the Pingback protocol, you can do it with this code:

// Prepare the Pingback client
$requestHandler = new Pingback\RequestHandler();
$client = new Pingback\Client($requestHandler);

// Perform the pingback call
try {

    $client->ping(
        "http://www.mabishu.com/blog/2012/12/14/get-better-performance-and-life-from-your-ssd-in-linux-based-systems/",
        "http://www.mabishu.com/blog/2012/12/14/object-calisthenics-write-better-object-oriented-code/";
    );

} catch (Pingback\Exception $e) {
  printf("Exception raised with code (%d) : %s\n", $e->getCode(), $e->getMessage());
}

Get better performance and life from your SSD in Linux-based systems

OCZ Vertex 4

Recently I acquired an OCZ Vertex 4 SSD as my old hard drive was about to die as SMART were reporting. Definitely I would suggest you to go for a SSD as this upgrade will be the most significant and noticeable upgrade you can do for you computer.

Moving on. In this article I will write down some tips/rules for get the best performance out of your Linux-based system while giving some explanations about them.

Object Calisthenics: write better object-oriented code

“Object Calisthenics” is supposedly an exercise to get you to write better object-oriented code. If you want me to sum-up in one sentence I will definitely say:

“That which obscures my code is bad.”

We’ve all seen poorly written code that’s hard to understand, test, and maintain. Object-oriented programming promised to save us from the old procedural code. And it promised allowing us to write reusable software incrementally. But sometimes it seems like we’re just chasing down the same old complex, coupled designs in any OO-capable language (Java, PHP, …) that we had in C.

It’s well understood what are the core concepts behind good design, any software engineering book will hightlight seven code qualities that matter: cohesion, loose coupling, no redundancy, encapsulation, testability, readability, and focus. Yet it’s hard to put those concepts into practice there are some other rules that could help us.

Remove grub from MBR under Mac OS X

rEFIT-dualboot

OK, you messed it up, you’ve installed Ubuntu on your Mac running a dual boot with OSX, and accidentally installed the bootloader to the MBR.  Well this will render your system useless as Mac’s use EFI and GPTs, rendering MBRs rather useless, outside of its MBR emulation mode that is.

The proper location for installing the GRUB locader in this EFI-based systems has to be on your first Ubuntu partition, not in the whole disk’s MBR segment.

If you try to install GRUB again in the proper location, that’ll will leave another icon of Tux just sitting there in your rEFIt menu.  Its a little annoying in my opinion so lets get rid of it.