Thursday 7 July 2011

QuickBits-4: sshfs

If you have ssh access to another PC and you want to access the folder of that PC the best way is to ssh mount that.
 sshfs username@hostname:/folder /mountfolder 


With this command the the /folder on the ssh host is mounted locally to /mountfolder. And you can access it as local folder.

To unmount the mounted folder

 fusermount -u /mountfolder 

Friday 1 July 2011

QuickBits-3: Vim diff

Most often when you are working in shell you want to find diff between two files and merge them. vimdiff is very good utility.

 vim -d file1 file2 




Keyboard Shortcuts:



ctrl+w ctrl+w - switch windows
do - diff obtain
dp - diff put
[c - previous difference
]c - next difference
:diffupdate - diff update ;)
:syntax off - syntax off
zo - open folded text
zc - close folded text