Monday, April 2, 2007

Using abbrevation in VIM

Here is a vim tip:

use abbreviate to something you type very frequently

:abb perl #!/usr/local/bin/perl

Now in insert mode as soon as you press space after typing perl, the #!/usr/local/bin/perl will be typed automatically for you.

if you don't want it to type, type something like "perls ", and then go back and remove the "s"!

Put this in your .exrc file for convenience

Sunday, April 1, 2007

Using Samba

Yes, it is possible!

Want to access a Windows machine from Linux?
Here is what you do to that (samba)

First of all, I assume that the two machines are somehow connected to each other. I have both of them connected to my home router.

Install samba, start samba, share the folder on windows - use your favorite browser to browse your files

Okay, here is little more details

On the Windows machine
  • Open a Windows Explorer
  • Right click on the folder you want to share
  • Click on "Sharing and Security"
  • A Properties window pops up, clock on the "Sharing" Tab
  • Check the checkbox "Share this folder on the network" (and "Allow network users to change my files", if you wish) in the "Network sharing and security" section
  • Apply and close the window
  • Make a note of the IP address of the interface that is connected to the network (say

On the Linux machine
  • Samba was already loaded on my Linux machine (I think you can use any of rug/yum/apt-get/YaST to install samba)
  • Start the samba service (may have to login as root or use sudo)
#> /etc/init.d/smb start
  • Now open any of the web browsers (firefox/konqueror) and type smb:// in the address bar

You should now be able to see all the files in the folder you are sharing on you web browser.