Last active
November 20, 2019 19:57
-
-
Save wware/dd1f93fdc2af3320096f4d50c884fc01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Provide access to a Bash shell on the remote machine during a RemotePdb session. | |
""" | |
import os | |
import remote_pdb | |
def rpdb(port=4444): | |
class RemotePdb(remote_pdb.RemotePdb): | |
def do_shell(self, arg): | |
print >> self.stdout, os.popen(arg + " 2>&1").read().strip() | |
do_H = do_shell | |
return RemotePdb("0.0.0.0", port) | |
rpdb().set_trace() | |
def fac(n): | |
p = 1 | |
for i in range(2, n+1): | |
p *= i | |
return p | |
print fac(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment