Trim and remove empty key & value in php array

Here is the PHP function that will remove empty key => value in PHP array… function array_trim($sv) { $s = 0; $svn = null; $c = count($sv); for($i = 0; $i < $c; $i++) { if($sv[$i] != “”){ $svn[$s++] = trim($sv[$i]); } } return $svn; } $svarray = array(‘   ‘, ‘svlinux’, ‘svnlabs’, ‘lamp’, ”); $svarray … Read more

CakePHP in svnlabs

CakePHP is the rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It follows design patterns like MVC and ORM, CakePHP reduces development costs and helps developers write less code. Features of CakePHP: – Extremely Simple. – Active, Friendly Community. – Flexible License. – Clean IP – Best … Read more

send xml over post

<?php /* $url = Web Service Url or Server Url where xml have to post $xml = XML  schema to post on server */ function sendXmlOverPost($url, $xml) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // For xml, change the content-type. curl_setopt ($ch, CURLOPT_HTTPHEADER, Array(“Content-Type: text/xml”)); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // … Read more

Oscommerce – made easy

osCommerce is an online e-commerce solution that offers a wide range of features that allows online stores to be setup quickly with ease, and is available for free as an Open Source based solution released under the GNU General Public License. http://svn.oscommerce.com/confluence/display/OSCDOC/Installation+and+Upgrades http://www.oscommerce.info/contents

Soap Client for MMS

Web services are widely supported the major technologies.. There are some ways to make web services: XML-RPC, SOAP and REST here is the demo in nuSOAP for sending MMS to mobiles using MM7 protocol…. <? // Pull in the NuSOAP code require_once(‘nusoap.php’); require_once(‘nusoapmime.php’); $wsurl = WEBSERVICEURL; $operation = “SubmitReq”; $username = USERNAME; $password = PASSWORD; … Read more

Grep / ACK

Grep / ACK Ack can be replacement for grep….. # yum install ack Suppose you are on /var/www/html, here you want to search text “svnlabs” in all files in current directory…. you can use: # ack svnlabs # man ack    (for more options) grep : print lines matching a pattern. find : search for … Read more

midentify – mplayer

midentify – It is the utility come with mplayer to find video ID of video files…. # /usr/bin/midentify video.mp4 ID_VIDEO_ID=0 ID_AUDIO_ID=1 ID_AID_1_LANG=eng ID_FILENAME=video.mp4 ID_DEMUXER=lavfpref ID_VIDEO_FORMAT=avc1 ID_VIDEO_BITRATE=0 ID_VIDEO_WIDTH=320 ID_VIDEO_HEIGHT=240 ID_VIDEO_FPS=25.000 ID_VIDEO_ASPECT=1.3333 ID_AUDIO_FORMAT=255 ID_AUDIO_BITRATE=0 ID_AUDIO_RATE=24000 ID_AUDIO_NCH=2 ID_LENGTH=72.62 ID_SEEKABLE=1 ID_CHAPTERS=0 ID_VIDEO_CODEC=ffh264 ID_AUDIO_BITRATE=128000 ID_AUDIO_RATE=48000 ID_AUDIO_NCH=2 ID_AUDIO_CODEC=faad ID_EXIT=EOF Try # mediainfo to get video infrmation on linux box  🙂

Traffic Capture – tcpdump

Packet Sniffer [root@svnlabs ~]# route Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 192.168.0.0     *               255.255.255.0   U     1      0        0 eth0 default         ip12.mshome.n 0.0.0.0         UG    0      0        0 eth0 # /sbin/route -n # tcpdump -i eth0 ‘port 80’ # tcpdump -n -c 30000 -w /root/port.80.debug.txt # tcpdump -X -vv -r /root/port.80.debug.txt … Read more