Skip to main content

Posts

Recent News and Articles - July 2012

Google announced the Google Compute Engine . Even though it is too early to comment, as a customer of Amazon's EC2 services, I am loving this; competition is definitely good news for business. For the gamers out there, Epic Games introduced the Unreal Engine 4 recently. Have a look at the Wired article to understand the implications of this new engine on the gaming and hardware industry. Here is the development walk-through . There is also a showcase demo available for a preview. Warning, shameless self promotion here: the Symfony Blog picked my article about creating a custom JMSSerializerBundle handler .

Creating a Custom JMSSerializerBundle Handler

A couple of days ago, I had to create a custom JMSSerializerBundle handler to process the serialization of a certain property of one of my models. In my case, I have a user model that has a single associated avatar stored on Amazon S3. The problem is that this avatar URI consists of just the path section (for example: /avatars/12/34/43/123443.jpg) instead of the full URL. This is required to allow my application to work with multiple buckets, each of which corresponds to a different environment such as development, production, etc. However, the Android client I am currently working on (or any other REST client for that matter) needs the full URL of each avatar returned from the server. Injecting this logic into the model class was obviously not a really good idea, so I decided to write a custom JMSSerializerBundle handler to achieve my objective. The idea is the have the custom handler access the required system services and transform the avatar path from a relative on to a full one...

Android Development

I have recently started developing a new application for the Android platform. It had been a while since I experimented with Android and this really manifested itself when I started this new project a couple of months ago. Having to deal with new Android features and corresponding backwards compatibility issues, I experienced a steep learning curve. This article highlights the lessons learned during this process. JDK Selection I have been a Linux user since 2001 and never looked back since then. So if you are developing on Linux, make sure to replace the default OpenJDK with Oracle's. This will save you a lot of headache dealing with peculiar errors and exceptions during the initial set-up process. Selecting an IDE I really like NetBeans and still develop with this IDE when it comes to PHP; it definitely feels much more intuitive than Eclipse. However, when it comes to Android development, it did not take long for me to realize I was fighting an uphill battle. With its excellen...

Setting up a Symfony2 REST service with FOSRestBundle

Installation First thing is to download and setup the FOSRestBundle. If you are running Symfony 2.0.x, get the FOSRestBundle version 0.6, otherwise, download the code in the master branch. The FOSRestBundle depends on the JMSSerializerBundle so the following instructions are going to include some extra information for setting up this bundle to complete our REST service. First thing is to install our dependencies. Add the following to your deps file: [metadata] git=http://github.com/schmittjoh/metadata.git version=1.1.0 [JMSSerializerBundle] git=git://github.com/schmittjoh/JMSSerializerBundle.git target=bundles/JMS/SerializerBundle [FOSRest] git=git://github.com/FriendsOfSymfony/FOSRest.git target=fos/FOS/Rest [FOSRestBundle] git=git://github.com/FriendsOfSymfony/FOSRestBundle.git target=bundles/FOS/RestBundle version=origin/0.6 Run the vendors script to install these bundles: php bin/vendors install Next, update your app/autoload.php file...

Securing Symfony2 REST services with FOSOAuthServerBundle

Overview In my previous article, I wrote about setting up a Symfony2 REST service using FOSRestBundle. However, this REST service was behind a firewall protected by a generic form_login provider. Not really ideal if you wish to open your REST API to other applications. So in this article, I will try to explain how to set up FOSOAuthServerBundle to protect your REST API methods using OAuth2. Before we start getting into the gritty details, it is a good idea to have a look at the official OAuth2 documentation . Let's begin... FOSOAuthServerBundle Installation You have to install v1.1.0 of FOSOAuthServerBundle if you are using Symfony 2.0.x. If not, see the docs . First, add the following entries to your deps file: [FOSOAuthServerBundle] git=git://github.com/FriendsOfSymfony/FOSOAuthServerBundle.git target=bundles/FOS/OAuthServerBundle version=origin/1.1.x [oauth2-php] git=git://github.com/FriendsOfSymfony/oauth2-php.git Run the vendors script to install these...

Some interesting news and articles

Here is a couple of news/articles/announcements that I have found interesting recently: The Case for the /usr Merge is definitely an interesting read. You can also have this functionality by upgrading to Fedora 17. Overview of new features in Apache HTTP Server 2.4 is obviously a must read. Besides the performance gains, I also find the KeepAliveTimeout upgrade - the ability to set this configuration option in microseconds - significant. This functionality can shave off those milliseconds spent for setting up a connection on AJAX heavy pages while not degrading overall server performance. PHP 5.4 is out if you haven't heard. Traits and a built-in web server for development purposes. Nice! I hate dealing with HTML so anything that helps me with this headache deserves some respect. Check out the Page Inspector 3D View (nicknamed Tilt).

Upgrading to Fedora 16

Finally had some time to upgrade my Fedora 14 distribution to Fedora 16. I followed the YUM upgrade instructions on the Fedora website. Having never had good luck with odd Fedora releases, I will be skipping Fedora 17 for now and waiting for 18 instead. Overall, The Fedora 15 upgrade was smooth and the reboot of my dual-boot system was successful. However, the following Fedora 16 upgrade presented me with a blank GRUB screen after reboot even though I followed the instructions line by line. At the end, I had to create a Fedora 16 DVD, boot into rescue mode, re-run the GRUB setup commands again: chroot /mnt/sysimage /sbin/grub2-mkconfig -o /boot/grub2/grub.cfg /sbin/grub2-install BOOTDEVICE After dealing with the usual sound problems, the system was up and running with the dual-boot GRUB setup still intact. At this point, a couple of changes have come to my attention. There is a new systemd component that handles system services. Runlevels concept is replaced by targets instead...