Wednesday, August 22, 2012

Is it possible to quit Google?

How to convert flv to mp3 in Ubuntu

FFmpeg from the repository is not compiled to support restricted formats such as mp3. You can use a third-party repository such as Medibuntu, compile ffmpeg yourself, or use another library, such as: libavcodec-extra-53.

The basic command:
Code:
ffmpeg -i inpuvvideofile.flv outputaudiofile.mp3

By default this will create a 64 kb/s file. You can declare the audio bitrate with -ab:
Code:
ffmpeg -i inpuvvideofile.flv -ab 128k outputaudiofile.mp3

If the flv already has mp3 audio, then there is no need to re-encode. You can just copy the audio stream. This will preserve the audio quality and will be much quicker since there is no re-encoding:
Code:
ffmpeg -i inpuvvideofile.flv -acodec copy outputaudiofile.mp3

Don't know what the audio is? Just ask ffmpeg:
Code:
ffmpeg -i inputvideo.flv

Along with some other information, ffmpeg will provide file details with the above command:
Code:
Stream #0.0: Video: flv, yuv420p, 320x240, 29.97 tb(r)
Stream #0.1: Audio: mp3, 22050 Hz, mono, s16, 56 kb/s
Source:ubuntuforums

Thursday, June 21, 2012

grub2 - Grub Error in Ubuntu 12.04 after upgrade from 11.10

Boot into the Ubuntu Live Cd and open terminal.



1. Identify Ubuntu partition:

sudo fdisk -l


2. Mount it ( replace sda1 with the Ubuntu partition number):

sudo mount /dev/sda1 /mnt


3.Reinstall grub:

sudo grub-install --root-directory=/mnt /dev/sda
sudo update-grub

Solution from: grub2 - Ubuntu 11.10 not showing up in GRUB bootloader after update and restart :( - Ask Ubuntu.

Friday, June 15, 2012

Installing Oracle-JDK in Ubuntu

Download JDK from ORacle. Run Terminal:

chmod u+x jdk-6u31-linux-i586.bin
./jdk-6u31-linux-i586.bin
sudo mv jdk1.6.0_31 /usr/lib/jvm/


#Next line will add java to symlink

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_31/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_31/bin/javac" 1

Or, better if you can set environment variable by adding the following lines at the bottom of .bashrc by "gedit ~/.bashrc":

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_03
export PATH=$PATH:$JAVA_HOME/bin

You can now check if the java is installed properly in terminal:

java -version
javac -version

These will return the version of java and javac.

Tuesday, April 24, 2012

Ubuntu Command Collection

  • install debian file:
sudo dpkg -i package_name.deb
  • install dependency:
sudo apt-get -f install
  • install software:
sudo apt-get -f install package_name
  • install bundle file:
sudo sh file_name.bundle
  • install bin/sh file:
chmod +x file_name.bin
./file_name.bin
  • Installing WIRESHARK's dumpcap without allowing non-root users to capture packets:
setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap
  • Find the MAC address:
ifconfig

References:
  1. WIRESHARK:

Monday, April 9, 2012

Generics are not supported in -source 1.3 error in Maven Project

When compiling via maven project, you may have encountered following error:
generics are not supported in -source 1.3 error in Maven Project. use -source 5 or higher to enable generics.

Annotation is not allowed in -source 1.3 use -source 5 or higher to enable annotation.

To solve this you must add the below lines at your pom.xml :


    
        
            org.apache.maven.plugins
            maven-compiler-plugin
            
                1.5</source>
                1.5