Beispiel #1
0
    def display_current_ip(self):
        """
        Displays the current internal IP address of the pi
        """
        curr_ip = get_ip()

        info_string = "The current internal IP address is \"{}\""

        self.display_info(info_string.format(curr_ip), "Current IP")
Beispiel #2
0
from OSC import OSCServer,OSCClient, OSCMessage
import sys
from time import sleep
import types

# get to know my own ip adress:
from tools import get_ip
													 
#set up the OSC server to listen for the UI device 
server = OSCServer( (get_ip("wlan0"), 10000) )
#server = OSCServer( ("192.168.1.250", 10000) )

# list of clients to relay the messages to:
clients = [
		   [OSCClient(), ("192.168.1.104", 8000)],
		   [OSCClient(), ("192.168.1.107", 8000)],
		   [OSCClient(), ("192.168.1.199", 8000)]
		   #, 
#		   [OSCClient(), ("192.168.1.199", 8000)]
		  ]
for client in clients:
	client[0].connect( client[1] )


# waiting for data to relay:
def handle_timeout(self):
	print ("Waiting for data...")

# this function will be called for every received message
def relayMessageCallback(path, tags, args, source):
	global faderLightFeedback
Beispiel #3
0
# author_li
# create time :2018/6/10
from random import choice
import config
import requests
import tools
from concurrent.futures import ThreadPoolExecutor

ip_list = tools.get_ip()
url = 'https://blog.csdn.net/qq_38505990/article/details/80603007'

i = 0


def visit_blog(ip):
    global i
    proxies = {
        "http": "http://{}".format(ip),
        "https": "https://{}".format(ip)
    }
    headers = {'User-Agent': choice(config.UserAgents)}
    try:
        requests.get(url,
                     proxies=proxies,
                     headers=headers,
                     timeout=config.TestTimeOut)
    except:
        print("visit wrong")

    i += 1
Beispiel #4
0

if __name__ == '__main__':

    def te():
        env = EnvServerMulti()
        env.make_env(env_id='Pendulum-v0', num_processes=1, seed=0)
        exit()

    #test()

    import Pyro4.naming
    import threading
    import time
    from tools import get_ip
    host = get_ip('eth0')
    host_ns = host

    def start_nameserver():
        Pyro4.naming.startNSloop(host=host, port=13579)

    threading.Thread(target=start_nameserver).start()

    def register_obj():
        Pyro4.Daemon.serveSimple({obj: "rl_envs"},
                                 ns=True,
                                 host=host_ns,
                                 port=24680)

    obj = EnvServerMulti()
    threading.Thread(target=register_obj).start()
Beispiel #5
0
 def fetch_ip(self):
   tools.get_ip()
Beispiel #6
0
class Mail:
    _port = 465
    _password = _user = _sender_email = _checkup_email = _smtp_server = ""
    _ip = get_ip()

    def __init__(self, what):
        print("> " + what + " mail is about to be send")
        try:
            with open("../credentials", "r") as fd:
                params = fd.read().splitlines()
                self._user = params[0]
                self._password = params[1]
                self._smtp_server = params[2]
                self._checkup_email = params[3]
                self._sender_email = params[4]
                self._alarm_email = params[5]
        except FileNotFoundError:
            print("No credentials file, check credentials_example.md")
            print("Exiting...")
        finally:
            exit()

    def send_checkup(self, mail_id):
        message = MIMEMultipart("alternative")
        message["Subject"] = "Hello, friend"
        message["From"] = self._sender_email
        message["To"] = self._checkup_email
        text = """\
		I would like to know if you are ok.
		You have 48h to click on this link:
		http://""" + self._ip + ":8080/alive=" "" + mail_id + ".html"

        message.attach(MIMEText(text, "plain"))
        context = ssl.create_default_context()
        with smtplib.SMTP_SSL(self._smtp_server, self._port,
                              context=context) as server:
            server.login(self._user, self._password)
            server.sendmail(self._sender_email, self._checkup_email,
                            message.as_string())
            server.quit()
            print("> Checkup mail send")
            print("> Waiting for user to answer...")

    def send_alarm(self):
        message = MIMEMultipart("alternative")
        message["Subject"] = "Romain isn't responding since 48h"
        message["From"] = self._sender_email
        message["To"] = self._alarm_email
        text = """\
		Romain hasn't responded to its deadman's switch since 48 hours.
		He wanted to share this with you if it has to happend:
		Bee me, me bee"""

        message.attach(MIMEText(text, "plain"))
        context = ssl.create_default_context()
        with smtplib.SMTP_SSL(self._smtp_server, self._port,
                              context=context) as server:
            server.login(self._user, self._password)
            server.sendmail(self._sender_email, self._alarm_email,
                            message.as_string())
            server.quit()
            print("> Alarm mail send, goodbye")
Beispiel #7
0
    response = {'transactions': lastBlock.transactions}
    return jsonify(response), 200


# run it once fore every node
if __name__ == '__main__':
    from argparse import ArgumentParser
    import socket
    #Initialize Node object
    parser = ArgumentParser()
    # Get Port to listen to
    parser.add_argument('-p',
                        '--port',
                        default=5000,
                        type=int,
                        help='port to listen on')
    parser.add_argument('-n',
                        '--nodes',
                        default=5,
                        type=int,
                        help='number of nodes')
    args = parser.parse_args()
    port = args.port
    nodes = args.nodes
    #Get own address
    myAddress = "http://" + tools.get_ip() + ":" + str(port) + "/"
    global node
    node = NodeModule.node(myAddress)
    node.create_initial_transaction(node.address, 100 * nodes)
    app.run(host='0.0.0.0', port=port)
from tools.version import *
from tools.whois import *
from tools.subdomain_finder import *
from tools.ddos import *
from tools.hashed import *

main_banner()
while True:
    try:
        pan = raw_input('\33[1mpan<( ')
        pan = pan.split()

        if pan[0] == 'use':

            if pan[1] == 'ip':
                get_ip()

            elif pan[1] == 'listener':
                listener()

            elif pan[1] == 'page_clonner':
                start_clonner()

            elif pan[1] == 'port_checker':
                port_checker()

            elif pan[1] == 'port_scanner':
                port_scanner()

            elif pan[1] == 'whois':
                whois()