Archive for September, 2009

Install JSON PHP Extension on CentOs / RedHat

I had numerous requests for info and questions relating to JSON extension in CentOS. To enable these functions in RedHat and CentOs 5, the process is really simple and fast.

NOTE: As of PHP 5.2, json extension is now standard. If you’re running PHP 5.2 or later, or like to upgrade instead, you can skip this!

  1. Ensure you have the necessary dependecies (php, php-pear, php-devel, gcc, make):
    • $ sudo yum install gcc make
    • $ sudo yum install php php-pear php-devel
  2. Use PECL (PHP Extension Community Library) to download the json package:
    • $ sudo pecl download json
  3. Use PEAR (PHP Extension and Application Repository) to extract and install the extension:
    • $ sudo pear install json-1.2.1.tgz
  4. Create a file in /etc/php.d called “json.ini”, and add the following lines:
    • ; php-json extension
    • extension=json.so
  5. Restart apache (gracefully if you’re running a live site:
    • $ sudo service httpd restart (apachectl graceful)
  6. Check for availability by creating an info.php file in the web root with the following line:
    • <?php phpinfo(); ?>
  7. Load info.php in your browser and check for JSON. You now should be all set, but if it doesn’t appear, verify all of the above steps very carefully.

ImageMagick from the command line

ImageMagick is such a cool and powerful tool to manipulate images, it’s a real shame if you don’t make use of it during your web design or photo album creation. From resizing, compositing and converting all types of file types, it’s list of usability cases is endless. It’s free and available for almost every operating system.

If you don’t have it on your system yet, here is the imagemagick download location. You might also have it in your repository, check your package manager as it might be as simple as calling “sudo apt-get install imagemagick” (on Ubuntu) or “sudo yum install imagemagick” (on Red Hat/CentOs).

Here is a small compilation of command-line tools (by no means a complete list). The list of available commands is actually sheer endless, you’ll be amazed by how powerful this application is.

imagemagick resize

convert image.gif -resize 128×128 resized_image.gif

imagemagick crop

convert  image.gif  -crop 240×360  cropped-image.gif      (add’l params for crop location: 240×360+10+10)

imagemagick rotate

convert image.gif -rotate 90 rotated-image.gif

imagemagick mirror

convert image.gif  -flop mirrored-image.gif

There are many more, actually way too many to list them all here. Have a look at the official ImageMagick usage page for a complete list of image manipulation actions.

Silverlight For Ubuntu And Other Linux Distro’s

It’s a real surprise that Microsoft supports a technology that works on Linux. But we don’t have to wonder, since Silverlight as a technology relies on it’s user base to end up as success or failure, it makes perfect sense. And that’s likely the only reason Microsoft has worked with Novell / Mono to create a Silverlight plugin for Linux.

Moonlight is an open source implementation of Silverlight for Linux/Unix systems. It comes in the form of a Firefox plugin, version 2 is currently in beta 3 and available in 32bit and 64bit versions. Simply download the *.xpi to your Firefox plugin directory (if Firefox doesn’t automatically detect and install it correctly for you) and you’re good to go.

I have come across some sites where the detection of Silverlight is negative, and as a result keep prompting the user to install Silverlight. As soon as I find a solution or workaround I will update this post.

Cloud Computing arrives in Ubuntu 9.10

Cloud computing is a methodology of computing in which dynamically scalable and often virtualized resources are provided as a service over the Internet or a private network. Users do not have to possess knowledge of, expertise in, or control over the infrastructure of the “cloud” and it’s technology.

The concept of cloud computing generally encompasses a combination of the following:

  • IaaS (infrastructure as a service)
  • SaaS (software as a service)
  • Paas (platform as a service)
  • Other recent technologies that provide common business applications online which are accessed via web browser (eg. Google Apps), while the software and data reside and execute on the servers.

The term cloud is used as a metaphor for the transparency of the Internet and is an abstraction for the complex infrastructure it encapsulates.

(more…)