Saturday, March 9, 2013

Marissa Mayer (CEO of Yahoo) - Got Million dollar as a bonus with in 6 months

Marissa Mayer CEO of YAHOO getting her first half annual bonus as 1.12 Million, at the same time
her salary is also 1 Million per annum. This bonus was based upon her achievements with
in this 6 months, She joined on July 16, 2012 at YAHOO.. Previously she worked with GOOGLE.
She joined google in 1999 as first female employee of google.
   
                                                         
The million-dollar payment is probably considered pretty much a bargain by investors, since the shares of Yahoo have risen close to 50 percent since she arrived. That’s been based largely on hopes that Mayer can turn the company around, and on the actual stellar performance of its Alibaba Group stake in China.

CFO Ken Goldman, who joined in October, was not eligible for a bonus in 2012, but was awarded a discretionary one of $100,000 nonetheless. He is also eligible for a 90 percent bonus in 2013, based on a $600,000 annual salary.



Friday, March 8, 2013

Setting Cron job with cakephp 2.0 in Easy steps

 
Setting Cron job with cakephp 2.0 in Easy steps: 
 
In some cases we need to do some process automatically every day /every hour / every week. For this 
we can use the Cron job. To see more about Cron Job Click here.
 
This example will shows that sending email to customers every 6 hours based on some  conditions:
 
My Project name is Sample and the Sample folder contains the following folders:
Sample
  — app
   — Controller etc
  —  lib
  — vendors
  — plugins
 
 
Step 1:  Go to the following folder
           Project folder/app/Console/Command/ 
 
Step 2: Create a file named MyShell.php  (You can create the file as per your own risk like SampleShell, CalShell etc)
 
Step 3: Paste the following code in that file. 
 
   class MyShell extends Shell {
    function main()
    {
        App::import(‘Component’, ‘BusinessLogic’);
        $businessLogic = & new BusinessLogicComponent();
        $businessLogic->initialize();
        $settings = $businessLogic->senReminderEmail();
           // senReminderEmail Mail function is defined in my Controller/Components/BusinessLogicComponent.php File
    }
    function expireMail()
    {
 App::import(‘Component’, ‘BusinessLogic’);
        $businessLogic = & new BusinessLogicComponent();
        $businessLogic->initialize();
        $settings = $businessLogic->senExpireEmail();
     // senExpireEmail Mail function is defined in my Controller/Components/BusinessLogicComponent.php File
    }
}
?>
 
 
Step 4 : Go to the following folder:   Project folder/app/Vendor/Shell/
            Inside that create a file name called cron.sh and paste the following code.  Give 777 permission to this file.
 #!/bin/bash
# lock logic for semaphore – http://mywiki.wooledge.org/BashFAQ/045
lockdir=/tmp/cron_sh.lock
echo >&2 “$(date ‘+%Y-%m-%d %H:%M:%S’)
 
 #################################################”
if mkdir “$lockdir”
 then    # directory did not exist, but was created successfully
     echo >&2 “successfully acquired lock: $lockdir”
 
##########################################################
 
# —————————————————————–
# Project name —>
# =========
 
 
# Project folder/lib/Cake/Console/cake – app  Project folder/app cron
/var/www/Sample/lib/Cake/Console/cake – app /var/www/Sample/app cron
################################################################
rmdir “$lockdir”
 else
     echo >&2 “cannot acquire lock, giving up on $lockdir”
     exit 0
 fi 
 
Step 5: To check that the cron functions are working or not, Go to the following folder in terminal
 Project folder/app/  #example  /var/www/Sample/app
and run the following Command :
 
 /var/www/Sample/app$  Console/cake myshell
The above line will execute the main function that we written in the MyShell.php file
To call other function just Console/cake my function_name
example: Console/cake my expireMail
 
Check the above functions are executing without any errors. If it executes with out any error then go for next step
 
Step 6: Now we are going to set the crontab. Just go to the Project folder through terminal and type crontab -e
 
It will open the editor in that paste the following code:
#The below line will execute the function every 6 hours
# *  */6   *    *   * /var/www/Sample/app/Console/cakeshell  my -cli /usr/bin -console /var/www/Sample/lib/Cake/Console -app /var/www/Sample/app
 
#The below line will execute the function named “expireMail” from myshell.php every 6 hours and it will log the execution in to the Home/error_file.log file
# *  */6   *   *   * /var/www/Sample/app/Console/cakeshell  my -cli /usr/bin -console /var/www/Sample/lib/Cake/Console -app /var/www/Sample/app >> ~/error_file.log