Backup Disk Snapshot on Google Compute Engine

Snapshots are stored in Google Cloud Storage, which is secure, incredibly large, and remarkably inexpensive. You might want to think about whether the labor involved in saving snapshots on your local PC, with all the attendant risks of data loss.

For pricing, see
https://cloud.google.com/pricing/cloud-storage. For example, if you have a 10 GB snapshot, that’s going to cost you $0.85/ month.

Overview Google Compute Engine
Overview Google Compute Engine

You can read more about here ….

https://cloud.google.com/pricing/compute-engine

https://developers.google.com/compute/docs/disks

1) Create a snapshot with the gcutil getsnapshot command.

$ gcutil addsnapshot red5 –source_disk red5 –zone us-east1-a

Snapshot Google Compute Engine
Snapshot Google Compute Engine

2) Create a new persistent disk with that snapshot

Disk Google Compute Engine
Disk Google Compute Engine

3) Create an instance with that persistent disk

Instance on Google Compute Engine
Instance on Google Compute Engine

4) Create an image of that instance

Operations Google Compute Engine
Operations Google Compute Engine

5) Save the image on the instance

$ sudo python /usr/share/imagebundle/image_bundle.py -b red5 -o /tmp

6) Download the image of the instance

You can find archived image in current user folder i.e. /home/svnlabs/red5/096df5a918c746f965338bda6b4c886ac4097c08.image.tar.gz

 

Install Apache, PHP, MySQL on HP Cloud

I am playing with all cloud services these days, so today we will try to setup Apache, PHP, MySQL on HP Cloud. HP Cloud is based on OpenStack Compute

Hope you already read our old article “Installing Apache, MySQL, PHP in CentOS 5.5 on Rackspace Cloud”?

In the HP Cloud Console Area you can manage

– Servers / Storage
– Floating IPs
– Images
– Key Pairs
– Security Groups
– Volumes

First you need to create Key Pairs and some rule in security default group…

Security Group Rules
Security Group Rules

HP Cloud Compute Overview

HP Cloud Object Storage Overview

You can start any type of server CentOS, Ubuntu using HP Cloud GUI …

Server on HP Cloud
Server on HP Cloud

Also you can manage running instances easily…

Manager Server on HP Cloud
Manager Server on HP Cloud

You can connect to server using SSH on port 22

# ssh -i KEYPair.pem root@IP-Address

In windows.. create PPK file from PEM Keypair using PuTTYgen

Install Apache

# sudo yum install httpd mod_ssl

Install MySQL

# yum install mysql mysql-server
# /etc/init.d/mysqld start

Install PHP

# yum install php php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml php-mbstring

# /etc/init.d/httpd start

You can access HP Cloud using HP Cloud Services APIs and HP Cloud Services CLI

Install Red5 on Google Compute Engine

Yesterday we have installed basic web server (apache, php, mysql) on Google Compute Engine. Today our target is to install Red5 on Ubuntu server for Google Compute Engine.

First we need to check Java version installed on Google Compute Engine

$ java -version
The program ‘javac’ can be found in the following packages:

* default-jdk
* ecj
* gcj-4.6-jdk
* openjdk-6-jdk
* gcj-4.5-jdk
* openjdk-7-jdk
Ask your administrator to install one of them

Now you have to install java using

$ sudo apt-get update
$ sudo apt-get install java-package
# sudo apt-get install openjdk-6-jdk
$ sudo apt-get install openjdk-6-jre

Install Ant

$ sudo apt-get install ant

Install Subversion

$ sudo apt-get install subversion

You can download latest Red5 from here http://www.red5.org/downloads/red5/

$ sudo wget http://www.red5.org/downloads/red5/1_0/red5-1.0.0.tar.gz
$ sudo tar xvfz red5-1.0.0.tar.gz
$ sudo mv red5-1.0.0 red5
$ sudo mv red5 /usr/share/

Now try to run Red5 Server

$ cd /usr/share/red5
$ sudo sh red5.sh

Yeah! Firewall always block you to access red5 port 5080 so please allow port 5080 & 1935 using below commands

