About Me

My Photo

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/E/B d-- s:++>: a-- C++(++++) UL++ P! L++ E--- W+++ N+++ w PS+ PE- !tv
b+++ G++ e++ h
------END GEEK CODE BLOCK------

Wednesday, October 26, 2005

Moving to LiveJournal

I am moving my daily(?) taking of notes to LiveJournal.

You can check it here:

http://www.livejournal.com/users/phoe6/

XML Feed: http://www.livejournal.com/users/phoe6/data/rss

I have notes,tips on Vim,Linux,Fedora etc here. So you can search for them using the Google Search below.

See you at LJ.

Monday, October 24, 2005

Fwd: appending and incrementing the numbers from a particular point

From: Tim Chase
Subject: Re: appending and incrementing the numbers from a particular point
To: Senthil Kumaran

> My requirement is to add more rows with incrementing numbers upto say 2300.
> like:
> 2191 Default SomeText
> 2192 Default SomeText.
> 2193
> 2194
> 2195
> .
> .
> .
> .
> .
> 2300
> ~
> ~
> How should I go about doing this in vim.

Well, there are several ways to go about it (as usual...this *is* vim ;)

The first that comes to mind is something like the following:

:let i=2193 | while (i <= 3000) | put =i | let i=i+1 | endwhile

When executed on the "2192" line, will add a whole bunch of other lines
afterwards. If you want your default text stuff in there too, you can
simply change the "put =i" to

put =i." Default Some Text"

which will pre-populate it with values if you want. If you like to be
left at the top of that inserted stuff, you can try the inverse. On a
blank/emtpy line below "2192", you can do

:let i=3000 | while (i > 2192) | put! =i | let i=i-1 | endwhile

This would be a direct answer to your question of "how to add more rows,
incrementing a number each time".

If, however, you'd like to have it auto-number, something like this
mapping might do the trick for you (all one line):

:inoremap <cr> <cr><c-o>:let i=substitute(getline(line('.')-1),
'^\(\d*\).*', '\1', '')<cr><c-r>=i>0?(i+1).' ':''<cr>

It can be done without a holding "i" variable, but it becomes about
twice as large, as both instances of "i" would be replaced with the
entire contents of the "substitute()" call.

It should gracefully handle lines with numbers and lines without numbers.

Help on the following topics should give you more details on what's
going on there.

:help getline()
:he line()
:he i_^R
:he while
:he let
:he :put
:he substitute()
:he /\d

Hope this helps,

-tim

Friday, October 21, 2005

Gnome Easter Egg (Wanda the Fish)

mricon: : "Gnome Easter Egg (Wanda the Fish)


Hit Alt-F2
type 'free the fish'
hit enter

Thursday, October 20, 2005

VisVim

its fun! like when you are using VC++ and you are so used to and like vim, then you want your vim as an editor whereever any editing function is needed.
yeah. Go to your Windows installation of vim. (You dont use it? Hey, get it now at www.vim.org and start using it. In a year or so, you might start appreciating it). yeah coming back, go to your windows installation of vim, which had OLE enabled and read the file called README_VisVim.txt. It gives the directions as how to integrate vim as an editor to your visual studio.
Found it One way. Debug mode is not possible. Big miss. Visual Commands are not recognized. But found a link in web to come around this. ( have not tried it) And the vim editor stands out of the IDE, it does not embed itself into the visual studio framework.
After you enable it as your editor, basically you can disable it with a hot-key and return to the normal editor, toggle its usage, after the debugging is over, you can load it again to vim using some hot keys. that readme explains them well.

So, I just started with both. Vim has lot to go :) getting to start liking it,what might take to go more into it! :D

Saturday, October 15, 2005

GnomeTinTin

You like Gnome and you have always loved reading TinTin. Get a feel of both with this wallpaper.





Saturday, October 08, 2005

tried new default apps with linux

Happened to try a lot of new Linux apps today. Basically it started with ripping the Swades CD Songs using the Sound Juicer to Ogg format.
Now Ogg happens to be something which most of the linux multimedia application should understand, so Helix Player played it. Helix does not have a playlist kind of facilty. So, tried if any other application can player this, my often wondered question of why the hell totem-player is present in the distro was answer as it played Ogg without requiring any external plugin :D Btw, thats sound,I have not seen a video yet on Totem.

We often use the mount command to mount a particular windows share on Linux:

mount -t smbfs -o username=<username>,password=<password> //<server-ip>/share /media/<mount-point>

And have always struggled with Connect to Server option presented by the Gnome Nautilus.
Tried it again today. But gave only the following:
- Service Type: Windows Share
- Server: IP
- Username
And Connect. And it established the connection. Had so long tried in vain with providing share name,folder, name to use blah blah blah..
mount command always seemed to require a second level directory, so I was always trying giving the share name in the Connect to server dialog box.

Now after the smb connection, that network share comes as an Icon in the Computer as well in Desktop. Thats become easy.

