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
ssh.connect('127.0.0.1', username='jesse', | |
password='lol') | |
stdin, stdout, stderr = ssh.exec_command( | |
"sudo dmesg") | |
stdin.write('lol\n') | |
stdin.flush() | |
data = stdout.read.splitlines() | |
for line in data: | |
if line.split(':')[0] == 'AirPort': | |
print line |
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
#send html email | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email.utils import formataddr | |
msg = MIMEMultipart('alternative') | |
msg['From'] = formataddr((str(Header('MyWebsite', 'utf-8')), '[email protected]')) | |
msg['To'] = '[email protected]' |