$ gcutil addfirewall red5 –description=”Let open port 5080.” –allowed=”tcp:5080″

$ gcutil addfirewall rtmp –description=”Let open 1935 rtmp port.” –allowed=”tcp:1935″

$ sudo sh red5.sh

Check Red5 is running

$ sudo netstat -ant
Find port 5080 Listening

Now try http://your-server-address:5080 in a web-browser.

Red5 on Google Compute Engine
Red5 on Google Compute Engine

Install oflaDemo from installer http://your-server-address:5080/installer/ then check πŸ˜‰

Red5 Demo on Google Compute Engine - Port Tester
Red5 Demo on Google Compute Engine – Port Tester

Install Webmin on Google Compute Engine

$ sudo wget http://prdownloads.sourceforge.net/webadmin/webmin-1.610.tar.gz
$ sudo gunzip webmin-1.610.tar.gz
$ sudo tar xf webmin-1.610.tar
$ sudo cd webmin-1.610
$ sudo ./setup.sh /usr/local/webmin

Open port 10000 usingΒ gcutil addfirewall

$ gcutil addfirewall webmin –description=”Let coordinator and snitches chatter.” –allowed=”tcp:10000″

Free Cloud Storage Services

Cloud Storage is really a buzz word for people who are facing troubles for backups and data loss. Cloud Storage can provide tension free management of data on the fly. You can choose any cloud program below as free storage. I really like Dropbox, it is available for all devices πŸ˜‰

Dropbox – Free for Windows, Mac, Linux, and Mobile

Free space : 2GB

Dropbox - Simplify your life
Dropbox – Simplify your life

Microsoft SkyDrive – SkyDrive on all your devices to access your photos and files from almost anywhere, store them, and securely share them.

Free space : 7GB

Files - SkyDrive
Files – SkyDrive

Amazon Cloud Drive – Amazon Cloud Drive makes storing your photos, videos, documents and other digital files in the Cloud quick and easy.

Free space : 5GB

Amazon Cloud Drive
Amazon Cloud Drive

Apple – iCloud – Your content. On all your devices

Free space : 5GB

Apple - iCloud - Your content. On all your devices
Apple – iCloud – Your content. On all your devices

Box – Secure content-sharing that users and IT love and adopt

Free space : 5GB

Box - Secure content-sharing that users and IT love and adopt
Box – Secure content-sharing that users and IT love and adopt

SugarSync – File Sync & Online Backup – Access and File Sharing from Any Device – Your Cloud

Free Space : 5 GB

File Sync & Online Backup - Access and File Sharing from Any Device - SugarSync - Your Cloud
File Sync & Online Backup – Access and File Sharing from Any Device – SugarSync – Your Cloud

Google Drive – Google Drive is everywhere you areβ€”on the web, in your home, at the office and on the go. So wherever you are, your stuff is just…there. Ready to go, ready to share. Get started with 5 GB free.

Free space : 5GB

Google Drive
Google Drive

Ubuntu One – Keep your content safe, access it anywhere, and share it with friends, family and colleagues. Spread the word and earn up to 20GB extra free cloud storage with our referral program.

Free space : 5GB

Ubuntu One
Ubuntu One

SpiderOak.com – Zero-Knowledge data backup, sync, access, storage and share from any device

Free Space : 2 GB

Zero-Knowledge data backup, sync, access, storage and share from any device - SpiderOak.com
Zero-Knowledge data backup, sync, access, storage and share from any device – SpiderOak.com

Syncplicity – File Sync, Sharing & Collaboration Cloud Service – Mobile Document Sync – File Management

Free cloud storage : 2GB

File Sync, Sharing & Collaboration Cloud Service - Mobile Document Sync - File Management - Syncplicity
File Sync, Sharing & Collaboration Cloud Service – Mobile Document Sync – File Management – Syncplicity

Wuala – Backup. Sync. Share. Access Everywhere. All data encrypted on your computer.

Free Space : 5 GB

Wuala - Secure Cloud Storage - Backup. Sync. Share. Access Everywhere.
Wuala – Secure Cloud Storage – Backup. Sync. Share. Access Everywhere.

Cloud Storage From Just Cloud. Free Online Storage

Free Space : 15 MB

Cloud Storage From Just Cloud. Free Online Storage
Cloud Storage From Just Cloud. Free Online Storage

MegaCloud – Home – Your files wherever you are

Free Space : 8GB File Storage + 8GB Backup

MegaCloud - Home - Your files wherever you are
MegaCloud – Home – Your files wherever you are

MiMedia – Online Storage & Online Backup Solutions

Free Space : 7 GB

Online Storage & Online Backup Solutions - MiMedia
Online Storage & Online Backup Solutions – MiMedia

MediaFire – Free Online Storage

Free Space : 50 GB

Free Online Storage - MediaFire
Free Online Storage – MediaFire

Symform – Free Cloud Backup – Start with 10 GB

Free cloud storage: Up to 10GB

Free Cloud Backup – Start with 10 GB – Symform
Free Cloud Backup – Start with 10 GB – Symform

YouSendIt – File Sharing, Send Large Files, Access Files from Any Device

Free Storage : 2 GB

YouSendIt - File Sharing, Send Large Files, Access Files from Any Device
YouSendIt – File Sharing, Send Large Files, Access Files from Any Device

Cubby.com – Cloud storage, syncing and sharing, with a smile.

Free Space : 5 GB

Cubby.com - Cloud storage, syncing and sharing, with a smile.
Cubby.com – Cloud storage, syncing and sharing, with a smile.

ElephantDrive – Beyond Backup. Your files – Everywhere.

Free Space : 2 GB

ElephantDrive - Beyond Backup. Your files – Everywhere.
ElephantDrive – Beyond Backup. Your files – Everywhere.

OpenDrive – Online Storage, Backup & Cloud Content Management

Free Space : 5 GB

OpenDrive - Online Storage, Backup & Cloud Content Management
OpenDrive – Online Storage, Backup & Cloud Content Management

And Many More … Search Free Cloud Storage Services

Create Website Thumbnails using PhantomJS

Hope you read my old article “Create WebThumb using LAMP”, it used for creating web thumbnails from Xvfb virtual framebuffer that is more time and resource consuming.

Shell Script with Xvfb try to open web browsers in real remote server to capture web-thumbs…

That whole setup might take a full day and image quality is very bad….

Thanks to PhantomJS

PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.

Simple Javascript example

console.log(‘Loading a web page’);
var page = require(‘webpage’).create();
var url = ‘https://www.svnlabs.com/’;
page.open(url, function (status) {
//Page is loaded!
phantom.exit();
});

Features:

– Headless Website Testing
– Screen Capture
– Page Automation
– Network Monitoring

Fork on Github https://github.com/ariya/phantomjs

PhantomJS is using WebKit for a real layout and rendering engine, it can be used to capture web page as screenshot or PDF files. PhantomJS can render anything on the web page, it can be used to convert contents in HTML/CSS, SVG and Canvas.

URL2PNG-URL2PDF-HTML2JPG-URL2IMAGE
URL2PNG-URL2PDF-HTML2JPG-URL2IMAGE
// Thumbnail of Webpage using webthumb.js

var page = require('webpage').create(),
    system = require('system'),
    weblink,
    fname;

if (system.args.length !== 3) {
    console.log('Usage: webthumb.js webURL filename');
    console.log('Usage: webthumb.js https://www.svnlabs.com svnlabs.png');
    phantom.exit(1);
} else {
    weblink = system.args[1];
    fname = system.args[2];    
    page.viewportSize = { width: 320, height: 480 };
    page.open(weblink, function (status) {
    if (status !== 'success') {
        console.log('Unable to open webpage!');
    } else {
        page.render(fname);
    }
    window.setTimeout(function () {
      phantom.exit();
    }, 3000);
    });
}

Download webthumb.js

# phantomjs webthumb.js https://www.svnlabs.com svnlabs.png
# phantomjs webthumb.js https://www.svnlabs.com svnlabs.pdf

You can even capture webpage as good quality PDF file πŸ˜‰

Output:

svnlabs.png
svnlabs.pdf

You can also use examples/rasterize.js for same sort of functions πŸ˜‰