What else: Yeah, rhn applet was constantly blinking. Which I have no requirement for as I am over Fedora Core4. (Why is Fedora Distro carrying rhn applet??) So, I did.

rpm -e up2date-4.4.23-4 up2date-gnome-4.4.23-4 rhn-org-trusted-ssl-cert-1.0-1 rhnlib-1.8-6.p24.1 rhn-applet-2.1.17-3 firstboot-1.3.42-1.noarch

Now its clean.

Yeah, used Dia too effectively.

Friday, October 07, 2005

Endianess

Endianess refers to the ordering of bytes in a multi-byte number. Big endian refers to the architecture where the most significant byte has the lowest address, while the opposite Little endian, the most significant byte has the highest address.
You can find the endianess of your architecture using the following programming snippets:


int x = 1;
if(*(char *)&x == 1)
printf("little-endian\n");
else printf("big-endian\n");



#define LITTLE_ENDIAN 0
#define BIG_ENDIAN 1

int machineEndianness()
{
short s = 0x0102;
char *p = (char *) &s;
if (p[0] == 0x02) // Lowest address contains the least significant byte
return LITTLE_ENDIAN;
else
return BIG_ENDIAN;
}

Endianess Wiki page for #c on FreeNode.

Tip for MediaWiki Users: mediawiki recognizes hot-keys ( thats php, not ajax) and play with alt+x on your favorite wiki site.

Doom3 the linux

There is Doom3 for Linux from id software. Tried on my Fedora Core 4 having 1 GB Ram. The Game was still very slow. The reasons I read at some performance comparisions that Doom3 was written using VC .Net and GCC optimization was not perfect. So there will always be 10% different.
Adding to this was the inbuilt video card of my machine.

VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01).

At #linux IRC channel while discussing this issue, came to know that this inbuilt video card does not support OpenGL graphics well and might have performance lags. The suggested ones are nVidia and ATI.

After downloading the game id software's ftp server.
- The Installation was breeze,using ncurses. Cool way for Linux for a big application.
- Had to change some settings in my X.org conf file. Increased the Depth to 24.
- To improve the performance on Linux with inbuilt video card,Added something called VideoRam 128000 under Device section and turned off all the advanced options from the game.

Now, its playable, but I need to figure out how to play it :)

Monday, October 03, 2005

brace expansion in BASH

mkdir {A..C}{a..c}{1..3} did a nested brace expansion and created the 27 directories. that was cool.
rm -rf {A..C}{a..c}{1..3}

Tip source: aplawrance

Tuesday, September 27, 2005

shell pi

pi=$(echo "scale=10; 4*a(1)" | bc -l)

ok; bc -l gives floating point value.
a(1) returns arc tangent of 1.
scale is the scable you assign to the bc.

how 4 * a(1) is pi?

Friday, September 23, 2005

cowsay

Cowsays


______________________________________
/ Don't worry about anything... Go out \ and have a good time. /
--------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/ ||----w |
|| ||

Tuesday, September 20, 2005

nice quote

Dealing with failure is easy:
Work hard to improve.
Success is also easy to handle:
You've solved the wrong problem.
Work hard to improve.

Patch How To

The command you need is:

# diff -ruP libsmbios-0.10.0_beta5 libsmbios-0.10.0_beta5_SENTHIL

Where the libsmbios-0.10.0_beta5_SENTHIL/ directory has your
modifications
. Make sure that you run a "make distclean" in both
directories and look at the patch to ensure no stray files got in.

After this, go ahead and send it as an attachment. Doing the patch
inline is excellent for reviewing, but because of the line-wraps your
email client puts in, it is not possible to apply it this way.
--
Michael

Monday, September 19, 2005

getup to oo

"'Well, grok bugzilla / your personal collection of tricky MS files, find some scab and pick at it' he says. He continues, 'the first thing to do is to download the latest ooo-build, and build it yourself, then go over the My First Hack page. Be sure to pop onto IRC and ask for help."

Monday, September 05, 2005

using rdesktop

rdesktop seems a nifty tool.

To use it,invoke with the options:

rdesktop -u <user_name> -d <domain_name> -g <resolution> <windows_machine_hostname/ip>

I used resolution as 800x600. the -g option is a must I guess;I googled for usage of it, cause I could not figure out using it by running the tool, using --help,man etc..

rdesktop on your linux and Cygwin/X on your windows might make a nice handshake!

Wednesday, August 31, 2005

Steve Waugh


"I see myself as an average guy who tries to help out my mates and loves my sport. I think in some ways, I'm sort of an underdog and a bit of a battler. I've always had to fight hard for my spot and to achieve what I have, and I've had to give 100%. I think Australians like to see that in people and they like to recognise it." - Steve Waugh

Quote for the day

"I find that the great thing in this world is not so much where we stand as in what direction we are moving: To reach the port of heaven, we must sail sometimes with the wind and sometimes against it— but we must sail, and not drift, nor lie at anchor."

Oliver Wendell Holmes, Sr.