def main(): """Console script for veronica.""" # sentry_sdk.init("https://[email protected]/5299322") parser = argparse.ArgumentParser() parser.add_argument('_', nargs='*') args = parser.parse_args() print(parser) init(autoreset=True) prompt = Veronica() prompt.prompt = 'veronica> ' prompt.ruler = '-' if (len(args._)): argParse(args._) prompt.cmdloop(Fore.YELLOW + 'Welcome ' + getpass.getuser().capitalize() + "! Veronica at your service ...") return 0
def talk(self, msg): colorama.init(strip="False") # -- Create the socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # establish the connection to the Server (IP, PORT) s.connect((self.ip, self.port)) # Send data. print(termcolor.colored("To Server: " + msg, "blue")) s.send(str.encode(msg)) # Receive data response = s.recv(2048).decode("utf-8") print("From Server: ", end="") print(termcolor.colored(response, "yellow")) # Close the socket s.close() # Return the response return "From server: " + response
def __init__(self): colorama.init() self.CRED = '\033[91m' self.CEND = '\033[0m' self.CEND = '\33[0m' self.CBLACK = '\33[30m' self.CRED = '\33[31m' self.CGREEN = '\33[32m' self.CYELLOW = '\33[33m' self.CBLUE = '\33[34m' self.CVIOLET = '\33[35m' self.CBEIGE = '\33[36m' self.CWHITE = '\33[37m' self.CBLACKBG = '\33[40m' self.CREDBG = '\33[41m' self.CGREENBG = '\33[42m' self.CYELLOWBG = '\33[43m' self.CBLUEBG = '\33[44m' self.CVIOLETBG = '\33[45m' self.CBEIGEBG = '\33[46m' self.CWHITEBG = '\33[47m' self.CGREY = '\33[90m' self.CRED2 = '\33[91m' self.CGREEN2 = '\33[92m' self.CYELLOW2 = '\33[93m' self.CBLUE2 = '\33[94m' self.CVIOLET2 = '\33[95m' self.CBEIGE2 = '\33[96m' self.CWHITE2 = '\33[97m' self.CGREYBG = '\33[100m' self.CREDBG2 = '\33[101m' self.CGREENBG2 = '\33[102m' self.CYELLOWBG2 = '\33[103m' self.CBLUEBG2 = '\33[104m' self.CVIOLETBG2 = '\33[105m' self.CBEIGEBG2 = '\33[106m' self.CWHITEBG2 = '\33[107m'
def talk(self, msg): # -- Create the socket colorama.init(strip="False") s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # establish the connection to the Server (IP, PORT) s.connect((self.ip, self.port)) # Send data. print("To Server:", msg) # mirar esto para Ex4.py s.send(msg.encode()) # Receive data response = s.recv(2048).decode("utf-8") print("from server:", response) print(termcolor.colored("to server: " + msg, "blue")) # Close the socket s.close() # Return the response return "From server: " + response
import os import shutil from pip._vendor.colorama import Fore, Style, init import subprocess import time init() src_dir = os.getcwd() servicesList = [ '<ServiceName>', '<ServiceName>', '<ServiceName>', '<ServiceName>', '<ServiceName>' ] def copyloop(appdir, target): cp_source_dir = appdir cp_target_dir = target file_names = os.listdir(cp_source_dir) for file_name in file_names: shutil.copy2(os.path.join(cp_source_dir, file_name), cp_target_dir) def stopServices(svcname): args = ['sc', 'stop', svcname] result = subprocess.run(args) def startServices(svcname): args = ['sc', 'start', svcname]
def display(message, is_warning=False): init() if is_warning: print(Fore.RED + message) else: print(Fore.BLUE + message)
newcheck.check(p) if p not in hyperlinks: hyperlinks.add(p) if website.split('.')[1] in p: #needs improvement if not website.endswith( ('.png', '.jpeg', '.js', 'jpg')): q.put(p) except Exception as e: print(e, address) def threader(): while True: value = q.get() result = extract_link(value) q.task_done() if __name__ == "__main__": colorama.init() q = queue.Queue() global hyperlinks, website hyperlinks = set() website = input("Please enter the website address: ") for x in range(30): t = threading.Thread(target=threader) t.deamon = True t.start() q.put(website.strip()) q.join()