Linux

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:

Monday, September 01, 2008

C in Ubuntu

The standard set of libraries for C are not installed by default. When i tried to compile a C file it gave errors like stdio.h not found,etc Eventually it did not create the out file. Found out from ubuntu forums that i need to install build-essential package to install few developer libraries and packages.

sudo apt-get install build-essential

After this step compilation went through

Labels:

Saturday, August 30, 2008

Ubuntu-8.04 rocks!

I installed Ubunty 8.04 Hardy on my Inspiron 1520. The installation went through very smoothly. I was amazed to find such an easy Linux installation. That too most of the hardware worked. Could test most of my hardware with the Live CD version itself. The installation was over in around 20 minutes.

After i booted into the installed linux by mistake i installed the restricted drivers for my nvidia GeForce graphics card. That's the end of it. No Xserver worked after i rebooted. I did not hear the Ubuntu's community warning that i should not install the restricted driver. Could not get to uninstall it in recovery mode. So switched to command mode(without X) in normal bootup mode and did

sudo dpkg-reconfigure xserver-xorg -phigh


this reconfigured the Xserver files to use the default drivers for X and could boot again properly. Thanks to Ubuntu community forum! Now i need to find out how to get the proper versions of the driver.

Labels:

Sunday, November 11, 2007

Weak CMOS battery

For several weeks i had been facing issue with my BIOS settings that my PC never remembered the current date and time. The situation has become worse that windows is not even booting up with a weak CMOS battery. It just freezes in that blue logon screen. Even Safemode boot is not happening with the boot freezing at mup.sys. On the other hand Linux boots up properly.
It seems that with a Weak CMOS battery windows will not boot.

Its high time that my motherboard needs CMOS battery replaced.

Labels: