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
#!/usr/bin/python3 | |
import os, sys, re | |
#--------------------------------------------------------------------------- | |
#Thank you to https://gist.github.com/dfee/6ed3a4b05cfe7a6faf40a2102408d5d8| | |
IPV4SEG = r'(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9])' #| | |
IPV4ADDR = r'(?:(?:' + IPV4SEG + r'\.){3,3}' + IPV4SEG + r')' #| | |
IPV6SEG = r'(?:(?:[0-9a-fA-F]){1,4})' #| | |
IPV6GROUPS = ( #| | |
r'(?:' + IPV6SEG + r':){7,7}' + IPV6SEG, #| |
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
import asyncio, socket, os, shlex | |
from watchdog.events import FileSystemEventHandler | |
from watchdog.observers import Observer | |
from watchdog.observers.polling import PollingObserver | |
from multiprocessing import Process | |
class socket_handler: | |
def __init__(self): | |
self.server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
async def run_server(self, address, port, printrun, handle): |
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
#!/bin/bash | |
while true | |
do | |
echo -n "$USER@$(hostname):$PWD> "; eval $(head -1) | |
done |
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
# I have decided to call this the ascii hasher | |
# new(msg) generates a hash using a psuedo random number with the encoded message as its seed for the key | |
# new_wkey(key, msg) generates a hash using the key and the message | |
def new_wkey(key, msg): | |
enc_key, enc_msg = int(''.join([str(ord(c)) for c in key])), int(''.join([str(ord(c)) for c in msg])) # Generates encoded key and encoded message | |
added = str(enc_key * enc_msg) # Creates the hash as an integer | |
if len(added) % 3: # Removes irregularities in the hash | |
if len("00" + added) % 3: | |
added = "00" + added |