Saturday, June 27, 2009

Check linux version

ls /etc/*-release
cat /etc/redhat-release
uname -a

Monday, June 22, 2009

Linux date

Command for Linux Date : $ date +"%m-%d-%y"
Command for Linux Date/Time : $ date +"%m-%d-%y %T"
Command for changing Date time of linux: : $ date 062321542009 where 06:month ,23: day, 21: hour ,54: minut,2009: year

for refrence: www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display

video to image converter in linux

FFMPEG is an awesome tool and today only i found that FFMPEG can extract JPEG image from video. To achieve this following are the software requirements.

Example:
fmpeg -i test.avi -ss 1.4 -vframes 33 -f image2 output%2d.jpg

Installing FFMPEG on Linux:
FFMPEG is an open source application that allows you to convert video and audio files easily between a variety of different formats. It supports most industry-standard codec and can convert from one file format to another quickly and easily. This article will guide you to installing FFMPEG and other codec on Linux.


FFMPEG Installation Requirements:

  • FFMPEG
  • LAME Mp3 Audio Codec (Requred for mpg, flv, avi, wmv etc files)
  • AMR Audio Codec (Required for 3gp video files)
  • XVID Audio Codec
  • FFMPEG-PHP


Note on installing FFMPEG:

  • All the Audio Codec getting used in FFMPEG are not part of FFMPEG Source base
    FFMPEG Download URL:On the download page of FFMPEG they have geven the download link from SVN and checkout-snapshot but i would suggest to use SVN source code base.
  • FFMPEG Download Page FFMPEGThe url for the SVN source code for FFMPEG is: svn://svn.mplayerhq.hu/ffmpeg/trunk
    To download from SVN you will have to install subversion located at subversion.tigris.org, or you can use “TortoiseSVN” located at tortoisesvn.tigris.org.
  • LAME Mp3 Codec download URL: Lame Mp3 Codec
  • AMR Audio Download URL: AMR Audio Codec
  • To install the AMR codec you will require both AMR-WB and AMR-NB files.
  • XVID Audio Download URL: XVID Audio Codec
  • FFMPEG-PHP Download URL: FFMPEG-PHP
    Installation Steps:
  • It is a good practice to install all the external audio codec libraries first and then install the FFMPEG.
    Installing LAME MP3 Encoder
  • Untar the lame file by using tar zxvf lametarfile
  • Assign 777 permission rights to the lame folder by typing chmod 777 lamefolder -R
  • Traverse to the root of lame folder and type./configuremakemake install
    Installing AMR Codec
  • For installing the AMR codec there are two separate files that needs to be installed are AMR-WB and AMR-NB.
  • Untar the AMR file by using tar zxvf tarfile
  • Assign 777 permission rights to the amr folder by typing chmod 777 amrfolder -R
  • Traverse to the root of amr folder and type./configuremakemake install
    Note on Installing AMR:You might get errors installing AMR codec on Autoconf utility of linux. To resolve this problem will have to install the latest version of Autoconf utility from Download AutoConf
    Installing Xvid Codec
  • Untar the xvid file bu using tar zxvf tarfilename
  • Assign 777 permission rights to the lame folder by typing chmod 777 xvidfolder -R
  • Traverse to the root of xvid folder
  • Goto Build/generic folder and type./configuremakemake install
    Installing GCC
  • This is required only if the SVN for FFMPEG is not compatible with the existing version of GCC(3x) requires a new version for the same
  • After the installation of GCC need to convert all the files of SVN to Unix compatible by using “dos2unix ffmpegfolder/* -R”.
    Installing FFMPEG
  • Download the ffmpeg from SVN
  • Assign 777 permission rights to the ffmpeg folder by typing chmod 777 ffmepgfolder -R
  • Traverse to the root of ffmpeg folder and
  • type ./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared
  • make
  • make install

Installing FFMPEG-PHP

  • Download the ffmpeg-php from Sourceforge
  • Unpack the archive by using following command “tar -xjf ffmpeg-php.X.XX.tar.gz”
  • Iterate inside the ffmpeg-php directory
  • Run phpize (included with your php install) to build configuration files./configuremakemake install
    NOTE FOR FFMPEG-PHP:If you are planning to install FFMPEG-PHP then will have to add –enable-shared parameter while configuring FFMPEG
    You might get installation error while making the file related to html or texti files in ffmpeg\doc folder. The solution for this that worked for me is to just create a empty file by using touch command in the respective folders.


Note:The following configure parameter will work with FFMPEG 0.49. But now the latest version does not have –enable-libogg parameter so if you are planning to installing the latest version then the configure parameter would be /configure –enable-libmp3lame –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared.

Note on Reinstalling FFMPEG:If you are planning to reinstall the FFMPEG software the will have to perform following steps:

  • ./configure –enable-libmp3lame –enable-libogg –enable-libvorbis –enable-libamr-nb –enable-libamr-wb –enable-libxvid –enable-gpl –enable-shared
  • make clean
  • make
  • make install
    Lot of people are facing error on loading shared libraries libavdevice.so.52, solution to the same is:export LD_LIBRARY_PATH=/usr/local/lib/

Thursday, June 18, 2009

Upload big files

Hi,
For uploading big files we have to make some changes on php configuration.
max_input_time 6000
max_execution_time 6000
post_max_size 300M
upload_max_filesize = 300M
memory_limit = 32
You can do it using .htaccess
php_value max_input_time 600
php_value max_execution_time 600
php_value post_max_size 200M

Mounting NT Server with Linux

mount -t cifs //IP/scryptionsdms /mnt/scryptionsdms -o username=apache,password=apache,uid=apache,gid=apache

Mysql Dump

mysqldump -u -p database_one table_name > /var/www/backups/table_name.sql

Wednesday, June 17, 2009

PHP Framework

I am just studing some framework.
1. CakePHP.
2.simfony.
3. PARADO.
I’ve used putty for all my ssh needs on windows for a long time now. It’s great but certainly lacks a little polish in some areas.
The one feature I really wanted was tabbed sessions. After a little searching I came across a comment on this post that mentioned an open source alternative called poderosa. I just got round to downloading and I must say that so far it looks great.
The only potential downside is that it relies on the .net framework (which I’d so far managed without) so it’s not quite as light weight as putty but good none-the-less.

Monday, June 8, 2009

Mysql Issue

Hi All,
We are having one issue which I want to share with you.
We are using Mysql 5 Enterprise Edition from last one year.
We are heaving some confusion/problem when we are quering to our database.
We have a "client" table and there is a integer field "ID"in database.
We are searching a record using the query give below. its giving wrong result set.
"Select * from client where id='11109C'"
This type of query giving us result of record where id equal to"11109" Which should not be there in the result Set