This file contains 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
#Bot Skeleton | |
import sys | |
class Bot: | |
"""Bot""" | |
def __init__(self,name) -> None: | |
self.name = name | |
self.memory = {} | |
self.running = True | |
self.words = [] |
This file contains 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 os | |
def GetPID(processName): | |
procs = [proc_fd for proc_fd in os.listdir("/proc/") if proc_fd.isdigit()] | |
for proc_fd in procs: | |
try: | |
status_fd = open("/proc/{0}/status".format(proc_fd),"r").readlines() | |
for line in status_fd: | |
if "Name:" in line: | |
name = line.replace("Name:\t","").replace("\n","") |
This file contains 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 subprocess | |
asm_code = """ | |
.global _start | |
.text | |
_start: | |
mov $1,%rax | |
mov $1,%rdi | |
mov $msg, %rsi |
This file contains 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
# This is the API we need to POST too.. | |
# https://api.psychonautwiki.org/ | |
# | |
import requests | |
import json | |
#We ask for input, displaying "Which Psych?" | |
query = input("Which Psych?") |
This file contains 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 requests | |
import sys | |
def download_file(url, filename): | |
with open(filename, "wb") as file: | |
print(f"Downloading {filename}") | |
response = requests.get(url, stream=True) | |
length = response.headers.get("Content-Length") |
This file contains 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
python -c "import os;print(os.getenv('path').replace(';','\n'))" | |
C:\Windows\system32 | |
C:\Windows | |
C:\Windows\System32\Wbem | |
C:\Windows\System32\WindowsPowerShell\v1.0\ | |
C:\Program Files\nodejs\ | |
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common | |
C:\Users\Jon\AppData\Local\Programs\Python\Python37-32\Scripts | |
C:\Users\Jon\AppData\Roaming\npm | |
C:\Python27\ |
This file contains 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
program_source = """ | |
print "Test" | |
print "Hello world" | |
end | |
""" | |
def parse_source(source_data): | |
return list(filter(lambda line: line != "", source_data.splitlines())) |
This file contains 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 random | |
def generate_hash(size=10): | |
alpha = [p for p in "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789_"] | |
return "".join([random.choice(alpha) for _ in range(size)]) |
This file contains 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 | |
class EchoProtocol(asyncio.Protocol): | |
def __init__(self): | |
self.transport = None | |
def connection_made(self, transport): | |
peer_name = transport.get_extra_info("peername") | |
print(f"Connection from {peer_name[0]}") |
This file contains 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
//Keymap | |
var keys = { | |
up: 38, | |
down: 40, | |
left: 37, | |
right: 39, | |
key_z: 90, | |
key_x: 88, | |
return: 13, | |
escape: 27, |
NewerOlder