Google App Engine – Downloading source code

Hits: 3376  

I am working on my old project on Google App Engine… so I need to download old source code from Google App Engine ….

We can download source code for application by with the download_app action in the Python SDK command-line tool:

> download_app -A <your_app_id> -V <your_app_version> <output-dir>

But it is giving error …

D:\Program Files\Google\google_appengine> download_app -A svnlabs -V 1 E:/AppEngine/svnlabs
Usage: [options] download_app -A app_id [ -V version ] error: “download_app” expects one non-option argument, found 3. 🙁

D:\Program Files\Google\google_appengine> download_app -A svnlabs -V 1 E:/AppEngine/svnlabs

D:\Program Files\Google\google_appengine> download_app help
Usage: [options] download_app -A app_id [ -V version ] error: You must specify an app ID via -A or – -application. 


> download_app – -application=<your_app_id> – -version=<your_app_version> <output-dir> 🙂

D:\Program Files\Google\google_appengine> download_app – -application=svnlabs E:/AppEngine/svnlabs
01:50 PM Host:
01:50 PM Fetching file list…
Password for

Use an application-specific password instead of your regular account password.
However, now the recommended way to log in is using OAuth2. See

Google IssuedAuthSubTokens accesscode

Password for
01:55 PM Fetching files…
01:55 PM [1/41] WEB-INF/lib/script-10.jar
01:55 PM [2/41] WEB-INF/classes/META-INF/jdoconfig.xml
01:55 PM [3/41] svnlabs.php


GAE - Download

Install Wowza Media Server for Google Compute Engine

Hits: 4002  

Hope you really enjoyed our articles about Google Compute Engine..

Install Apache, PHP, MySQL on Google Compute Engine

Build your business on Google Cloud Platform

Install Red5 on Google Compute Engine

First you need to install Google Cloud platform command-line tools

$ wget
$ sudo apt-get install unzip

$ export PATH=${PATH}:$HOME/gcutil-1.9.1
$ sudo ln -s /usr/local/share/gcutil-1.9.1/gcutil /usr/local/bin/gcutil

Then make sure you have Ports used for Wowza streaming

TCP 1935: RTMP (all variants)
TCP 8084-8085: JMX/JConsole monitoring and administration
TCP 8086: HTTP administration
TCP 80: Apple HTTP Live Streaming (Apple HLS), Adobe HTTP Dynamic Streaming (Adobe HDS), Microsoft Smooth Streaming, MPEG-DASH streaming, RTMPT

$ gcutil addfirewall red5 –description=”Let open port 5080.” –allowed=”tcp:5080″
$ gcutil addfirewall rtsp –description=”Let open 554 rtmp port.” –allowed=”tcp:554″
$ gcutil addfirewall rtmp –description=”Let open 1935 rtmp port.” –allowed=”tcp:1935″
$ gcutil addfirewall http2 –description=”Let open port 5080.” –allowed=”tcp:8086″
$ gcutil getfirewall

Check Java Version or Install

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

Now read Install Wowza Examples

Download Wowza and install examples

$ wget
$ chmod +x WowzaMediaServer-3.6.2.deb.bin
$ ./WowzaMediaServer-3.6.2.deb.bin
$ cd /usr/local/WowzaMediaServer/bin
$ sudo ./
$ cd /usr/local/WowzaMediaServer-3.6.2/examples
$ sudo chmod +x
$ sudo ./

$ sudo service WowzaMediaServer start

Please check Wowza Forum for more help…

MP3 waveforms with PHP

Hits: 6487  

If you are thinking how generates the waveform for sound MP3 player?


There are some audio processing libraries used to process MP3 files to WAV and then PNG / SVG images..

MP3 to WAV to PNG

1. LAME MP3 encoder/decoder

$ lame input.mp3 -f -m m -b 16 –resample 8 resampled.mp3 && lame –decode resampled.mp3 output.wav

2. SOX – Sound eXchange

$ sox output.wav −n spectrogram
$ sox output.wav -n spectrogram -Y 140 -l -r -o output.png

3. wav2png – Creates waveform pngs out of audio files

$ sox mp3-song.mp3 -c 1 -t wav – | wav2png -o mp3-song.png /dev/stdin
$ wav2png –foreground-color=2e4562ff –background-color=00000000 -o  output.png   input.wav

WaveForm generated using SOX

WaveForm Generator using SOX


Liquidsoap GStreamer

Hits: 5483  

LiquidSoap Liquidsoap is a programming language to manage audio and video source streams for Icecast Radio server.

Liquidsoap is a powerful and flexible language for describing, creating or transforming streams. It offers rich operators and library that you can be used for making Icecast Radio Server.

Now Play Your Favorite Radio FM Stream in HTML5 Player…..
Live Audio Streaming, Internet Radio Player


* It can play icecast stream from files, playlists, directories or scripted playlists.
* Liquidsoap used for scheduling of source streams.
* It help to Mix sources streams.
* It allows queuing of user requests.
* It allows sound compression, normalization, echo, volume, Blank detection.
* It is useful for rewriting and inserting Metadata in Radio Stream.
* It can play live stream play files and streams like
* It can output to Radio Server Icecast/Shoutcast (MP3/Ogg).
* It also support Video streams generation.

You can use it to stream RTMP MP3 stream to Icecast/Shoutcast using mplayer, rtmpdump or gstreamer …

GStreamer- open source multimedia framework

GStreamer provide a rich library to manage streaming audio/video with complex audio (mixing) and video (non-linear editing) processing.

gst =”playbin uri=rtmp://″)
output.icecast(%mp3(), host = “localhost”, port = 8000, password = “xxxxxx”, mount = “gst stream”, fallible=true, gst)

Common Errors

File format problem can display ^M characters

😉 : set ff=unix and then : x in vi editor

init: security exit, root euid (user)

😉 you need to run liq file with non root user

the variable used here has not been previously defined

😉 Define variable “” .. .find here

Stay connected for more Audio / Video Programming ….

Installing Apache, MySQL, PHP in Gentoo Server

Hits: 9049  

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

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: 3916  

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

Or you can use ….

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

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

Get zip file size

exec(“ls -ls /var/www/html/ | 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: 7807  

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
$ sudo apt-get install gdebi

$ sudo gdebi airtime-easy-setup.deb


Unpacking airtime-easy-setup (from airtime-easy-setup.deb) …
Setting up airtime-easy-setup (2.3.0-1) …
Installing Sourcefabric package signing key…
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%%
KERNEL_VERSION = 3.5.0-21-generic
OS = Ubuntu 12.10 x86_64
CPU = Intel(R) Xeon(R) CPU E5430 @ 2.66GHz
WEB_SERVER = Apache/2.2.22 (Ubuntu)
— 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



Amazon S3 Expiring Link

Hits: 9562  

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

      * 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){

      * 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 (
      * @param string $path The target file path
      * @param int $expires In minutes
      * @return string Temporary Amazon S3 URL
      * @see
      function el_s3_getTemporaryLink($accessKey,$secretKey,$bucket,$path,$expires=5){
          // Calculate expiry time
          // Fix the path; encode and sanitize
          // Path for signature starts with the bucket
          // S3 friendly string to sign
          // Calculate the hash
          $signature= el_crypto_hmacSHA1($secretKey,$signsz);
          // Glue the URL ...
          // ... to the query string ...
          // ... and return the URL!



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

Demo Amazon S3 Cloud HTML5 MP3 Player


Backup Disk Snapshot on Google Compute Engine

Hits: 8206  

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 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 ….

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/ -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

Hits: 5512  

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