Top-rated recipes tagged "remote" Code RecipesExecute remote commands on windows like psexec (Python) 2011-11-18T11:54:42-08:00Ofer Helman <p style="color: grey"> Python recipe 577945 by <a href="/recipes/users/4179914/">Ofer Helman</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/remote/">remote</a>, <a href="/recipes/tags/windows/">windows</a>). Revision 4. </p> <p>This code attempts to implement psexec in python code, using wmi. As part of a project of mine I had to run remote commands on remote Windows machines from other Windows machine. At first I used psexec for that with subprocess.Popen. The reason in this code for creating .bat files and running them remotely is because complicated commands do not run properly with Win32_Process.Create</p> <p>In this code I used this code: <a href="" rel="nofollow"></a></p> <p>required installations:</p> <p>pywin32 - <a href="" rel="nofollow"></a></p> <p>wmi - <a href="" rel="nofollow"></a></p> Debugging a running python process by interrupting and providing an interactive prompt (Python) 2008-09-25T11:23:29-07:00Brian McErlean <p style="color: grey"> Python recipe 576515 by <a href="/recipes/users/111980/">Brian McErlean</a> (<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/interactive/">interactive</a>, <a href="/recipes/tags/remote/">remote</a>, <a href="/recipes/tags/signal/">signal</a>). Revision 2. </p> <p>This provides code to allow any python program which uses it to be interrupted at the current point, and communicated with via a normal python interactive console. This allows the locals, globals and associated program state to be investigated, as well as calling arbitrary functions and classes.</p> <p>To use, a process should import the module, and call listen() at any point during startup. To interrupt this process, the script can be run directly, giving the process Id of the process to debug as the parameter.</p> Tkinter remote debugging (Python) 2017-01-24T20:23:45-08:00Miguel Martínez López <p style="color: grey"> Python recipe 580721 by <a href="/recipes/users/4189907/">Miguel Martínez López</a> (<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/remote/">remote</a>, <a href="/recipes/tags/tkinter/">tkinter</a>). Revision 6. </p> <p>This trick requires rpyc.</p> <p>You can install rpyc typing:</p> <blockquote> <p>pip install rpyc</p> </blockquote> <p>Run the code below and in another interpreter write:</p> <pre class="prettyprint"><code>import rpyc c = rpyc.classic.connect("localhost") c.execute("from Tkinter import Label; label=Label(app, text='a label')") c.execute("label.pack()") app = c.eval("app") app.responsive_button.invoke() </code></pre> LoggingWebMonitor - a central logging server and monitor. (Python) 2010-02-02T01:56:42-08:00Gabriel Genellina <p style="color: grey"> Python recipe 577025 by <a href="/recipes/users/924636/">Gabriel Genellina</a> (<a href="/recipes/tags/client_server/">client_server</a>, <a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/distributed/">distributed</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/remote/">remote</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>, <a href="/recipes/tags/web/">web</a>). Revision 3. </p> <p>LoggingWebMonitor listens for log records sent from other processes running in the same box or network. Collects and saves them concurrently in a log file. Shows a summary web page with the latest N records received.</p> CallPipe: Call the methods of an object in a remote process (Python) 2008-09-17T17:33:36-07:00david decotigny <p style="color: grey"> Python recipe 576509 by <a href="/recipes/users/4129454/">david decotigny</a> (<a href="/recipes/tags/call/">call</a>, <a href="/recipes/tags/multiprocessing/">multiprocessing</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/processing/">processing</a>, <a href="/recipes/tags/remote/">remote</a>). Revision 6. </p> <p>I am process A and I own object Obj. Now I decide to fork(): process B is born.</p> <p>How do I do to make process B call the methods of A's object Obj (and not the methods of its own copy of Obj...) ?</p> <p>This is what this module does: you create the "CallPipe" for Obj prior to fork()ing, and then process B can call any method of A's object Obj through it.</p> RSH with timeout (Python) 2010-09-13T06:49:35-07:00Shrinidhi Rao <p style="color: grey"> Python recipe 577390 by <a href="/recipes/users/4174946/">Shrinidhi Rao</a> (<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/execution/">execution</a>, <a href="/recipes/tags/remote/">remote</a>, <a href="/recipes/tags/rsh/">rsh</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>, <a href="/recipes/tags/timeout/">timeout</a>). </p> <p>RSH sometimes hangs if it cannot resolve to a given host. So here is a quick recipe in python </p>