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

file format validation

Below is the code to check file type in javascript.. <script type=”text/javascript” language=”javascript”> function isImage(file) { var image    = /\.(jpg|jpeg|bmp|gif|png|jpe)$/i; if (image.test(file)) return true; else return false; } function isAudio(file) { var audio    = /\.(mp3|wav|mid|midi|mp2|ul|ra|m3u|ram|rm)$/i; if (audio.test(file)) return true; else return false; } function isArchive(file) { var archive    = /\.(zip|rar)$/i; if (archive.test(file)) return true; else … Read more

create sub buckets on amazon s3

Sub buckets is very tricky task to create on Amazon S3 service… <?php include(“S3.php”); // class for REST based S3 manager $s3 = new S3(‘accessKey’, ‘secretKey’); $s3->putBucket(‘bucketname’, S3::ACL_PUBLIC_READ); /* function to upload svnlabs.txt file to subfolders s/v/n/l/a/b/s on S3 bucketname */ $s3->putObjectFile(‘svnlabs.txt’, ‘bucketname’, ‘s/v/n/l/a/b/s/svnlabs.txt’, S3::ACL_PUBLIC_READ); /* function to delete svnlabs.txt file to subfolders s/v/n/l/a/b/s on … Read more

wget – server to server files transfer

wget is powerful utility in linux. We can use “wget” to download files of any folder on any server to our server. wget will download files on local server in current folder, we can use # pwd (for current directory) # wget -H -r –level=1 -k -p http://www.domain.com/folder/ here level is folder’s level Keep downloading … Read more

float: left – anchor’s height

Today I faced a strange problem …. I have to add drop-down menu by javascript. <a href=”https://www.svnlabs.com” style=”border:2px dotted #0000FF”><img src=”svnlabs.gif” border=”0″ style=”border:2px solid #009966″ /></a> this is the code where I have to add a menu but menu dancing on this image.. when I mouse over the image menu appeared to bottom of the … Read more

txt2img

Here is the code to convert text to image or simply write text on image…. <?php $img=ImageCreate (100,20); $background_color=ImageColorAllocate($img,255,205,255); $textcolor=ImageColorAllocate ($img,203,14,91); ImageString($img,3,5,5,”svnlabs.com!”,$textcolor); ImagePNG ($img, “svnlabs.png”); $img2 = imagerotate ($img, 100, 0); ImagePNG($img2,”svnlabs.png”); ImageDestroy($img); ImageDestroy($img2); ?>