存档

2011年10月 的存档

pexpect Timeout exceeded in read_nonblocking()

2011年10月24日 评论已被关闭

gg resolve from bbs:
vi /usr/lib/python2.6/site-packages/pxssh.py
#add line 134,135:
    123     def synch_original_prompt (self):
    124
    125         “””This attempts to find the prompt. Basically, press enter and record
    126         the response; press enter again and record the response; if the two
    127         responses are similar then assume we are at the original prompt. “””
    128
    129         # All of these timing pace values are magic.
    130         # I came up with these based on what seemed reliable for
    131         # connecting to a heavily loaded machine I have.
    132         # If latency is worse than these values then this will fail.
    133
    134         self.sendline()
    135         time.sleep(0.5)

    136         self.read_nonblocking(size=10000,timeout=1) # GAS: Clear out the cache before getting the prompt
    137         time.sleep(0.1)

we just put something there before ssh expect read.

分类: python 标签:

Linux Keyboard shortcut keys

2011年10月21日 评论已被关闭

CTRL + C    Cancels the currently running command.
CTRL + D    Logs out of the current session.
CTRL + Z    Cancels current operation, moves back a directory or takes the current operation and moves it to the background.
CTRL + A    Moves the cursor to first character.
CTRL + E    Moves the cursor to last character.
CTRL + R    Search history command
CTRL + W    Deletes the last word typed in. For example, if you typed ‘mv file1 file2’ this shortcut would delete file2.
CTRL + U    Erases the complete line.
CTRL + P    Paste previous line(s). same as up
CTRL + B    Moves the cursor backward one character.
CTRL + F    Moves the cursor forward one character.
CTRL + H    Erase one character. Similar to pressing backspace.
CTRL + S    Stops all output on screen (XOFF).
CTRL + Q    Turns all output stopped on screen back on (XON).

分类: linux 标签: