Installing Apache, MySQL, PHP in Gentoo Server


Hits: 9407  

All commands are performed as root to install Apache, MySQL, PHP and phpMyAdmin in Gentoo Linux Server.

1. Update your System

# emerge –sync

2. Install Apache Webserver

# emerge apache

The web server ROOT is in /var/www/localhost/htdocs/

# /etc/init.d/apache2 start

Then go to http://server-ip/
it works on gentoo

Add apache2 to the startup script
# rc-update -v add apache2 default

3. Install MySQL Database

# emerge mysql

Install MySQL database
# /usr/bin/mysql_install_db

Start MySQL Server
# /etc/init.d/mysql start

Change MySQL User Password
# /usr/bin/mysqladmin -u root -h localhost password ‘new-password’

Test MySQL Server
# /etc/init.d/mysql restart

Add MySQL to the startup script
# rc-update -v add mysql default

4. Install the PHP with modules

# USE=”cli cgi apache2 xml mysql mysqli” emerge ‘dev-lang/php’

Before you can use PHP with Apache… Edit /etc/conf.d/apache2 and add “-D PHP5″ to APACHE2_OPTS

It looks like
APACHE2_OPTS=”-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5″

You can find php.ini in /etc/php/apache2-php5.4

then restart apache server
# /etc/init.d/apache2 restart

Then go to http://server-ip/info.php (Create phpinfo() file)

phpinfo on gentoo
phpinfo on Gentoo

phpinfo php

phpinfo mysql

5. Install phpMyAdmin

# emerge -av phpmyadmin

Then go to http://server-ip/phpmyadmin/

phpMyAdmin on gentoo
phpMyAdmin on Gentoo

Creating Zip Without Recording ROOT Paths


Hits: 4068  

Simply use chdir() to change the working directory before you exec()

Or you can use ….

exec(“cd /var/www/html/media; zip -r -9 Media.zip . 2>&1”, $log);

exec(“mv /var/www/html/media/Media.zip /var/www/html/Media.zip”);

Get zip file size

exec(“ls -ls /var/www/html/Media.zip | awk ‘{print $6}’ 2>&1”, $size);

$zipsize = implode(” “, $size);

Without this solution

Length Date Time Name
——– —- —- —-
0 03-08-13 15:10 /var/www/html/media/dialogs/
125305 08-07-12 16:31 /var/www/html/media/dialogs/1.3.mp3
125305 08-07-12 16:33 /var/www/html/media/dialogs/1.5.mp3
184864 08-07-12 16:32 /var/www/html/media/dialogs/1.4.mp3
125305 08-07-12 16:30 /var/www/html/media/dialogs/1.1.mp3
125305 02-24-13 16:48 /var/www/html/media/dialogs/1.2.mp3
125305 08-07-12 16:34 /var/www/html/media/dialogs/1.6.mp3

With this solution

Length Date Time Name
——– —- —- —-
0 03-08-13 16:40 dialogs/
125305 08-07-12 16:51 dialogs/1.3.mp3
125305 08-07-12 16:53 dialogs/1.5.mp3
184864 08-07-12 16:52 dialogs/1.4.mp3
125305 08-07-12 16:50 dialogs/1.1.mp3
125305 02-24-13 16:58 dialogs/1.2.mp3
125305 08-07-12 17:04 dialogs/1.6.mp3

Install Airtime – open source radio automation software


Hits: 8134  

Airtime is open source radio automation software (GPL v3) for GNU/Linux platforms. It’s recommend installing on Ubuntu Linux 12.04 LTS or Debian Squeeze on a computer with at least a 1 GHz processor and 512 MB of RAM for a Server Edition OS or 1GB of RAM for a Desktop Edition OS.

Download airtime-easy-setup

$ sudo wget http://apt.sourcefabric.org/misc/airtime-easy-setup.deb
$ sudo apt-get install gdebi

$ sudo gdebi airtime-easy-setup.deb

Airtime-Icecast
Airtime-Icecast

Unpacking airtime-easy-setup (from airtime-easy-setup.deb) …
Setting up airtime-easy-setup (2.3.0-1) …
Installing Sourcefabric package signing key…
OK
Setting up Airtime for Etc/UTC timezone…
Setting Icecast and Airtime domain names to ip-10-xxx-yy-74.ec2.internal…
Setting defaults for non-interactive installation…
Checking that the server has a UTF-8 locale…
en_US.UTF-8 is the default locale on this server and appears to support UTF-8 encoding.

Now please run the commands:

sudo apt-get update
sudo apt-get install airtime

After that, installation of Airtime should be complete in a couple of minutes.

You should then be able to log in to Airtime at http://ip-10-xxx-yy-74.ec2.internal/
Processing triggers for man-db …

Install Airtime

$ sudo apt-get update
$ sudo apt-get install airtime

*** Verifying your system environment, running airtime-check-system ***
AIRTIME_STATUS_URL = http://ip-10-xxx-yy-74.ec2.internal:80/api/status/format/json/api_key/%%api_key%%
AIRTIME_SERVER_RESPONDING = OK
KERNEL_VERSION = 3.5.0-21-generic
MACHINE_ARCHITECTURE = x86_64
TOTAL_MEMORY_MBYTES = 604072
TOTAL_SWAP_MBYTES = 0
AIRTIME_VERSION = 2.3.0
OS = Ubuntu 12.10 x86_64
CPU = Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
WEB_SERVER = Apache/2.2.22 (Ubuntu)
PLAYOUT_ENGINE_PROCESS_ID = 19766
PLAYOUT_ENGINE_RUNNING_SECONDS = 32
PLAYOUT_ENGINE_MEM_PERC = 2.6%
PLAYOUT_ENGINE_CPU_PERC = 0.9%
LIQUIDSOAP_PROCESS_ID = 19801
LIQUIDSOAP_RUNNING_SECONDS = 31
LIQUIDSOAP_MEM_PERC = 3.4%
LIQUIDSOAP_CPU_PERC = 7.9%
MEDIA_MONITOR_PROCESS_ID = 19701
MEDIA_MONITOR_RUNNING_SECONDS = 38
MEDIA_MONITOR_MEM_PERC = 2.4%
MEDIA_MONITOR_CPU_PERC = 0.0%
RABBITMQ_PROCESS_ID = 16705
RABBITMQ_RUNNING_SECONDS = 427
RABBITMQ_MEM_PERC = 4.8%
RABBITMQ_CPU_PERC = 0.9%
— Your installation of Airtime looks OK!

******************************* Install Complete *******************************
Setting up liquidsoap-plugin-faad (1.0.1+repack1-1) …
Processing triggers for libc-bin …
ldconfig deferred processing now taking place

Airtime
Airtime

Help: http://en.flossmanuals.net/airtime-en-2-3/easy-setup/

Amazon S3 Expiring Link


Hits: 9861  

I was working on Amazon S3 Cloud HTML5 MP3 Player for S3 Bucket security and Expiring Media links.

Amazon S3 Cloud HTML5 MP3 Player
Amazon S3 Cloud HTML5 MP3 Player
<?php

  if(!function_exists('el_crypto_hmacSHA1')){
      /**
      * Calculate the HMAC SHA1 hash of a string.
      *
      * @param string $key The key to hash against
      * @param string $data The data to hash
      * @param int $blocksize Optional blocksize
      * @return string HMAC SHA1
      */
      function el_crypto_hmacSHA1($key,$data,$blocksize=64){
          if(strlen($key)>$blocksize)$key=pack('H*',sha1($key));
          $key=str_pad($key,$blocksize,chr(0x00));
          $ipad=str_repeat(chr(0x36),$blocksize);
          $opad=str_repeat(chr(0x5c),$blocksize);
          $hmac=pack('H*',sha1(
              ($key^$opad).pack('H*',sha1(
                  ($key^$ipad).$data
              ))
          ));
          returnbase64_encode($hmac);
      }
  }

  if(!function_exists('el_s3_getTemporaryLink')){
      /**
      * Create temporary URLs to your protected Amazon S3 files.
      *
      * @param string $accessKey Your Amazon S3 access key
      * @param string $secretKey Your Amazon S3 secret key
      * @param string $bucket The bucket (bucket.s3.amazonaws.com)
      * @param string $path The target file path
      * @param int $expires In minutes
      * @return string Temporary Amazon S3 URL
      * @see http://awsdocs.s3.amazonaws.com/S3/20060301/s3-dg-20060301.pdf
      */
      function el_s3_getTemporaryLink($accessKey,$secretKey,$bucket,$path,$expires=5){
          // Calculate expiry time
          $expires=time()+intval(floatval($expires)*60);
          // Fix the path; encode and sanitize
          $path=str_replace('%2F','/',rawurlencode($path=ltrim($path,'/')));
          // Path for signature starts with the bucket
          $signpath='/'.$bucket.'/'.$path;
          // S3 friendly string to sign
          $signsz=implode("\n",$pieces=array('GET',null,null,$expires,$signpath));
          // Calculate the hash
          $signature= el_crypto_hmacSHA1($secretKey,$signsz);
          // Glue the URL ...
          $url=sprintf('http://%s.s3.amazonaws.com/%s',$bucket,$path);
          // ... to the query string ...
          $qs=http_build_query($pieces=array(
              'AWSAccessKeyId'=>$accessKey,
              'Expires'=>$expires,
              'Signature'=>$signature,
          ));a
          // ... and return the URL!
          return$url.'?'.$qs;
      }
  }

  ?>

Uses:

$ExpiringLink = el_s3_getTemporaryLink(‘AWS-KEY’, ‘AWS-SECRET-KEY’, ‘BUCKET’, ‘FILENAME’, ‘EXPIRING-TIME’);

Demo Amazon S3 Cloud HTML5 MP3 Player

Reference: http://snipplr.com/view/46753.57507/

PHP Run Background Process using Exec


Hits: 8984  

If you need to start process in background and get its PID to manage it later using PHP.

<?php

function runInBackground($command,$log,$priority=0)
{
if($priority)
   $PID=shell_exec("nohup nice -n $priority $command > $log 2>&1 & echo $!");
else
   $PID=shell_exec("nohup $command > $log 2>&1 & echo $!");
return($PID);
}

?>
PHP Process
PHP Process

echo $! will return process ID
# Command & echo $!

 

Check if process is running

<?php

function isProcessRunning($PID)
{

if($PID==0)return false;
if($PID=="")return false;

exec("ps -p $PID 2>&1",$state);
return(count($state)>=2);

}

?>

 

Display Process Logs

<?php

function displayProcessLog($logfile)
{

exec('cat $logfile 2>&1',$log);
return implode("\r\n",$log);

}

?>

 

Kill Process

<?php

function killProcess($PID)
{
 exec('kill '.$PID.' 2>&1',$status);
 return implode("\r\n",$status);
}

?>

 

Save Process ID to file

#!/bin/bash
Command &
echo $! >/path/to/pid.file

Kaltura Red5 iOS Live Streams Setup


Hits: 7634  

We have a plugin that can be used for streaming kaltura live red5 rtmp to mobile devices.

Kaltura Red5 Live Plugin take below data to segment live video stream

– Red5 Live Video RTMP Stream Link
– Red5 Stream Name
– Publishing Folder
– Publishing Link

Configure Live Stream for Mobile on Kaltura Red5
Configure Live Stream for Mobile on Kaltura Red5

The Main feature of this plugin to show live RTMP streams using Adobe FMLE, on computers using the Kaltura Player and HTML5 player on mobile devices using M3U8 video iOS compatible format.

– Capture Red5 live kaltura stream for FFMpeg Segmentation
– Manage Segmented Clips in M3U8 format
– Stream iOS compatible video to iPhone / iPad in HTML5 Player
– Track Analytic / Stats for live stream in HTML5 Player
– Embed code for HTML5 Player
– Track process log

Live Stream for Mobile on Kaltura Red5
Live Stream for Mobile on Kaltura Red5
KMC - content - manage
KMC – content – manage

Process Log Live Stream for Mobile on Kaltura Red5

Process Log Live Stream for Mobile on Kaltura Red5
Process Log Live Stream for Mobile on Kaltura Red5

Embed Code Live Stream for Mobile on Kaltura Red5

Embed Live Stream for Mobile on Kaltura Red5
Embed Live Stream for Mobile on Kaltura Red5

Related Articles
* VOD to iOS
* Record Audio from Websites
* Red5 Media Server iOS Android Setup

Kaltura Live Red5 CAM RTMP to iOS (iPhone or iPad). Get more help for HTTP Live Video Stream Segmenter and Distributor Contact Us

RTMP (Red5) -> FFMpeg -> Segementer -> .ts files -> iOS (m3u8)

Free Cloud Storage Services


Hits: 5563  

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


Hits: 9406  

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 = ‘http://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 http://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 http://www.svnlabs.com svnlabs.png
# phantomjs webthumb.js http://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 http://www.svnlabs.com/ svnlabs.png
# phantomjs examples/rasterize.js ‘http://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


Hits: 8011  

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


Hits: 7055  

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