Thursday, October 18, 2012

Flash Player 11 installation on Ubuntu 12.04


Recently while I was watching some youtube video I encountered an error which didnt allow me to play the particular youtube videos. This occured in both Mozilla Firefox and Google Chrome web browsers. It was due to missing flash player. I downloaded the latest flash player from the official website. Well you can get the flash player 11 for Ubuntu 12.04 64-bit from this link.

It was very simple to install the flash player, just a couple of quick steps.
Make a new directory and place the downloaded flash player into it and proceed to extract the .tar.gz tarball.
$ tar xzvf install_flash_player_11_linux_x86_64.tar.gz

Now move to the Mozilla Plugins directory
$ cd /usr/lib/mozilla/plugins/

Lastly just copy the libflashplayer.so file that you just extracted in your folder to the Mozilla Plugins directory.
$ sudo cp /your_folder/install_flash_player_11_linux_x86_64/libflashplayer.so .

That's it. Flash Player 11 is installed in your system. Resume playing to your youtube videos. Enjoy!

Tuesday, October 02, 2012

File Archiving and Compressing Using tar and gzip


It is a common practice by UNIX professionals to use the tar utility for archiving, compressing and decompressing of files. Most commonly used utility for this purpose is tar utility. The tar command can be used to rip the files and directories into a archive file which is commonly called a tarball or just tar. Depending on the rate of compression there are different compressed archive utilities which rip files and directories to a single highly compressed archive, like gzip and bzip2.

The main purpose of this article is to compare these tar archives through commands used to extract, read and archive various tarballs.

tar Archive

Archive
$ tar cvf </path/to/destination/archivename.tar> </path/to/source/dir/>

To estimate the size in bytes before creating tar file
$ tar cf - </path/to/source/dir/> | wc -c

Read
$ tar tvf </path/to/destination/archivename.tar>

Extract
To extract in current directory
$ tar xvf </path/to/archivename.tar>

To extract to specific directory
$ tar xvf </path/to/archivename.tar> -C </path/to/destination/dir>

To extract a particular directory
$ tar xvf </path/to/archivename.tar> <path/to/particular/dir/to/extract/>

To extract a multiple directories
$ tar xvf </path/to/archivename.tar> <path/to/dir1> <path/to/dir2/>

To extract a particular file
$ tar xvf </path/to/archivename.tar> <file/to/be/extracted>

To extract all files with '.pl' extension
$ tar xvf </path/to/archivename.tar> --wildcards '*.pl'

Append
$ tar rvf </path/to/archivename.tar> <path/to/newfile>

$ tar rvf </path/to/archivename.tar> <path/to/new_directory>

Note: You cannot add file or directory to a compressed archive. If you try to do so, you will get “tar: Cannot update compressed archives” error as shown below.

tar.gz Compressed Archive

Archive
$ tar cvzf </path/to/destination/archivename.tar.gz> </path/to/source/dir/>
Note: the 'z' switch filters the archive through gzip and tar.gz is same as tgz

To estimate the size in bytes before creating tar.gz file
$ tar czf - </path/to/source/dir/> | wc -c

Read
$ tar tvf </path/to/destination/archivename.tar.gz>

Extract
$ tar xvf </path/to/archivename.tar.gz> ### Extract in current directory

To extract to specific directory
$ tar xvf </path/to/archivename.tar.gz> -C </path/to/destination/dir>
xvzf

tar.bz2 Compressed Archive
bzip2 takes more time to compress and decompress than gzip. bzip2 archival size is less than gzip.

Archive
$ tar cvjf </path/to/destination/archivename.tar.bz2> </path/to/source/dir/>
Note: the 'j' switch filters the archive through bzip2 and tar.bz2 is same as tbz2

To estimate the size in bytes before creating tar.bz2 file
$ tar cjf - </path/to/source/dir/> | wc -c

Read
$ tar tvf </path/to/destination/archivename.tar.bz2>

Extract
To extract in current directory
$ tar xvf </path/to/archivename.tar.bz2>

To extract to specific directory
$ tar xvf </path/to/archivename.tar.bz2> -C </path/to/destination/dir>

Monday, October 01, 2012

VMware Workstation 8.0.4 installation on Ubuntu 12.04

After doing a fresh install of Ubuntu 12.04, I had problems installing and running VMware Workstation 8. It was because it failed to build the network module (vmnet) during kernel modules build process. After some googling around I found a fix to patch the kernel modules of Ubuntu 12.04.
This is how it was done.

1. Download the VMware Workstation 8 from VMware site into your home folder. You will notice that the application was downloaded as a text file while using chrome.

2. So you need to change the extension to .bundle.
# sudo mv VMware-Workstation-Full-8.0.4-744019.x86_64.txt VMware-Workstation-Full-8.0.4-744019.x86_64.bundle

3. Next is you have to make it executable.
# sudo chmod +x VMware-Workstation-Full-8.0.4-744019.x86_64.bundle

4. Next is you have to download the required patch to fix the kernel from here.

5. Now install the VMware Workstation 8.
# sudo ./VMware-Workstation-Full-8.0.4-744019.x86_64.bundle

6. Unzip the patch file in your home directory.
# tar xzvf vmware802fixlinux320.tar.gz

7. Check if the extracted patch file (patch-modules_3.2.0.sh) is executable, or else make it executable using the below command
# sudo chmod +x patch-modules_3.2.0.sh

8. We have to edit the script a bit to make our workstation work.

You would find the script similar to below shown screenshot

Just change the values of 'vmreqver' and 'plreqver' as shown in below screenshot.



9. Now run the script to patch the modules.
# sudo ./patch-modules_3.2.0.sh

When I ran the script it tried to build the modules and the next time I ran workstation again it built them and loaded the modules successfully without any problems.

Note: If you have upgraded your vmware workstation from 8.0.3 to 8.0.4, you just need to remove the old patch-flag file and rerun the patch with necessary editing in the 'vmreqver' and 'plreqver' values' as shown earlier.
# sudo rm /usr/lib/vmware/modules/source/.patched
# sudo ./patch-modules_3.2.0.sh

To uninstall VMware Workstation
# sudo vmware-installer --uninstall-product vmware-workstation

Enjoy !!!