

SmtpObj.login(email_address, email_password) Message = (rawMessage]'])ĭef sendEmail(email_address, email_password, address, ipMessage):


ImapObj.login(email_address, email_password) ImapObj = imapclient.IMAPClient('', ssl = True) IpObj = re.compile(r'\d+\.\d+\.\d+\.\d+')ĭef checkEmail(email_address, email_password): Import re, smtplib, imapclient, pyzmail, time, getpass # established email address receives an email with the subject line # and then proceeds to send an email with the IP address when an # Script to grab public IP address from "HTTP:///" If you guys have any ways of making this better let me know! #! /usr/bin/python3 But I'm barely thinking of this now while I'm typing. It might be a good idea to delete the messages sent and received after a set period of time and also keep a log of what's going on. I don't know if doing this is a good idea or if it's even secure but for extra security I might make it so that it only replies to emails received from a specific email address. I thought I could use this to ssh into my pi without having to setup a domain name. When you send it an email with the subject line "Where are you?" it sends you an email within five minutes with the public IP of the network where your pi is. os.system('macshift.exe -i "Local Connection 3"') is used provide macshift command to the operationg system whit related interface information which is Local Connection 3 in this example.So the idea is that you make an email address for your raspberry pi then you run this script in a tmux or screen session.time.sleep(5) function is used to sleep current loop for 5 seconds in every step.We create a while loop which is infinite python while loop in order to never end the process except CTR+C.We import time and os libraries in order to use related functions and API’s.Os.system('macshift.exe -i "Local Area Connection 3"')

Here the simply code provided by Timer.py import time The periodic operations are managed by Timer.py python file. It is provided by git repository so we do not need to download explicitly. macshift.exe as its name suggest changes the mac address of given interface. In order to do low level mac change operations we will use macshift.exe . OR we can download from following link as compressed archive. The code can be downloaded with the following git command. Download Periodic-Mac-Changer From Github But can be changed by operating system with sufficient privileges. Mac addressee is provided by the network card to the operations system network stack. A general thought that mac addresses can be changed. Mac address is the unique address that specifies the network interface. In this tutorial we will look a simple but useful code that changes windows operating system Mac address.
