SSH & Telnet

Anonymous
2010-11-22
2012-11-14

  • Anonymous
    2010-11-22

    SSH :-

    NPP_CONSOLE 0
    cmd /c "C:\Program Files\PuTTY\putty" -ssh $(CURRENT_WORD)

    Telnet :-

    NPP_CONSOLE 0
    cmd /c "C:\Program Files\PuTTY\putty" -ssh $(CURRENT_WORD)

    Click on an IP address or hostname and ssh or telnet to it using PuTTY

     
  • Sigvald Refsum
    Sigvald Refsum
    2010-11-23

    I hve used plink.exe to run remote commands on unix systems. plink comes with the fullpackage for putty.

    I use one data file to define my system variables, this file is executed when I start notepad++ with the npp_exec plugin.

    // global configurations
    set REMCON     = c:\program files\PuTTY\plink.exe -ssh -pw
    set REMUSER    = me
    set REMHOST    = unix_machine_name
    set REMPASS    = passwd
    set REMSHELL   = /bin/sh -e
    set REMSHSETUP = ./F7_login

    // Local application configuration point
    set PLUGIN_CONFIG_DIR = "$(SYS.APPDATA)"\Notepad++\plugins\config

    set UNIX_ROOT_DIR = /net/rita/disk3/ADVA/sw/nesw-F7/users/
    set WIN_ROOT_DIR  = V:\sw\nesw-F7\users\

    // Define the complete connection command
    set REMCONNECTION   = $(REMCON) $(REMPASS) $(REMUSER)@$(REMHOST) $(REMSHELL) $(REMSHSETUP)

    npe_cmdalias alias=npe_cmdalias

    set UNIX_CSCOPE_CMD = cscope
    set UNIX_CSCOPE_REBUILD = -bRquv
    set UNIX_CSCOPE_LPARAMS = -LRqld

    // cscope commands
    npe_cmdalias Rebuild     = npp_exec cs_Rebuild  
    npe_cmdalias ThisSym     = npp_exec cs_ThisSym  

    ################

    In npes_saved.txt I can list out general commands like the one which uses unix cscope to list out all references to the word which is selected in the active editor window.

    ################

    ::cs_ThisSym
    cd $(WIN_SOURCE_DIR)
    $(REMCONNECTION) && cd $(UNIX_SOURCE_DIR) && $(UNIX_CSCOPE_CMD) $(UNIX_CSCOPE_LPARAMS) -0$(CURRENT_WORD)

    ::cs_Rebuild
    cd $(WIN_SOURCE_DIR)
    echo "$(REMCONNECTION) && cd $(UNIX_SOURCE_DIR) && $(UNIX_CSCOPE_CMD) $(UNIX_ADD_DIRS) $(UNIX_CSCOPE_REBUILD)"
    $(REMCONNECTION) && cd $(UNIX_SOURCE_DIR) && $(UNIX_CSCOPE_CMD) $(UNIX_ADD_DIRS) $(UNIX_CSCOPE_REBUILD)

    ###############################
    Project specific file I can add more commands like make:

    set UNIX_MAKE_CMD   = "make PRODUCTION=YES CROSS=YES"
    set UNIX_CREATE_HW   = "sh ./create_hw_h_files.sh"

    // Make commands
    npe_cmdalias make=$(REMCONNECTION) && cd $(UNIX_BUILD_DIR) && $(UNIX_MAKE_CMD)

    I also uses the "Console Output filters" to change / to \ and get the correct relative or absolute path, so that I can click on errors to active the correct  file+line

    All in all, Notepad++ with the npp_exec plugin makes it great fun to write code in a Windows/unix environment.