From 8bc43978057ddedb72a53227711d60ce624bb0d0 Mon Sep 17 00:00:00 2001 From: BarsTiger Date: Sun, 29 May 2022 15:09:40 +0300 Subject: [PATCH] deleted debug admin without gui --- admin/admin_simulator/connect.py | 32 ---------------------- admin/admin_simulator/receive_logs.py | 38 --------------------------- admin/admin_simulator/send_command.py | 36 ------------------------- admin/admin_simulator/send_python.py | 35 ------------------------ 4 files changed, 141 deletions(-) delete mode 100644 admin/admin_simulator/connect.py delete mode 100644 admin/admin_simulator/receive_logs.py delete mode 100644 admin/admin_simulator/send_command.py delete mode 100644 admin/admin_simulator/send_python.py diff --git a/admin/admin_simulator/connect.py b/admin/admin_simulator/connect.py deleted file mode 100644 index ff84654..0000000 --- a/admin/admin_simulator/connect.py +++ /dev/null @@ -1,32 +0,0 @@ -from env import * -import pusher -import pysher -import sys - - -client = pusher.Pusher( - app_id=app_id, - key=key, - secret=secret, - cluster=cluster, - ssl=False -) -receiver = pysher.Pusher(key=key, cluster=cluster) - - -def handle_connection_to_server(connection): - print("Connected to server") - print("Server returned: " + str(connection)) - print("Available client IDs: " + - str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1], - list(client.channels_info(prefix_filter='admin-')['channels'])))))) - client_id = input("Enter id to connect: ") - client.trigger('admin-' + str(client_id), 'connection_from_admin', None) - print("Sent connection message to client") - - -if __name__ == '__main__': - receiver.connection.bind('pusher:connection_established', handle_connection_to_server) - receiver.connect() - while True: - pass diff --git a/admin/admin_simulator/receive_logs.py b/admin/admin_simulator/receive_logs.py deleted file mode 100644 index f792e56..0000000 --- a/admin/admin_simulator/receive_logs.py +++ /dev/null @@ -1,38 +0,0 @@ -from env import * -import pusher -import pysher -import sys - - -client = pusher.Pusher( - app_id=app_id, - key=key, - secret=secret, - cluster=cluster, - ssl=False -) -receiver = pysher.Pusher(key=key, cluster=cluster) - - -def on_logs(data): - print("Logs: " + data) - - -def handle_connection_to_server(connection): - print("Connected to server") - print("Server returned: " + str(connection)) - print("Available client IDs: " + - str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1], - list(client.channels_info(prefix_filter='admin-')['channels'])))))) - client_id = input("Enter id to connect: ") - client.trigger('admin-' + str(client_id), 'connection_from_admin', None) - print("Sent connection message to client") - log_channel = receiver.subscribe('client-' + str(client_id)) - log_channel.bind('logs', on_logs) - - -if __name__ == '__main__': - receiver.connection.bind('pusher:connection_established', handle_connection_to_server) - receiver.connect() - while True: - pass diff --git a/admin/admin_simulator/send_command.py b/admin/admin_simulator/send_command.py deleted file mode 100644 index 690f1eb..0000000 --- a/admin/admin_simulator/send_command.py +++ /dev/null @@ -1,36 +0,0 @@ -from env import * -import pusher -import pysher -import sys - -client = pusher.Pusher( - app_id=app_id, - key=key, - secret=secret, - cluster=cluster, - ssl=False -) -receiver = pysher.Pusher(key=key, cluster=cluster) - - -def handle_connection_to_server(connection): - print("Connected to server") - print("Server returned: " + str(connection)) - ids = dict() - - print("Available client IDs: " + - str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1], - list(client.channels_info(prefix_filter='admin-')['channels'])))))) - client_id = input("Enter id to connect: ") - client.trigger('admin-' + client_id, 'connection_from_admin', None) - print("Sent connection message to client") - while True: - client.trigger('admin-' + client_id, 'command', input("Enter shell command: ")) - print("Sent shell command to client") - - -if __name__ == '__main__': - receiver.connection.bind('pusher:connection_established', handle_connection_to_server) - receiver.connect() - while True: - pass diff --git a/admin/admin_simulator/send_python.py b/admin/admin_simulator/send_python.py deleted file mode 100644 index f4f2ed6..0000000 --- a/admin/admin_simulator/send_python.py +++ /dev/null @@ -1,35 +0,0 @@ -from env import * -import pusher -import pysher -import sys - - -client = pusher.Pusher( - app_id=app_id, - key=key, - secret=secret, - cluster=cluster, - ssl=False -) -receiver = pysher.Pusher(key=key, cluster=cluster) - - -def handle_connection_to_server(connection): - print("Connected to server") - print("Server returned: " + str(connection)) - print("Available client IDs: " + - str(', '.join(list(map(lambda channel_id: channel_id.split('-')[-1], - list(client.channels_info(prefix_filter='admin-')['channels'])))))) - client_id = input("Enter id to connect: ") - client.trigger('admin-' + str(client_id), 'connection_from_admin', None) - print("Sent connection message to client") - while True: - client.trigger('admin-' + str(client_id), 'python', input("Enter python code: ")) - print("Sent python code to client") - - -if __name__ == '__main__': - receiver.connection.bind('pusher:connection_established', handle_connection_to_server) - receiver.connect() - while True: - pass