RSS

Category Archives: 1

yum install cronjob

Cron is a daemon that can be used to schedule the execution of recurring tasks according to a combination of the time, day of the month, month, day of the week, and week.

Install crond/crontab on linux:

# yum install vixie-cron crontabs
# /sbin/chkconfig crond on
# /sbin/service crond start

set default editor for crontab:
# export EDITOR=/usr/bin/nano

Setup crontab:
# crontab -e
1 2 3 4 5 /path/to/command arg1 arg2

Where,

* 1: Minute (0-59)
* 2: Hours (0-23)
* 3: Day (0-31)
* 4: Month (0-12 [12 == December])
* 5: Day of the week(0-7 [7 or 0 == sunday])
* /path/to/command – Script or command name to schedule

* * * * * command to be executed
– – – – –
| | | | |
| | | | —– Day of week (0 – 7) (Sunday=0 or 7)
| | | ——- Month (1 – 12)
| | ——— Day of month (1 – 31)
| ———– Hour (0 – 23)
————- Minute (0 – 59)

Sample:

* * * * * env php -q /var/www/html/cron.php

How to run cronjobs per second?

🙂

 

Tags: , , , , ,

Automating Amazon S3 Backup on Windows with CloudBerry S3 Backup

CloudBerry S3 Backup is a Windows application that automates backup and restore
processes to Amazon S3 secure cloud storage. CloudBerry S3
Backup provides a powerful Backup and Restore program designed
to leverage Amazon S3storage to make your disaster recovery plan simple,
reliable, and affordable.

Disaster recovery planning is often times an afterthought that comes to
light when disaster strikes.

Very seldom do companies fully recover from loss of critical data which could
lead to loss of business.

backup-screenshot-main.jpg

What is Amazon S3

To use CloudBerry S3 Backup you should create your Amazon S3 account. Amazon S3 is unlimited
secure internet storage that leverages Amazon infrastructure. Amazon S3 is
primarily designed for software developers who want to take advantage of
scalable internet storage in their applications. However, the products like
CloudBerry S3 Backup unleash the power of Amazon S3 and make it available for
less sophisticated consumers.

There are no sign-up or minimum fees. You only pay
for what you use. In many cases your monthly checks will be less than a dollar!
The costs start at $0.15 per GB of data storage a month and ONLY (!) $0.03 per
GB of data transfer until June, 30 2009. The data transfer costs will return
to the normal $0.1 per GB as of July, 1 2009. So hurry up to do the initial
backup!

Check here
for more info on Amazon S3 pricing.

With CloudBerry S3 Backup you can

  • Setup your backup process in a couple of minutes
  • Strong data encryption protects your data
    from unauthorized access
  • Data compression allows you to lower your Amazon S3
    storage and transfer costs
  • Scheduling capabilities automate the backup
    process
  • Backups are available for recovery 24/7
  • Intuitive interface provides easy file and folder
    selection capabilities
  • No proprietary storage format. You can access your
    files using other Amazon S3 tools.
  • Control bandwidth utilization to do other tasks
    online when backup is running
  • Support multiple storage clouds in the future such
    as Microsoft Azure, Sun Cloud Storage Service

2.png

This is a list of CloudBerry S3 Backup features.

  • Easy installation and configuration
  • Scheduling capabilities
  • Data encryption
  • Data retention schedule
  • Secure online storage
  • Backup verification
  • Alerting notifications
  • Indication for successful/failed backup status
  • The ability to restore to a particular date
  • Backup open files
  • Bandwidth throttling
  • Support SSL for secure data connection
  • Minimize to tray
  • Built-in feedback form

Conclusion

CloudBerry S3 Backup is a fully functional backup product that can help computer users ranging from private individuals to small and mid size business leverage Amazon S3 secure and reliable Cloud storage to automate data backup and restore processes. If you are considering using Amazon S3 for data backup purposes it is a good reason to start now and download CloudBerry S3 Backup from CloudBerry Lab website at http://cloudberrydrive.com/

 
4 Comments

Posted by on June 10, 2009 in 1, Amazon S3, php, Web Services

 

Tags: , , , , ,

Resize YouTube Embed Video

Here is the code how to resize youtube video embed code, even this code will work to non-youtube embed videos…..


<?php

$embed = '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/ v/SOiGqFceMYo&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SOiGqFceMYo&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';

//$alt = preg_match_all('/(width|height)=("[^"]*")/i', $embed, $matches);

$embed = preg_replace('/(width)=("[^"]*")/i', 'width="200"', $embed);
$embed = preg_replace('/(height)=("[^"]*")/i', 'height="200"', $embed);

echo $embed;

?>

Now try to resize youtube player with php regular expression replace preg_replace()……

 
13 Comments

Posted by on April 22, 2009 in 1, php

 

Tags: , , , ,

Javascript Event Log ~ Console

This is the javascript function used for tracking javascript events as in alert(). This may be replacement of alert() to better track the javascript events and error/success messages.


/*
Below is the function where to call console()
*/
window.document.onclick = function(){ console(window.event.target.onclick) }; 

function console(msg)
{

	mywin = window.open('', 'console', 'width=500,height=150,left=800,top=800,scrollbars=yes,location=no');
	
	if (mywin && msg!=null)
	  mywin.focus();	
	
	mywin.document.title='Javascript Console...';
	//mywin.document.writeln('<h4>Javascript Log here..</h4>');
	if(msg!=null)
	mywin.document.writeln('<div style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; border-bottom: 1px dotted #FFB64A; padding:4px;">'+msg+'</div>');
	
	//mywin.document.writeln("<br /><a href=\"javascript:void(0)\" onclick=\"this.document.write='';\" >Clear</a>");
	
	//sleep(10); mywin.blur();
	
}

 
Leave a comment

Posted by on April 15, 2009 in 1, Ajax, javascript

 

Tags: , , , , ,

Configure Amazon EC2 server

Video help for EC2:

http://s3.amazonaws.com/AmazonEC2Tutorial/AmazonEC2Tutorial.html

Help Doc for upload files to EC2 server
http://docs.amazonwebservices.com/AmazonEC2/gsg/2006-10-01/

Some steps:

1. Download EC2 command line tools (“ec2-api-tools.zip”) for Instances from here . . .
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351

2. Download “509Certificate.pem” and “PrivateKey.pem” from Amazon Account Section

clip_image001.png

3. Unzip ec2-api-tools.zip and copy “bin” and “lib” folders to C:\EC2, also copy “509Certificate.pem” and “PrivateKey.pem”. Now make a BATCH file “EC2.Bat” and write this to EC2.Bat …

You have to install latest JDK for this EC2 command line tool

@echo off
set EC2_URL=http://ec2.amazonaws.com/
set EC2_HOME=c:\EC2
set PATH=%PATH%;%EC2_HOME%\bin
set EC2_PRIVATE_KEY=c:\EC2\PrivateKey.pem
set EC2_CERT=c:\EC2\509Certificate.pem
set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_14
“%JAVA_HOME%\bin\java” –version

you can use these commands to get key-pair for login to FTP

C:\EC2\>ec2-describe-images -x all
C:\EC2\>ec2-add-keypair mc-keypair save it to file name “mc-keypair” at C:\EC2
C:\EC2\>ec2-describe-images -x all
C:\EC2\>ec2-run-instances ami-23b6534a -k mc-keypair
C:\EC2\>ec2-describe-instances

4. Create instance by EC2 UI Firefox plug-in (configure it by Account Email and Credentials) “chrome://ec2ui/content/ec2ui_main_window.xul” for available AMI by the key-pair recently created, here you get the public DNS

clip_image004.jpg

5. Use http://ec2-67-202-38-83.compute-1.amazonaws.com to access your EC2 server and FTP

clip_image005.png

6. Create .PPK file by “puttygen.exe” user key-pair in Conversions TAB and click “Save public key”, here save PrivateKey123.ppk as shown in above image, after login you can access FTP of your EC2 server.

clip_image007.png

7. Now EC2 Server will work like your hosting server, you can use S3 Firefox organizer (“chrome://s3fox/content/s3foxWindow.xul”) for accessing Amazon S3 buckets.

Configure Amazon EC2 server

for more help search rightscale, scalr etc. on google.

Sandeep verma

 
Leave a comment

Posted by on April 1, 2008 in 1

 

Tags: , , ,