Linux

Monday, September 07, 2009

Disable beep sound in Linux

Felt that beep sound (bell) annoying whenever i operate on gvim or shell and if i do something extra. To disable that add this line into .cshrc file
setenv bell-style none
quit the terminal and open again. Say bye to beep sounds! "set vb" command in gvim will also suppress the audible bell in the gvim and rather do visual bell!

Labels:

Monday, August 31, 2009

Mail from linux prompt

Simple way to send an attachment over mail from the linux shell

uuencode surfing.jpeg surfing.jpeg | mail sylvia@home.com

mutt -s "Birthday celebration" -a citymap.jpg all@friends.org \< invitation.txt

To send without message
mutt -s "Birthday celebration" -a citymap.jpg all@friends.org \< /dev/null

Reference:
http://www.shelldorado.com/articles/mailattachments.html

Tuesday, August 04, 2009

History recovery from backup in Firefox3

Firefox stores the webpage browsing history in the following folder
%APPDATA%\Mozilla\Firefox\Profiles\

In my windows xp machine it was
C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\ycexgsuz.default

It will be in a file called places.sqlite. For restore I renamed the existing .sqlite with the old one and all the history is available in the new firefox

Labels:

Restoring bookmarks in firefox

I had to reinstall the OS on a different drive and had to reinstall firefox as well. Figured out a way to restore the bookmarks from the backup. This worked with firefox 3.5.2

  1. Browse and navigate to the location in hard disk where windows is installed
  2. Go to the location Then go to the following location C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles\
  3. Inside the profiles folder there will be .default folder
  4. Inside this directory there will be a bookmarksbackup folder
  5. There will be a bunch of .JSON files stored as backups with the dates and times
  6. You can replace your current bookmarks with a backup copy by opening the Firefox 3 ("Bookmarks -> Organize Bookmarks -> Import and Backup -> Restore..." ). You can select one of the five dated backups that Firefox automatically creates or you can use the "Choose File..." option to select another bookmark backup file.
  7. Choose the JSON file then restart firefox this will restore your bookmarks
References:
[1] http://www.clazh.com/how-to-restore-and-recover-your-firefox-bookmarks/
[2] http://kb.mozillazine.org/Lost_bookmarks

Labels:

Sunday, May 10, 2009

Gvim tip #1

To delete a line containing a pattern
:g/profile/d

To see the lines that this command will delete

:g/profile
Reference:
[1] http://vim.wikia.com/wiki/Delete_all_lines_containing_a_pattern

Labels:

Wednesday, April 22, 2009

Excel macro from Perl

A Macro defined in Excel can be called from Perl. Here is the following code derived on googling that did the magic

use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3;

my $Excel = Win32::OLE->GetActiveObject('Excel.Application')||Win32::OLE->new('Excel.Application', 'Quit'); # use the Excel application i
#f it's open, otherwise open new

my $Book = $Excel->Workbooks->Open( "c:\\Test.xls" ); # open the file

my $Sheet = $Book->Worksheets(2);
printf ("the value is %s \n",$Sheet->Cells(1,3)->{'Value'});

$Excel->Run("SetIO");
$Excel->Run("CommandButton1_Click");
#$Excel->Run("Temp");
$Book->Save; #optional - save any changes made by the macro
$Book->Close;

Labels:

Saturday, November 22, 2008

gvim in ubuntu

somehow in my ubuntu machine gvim was not working had to install vim-perl or vim-gtk to get gvim to work.

sudo apt-get install vim-perl

installed the necessary packages and after that gvim started working.

Saturday, September 06, 2008

Playing a DVD in ubuntu

In order to play DVDs, you must install some additional software. Unfortunately, DVD support is not provided by default in Ubuntu due to legal and technical restrictions.

To play DVD install the following packages libdvdnav4 and libdvdread3

for playing encrypted DVDs in a terminal type
sudo /usr/share/doc/libdvdread3/install-css.sh

After this if you insert a DVD it should play using totem player. But somehow i did not get the menus properly in that player so installed gxine that gave the proper DVD menus.

Somehow i am getting an error printed in console

*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***
*** for dsi->dsi_gi.zero1 == 0 ***

but right now i am happy that i am able to play DVDs properly in Ubuntu. I am ignoring this error as of now

Labels: