Hits: 648 Hello Friends, I read some where “Quality is not a product.. it is a process ” I think process is hard-work we do and product is final result we get. But how we make our process to get a good product, as a LAMP developer I think track processes “Debug Log” is good sort [...]
Hits: 263 PEAR have rich library to access web based resources easily… <?php $sv = new SVTube(); $sv->download(“D7cm-yu-CP0″, “svnlabs.flv”) ?> Class: SVTube.php —————————— <?php require_once ‘HTTP/Client.php’; require_once ‘HTTP/Request.php’; class SVTube { var $req; var $debug = false; var $auth = false; function download ($video_id, $video_filename) { $url = “http://www.youtube.com/watch?v=”.$video_id; $this->req =& new HTTP_Request($url); $response = $this->req->sendRequest(); [...]
Hits: 646 Hey, here are some simple steps to run shell commands under cgi-bin using Apache web server (/var/www/cgi-bin), which is configured with cgi access. Apache CGI allows files with executable permission in cgi-bin directory treated as application and run on web browsers. We have to send the MIME type before outputting data to the web [...]
Hits: 642 We have to install opera/firefox first on server. Then install Xvfb for Xvfb virtual framebuffer html2image.sh ………………………. #! /bin/sh /etc/init.d/xvfb start export DISPLAY=:7 DISPLAY=:7 opera –remote ‘openURL(‘$1′)’ & sleep 20 DISPLAY=:7 import -window root $2 /etc/init.d/xvfb stop Uses: # ./html2image.sh http://www.svnlabs.com webthumb/svnlabs.png Open FireFox in Xvfb: firefox.sh #!/bin/sh mozilla-firefox -a firefox -remote ‘openURL(‘$1′, new-tab)’ [...]
Hits: 501 We can use PEAR to process zip files in PHP using Archive_Zip…. First set PEAR path in php include path using set_include_path Make Zipped file <?php include (‘Archive/Zip.php’); // include PEAR ZIP package $obj = new Archive_Zip(‘test.zip’); // zipped file name $files = array(‘svnlabs/1.gif’, ‘svnlabs/resume.doc’, ‘svnlabs/invoice.xls’); // files add to zip if ($obj->create($files)) { [...]
Hits: 680 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 [...]
Hits: 512 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 [...]
Hits: 663 Sometime we face the problem when we navigate from HTTP URL to HTTPS URL our session lost. You can manage session between HTTP to HTTPS or HTTPS to HTTP: 1. Transmit session ID between page using GET 2. POST session ID by POST 3. Use files to save sessions 4. Use Cookies for sessions [...]
Hits: 452 # ffmpeg is a command line tool to convert one video file format to another. It can also grab and encode in real time from a TV card. # ffserver is an HTTP and RTSP multimedia streaming server for live broadcasts. It can also time shift live broadcast. # ffplay is a simple media [...]









