Open Source

Back to blogging: What to expect

Posted on

Hello Readers, I started this blog as a way to share my experiments and experiences while learning web development and computer science in general. In the first 2 years (between Apr’08 and Aug’10) I wrote as many as 100 blog posts. Quite a frenzy. Ever since, I only managed to write 5-6 posts in the following 4 years, about nearly 45 drafts which may now never get published. Good thing is that, I am back to blogging, which means a lot to share. Briefly, here is what (or what not) to expect in the future posts: PHP – In past, PHP has dominated the […]

Open Source

Working with Jaxl – A Networking Library in PHP – Part 1 – An Introduction, Philosophy and History

Posted on

Development of Jaxl library started way back in December’07 while I was working on a self-initiated project called Gtalkbots. The project is now dead, if you are interested in knowing more about it go through Gtalkbots BlogSpot. Jaxl v1.x was first released in Jan’09 and about a year later in Aug’10 Jaxl v2.x was released. First two versions were released as JAbber XMPP Library for writing clients and external server components. While working on my startup Jaxl – A Platform As A Service (PAAS) for developing real-time applications, I started experiencing v2.x limitations when my external server side components were […]

Open Source

Announcing Jaxl v3.x – asynchronous, non-blocking I/O, event based PHP client/server library

Posted on

Jaxl v3.x is a successor of v2.x (and is NOT backward compatible), carrying a lot of code from v2.x while throwing away the ugly parts. A lot of components have been re-written keeping in mind the feedback from the developer community over the last 4 years. Also Jaxl shares a few philosophies from my experience with erlang and python languages. Jaxl is an asynchronous, non-blocking I/O, event based PHP library for writing custom TCP/IP client and server implementations. From it’s previous versions, library inherits a full blown stable support for XMPP protocol stack. In v3.0, support for HTTP protocol stack […]

PHP

PHP Code, Setup and Demo of Jaxl boshchat application

Posted on

Jaxl 2.0 bosh support allow web developers to write real time web applications within minutes, without having any pre-requisite knowledge about the XMPP protocol itself. In this blog post, I will walk you through setup and demo of an XMPP based web chat application using Jaxl library. Get the code Follow the following steps to download and install this sample web application on your systems: Clone the development branch of Jaxl library [email protected]:~/git# git clone [email protected]:abhinavsingh/JAXL.git [email protected]:~/git# cd JAXL/ [email protected]:~/git/JAXL# If you are not familiar with git, simply visit [email protected], click Download Source and extract under ~/git/JAXL directory on your […]

Open Source

Releasing Jaxl 2.0 – Object oriented XMPP framework in PHP

Posted on

After months of restructuring the Jaxl library, I am pleased to announce Jaxl 2.0, an object oriented XMPP framework in PHP for developing real time applications for browsers, desktops and hand held devices. What’s new in Jaxl 2.0? A lot of structural changes has been done from the previous version to make it more scalable, robust, flexible and easy to use Library now provides an event mechanism, allowing developers to register callbacks for various xmpp events in their application code Use integrated BOSH support to write real time web applications in minutes More than 10 new implemented XMPP extensions (XEP’s) […]

Web Development

Setting Nginx, PHP Fastcgi and XCache on a new Ubuntu

Posted on

Recently, because of a mandatory VPS move I had an opportunity to migrate all my sites from apache to nginx. My old box was in a messy state and setting up a new box from scratch was always going to be fun. Here in this post, I will walk you through all the steps that helped me migrate seamlessly. Specially, how did I setup the new box ensuring zero downtime on the sites. Ensuring zero downtime while migration: By the time I will pin up various pieces on my new vps box, I didn’t want my site visitors to see […]

XMPP

Writing your first facebook chat bot in PHP using Jaxl library

Posted on

Today facebook officially announced availability of it’s chat through jabber/xmpp clients. This is a big win for XMPP, with almost 400 million new probable users adding into XMPP club. In this post, I will demonstrate how to connect to facebook chat servers using Jaxl client library in PHP. It can further be used to make custom chat bots for facebook. Creating your first facebook chat bot: Follow the steps to successfully run a facebook chat bot: Download Jaxl or checkout latest from trunk svn checkout http://jaxl.googlecode.com/svn/trunk/ jaxl-read-only Edit the configuration file config.ini.php as follows: // Set an enviornment $env = […]

PHP

MEMQ : Fast queue implementation using Memcached and PHP only

Posted on

Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this post, I will demonstrate and explain how to implement fast scalable queues in PHP. MEMQ: Overview Every queue is uniquely identified by it’s name. Let’s consider a queue named “foo” and see how MEMQ will implement it inside memcached: Two keys namely, foo_head and foo_tail contains meta information about the queue While queuing, item is saved in key foo_1234, where 1234 is the current value of key […]

WordPress

JAXL BOSH Demo: IM chat client for all WordPress blogs

Posted on

Have you ever wished of a wordpress plugin capable of providing a facebook style chat bar on your blog post. In this blog post, I will lay down the details of how Jaxl‘s bosh support comes in handy for building such browser based real time application. Specifically, I will explain how I achieved building a plugin for my wordpress blog. If everything goes perfect over next few weeks, this plugin might be submitted in wordpress plugin’s directory. Jaxl BOSH Support Framework Jaxl BOSH support comprise of three main parts: jaxl.jquery.js: JQuery extension written for Jaxl bosh support jaxl4bosh.class.php: Connection manager […]

XMPP

Get real time system & server load notification on any IM using PHP and XMPP

Posted on

There are various system and server related information which server administrators always need to have as soon as possible, infact I must say in real time. There are several open and closed source softwares in the market which can generate almost real time notifications for you. Most famous one being Nagios. In this blog post I will discuss, how to generate real time system notifications using PHP and XMPP. Specifically, I will present sample script using Jaxl (Jabber XMPP Client Library) for generating real time system load notifications, which can be received using any Instant Messengers. /proc/loadavg We will be […]