a2zVideo API

Welcome to the a2zVideoAPI wiki! This API supports video links to get video information like Embed Code, Video Thumb, Video Title, Video Description etc. How to use a2zVideoAPI: 1. Download “api.php” from http://github.com/svnlabs/a2zVideoAPI 2. API require PHP with CURL extension.. Setup / Upload “api.php” to your web server 3. Modify “api.php” for API Video server … Read more

Stream MP3 using PHP – m3u

M3U is a computer file format that stores multimedia playlists. <?php function m3u_stream($dir) { $mp3=””; $siteurl=”http://www.domain.com/mp3/”; $h1 = opendir($dir); while ($file = readdir($h1)) { if ($file == ‘.’ || $file == ‘..’) continue; $mp3.=$siteurl.basename($dir).”/”.$file.”\r\n”; } closedir($h1); return $mp3; } $folder = “svnlabs”; file_put_contents($folder.”.m3u”, m3u_stream($_SERVER[“DOCUMENT_ROOT”].”/mp3/”.$folder.”/”)); ?> Here “svnlabs” is a folder where all mp3 files exists… … Read more

Class Loading in J2SE Environment

Java Class Loading mechanism is one of the darkest corners inside java virtual machine. The class loading concept describes the behavior of converting a named class into the bits responsible for implementing that class. Wait a minute! “I never have to deal with it. Why do I need to know this bulky philosophy”, this might … Read more

Install libpurple with PHP

libpurple is intended to be the core of an IM program. This libpurple PHP binding, which defines a set of internal classes, gives a possibility to use aol and icq (oscar), yahoo, msn, jabber, irc and much more protocols directly from PHP. Write your own IM chat client in PHP, as simply as PHP enables … Read more

VideoAPI

Curl must be on your server to use this plugin. This widget tested to latest version of wordpress. Download a2zVideoAPI.zip Extract and upload a2zVideoAPI.php to the plugins/ directory Enable a2zVideoAPI Widget in the Plugin admin panel Place a2zVideoAPI in the sidebar, and edit it to enter the Video URL

7 Simple Steps to create Twitter Application

First you have to download oAuth from github “An open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.” 7 Simple Steps to create Twitter Application using Twitter’s OAuth…. 1. Build TwitterOAuth object Login to twitter and register a new application here https://twitter.com/oauth_clients … after registering application … Read more

Magic of PEAR – Date TimeZone

PEAR is a framework and distribution system for reusable PHP components. How we get PEAR packages with php files? Add block of code to the php file…. <?php // include PEAR class include (“Date.php”); // initialize Date object $d = new Date(“1981-08-07 01:30:11”); // retrieve date to display echo $d->getDate(); // retrieve date as formatted … Read more

No route to host

Often, when we get error “No route to host” to connect remote server via linux command line e.g. wget, curl etc. or web services (webserviceserver). The first solution we want to try to troubleshot firewalls and proxies? But before that try hostname entry in linux box… # vi /etc/hosts add & save 192.168.0.100 webserviceserver If … Read more

Backup mysql database to amazon S3

Below is the simple code to create sql script of database on Amazon EC2 server using “mysqldump”… then upload this sql script to Amazon S3 bucket using command line S3 tool “s3cmd”… <?php $sqlbackup=”/usr/bin/mysqldump -v -u root -h localhost -r /var/www/html/backup/”.date(“Y-m-d-H-i-s”).”_db.sql -pdbusername  databasename 2>&1″; exec($sqlbackup, $o); echo implode(“<br /> “, $o); $file = “/var/www/html/backup/”.date(“Y-m-d-H-i-s”).”_db.sql”; $bucket = “s3bucketname”; exec(“/usr/bin/s3cmd  put –acl-public –guess-mime-type  –config=/var/www/html/.s3cfg   “.$file.”  s3://”.$bucket.”  2>&1″, $o); echo implode(“<br /> “, $o); ?> 0 */12 * * * env php -q /var/www/html/s3bkup/s3bkup.php > /dev/null 2>&1 (per 12 … Read more