Abhishek Gupta

The Sun won’t set at NIT Durgapur !

Posts Tagged ‘command’

How To Convert Video File in Linux through command line

Posted by abhiitechie on August 30, 2009

Get the ffmpeg package first from the repo by

sudo apt-get install ffmpeg

Then follow the following command lines to get going


3gp to avi : ffmpeg -i source.3gp -f avi -vcodec xvid -acodec mp3 -ar 22050 destination.avi

flv to 3gp : ffmpeg -i source.flv -s 176×144 -vcodec h263 -r 25 -b 200 -ab 64 -acodec mp3 -ac 1 -ar 8000 destination.3gp

flv to mp4 : ffmpeg -i source.flv -vcodec h264 -r 25 -b 200 -ab 128 -acodec mp3 -ac 2 -ar 44100 destination.mp3

avi to mp4 : ffmpeg -i source.avi -f psp -r 29.97 -b 768k -ar 24000 -ab 64k -s 320×240 destination.mp4

mp4 to 3gp : ffmpeg -i source.mp4 -s 176×144 -vcodec h263 -r 25 -b 12200 -ab 12200 -ac 1 -ar 8000 destination.3gp

avi to 3gp : ffmpeg -i source.avi-s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -r 25 -ab 32 -y destination.3gp

mpg to 3gp : ffmpeg -i source.mpg -s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -ab 32 -y destination.3gp

Enjoy !

Posted in linux, Personal | Tagged: , , , , , , , , , | 5 Comments »

Resetting password in MySQL when showing Permission denied

Posted by abhiitechie on April 27, 2009

mysql> CREATE DATABASE TEST;
ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘TEST’

Stop the mysqld daemon process by 
$killall mysqld

Start the mysqld daemon process with the 
$mysqld –skip-grant-tables option.

Start the mysql client with the        
$mysql -u root option.

Execute the 
mysql>UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE   User=’root’;  
(say user can be abhishek and password can be abhishek)

Execute the command              

mysql>FLUSH PRIVILEGES;

After this start the MySQL client by $ mysql -u root -p 
Enter the newly set password and get down to the business.

Posted in mysql | Tagged: , , , , , , , , , , | Leave a Comment »

How to open a .war (web archive) or .jar (java archive) files

Posted by abhiitechie on April 27, 2009

With Java we generate .JAR files to bundle a set of resources. For J2EE web applications, we generate .WAR (Web Archive) files for deployments. Both of these are ways of archiving a set of files.

Both these .jar or .war archives are in zip format. So there are plenty of ways to open those files to read the content. One way would be to use any tool that you use to open/extract a .zip file. Next will be to use the Jar command itself.

JAR Command

JAR (command) utility in Java can be used to open/extract these files as follows. Run following command from the folder where you need the content to be extracted by providing the path to the archive.

jar xf

options:

x – extract the files
f – file to extract

jar xf myWebApp.war
jar xf myProject.jar

Posted in Uncategorized | Tagged: , , , , , , , , , | 1 Comment »