Vim tips

:set wildmenu
:set nocompatible

And now try with some command like :color the bottom status line changes to your choice line, which you can choose from using the arrow keys.


Struggled a lot with :put command to basically do some text processing work. I had to repeat a a block of text, formatted in a particular way, and in each block changing and incrementing the number.
My skills with vim are so less that I spent some 2 hours trying the ways, I could do that, (meanwhile, learnt many new things) only at the end to go back to the normal routine unintelligent way, which I was able to do it in 1/2 hour. The completion of the job was more important.

LiveJournal

It was nice to know that bluesmoon had added me as a friend. Yeah, I read his blog and he is a famous geek in bangalore.
Also added two of my other friends sajith and his roommie abdul.
I am basically trying with something new and different after using usr.blogspot.com for a long time now.
Again, if I start using this journal,then this will basically have notes taken when working with Linux.

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

Gnome Easter Egg (Wanda the Fish)

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




Hit Alt-F2

type 'free the fish'

hit enter

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

GnomeTinTin

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





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.

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 :)

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