OLD | NEW |
(Empty) | |
| 1 This directory contains scripts that give examples of using Pexpect. |
| 2 |
| 3 hive.py |
| 4 This script creates SSH connections to a list of hosts that |
| 5 you provide. Then you are given a command line prompt. Each |
| 6 shell command that you enter is sent to all the hosts. The |
| 7 response from each host is collected and printed. For example, |
| 8 you could connect to a dozen different machines and reboot |
| 9 them all at once. |
| 10 |
| 11 script.py |
| 12 This implements a command similar to the classic BSD "script" command. |
| 13 This will start a subshell and log all input and output to a file. |
| 14 This demonstrates the interact() method of Pexpect. |
| 15 |
| 16 fix_cvs_files.py |
| 17 This is for cleaning up binary files improperly added to |
| 18 CVS. This script scans the given path to find binary files; |
| 19 checks with CVS to see if the sticky options are set to -kb; |
| 20 finally if sticky options are not -kb then uses 'cvs admin' |
| 21 to set the -kb option. |
| 22 |
| 23 ftp.py |
| 24 This demonstrates an FTP "bookmark". |
| 25 This connects to an ftp site; does a few ftp commands; and then gives the us
er |
| 26 interactive control over the session. In this case the "bookmark" is to a |
| 27 directory on the OpenBSD ftp server. It puts you in the i386 packages |
| 28 directory. You can easily modify this for other sites. |
| 29 This demonstrates the interact() method of Pexpect. |
| 30 |
| 31 monitor.py |
| 32 This runs a sequence of system status commands on a remote host using SSH. |
| 33 It runs a simple system checks such as uptime and free to monitor |
| 34 the state of the remote host. |
| 35 |
| 36 passmass.py |
| 37 This will login to a list of hosts and change the password of the |
| 38 given user. This demonstrates scripting logins; although, you could |
| 39 more easily do this using the pxssh subclass of Pexpect. |
| 40 See also the "hive.py" example script for a more general example |
| 41 of scripting a collection of servers. |
| 42 |
| 43 python.py |
| 44 This starts the python interpreter and prints the greeting message backwards
. |
| 45 It then gives the user interactive control of Python. It's pretty useless! |
| 46 |
| 47 rippy.py |
| 48 This is a wizard for mencoder. It greatly simplifies the process of |
| 49 ripping a DVD to mpeg4 format (XviD, DivX). It can transcode from any |
| 50 video file to another. It has options for resampling the audio stream; |
| 51 removing interlace artifacts, fitting to a target file size, etc. |
| 52 There are lots of options, but the process is simple and easy to use. |
| 53 |
| 54 sshls.py |
| 55 This lists a directory on a remote machine. |
| 56 |
| 57 ssh_tunnel.py |
| 58 This starts an SSH tunnel to a remote machine. It monitors the connection |
| 59 and restarts the tunnel if it goes down. |
| 60 |
| 61 uptime.py |
| 62 This will run the uptime command and parse the output into python variables. |
| 63 This demonstrates using a single regular expression to match the output |
| 64 of a command and capturing different variable in match groups. |
| 65 The regular expression takes into account a wide variety of different |
| 66 formats for uptime output. |
| 67 |
| 68 df.py |
| 69 This collects filesystem capacity info using the 'df' command. |
| 70 Tuples of filesystem name and percentage are stored in a list. |
| 71 A simple report is printed. Filesystems over 95% capacity are highlighted. |
| 72 |
| 73 PEXPECT LICENSE |
| 74 |
| 75 This license is approved by the OSI and FSF as GPL-compatible. |
| 76 http://opensource.org/licenses/isc-license.txt |
| 77 |
| 78 Copyright (c) 2012, Noah Spurrier <noah@noah.org> |
| 79 PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY |
| 80 PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE |
| 81 COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES. |
| 82 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 83 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 84 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 85 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 86 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 87 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 88 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 89 |
OLD | NEW |