Categories
Open Source Ubuntu

Fixing – “Internal error: Segmentation fault”

Recently while compiling some programs I received an unique error message:

c++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.

Even compiling a simple Hello World program gave the same error.

To fix the problem I needed to use a program called debsums on Ubuntu. debsums is a program used to check the MD5 checksums of your installed deb packages. You can install it using the command:

sudo apt-get install debsums

and run it using the command:

debsums | grep -v OK

The above command lists all the packages which have not been installed correctly. If the following line is present in the output:

/usr/lib/gcc/i486-linux-gnu/4.4/cc1plus FAILED

then all you need to do to fix your system is the following command:

sudo apt-get –reinstall install g++-4.4

Now when you compile your code the earlier error shouldn’t appear.

Categories
Open Source Solutions Ubuntu

Recovering Deleted Data on Linux…

Imagine this situation -  “you are browsing through your photos on your camera or on your your thumb drive.  You decide to clean up the unwanted photos/data and start deleting files.  All of a sudden you realize you deleted your best photo or that important file. How do you get the data back?”

Firstly dont create any new files or copy any new data on the disk.  This will make sure that the data is recoverable (once the sectors where your file used to reside get overwritten its impossible to recover).

Now there are two simple solutions I found for recovery problems.  Both work best in different situations:

GDDRescue

ddrescue is a simple program that copy bit by bit information form one area of the hard disk to another.  It has loads of amazing features but the one that I like the most is that it ignores unreadable sectors and moves on.  This feature is very useful when recovering movies.  It also makes it easy to recover media files if you have the torrent from which you originally downloaded the file.

sudo apt-get install gddrescue

ddrescue -r 3 /media/cdrom/movie.avi /home/user/movie.avi

In the above command
-r 3 :- makes the program to retry to recover data from a bad sector 3 times and then move on.
/media/cdrom/movie.avi :- The input file
/home/user/movie.avi :- The recovered file

Foremost:

Foremost is a simple application that recovers data from a damaged disk. It goes one step better by sorting out the information for the common file types. The output of Foremost is a directory which has a series of subdirectories where files like jpg, avi, mpg, bmp ect are recovered and stored. This is a perfect application to recover specific data from a disk

To install Foremost use the following command:

sudo apt-get install foremost

To run foremost use the following command:

sudo foremost -i /dev/sdb1 -o /recovery/disk

In the above command
-i indicates the partition/file to be recovered from.
-o indicates the output directory where the recovered files will be stored.

Once the recovery is done you will need to change the ownership of the output directory so that you can read the files. Use the following command to do that:

sudo chown -R username /recovery/disk

Ps: There are more complex methods and applications to do data recovery on Linux. These two are the simplest I have used. Feel free to share your suggestions in the comments.

Categories
Media Open Source Solutions

Mplayer without Text

I upgraded my desktop to Kubuntu Karmic 9.10 yesterday and realized an unique problem. There was no text displayed in the OSD(On Screen Display).

Mplayer without Text

If you open the file in command prompt mode you will see the following message:

subtitle font: load_sub_face failed.

The reason for was basically that Mplayer could not find the required font file to display the text. To solve the problem you need to open the .mplayer directory in your home directory. And do one of the two following things:

  1. Copy any font file of your choice to that directory and rename it subfont.ttf (You will find fonts at /usr/share/fonts)
  2. Open the config file in the .mplayer directory and add the following lines:
    font=/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf
    subfont-text-scale=2.5

Ps: You can replace the link to your favourite font after the font= command.  Also using Method 2 will let you even set the size of the font

Reblog this post [with Zemanta]
Categories
Device Open Source Solutions

Downloading Garmin GPS Data in Ubuntu

One of the simplest ways to download Track, Waypoint and Route information from your Garmin GPS in Ubuntu is using gpsbabel.

{adinserter 3}

Install gpsbabel via apt-get

sudo apt-get install gpsbabel

Connect the gps via the cable provided to the serial port of the computer or via a serial to USB converter to the USB port on your desktop/notebook.  To extract the infrormation all you need to do is, execute the following command:

gpsbabel -r -t -w -i garmin -f /dev/ttyUSB0 -o gpx -F data.gpx

The above command copies Routes(-r), Tracks(-t) and Waypoints(-w) from a garmin device (-i garmin) located at Serial-USB interface (-f /dev/ttyUSB0) and saves the info (-o) in the standard gps format (gpx) in the file data.gpx. You can omit the information you dont require and even choose other fromats like kml for google earth:

gpsbabel -r -t -w -i garmin -f /dev/ttyUSB0 -o kml -F data.kml

You should now have a file “data.gpx” which can be used to retrive or map your gps data.

Reblog this post [with Zemanta]
Categories
Media Open Source Solutions

XBMC – No Cast Info from IMDB

XBMC
Image via Wikipedia

If you have been using the latest release of XBMC you might have noticed that XBMC does not seem to pick up the cast information of a movie from IMDB.  The problem here is that Imdb recently made minor changes to its api  and the infomation we are looking for is not available in the same location.

{adinserter 2}

The Fix

You just need to open the imdb.xml file in “/usr/share/xbmc/system/scrapers/video/” directory in linux systems(you will need to open the file as the superuser: sudo nano/usr/share/xbmc/system/scrapers/video/imdb.xml ) and “system/scrapers/video/” directory under your Xbmc installation directory in Windows.