Re: [Tutor] Sending a disconnect after openssl s_client command?

2009-04-20 Thread Kayvan Sarikhani
On Mon, Apr 20, 2009 at 1:17 PM, Martin Walsh wrote: > from subprocess import Popen, PIPE > > openssl_cmd = 'openssl s_client -ssl2 -connect somewebsitename:443' > openssl = Popen( > openssl_cmd, shell=True, stdout=PIPE, stderr=PIPE, stdin=PIPE > ) > stdout, stderr = openssl.communicate('GET /')

[Tutor] Sending a disconnect after openssl s_client command?

2009-04-17 Thread Kayvan Sarikhani
Tutors, I'm working on a script to verify whether a particular website supports SSLv2 via the following: --- BEGIN --- #!/usr/bin/python import os, re checkssl_out = open('checkssl.txt','w') website = 'somewebsitename' sslv2 = 'Protocol : SSLv2' print 'Checking:', website checksslv2 = os.p

Re: [Tutor] Simple PassGen

2009-02-09 Thread Kayvan Sarikhani
On Mon, Feb 9, 2009 at 4:53 PM, W W wrote: > It's actually not the range but the print function. Print automatically > prints a newline. If you were to create a string of what print does: > > print 'foo' > > 'foo\n' > > However, adding a trailing comma will eliminate that. It will still add a > t

Re: [Tutor] Simple PassGen

2009-02-09 Thread Kayvan Sarikhani
--- www.fsrtechnologies.com > > On Feb 9, 2009 1:35 PM, "Kayvan Sarikhani" wrote: > > Hello Tutors, > > I've been messing around with a simple password generation script...no > real crypto or anything, but a little stumped on the output. > >

[Tutor] Simple PassGen

2009-02-09 Thread Kayvan Sarikhani
Hello Tutors, I've been messing around with a simple password generation script...no real crypto or anything, but a little stumped on the output. #!/usr/bin/python import random, string pool = string.digits + string.letters + string.punctuation for i in range(8): print random.choice(pool)

Re: [Tutor] Opsware Global Shell Scripting

2009-01-15 Thread Kayvan Sarikhani
Hello...thanks to several individuals, I've been able to get a little farther in this Opsware global shell script: #!/usr/bin/python import os outfile = open('test.txt','w') for servername in os.listdir('/opsw/Server/@'): print '---', servername print >> outfile, '---', servername rosh

Re: [Tutor] Opsware Global Shell Scripting

2009-01-07 Thread Kayvan Sarikhani
On Wed, Jan 7, 2009 at 5:09 PM, Sander Sweers wrote: > On Wed, Jan 7, 2009 at 22:04, Kayvan Sarikhani > wrote: > > > > This is of course not a Python error, but as you might guess from looking > at > > the script, the whole $SERVER_NAME piece is probably wrong. > &g

Re: [Tutor] Opsware Global Shell Scripting

2009-01-07 Thread Kayvan Sarikhani
On Wed, Jan 7, 2009 at 4:57 PM, spir wrote: > Le Wed, 7 Jan 2009 16:04:28 -0500, > "Kayvan Sarikhani" a écrit : > > > #!/bin/bash > > # > > # This script checks the dates on all managed systems. > > OUTFILE="/home/ksarikhani/public/bin/timech

[Tutor] Opsware Global Shell Scripting

2009-01-07 Thread Kayvan Sarikhani
Hi there...I'm new to Python scripting, with maybe 3 days under my belt thus far. Besides the occasional shell script, the last time I ever touched a programming language was probably at least 12 years ago, if that gives you any indication of my experience. :) I don't know if this is the proper pl