# phantomjs examples/rasterize.js https://www.svnlabs.com/ svnlabs.png
# phantomjs examples/rasterize.js ‘https://www.svnlabs.com/’ svnlabs.pdf

rasterize.js – rasterizes a web page to image or PDF
render_multi_url.js – renders multiple web pages to images
technews.js – captures Google News as a PNG image

Free Cloud Server Hosting

Benefits of Free Cloud Hosting

* Self-Managed with Console
* Free storage
* Easy application deployment
* Production ready apps
* Cloud hosts (IaaS)
* Automatic backup & recovery
* Server resizing
* Migration facility
* Portability
* Cloud portability
* Free bandwidth
* Enhanced performance
* High availability of resources
* Data storage redundancy
* Growth flexibility
* Economical

AWS Free Usage Tier

Deploy a Sample Web Application in the Free Usage Tier
Deploy a Sample Web Application in the Free Usage Tier

Google App Engine – Easy to build, Easy to scale, Easy to maintain
Try Free … Google Cloud Storage, Google BigQuery and Google Cloud SQL

Google App Engine β€” Google Developers
Google App Engine β€” Google Developers

PHPCloud – Zend Developer Cloud, as its name suggests, a cloud-based environment designed to help you code more quickly and more efficiently. It includes a robust PHP stack, advanced debugging capabilities, collaboration tools and much more. Zend Developer Cloud is only a few clicks away and does not require any installation. To make it even better, it’s absolutely free!

PHP Cloud
PHP Cloud

HP Cloud – Open source-based public cloud computing HP tailored for developers and enterprise. Ready-to-use Storage, PaaS, IaaS, solutions from a rich partner community.

Cloud Computing - HP Cloud Services - Storage
Cloud Computing – HP Cloud Services – Storage

AppFog – The Best Public Cloud PaaS, Now Available on Private Clouds Simple, elegant, and modern way to develop and deploy apps. Unlimited apps within 2GB RAM, Up to 8 service instances 100MB per MySQL or PostgreSQL instance.

https://phpfog.com/ Rock-solid Cloud Platform for PHP by AppFog.

AppFog- PaaS for Public and Private Clouds
AppFog- PaaS for Public and Private Clouds

Xeround – A ridiculously simple, seriously powerful CLOUD DATABASE Xeround is an elastic, always-on database-as-a-service for your MySQL applications.

Cloud Database
Cloud Database

ClearDB is a reliable, fault tolerant database-as-a-service for your MySQL powered applications.

ClearDB - The Ultra Reliable, Globally Distributed Cloud Database For Your MySQL Applications
ClearDB – The Ultra Reliable, Globally Distributed Cloud Database For Your MySQL Applications

Gozure is cloud hosting built for website and blog owners. Run WordPress, Joomla, Drupal, and many other web applications on our powerful platform and get started for free. Gozure uses a simple control panel so no technical experience is necessary.

Gozure - Free Cloud Hosting
Gozure – Free Cloud Hosting

BitNami provides free, ready to run environments for your favorite open source web applications and frameworks, including Drupal, Joomla!, WordPress, PHP, Rails, Django and many more. And with BitNami Cloud Hosting, enjoy automatic backups, monitoring, and more.

BitNami- Open Source. Simplified
BitNami- Open Source. Simplified

PagodaBox is a relatively new Cloud PaaS provider, accessed at PagodaBox.com. PagodaBox markets itself is a PHP specialist. This is proven by the fact that PagodaBox features popular PHP projects like PyroCMS, WordPress, Kohana and CodeIgniter for easy 1-click installations.

Premier Cloud Hosting
Premier Cloud Hosting

OpenShift is Red Hat’s free, auto-scaling Platform as a Service (PaaS) for applications. As an application platform in the cloud, OpenShift manages the stack so you can focus on your code.

OpenShift by Red Hat
OpenShift by Red Hat

Cloud Foundry – Deploy and scale applications in seconds, without locking yourself into a single cloud.

Cloud Foundry
Cloud Foundry

Apprenda is an Open Platform as a Service (PaaS) stack that enables any organization to transform their existing infrastructure into a self-service cloud application platform.

Open Platform as a Service (PaaS) for .NET - Apprenda
Open Platform as a Service (PaaS) for .NET – Apprenda

The CloudBees Platform as a Service (PaaS) architecture provides a powerful foundation for cloud development and deployment services.

CloudBees- The Java PaaS Company
CloudBees- The Java PaaS Company

Orchestra is a Platform as a Service for deploying (PHP Hosting), scaling and managing PHP applications. Built on Amazon Web Services, it integrates with your workflow, autoscales up and down and gives you extra capabilities with powerful add-ons. Engine Yard provides a portfolio of options that let you begin deploying for your applications for free and then allows you to upgrade to elastic, dedicated resources when you’re ready to go into production. Think Orchestra PHP hosting for PHP development.

Ruby On Rails and PHP Cloud Hosting PaaS - Managed Rails Development - Engine Yard Platform as a Service
Ruby On Rails and PHP Cloud Hosting PaaS – Managed Rails Development – Engine Yard Platform as a Service

Jelastic Java Host – Rock-solid Java in the Cloud Auto-scales. Easy to deploy. Runs ANY Java app.

Jelastic β€” Top Java Host, Rock-Solid Java in the Cloud, Java Server Hosting, Java Cloud Computing
Jelastic β€” Top Java Host, Rock-Solid Java in the Cloud, Java Server Hosting, Java Cloud Computing

dotCloud – Build your ideal application stack by combining powerful cloud services. Experiment for free, then go live and only pay for what you need.

dotCloud - One home for all your apps
dotCloud – One home for all your apps

Cloudflare – Give us five minutes and we’ll supercharge your website.

CloudFlare - The web performance & security
CloudFlare – The web performance & security

And Many More ……..

If you are really interested in Cloud Computing, you can find more “Free PaaS” or “Free Cloud” to take advantage of free cloud hosting πŸ˜‰

Upload Large Files from Amazon S3 Bucket to Dropbox Folder

Dropbox Uploader is a BASH script (only needs cURL) which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.

Usage: ./dropbox_uploader.sh COMMAND [PARAMETERS]…

Amazon S3 to Dropbox
Amazon S3 to Dropbox

Secure:It’s not required to provide your username/password to this script, because it uses the official Dropbox API for authentication process.

START DROPBOX UPLOADER

# chmod +x dropbox_uploader.sh
# ./dropbox_uploader.sh

It will ask “App key”, “App secret” and “Access level (App folder or Full Dropbox)”

As shell script authorize token…

Please visit this URL from your Browser, and allow Dropbox Uploader
to access your DropBox account:

–> https://www2.dropbox.com/1/oauth/authorize?oauth_token=xxxxxxxxxxxxxxx

Dropbox token for Command Line
Dropbox token for Command Line

If everything go well …

> Access Token request… OK

Setup completed!

Now you can download Amazon S3 Bucket files on server using “wget” then you can run command like…

# ./dropbox_uploader.sh COMMAND [PARAMETERS]…
# ./dropbox_uploader.sh upload /var/www/aws/s3/svnlabs.mp4 /DROPBOX-FOLDER/svnlabs.mp4

I have uploaded media file upto 500MB on dropbox successfully using this shell script πŸ˜‰

Alternate Options:

You can try Node.js for reading files from Amazon S3 and then upload to Dropbox

Useful JavaScript Tools

http://loose-bits.com/2011/10/16/node-sunny-cloud-library.html
https://github.com/nuxusr/Node.js—Amazon-S3
https://github.com/appsattic/connect-stream-s3

https://github.com/evnm/dropbox-node
https://github.com/sintaxi/node-dbox
https://github.com/dropbox/dropbox-js

Build your business on Google Cloud Platform

Hope you already read my old article “Application Setup on Google App Engine”

Google Cloud Platform allows to build applications and websites, store and analyze data on Google’s infrastructure.

Google Cloud Platform
Google Cloud Platform

Features of Google Cloud Platform

* Scale your app – Take advantage of the speed and scale of Google’s applications.

* Focus on building – Deal with capacity planning and data center infrastructure.

* Save on costs – Pay only for what used.

* Fast Data Access – Quick and easy access to data around multiple regions.

* Reliable & Secure infrastructure – Google provides highly available, robust storage for your mission-critical data.

* Unlimited Storage – Store and manage unlimited number of objects within Application.

* Fully managed – Google will take care of replication, patch management or database management.

Solutions on Google Cloud Platform

Google App Engine
Google Cloud Storage
Google BigQuery
Google Cloud SQL
Google Compute Engine
Google Prediction API
Google Translation API

Google Cloud Platform
Google Cloud Platform

Over 1M applications run on Google Cloud Platform

Build Apps and Websites – Build apps and websites on Google’s infrastructure with Google App Engine.

Compute at Google Scale – Run Linux Virtual Machines in the cloud using Google Compute Engine.

Store your Data – Store and manage data on Google’s infrastructure with Google Cloud Storage.

Analyze Big Data – Analyze Big Data at astonishing speed using Google BigQuery.

Mobile Apps using Google App Engine

Google App Engine provide friction-less development environment to makes scale-able mobile back-end on Google’s infrastructure with less worries.

It goes live fast, scale infinitely and get started easily…

Business on Google Cloud Platform

Business on Google Cloud Platform
Business on Google Cloud Platform

You can download SDK to start building your app on Google App Engine.

If you are interested for creating Applications on Google Cloud Platform … Please Contact us

Email: svnlabs[at]gmail.com
Skype: svnlabs
MSN: svnlabs[at]hotmail.com

Amazon S3 Cloud HTML5 MP3 Player

Amazon S3 Cloud HTML5 Player plugin that allows you to link to your amazon S3 bucket and sets up a HTML5 Player playlist (horizontal or vertical). This plugin will support MP3 files only.

Amazon S3 Cloud HTML5 MP3 Player is not associated in any way to amazon.com

Get Self Hosted Amazon S3 Cloud HTML5 MP3 Player for WordPress just in $24

You will need an amazon account to use this.

AWS access info

Add your amazon information amazon key and amazon secret key. Then just add the bucket to your account add folders.

Make sure you have public permission for all your music in your S3 buckets and folders.

Shortcode for Page or Post

[html5aws3mp3 player=”horizontal” bucket=”BUCKET” endpoint=”BUCKET-ENDPINT” folder=”FOLDER/”]

Plugin Page

Amazon S3 Error Handling

AWS CloudFront with PHP

Create sub buckets on amazon s3

Amazon S3 Cloud HTML5 MP3 Player is not associated in any way to amazon.com

Amazon S3 Error Handling

Amazon S3 PHP Class A standalone Amazon S3 (REST) client for PHP 5.2.x using CURL that does not require PEAR.

AWS Management Console Home
AWS Management Console Home

AMAZON S3 (Scalable Storage in the Cloud) PHP CLASS

AWS access info
AWS access info

// AWS access info
if (!defined(‘awsAccessKey’)) define(‘awsAccessKey’, ‘CHANGE-KEY’);
if (!defined(‘awsSecretKey’)) define(‘awsSecretKey’, ‘CHANGE-KEY’);

OO method (e,g; $s3->getObject(…)):
$s3 = new S3(awsAccessKey, awsSecretKey);

Statically (e,g; S3::getObject(…)):
S3::setAuth(awsAccessKey, awsSecretKey);

Warning: S3::getBucket(): [PermanentRedirect] The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

We need to End Point for our S3 Buckets by default it’s s3.amazonaws.com

$s3 = new S3(awsAccessKey, awsSecretKey);

S3 Management Console
S3 Management Console

Else we need to specify here… s3-ap-southeast-1.amazonaws.com

S3 Management Console
S3 Management Console

$s3 = new S3(awsAccessKey, awsSecretKey, true, ‘s3-ap-southeast-1.amazonaws.com‘);

Warning: S3::getBucket(): [60] SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

We need SSL enabled with CURL πŸ˜‰

OpenSSL phpinfo()
OpenSSL phpinfo()
CURL With OpenSSL phpinfo()
CURL With OpenSSL phpinfo()

For class documentation see:
http://undesigned.org.za/files/s3-class-documentation/index.html