SkyLedger iPhone App UI Clone Tryout using Titanium

Last night while browsing Dribbble, I’ve seen a beautifully crafted iPhone UI project done by Josh Helmsley, which was part of his SkyLedger project. It was just fantastic.


So I tried to clone the same UI using Titanium and finally done something similar :)

SkyLedger iPhone App UI Clone in Titanium :P

Just a test project. No interaction, just plain simple UI done using Titanium. You can download this Appcelerator titanium project by clicking on the following link. Let me know if you like it.


Icons by DryIcons (Handy-2)

Startup Trouble: Selling your product!

Once your startup is live and has a developed product, you want to jump into the beautiful world of real money, isn’t it? But then there are chances that you are puzzled with lots of questions like “How can I sell my product from Bangladesh?” or “How can I bring my money back here?”

When we decided that we want to go live with MiproApps subscription plan, there was one more thing that troubled us a lot. We wanted to sell a special type of product, subscription based with automated monthly or yearly recurring charges. So we started looking for one easier solution. Its not like that we were not willing to pay for it, but the problem was that we don’t have paypal available in Bangladesh and you know that it’s a real pain in the ass to use international credit card here.

So, we’ve found “merchant account providers”. These merchant account providers help you to charge your client as well as work like a virtual bank account. You don’t need to setup anything to start with them. Some of them charge a one-time fee (like 2Checkout) but most of them charge a percentage from your sales. After searching for couple of weeks, we found the following merchant account providers who looked reliable. Now I know there are other providers as well, but I am just telling our story here, as we experienced it.

ShareIt from DigitalRiver

We tried to go with Avangate. They have nice UI, pro looking support, but unfortunately it didn’t work really good for us because of their hard-to-understand documents, specially for subscription based charging. And one more thing that’s not so cool was their charging at comparatively higher rate per sale. FastSpring has a very nice support with UI as well, and very good documentation. But they didn’t have subscription based charging model that time (They have one now, called Saasy). We bought one account in 2checkout and almost implemented our charging module based on that, but then, surprisingly we’ve found Plimus.

Plimus was extremely easy to setup, with a lower charging rate per sale and with user friendly control panel that worked really well for us. It was a charm from setting up first product to setup coupon code and volume based discount. And guess what, we were able to charge our customers, no matter if he was paying using Paypal or CC or Wire-transfer. Plimus managed everything and we had almost nothing to worry about. It is such a great experience using Plimus and we are still using their service.

Last one, how will you bring your money that you’ve earned by selling your products? Plimus supports wire-transfer or payoneer debit card which was just easy to set up. It takes a few days to get your payoneer card if you apply from plimus and after every month, they will send money to either your bank account or to this payoneer debit card. In case you are using payoneer card, you can withdraw money from any local ATMs with almost no hassle at all.

That’s mainly it for today, will come back with more very soon.

Complete oAuth script for Twitter and LinkedIn using PECL oAuth Extension

After searching for help to connect with LinkedIn via their oAuth protocol using PECL oAuth extension, I’ve found that lots of people are posting in their forum for the code samples. And only very few obscure code examples are available. I’ve found phplinkedin script but that is just too bulky for a simple oAuth dance :)

So here are two files to perform 3 step oAuth Dance for both twitter and linkedin. Just set your consumer key and consumer secret key in these scripts (config.php) and in your LinkedIn and Twitter application, set the url of these scripts as authentication callback :) thats it :)

check out the source code below or just straight download them from the following url

config.php: source


twitter.php: source

 * twitter authentication script based on
 * pecl oauth extension
$oauthc = new OAuth($oauth['twitter']['consumerkey'],
if(empty($_SESSION['trequest_token_secret'])) {
    //get the request token and store it
    $request_token_info = $oauthc->getRequestToken($oauth['twitter']['requesttokenurl']); //get request token
    $_SESSION['trequest_token_secret'] = $request_token_info['oauth_token_secret'];
    header("Location: {$oauth['twitter']['authurl']}?oauth_token=".$request_token_info['oauth_token']);//forward user to authorize url
else if(empty($_SESSION['taccess_oauth_token'])) {
    //get the access token - dont forget to save it 
    $request_token_secret = $_SESSION['trequest_token_secret'];
    $oauthc->setToken($_REQUEST['oauth_token'],$request_token_secret);//user allowed the app, so u
    $access_token_info = $oauthc->getAccessToken($oauth['twitter']['accesstokenurl']);
    $_SESSION['taccess_oauth_token']= $access_token_info['oauth_token'];
    $_SESSION['taccess_oauth_token_secret']= $access_token_info['oauth_token_secret'];
if(isset($_SESSION['taccess_oauth_token'])) {
    //now fetch current users profile
    $access_token = $_SESSION['taccess_oauth_token'];
    $access_token_secret =$_SESSION['taccess_oauth_token_secret'];
    $data = $oauthc->fetch('');
    $response_info = $oauthc->getLastResponse();
    echo "<pre>";
    echo "</pre>";

linkedin.php: source

 * linkedin authentication script based on
 * pecl oauth extension
$oauthc = new OAuth($oauth['linkedin']['consumerkey'],


if(empty($_SESSION['lrequest_token_secret'])) {
    //get the request token and store it
    $request_token_info = $oauthc->getRequestToken($oauth['linkedin']['requesttokenurl']); //get request token
    $_SESSION['lrequest_token_secret'] = $request_token_info['oauth_token_secret'];
    header("Location: {$oauth['linkedin']['authurl']}?oauth_token=".$request_token_info['oauth_token']);//forward user to authorize url
else if(empty($_SESSION['laccess_oauth_token'])) {
    //get the access token  - dont forget to save it
    $request_token_secret = $_SESSION['lrequest_token_secret'];
    $oauthc->setToken($_REQUEST['oauth_token'],$request_token_secret);//user allowed the app, so u
    $access_token_info = $oauthc->getAccessToken($oauth['linkedin']['accesstokenurl']);
    $_SESSION['laccess_oauth_token']= $access_token_info['oauth_token'];
    $_SESSION['laccess_oauth_token_secret']= $access_token_info['oauth_token_secret'];
    $_SESSION['loauth_verifier'] = $_REQUEST['oauth_verifier'];
if(isset($_SESSION['laccess_oauth_token'])) {
    //now fetch current user's profile
    echo "<pre>";
    $access_token = $_SESSION['laccess_oauth_token'];
    $access_token_secret =$_SESSION['laccess_oauth_token_secret'];
    $oauth_verifier = $_SESSION['loauth_verifier'];
    $data = $oauthc->fetch('');
    $response_info = $oauthc->getLastResponse();
    echo "</pre>";

Download these files from – Happy dancing time, in oAuth way ;)

Getting HP-1020 Laserjet Printer working on Snow Leopard

Since upgrading to snow leopard from leopard, this was the biggest problem and most frustrating thing for me. My HP Laser-jet 1020 stopped working. I’ve downloaded all possible updates from apple and none works. My good old printer just became a piece of brick (lol, yeah really)

So how did I finally get it running? almost 10-20 hours of googling+downloading+trial and error+cursing and drinking a lot of coffee, open source stuffs saved my day :) – here you go .

#1 – download foomatic-RIP from here (choose the snow leopard package)
#2 – download ghostscript from )choose snow leopard package)
#3 – download foo2zjs from here

#4 Ok, now install GhostScript First, then Install Foomatic-RIP. Just perform a default install. no extra thingy – nothing :)

#5 Now install foo2zjs package. while installing, it will ask for admin access. Then it will open a shell window and display you a list of firmware to choose from. You will find HP-1020 listed on #7 – so type “7” and hit enter. Now if it asks you whether you want to delete the installation file, choose “yes”.

#6 Now open the “helper” folder inside this foo2zjs package and copy the load_LaserJet_firmware_v4 file to anywhere else. We need this file later.

#7 Connect HP-1020 in USb port and Add the printer from your printer preference panel.

#8 Now double click on load_LaserJet_firmware_v4 file that you have copied earlier and run it :)

Ok, now you have a working HP-1020 in your snow leopard. Until HP or Apple releases a patch, this is the only way to get it working. Well, dont forget to send me a cup of coffee for saving you from buying a new printer – lol!

Using new PECL Memcached extension for storing session data

Many of you already know that managing session is a critical task for web applications, specially when you want to avoid I/O hop and also a significant load over your database by writing a custom session handler. Beside that, if your application makes use of multiple web servers behind a proxy, then its more than a critical job to share and manage session data among these servers effectively. This is why a central session manager is very important for your application to scale. In this article I am going to show you how you can use the latest Memcached extension (developed by Andrei Zmievski and his team) to isolate the session storage from web servers. I will show you how to compile the extension and use it.

Step1: Install Memcached Server
If you are using Debian its just plain simple

apt-get install memcached

Step 2: Run memcached instances
Lets run two instances of memcached in same machine (well, this article is just for demonstrating you how you can get things done. In the production environment, you can deploy as many memcached instances as you want in different servers in same network)

memcached -d -l -p 11211 -u <username> -m 16
memcached -d -l -p 11212 -u <username> -m 16

Above commands will run two instances of memcached listening on port number 11211 and 11212, same IP Each of them get an allocation of 16 MB of memory (on RAM).

Step 3: Install the PECL Memcached extension.
Lets install the new PECL memcached extension in your web server. This new extension depends on libmemcached. You can grab the latest distribution of libmemcached from and compile it in your own machine. Make sure you have the dependencies met.

tar -zxvf libmemcached-0.34.tar.gz 
cd libmemcached-0.34
make && make install

Considering everything went fine, lets install the PECL memcached extension

pecl install memcached

If everything goes fine, you should see the output similar like this

Build process completed successfully
Installing '/usr/lib/php5/20060613/'
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

Make sure that is placed in your PHP extension_dir folder (here /usr/lib/php5/20060613). Add the line “” in your php.ini and restart your web server.

To make sure, everything’s done and working – run a phpinfo() and check the output. There should be a “memcached” sesction which will look like the following one.

Memcached PECL Extension
Memcached PECL Extension

Now we need to make change in our php.ini to register Memcached as a session handler and set the necessary properties there. Open your php.ini and add the following two lines. If you find any similar line un-commented, comment them out first.


Restart your web server. And …… you are done! :) – Now all your session data will be saved and served from these memcached servers. No matter whenever you need to extend your setup by adding extra web servers, all user data and session data will remain valid and served from a central location. No I/O issue, no huge write load on DB servers.

RackSpace Cloud Server Client Library for PHP

We, the developers at Leevio are currently developing an open source group collaboration application. We are using RackSpace Cloud servers since the very beginning of the development and we will also deploy in on rack space cloud.

As a part of our study we’d found that RackSpace provides excellent API to manage your cloud services. Unfortunately there are no language binding library released yet (for Cloud Server). But they’ve mentioned that they are developing one for python.

So we have spend our time for last two days and developed a PHP client library to use RackSpace cloud server API from inside a PHP application.

This client library is released under New BSD license. And is available to download/svn-checkout from it’s project page at

There is plenty of documentation and example included. The code is mostly self explanatory. Please dont forget to check the Wiki page to get some idea on how to use this library and how far you can go. We have covered all available methods by RackSpace cloud server in our client library.

Happy clouding.

Project Page and Download:

Using iPaper API to convert office documents to flash movie on the fly :)

Embedding documents in web applications is a challenging work. Because you need to convert these documents into flash movie and only then you can embed them in your web applications. There are many converters available out their for use. Some of them are proprietary, Some of them comes for free. There are command line tools as well as web services also to perform these conversions and make your life easier. In this post I am going to introduce you to IPaper, an excellent service from Scribd. Using IPaper API you can upload and convert your documents to flash movie on the fly, and then you can embed them using Scribd’s excellent document viewer. Scribd offers a collection of client libraries and fortunately, we have a PHP lib in that collection.

Scribd API can convert numbers of document types including the followings

* Adobe PDF (.pdf)
* Adobe PostScript (.ps)
* Microsoft Word (.doc, .docx)
* Microsoft PowerPoint (.ppt, .pps, .pptx)
* Microsoft Excel (.xls, xlsx)
* OpenOffice Text Document (.odt, .sxw)
* OpenOffice Presentation Document (.odp, .sxi)
* OpenOffice Spreadsheet (.ods, .sxc)
* All OpenDocument formats
* Plain text (.txt)
* Rich text format (.rtf)

To use IPaper API, you need to create a developer account in ScribD and get your API key and secret key. Also, download the PHP client library from

You are ready to go once you get your Scribd api key and secret key. You can upload different types of files to scribd server and of course you can make them private or publicly accessible. After successful upload and conversion you will receive a doc_id and access_key from Scribd web service. Using those data you can embed your document in your web app. Lets have a look. In the following code examples, you may find the getEmbedUrl() and getEmbedCode() functions handy. You can also use SWFObject for quick embedding :)


$UpdloadData = createIPaper("gpl.pdf","pdf","public");
$EmbedUrl = getEmbedUrl($UpdloadData);
echo $EmbedUrl;
$EmbedCode = getEmbedCode($UpdloadData);
echo $EmbedCode;

function createIPaper($File, $FileType, $Access="private")
    $scribd_api_key = "<your API key>";
    $scribd_secret = "<your Secret key>";

    if (empty($FileType))
    throw new Exception("Filetype cannot be empty");
    $Scribd = new Scribd($scribd_api_key,$scribd_secret);

    $UploadData = $Scribd->upload($File,$FileType,$Access,1);
    return $UploadData;

function getEmbedUrl($UploadData)
        $EmbedUrl = "{$UploadData['doc_id']}&access_key={$UploadData['access_key']}&page=1&version=1&viewMode=list";
        return $EmbedUrl;

function getEmbedCode($UploadData, $Width=450, $Height=500)
    $EmbedCode = <<<EOD
<object codebase=",0,0,0" 
    id="doc_512761847372423" name="doc_512761847372423" 
    width="{$Width}" >
<param name="movie" value="{$UploadData['doc_id']}&access_key={$UploadData['access_key']}&page=1&version=1&viewMode=list">
<param name="quality" value="high">
<param name="play" value="true">
<param name="loop" value="true">
<param name="scale" value="showall">
<param name="wmode" value="opaque">
<param name="devicefont" value="false">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="true">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<param name="salign" value="">
<param name="mode" value="list">
<embed src="{$UploadData['doc_id']}&access_key={$UploadData['access_key']}&page=1&version=1&viewMode=list" 
    return $EmbedCode;

and here is how it will look after embedding

download the source code from here

By the way, IPaper PHP client library has some cool methods like uploadFromUrl() – Check them out )

Stay in touch, In next post I will show you how to use some other exciting tools which you can use and host in your own server :). that will be fun to host your own service like this :)

Thanks to Rana for helping me out with iPaper.