Paul’s Linux Blog

Just Another Uber-Geek

Browsing Posts published in February, 2010

Thanks to this great little script you no longer need to work out which program to use to uncompress multiple file archive formats.
Add this script to your .bashrc file and use as follows:
extract file.zip

 
extract () {
if [ -f $1 ] ; then
case $1 in
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>.bz2)   <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvjf $1    ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>.gz)    <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvzf $1    ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>.xz)    <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvJf $1    ;;
*.bz2)       bunzip2 $1     ;;
*.rar)       unrar x $1     ;;
*.gz)        gunzip $1      ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span>)       <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvf $1     ;;
*.tbz2)      <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvjf $1    ;;
*.tgz)       <span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">tar</span> xvzf $1    ;;
*.<span class="highlight" style="border: 1px solid gray; background: yellow none repeat scroll 0% 0%;">zip</span>)       unzip $1       ;;
*.Z)         uncompress $1  ;;
*.7z)        7z x $1        ;;
*.xz)        unxz $1        ;;
*.exe)       cabextract $1  ;;
*)           echo "\`$1': unrecognized file compression" ;;
esac
else
echo "\`$1' is not a valid file"
fi

At last I managed to get handbrake-gui on my pc big woohoo.

Not that excited hmm maybe not but I have tried many times to install handbrake, the only success I have had was on windows :( I have managed to get the Linux CLI version installed but could not get the out of my files quite right. The gui version I thought would be a simple install however I kept running into dependency issues.

Finally I did it, and worst of all it was far easier than expected.

First ensure you have subversion installed and configured as follows.

  • sudo apt-get install subversion

Now setup subversion

  • sudo svnadmin create /svn

Now to sort the dependencies.

  • sudo apt-get install  yasm build-essential autoconf libtool zlib1g-dev libbz2-dev intltool libglib2.0-dev libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev libwebkit-dev libnotify-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

To begin the install you will need to fetch the latest build of handbrake as follows:

  • svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk

Once the handbrake source code has downloaded change into the src directory.

  • cd hb-trunk

To configure and install handbrake in one easy go use the following command.

  • ./configure --launch

Once the build has completed you should be able to launch the gui as follows.

  • cd build/gtk/src
  • ./ghb &

NOTE: You are able to copy the ghb binary file to anywhere on your system.

I would recommend moving it to the local bin dir, then you should be able to launch it from a terminal screen by typing handbrake-gui &

  • mv ghb /usr/local/bin/handbrake-gui

If all was good you can delete the installation directory.

  • rm -rf hb-trunk

NOTES: I have run through these instructions on crunchbang / ubuntu 8.04 & 8.10 with no problems.

Powered by WordPress Web Design by SRS Solutions © 2010 Paul’s Linux Blog Design by SRS Solutions