Cronjobs in new cpanel

April 27, 2009

The new cpanel has made cronjobs very easy … you can pick time when the job will run, all you have to do is write the command to do the job. Now, that is little confusing, and when you search the web you are going to find a lot of things, more confusing. So, here I’m writing the most simple one

wget http://www.example.com/mailstock.php

It will just execute the php file and mail you the output of that php file.

I love sitepoint.com for their so clear articles, checkout for details about this in their article http://www.sitepoint.com/article/introducing-cron/

In our company we use a time log application which is intranet based. I wanted to have it in system tray so that it’s very accessible and easy to use. I thought of making a simple application which will load only a page with simple functionality, just work update sort.

Then from sitepoint I came to know that many other people need same thing and so it has been already developed :D One is Prism – Mozilla Firefox based, one is Bubbles – Internet Application based and obviously AIR. However, Prism doesn’t support minimizing system tray while bubbles is basically system tray based. Also very light weight and very easy to use. So, I have been using that.

But, if you want to provide some sort of exe file as installer for desktop functionality then it seems AIR is the best way. Today I found some interesting links about AIR – 6 Apps in AIR. The best application I liked is Agile Agenda. And for desktop system tray I found this tutorial I was looking for.

P1i restart problem

March 3, 2009

Recently I was having restart problem in my sony ericsson p1i mobile. Automatically after some time it restarts. Or, sometimes even while talking. I googled about it but didn’t find a solution. But, found somebody asking to reset … well, I know how to reset a mobile, master reset and other battery reset. But, a link said another reset, resetting keeping the battery away for 10 mins. I gave it a try and found it’s working, no more restart automatically!! It’s amazing!! I thought somebody might be facing same problem so shared through my blog.

XPath example

April 23, 2008

I have used XPath before, recently when I needed I forgot the syntax, so thought of keep it written here. It may come helpful for some others as well

import mx.xpath.XPathAPI;

var xml:XML = new XML();
xml.ignoreWhite = true;
xml.load(”http://api.flickr.com/services/feeds/photos_public.gne?id=67845814@N00&lang=en-us&format=rss_200″);

xml.onLoad = function()
{
    var thumbs:Array = XPathAPI.selectNodeList(this.firstChild, “/rss/channel/item/media:thumbnail”);
    for(var i in thumbs)
    {
        trace(thumbs[i].attributes.url);
    }
}

This tutorial was a great help.

http://tutorials.lastashero.com/2005/10/using_the_xpath_api_in_flash.html

In our company we have been working on t-shirt customization tool for long time. Here people can upload their own picture and it is placed on t-shirt. They can rotate, resize, move and many other features. Infact all features t-shirt tools now-a-days offer.

Normally the image gets pixelated like normal html. So, whether the image is bigger or smaller always it’s little crippled. One of our client asked to make it smoother. Then I found Flash supports bitmap smoothing. After working on the code, I have made a small code snippet which will make any movieclip loading smooth image.

Just paste in the movieclip actionscript

onClipEvent(load)
{
        if(this.getBytesLoaded()>100)
        {
            import flash.display.*;
            var bitmap:BitmapData = new BitmapData(_width,_height);
            bitmap.draw(this);
            this._quality = “BEST”;
            this.attachBitmap(bitmap,1,”auto”,true);
        }
}

Interesting, huh?

Key.isDown unavailable in AS3

February 26, 2008

Unlike AS2 developers can’t use Key.isDown in AS3. But, while you are making a game like racing or people moving you must work with two/three key press which can’t be achieved without Key.isDown.

I was facing the same problem when one of my dev Zeeshan was working with car racing game. So, went for some Googling and found this http://www.kirupa.com/forum/showthread.php?p=2098269 Thanks Guru for the beautiful class.

WAMP time zone problem

February 26, 2008

WAMP doesn’t configure time zone as Apache default installation will do. So, by default it takes GMT 0. If the server is located somewhere else make sure to set the time zone. The list of time zones available here

http://www.php.net/manual/en/timezones.php

This caused me quite pain for 2 hrs today and searching with WAMP time zone problem I didn’t find anything so thought people may need :-)

It has been long since I have written something. Recently have been going through some interesting experience. Thought why not add this up. At least it would help me to remember :P

Today we had a situation that we needed to upload 3 Joomla sites. Now, as you know Joomla has around 1800 files. So, it’s around 5400 files. Yesterday we tried to upload and it didn’t for while day!

So, today thought why not try some zip/unzip. So, I just zipped to tgz and then uploaded (around 7 mins) and unzipped using shell command.

gzip -d ar_ny.tgz
made it ar_ny.tar

tar -xf ar_ny.tar
made it extract to ar_ny. I believe there is more short methods, I’m totally new to shell. But, at least now it does in 10 mins :-)

Happy shelling everybody!

http://www.fastcompany.com/online/06/writestuff.html

Today I found this interesting old article about software writing. How people write software for shuttle and how seriously bug free it has to be. Here Charles Fishman shortlisted some healthy habits of software writing as well.

Some icons collections

January 21, 2007

I needed some icons and I found that I forgot some sites that I liked earlier. So, for me (and anybody if needed) I recollected some list of icons from my friends at Pageflakes.

http://tango.freedesktop.org/Tango_Desktop_Project

http://www.famfamfam.com/

http://www.yellowicon.com/

I hope it will help some of my friends here.