Search This Blog

April 20, 2011

How to disable gnome-ssh-askpass?


Today we had setup Git repo with access to it through corporate's LDAP authentication. From the client machines we can access it using the .netrc (where the machine, login and password are configured).
However, for some wierd reason, upon trying to pull/push commits from/to the Git repository, the bash shell tries to open the gnome-ssh-askpass dialogue and it fails. I wanted to prevent the bash shell from attempting to launch the dialogue box. To do this, all I had to do is run the following command in the terminal:
$ unset SSH_ASKPASS

To prevent it in future, you can add the above line in your .bashrc or .bash_profile.

Wish you trouble-free working!

No DHCPOFFERS received. No working leases in persistent database - sleeping.


I was getting this weird error "No DHCPOFFERS received. No working leases in persistent database - sleeping.", when trying to connect to internet via WIFI in Ubuntu.
After enough googling to no avail, and by sheer serendipity I solved this. This worked for me; may be it helps you too.

Argh, I missed the point. So here is what you can try if you are stil having this issue.
Step 1: Go to, System -> Preferences -> Network Connections
Step 2: Select Wireless tab
Step 3: Click "Edit" the wifi connection profile you have created
Step 4: There are two connection modes - Ad hoc and Infrastructure. Choose the "Infrastructure" mode
Step 5: Save and try connecting again. You are done...!

April 3, 2011

GVim, Vim, Vi key-board short-cuts


  • Switch between tabs

    Ctrl+PageUp, Ctrl+PageDown
    Ctrl + Shift + UpArrowCtrl + Shift + DownArrow

  • Move to Nth tab in gvim
    gt, gT
    Note: The advantage with using gt, gT keys are that you can move to [N]th tab. For eg., if you want to go to 3rd tab type 3gt


  • Open a file in new tab from NERDTree while still remaining in NERDTree

    T will open the selected file in new tab, without changing focus from NERDTree
    t will open the selected file in new tab, and changes focus to that tab


  • Recursively Open all child nodes     

    Activate the NERDTree and navigate to the directory whose all child nodes must open.
    Now press O (capital) to expanded list of child nodes
  

  • Recursively Close all child nodes

    Activate the NERDTree and navigate to the directory whose all child nodes must close.
    Now press X (capital) to collapsed list of child nodes


  • Close all tabs at once with a single command, when I have multiple tabs open

    If no files are modified, then
    :qa
    To save work in all tabs and exit, then
    :wqa
    :xa
    To close all other tabs, except the active one:
    :tabo
    To close all tabs and open buffers
    :qall
    :tabdo :q   (The :tabdo will execute the command passed to it - in this case :q - for all the open tabs)

  • Text object selection

    Select text between Single Quotes
    When cursor is within the single quotes ('), type vi'

    Select text between Paranthesis block ()
    When cursor is within the Paranthesis block (), type vib

    Select text between Curly braces block ()
    When cursor is within the Curly braces block (), type viB

    Note: To make the selections "inclusive" of quotes, parenthesis or braces you can use a instead of i

    More on this can be read at Text object selection
  
  • Create a file or directory in NERDTree
     Activate the NERDTree and navigate to the directory in which the file/directory should be created.    Then press m to bring-up the NERDTree File-system Menu and choose a for "add child node". Now enter the file/directory name and you are done. Note that directory name should end with forward slash - /.

  • Rename a file or directory in NERDTree
    Activate the NERDTree and navigate to the directory in which the file/directory should be renamed. Then press m to bring-up the NERDTree File-system Menu and choose m for "move the current node". Moving is same as Renaming! Now enter the file/directory name and you are done. Note that directory name should end with forward slash - /.

  • Start VIM with NERDTree opened automatically
    Add the line below to your .vimrc:
    NERDTree

  • Auto-open NERDTree in every tab
    Add the two below lines to your ~/.vimrc:
    autocmd VimEnter * NERDTree
    autocmd BufEnter * NERDTree