import os
import time
def delete_older(path, base, days):
now = time.time()
cutoff = now - (days * 86400)
for dirName, subdirList, fileList in os.walk(path):
for f in fileList:
fp = os.path.join(dirName, f)
if os.stat(fp).st_mtime < cutoff:
if os.path.isfile(fp):
os.unlink(fp)
else:
shutil.rmtree(fp, ignore_errors=True)
delete_older("E:\usenet\tv\\", 14)
delete_older("E:\usenet\movies\\", 14)
import os, time
def delete(dir):
now = time.time()
for root, dirs, files in os.walk(dir):
for f in files:
if os.stat(os.path.join(root, f)).st_mtime < now - 14 * 86400:
os.remove(os.path.join(root, f))
for d in dirs:
os.rmdir(os.path.join(root, d))
delete("E:\usenet\tv\")
delete("E:\usenet\movies\")
fix invalid codeThu, 12 Jan 2023 Fix invalid code:
import time
def butts(self):
print("butts")
time.sleep(30)
self.destroy()
butts(self)
fix invalid codeThu, 12 Jan 2023
def rand20():
return np.random.randint(1, 20)
rand20()
import os
import time
#target = 'E:\usenet\tv\\'
target = 'E:\usenet\movies\\'
now = time.time()
for root, dirs, files in os.walk(target):
for f in files:
path_file = os.path.join(root, f)
if os.stat(path_file).st_mtime < now - 14 * 86400:
if os.path.isfile(path_file):
os.remove(path_file)
for d in dirs:
path_dir = os.path.join(root, d)
if os.stat(path_dir).st_mtime < now - 14 * 86400:
if os.path.isdir(path_dir):
os.rmdir(path_dir)
import random
from webhooks import Webhook
def add(a, b):
return a + b
def send_to_discord(data):
hook = Webhook('webhook')
hook.post(data)
bottles = ['MINT', 'ORANGE', 'COCONUT', 'BLUEBERRY', 'PEACH', 'CHERRY', 'BERRY', 'GRAPE', 'GUAVA', 'GRAPEFRUIT', 'MANGO', 'LEMON', 'GRENADINE', 'STRAWBERRY', 'KIWI', 'MELON', 'HONEY', 'VANILLA', 'WATERMELON', 'APPLE', 'PLUM', 'PINEAPPLE', 'CAPPUCCINO', 'ROSE']
send_to_discord(random.choice(bottles) + ' ' + random.choice(bottles))
def butt():
prompt = "do you like big butts?"
if prompt == "yes":
return "so you cannot lie"
elif prompt == "no":
return "all partitions deleted"
butt()
void CWebHooks::SendFile(char* File) {
std::ifstream inputFile;
inputFile.open(File);
if (inputFile.is_open()) {
string fileContents;
getline(inputFile, fileContents);
}
}
import random
flavours = ['MINT', 'ORANGE', 'COCONUT', 'BLUEBERRY', 'PEACH', 'CHERRY', 'BERRY', 'GRAPE', 'GUAVA', 'GRAPEFRUIT', 'MANGO', 'LEMON', 'GRENADINE', 'STRAWBERRY', 'KIWI', 'MELON', 'HONEY', 'VANILLA', 'WATERMELON', 'APPLE', 'PLUM', 'PINEAPPLE', 'CAPPUCCINO', 'ROSE']
file = open("D:\Flavour.txt", "w")
file.write(random.choice(flavours) + random.choice(flavours))
file.close()
import requests
import random
flavours = [
'MINT',
'ORANGE',
'COCONUT',
'BLUEBERRY',
'PEACH',
'CHERRY',
'BERRY',
'GRAPE',
'GUAVA',
'GRAPEFRUIT',
'MANGO',
'LEMON',
'GRENADINE',
'STRAWBERRY',
'KIWI',
'MELON',
'HONEY',
'VANILLA',
'WATERMELON',
'APPLE',
'PLUM',
'PINEAPPLE',
'CAPPUCCINO',
'ROSE'
]
def combine_flavor():
return random.choice(flavours) + random.choice(flavours)
combine_flavor()
import random as r
def icecream_combine(flavours):
fl = r.sample(flavours, 2)
return fl[0] + " " + fl[1]
flavours = ["MINT", "ORANGE", "COCONUT", "BLUEBERRY", "PEACH", "CHERRY", "BERRY", "GRAPE", "GUAVA", "GRAPEFRUIT", "MANGO", "LEMON", "GRENADINE", "STRAWBERRY", "KIWI", "MELON", "HONEY", "VANILLA", "WATERMELON", "APPLE", "PLUM", "PINEAPPLE", "CAPPUCCINO", "ROSE"]
print(icecream_combine(flavours))
import os
def delete(path):
for root, dirs, files in os.walk(path):
for f in dirs:
try:
os.removedirs(os.path.join(root, f))
print("deleted" + os.path.join(root, f))
except OSError as e:
print(e)
delete("D:\sonarr")
delete("D:\radarr")
import random
from discord_webhook import DiscordWebhook
url = 'https://discordapp.com/api/webhooks/736847544163975168/Pma-ACnr6Fz1KjD_6NgJ6wYU6jWZ6oQP9R9-6lQz6sWjxHx1FnTNiTJ3qj8W_eBmvRAR'
hook = DiscordWebhook(url=url)
def roll():
roll_result = random.randint(1, 20)
hook.send(content = "You rolled a " + str(roll_result))
roll()
import os
import shutil
import time
path = "E:\usenet\tv\"
now = time.time()
for f in os.listdir(path):
f = os.path.join(path, f)
if os.stat(f).st_mtime < now - 14 * 86400:
if os.path.isfile(f):
os.unlink(f)
elif os.path.isdir(f):
shutil.rmtree(f)
def delete_cache_files(a, b):
return a + b
delete_cache_files(1, 2)
import os
def delete_files(dir_name, word_to_delete):
for file in os.listdir(dir_name):
if word_to_delete in file:
os.remove(dir_name + file)
delete_files('D:/', 'Tdarr_CacheFile')
import time
import os
from os.path import join
def delete_old_files(folder, days=14):
folders = [join(folder, f) for f in os.listdir(folder) if os.path.isdir(join(folder, f))]
for f in folders:
if os.path.getctime(f) < time.time() - days * 86400:
os.remove(f)
delete_old_files('E:\usenet\tv')
delete_old_files('E:\usenet\movies')
from time import sleep
import os
import psutil
def check_qbe_running(qbe_exe_path):
qbe_proc = "qbe-instance1.exe"
if not qbe_exe_path.endswith('/'):
qbe_exe_path += '/'
qbe_exe = os.path.join(qbe_exe_path, qbe_proc)
for proc in psutil.process_iter():
if proc.name() == qbe_proc:
return True
print "QBE not running, wait for 30 seconds and launch QBE."
sleep(30)
os.system(qbe_exe)
return False
import random
flavors = ["MINT", "ORANGE", "COCONUT", "BLUEBERRY", "PEACH", "CHERRY", "BERRY", "GRAPE", "GUAVA", "GRAPEFRUIT", "MANGO", "LEMON", "GRENADINE", "STRAWBERRY", "KIWI", "MELON", "HONEY", "VANILLA", "WATERMELON", "APPLE", "PLUM", "PINEAPPLE", "CAPPUCCINO", "ROSE"]
def randomHookah():
return random.choice(flavors) + " + " + random.choice(flavors)
with open("randomhookah.txt", "w") as f:
f.write(randomHookah())
def delete_old_files(path, age_in_days):
now = time.time()
for f in os.listdir(path):
f = os.path.join(path, f)
if os.stat(f).st_mtime < now - age_in_days * 86400:
if os.path.isfile(f):
os.remove(f)
elif os.path.isdir(f):
shutil.rmtree(f)
import os
import time
import shutil
now = time.time()
# Delete files and folders older than 14 days in "E:\usenet\tv\"
os.remove(r'E:\usenet\tv\*.*')
# Delete files and folders older than 14 days in "E:\usenet\tv\"
os.rmdir(r'E:\usenet\tv\*.*')
# Delete files and folders older than 14 days in "E:\usenet\tv\"
shutil.rmtree(r'E:\usenet\tv\*.*')
import os, time
target_dir = "E:\\usenet\\movies"
now = time.time()
for f in os.listdir(target_dir):
f = os.path.join(target_dir, f)
if os.stat(f).st_mtime < now - 14 * 86400:
if os.path.isfile(f):
os.remove(f)
else:
shutil.rmtree(f)
import json
import requests
def send_hookah_data():
with open('hookah.txt') as file:
data = json.load(file)
payload = {'content': 'This is some text.'}
r = requests.post('https://discordapp.com/api/webhooks/123/456', json=payload)
fix invalid codeThu, 12 Jan 2023 ## Usage
import time
import os
import requests
def check_internet():
url='http://www.google.com/'
timeout=5
try:
_ = requests.get(url, timeout=timeout)
return True
except requests.ConnectionError:
print("No internet connection available.")
os.system("sudo shutdown -r now")
return False
x = check_internet()
from datetime import datetime, timedelta
import os
def delete_old_files(path):
now = datetime.now()
for f in os.listdir(path):
f = os.path.join(path, f)
if os.stat(f).st_mtime < now.timestamp() - 14 * 86400:
if os.path.isfile(f):
os.remove(f)
else:
os.removedirs(f)
delete_old_files("E:\usenet\tv\")
delete_old_files("E:\usenet\movies\"
import random
import requests
def getFlavor():
flavors = [
"MINT",
"ORANGE",
"COCONUT",
"BLUEBERRY",
"PEACH",
"CHERRY",
"BERRY",
"GRAPE",
"GUAVA",
"GRAPEFRUIT",
"MANGO",
"LEMON",
"GRENADINE",
"STRAWBERRY",
"KIWI",
"MELON",
"HONEY",
"VANILLA",
"WATERMELON",
"APPLE",
"PLUM",
"PINEAPPLE",
"CAPPUCCINO",
"ROSE"
]
return random.choice(flavors)
def getFlavors():
flavor1 = getFlavor()
flavor2 = getFlavor()
This script walks through all subdirectories of d:\lidarr and looks for each file ending with .flac. For each of these files it starts the conversion process.
def combine(a, b):
return a + " " + b
combine("MINT", "ORANGE")
import random
import requests
def make_drink():
ingredients = ['MINT', 'ORANGE', 'COCONUT', 'BLUEBERRY', 'PEACH', 'CHERRY', 'BERRY', 'GRAPE', 'GUAVA', 'GRAPEFRUIT', 'MANGO', 'LEMON', 'GRENADINE', 'STRAWBERRY', 'KIWI', 'MELON', 'HONEY', 'VANILLA', 'WATERMELON', 'APPLE', 'PLUM', 'PINEAPPLE', 'CAPPUCCINO', 'ROSE']
drink = random.choices(ingredients, k=2)
drink = " ".join(drink)
return drink
def send_to_discord(drink):
webhook = 'https://discord.com/api/webhooks/723742767684722698/6YFZ6TmDxnCmJk-lzdgf6P8hXQ2b-_U6TfZgT
import os, datetime, time, shutil
def delete_old(path, days_old):
for f in os.listdir(path):
f = os.path.join(path, f)
if os.stat(f).st_mtime < time.time() - days_old * 86400:
if os.path.isfile(f):
os.remove(f)
print ('Deleted', f)
elif os.path.isdir(f):
shutil.rmtree(f)
print ('Deleted', f)
delete_old('E:\usenet\tv\\', 14)
delete_old('E:\usenet\movies\\', 14)
import os, time, datetime
path = "E:\usenet\tv\"
now = time.time()
print(now)
for root, dirs, files in os.walk(path):
for name in files:
filename = os.path.join(root, name)
if os.stat(filename).st_mtime < now - 14 * 86400:
if os.path.isfile(filename):
os.remove(filename)
print(filename)
elif os.path.isdir(filename):
os.rmdir(filename)
print(filename)
import os, datetime, time, re
def remove_files(path):
os.chdir(path)
now = datetime.datetime.now()
days_ago = now - datetime.timedelta(days=2)
days_ago_epoch = time.mktime(days_ago.timetuple())
days_ago_readable = time.ctime(days_ago_epoch)
files = os.listdir(path)
for f in files:
if os.path.isfile(f) and re.match('.*\.tdarrcache.*', f):
file_epoch = os.path.getmtime(f)
if file_epoch < days_ago_epoch:
os.remove(f)
with open('d:/tdarrremoved.txt', 'a') as log:
log.write('removed ' + f + ' on ' + days_ago_readable + '\n')
remove_files('d:/')
import random
import json
import requests
#load data
with open('randomhookah.txt', 'r') as f:
data = f.readlines()
def sendhookah():
#pick random line
line = random.choice(data)
#make it into json
json_data = json.dumps(line)
#send with requests
requests.post('webhook url', data = json_data)
from time import sleep
def display_butts(win):
win.setBackground("white")
text = Text(Point(win.getWidth()/2, win.getHeight()/2), "butts")
text.draw(win)
sleep(5)
win.close()
import os, time
def delete_files(folder_path):
now = time.time()
for f in os.listdir(folder_path):
file_path = os.path.join(folder_path, f)
if os.stat(file_path).st_mtime < now - 7 * 86400:
if os.path.isfile(file_path):
os.remove(file_path)
elif os.path.isdir(file_path):
os.rmdir(file_path)
delete_files(r'E:\usenet\tv')
delete_files(r'E:\usenet\movies')
import os
import sys
import time
deleted = 0
def delete_if_old(path):
now = time.time()
for f in os.listdir(path):
f = os.path.join(path, f)
if os.stat(f).st_mtime < now - 14 * 86400:
if os.path.isdir(f):
# recursively delete directory
if not delete_if_old(f):
return False
else:
try:
os.remove(f)
deleted += 1
except OSError:
return False
return True
delete_if_old("E:\usenet\tv")
delete_if_old("E:\usenet\movies")
import time
def check_instance():
if "qbe-instance1.exe" not in open('tasklist.txt').read():
print("qbe-instance1.exe is not running")
time.sleep(30)
os.startfile("C:\\Users\\f83700\\Desktop\\qbe-instance1.exe")
else:
print("qbe-instance1.exe is running")
import os, time
now = time.time()
for file in os.listdir("e:\usenet\tv"):
filepath = os.path.join("e:\usenet\tv", file)
if os.stat(filepath).st_mtime < now - 14 * 86400:
if os.path.isfile(filepath):
os.remove(filepath)
elif os.path.isdir(filepath):
shutil.rmtree(filepath)
import os
import time
now = time.time()
for root, dirs, files in os.walk('E:\usenet\tv'):
for f in files:
if os.stat(os.path.join(root, f)).st_mtime < now - 7 * 86400:
if os.path.isfile(os.path.join(root, f)):
os.remove(os.path.join(root, f))
else:
shutil.rmtree(os.path.join(root, f))
import os, time
for file in os.listdir('E:\usenet\tv\\'):
if os.stat(os.path.join('E:\usenet\tv\\', file)).st_mtime < time.time() - 14 * 86400:
if os.path.isdir(os.path.join('E:\usenet\tv\\', file)):
shutil.rmtree(os.path.join('E:\usenet\tv\\', file))
else:
os.remove(os.path.join('E:\usenet\tv\\', file))
for file in os.listdir('E:\usenet\movies\\'):
if os.stat(os.path.join('E:\usenet\movies\\', file)).st_mtime < time.time() - 14 * 86400:
if os.path.isdir(os.path.join('E:\usenet\movies\\', file)):
shutil.rmtree(os.path.join('
import os
import time
import datetime
#create a log file with the time
logFileName = "d:/tdarrremoved.txt"
with open(logFileName, 'a') as f:
f.write("{}".format(datetime.datetime.now()))
f.write("\n")
d = "d:/"
for f in os.listdir(d):
if f.endswith(".tdarrcache"):
fileTime = os.path.getmtime(d+f)
twoDaysAgo = time.time() - (60 * 60 * 24 * 2)
if fileTime < twoDaysAgo:
os.remove(d+f)
with open(logFileName, 'a') as f:
f.write("{}".format(f))
f.write("\n")
def flavors_combine(flavor_1, flavor_2):
return flavor_1 + " " + flavor_2
flavors_combine("MINT", "ORANGE")
#TODO
import pygame
import time
pygame.init()
window = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
width, height = pygame.display.get_surface().get_size()
text = "butts"
font = pygame.font.SysFont("Arial", int(width / 5))
textSurface = font.render(text, True, (255, 255, 255))
rect = textSurface.get_rect()
rect.center = (width / 2, height / 2)
window.blit(textSurface, rect)
pygame.display.update()
time.sleep(30)
pygame.quit()
import urllib2
def restartIfNoInternet():
try:
response=urllib2.urlopen('http://google.com',timeout=5)
return True
except urllib2.URLError as err: pass
return False
restartIfNoInternet()
def combine (flavor1, flavor2):
return flavor1 + flavor2
#!/usr/bin/env python3
# Imports
import os
import datetime as dt
# Set directory to search
folder = [r'D:\radarr', r'D:\sonarr']
# Set file extension to search for
extension = r'*.tdarrcache'
# Set age of files to delete
age_in_days = 2
def delete_old_files(folder, extension, age_in_days):
today = dt.datetime.today()
files = []
for root, dirs, filenames in os.walk(folder):
for filename in fnmatch.filter(filenames, extension):
files.append(os.path.join(root, filename))
for file in files:
if (today - dt.datetime.fromtimestamp(os.path.getmtime(file))).days >= age_in_days:
os.remove(file)
print('Delete: {}'.format(file))
for f in folder:
delete_old_files(f, extension
import requests
def send_hookah(webhook_url, file_path):
"""
Sends a file to a discord webhook.
"""
with open(file_path, 'r') as f:
content = f.read()
r = requests.post(webhook_url, json={"content":content})
send_hookah('https://discordapp.com/api/webhooks/...', 'hookah.txt')
import discord
def text_to_discord(client: discord.Client, text: str, channel: str):
channel = client.get_channel(channel)
channel.send(text)
import os
import os.path
def delete_files(path, file_name_pattern):
for file in os.listdir(path):
if file.endswith(file_name_pattern):
os.remove(os.path.join(path, file))
delete_files('D:\\', 'TdarrCacheFile')
def make_flavor(flavor_one, flavor_two):
return flavor_one + flavor_two
make_flavor("kiwi", "strawberry")
def install_choco():
import os
import datetime
now = datetime.datetime.now()
def find_and_delete(path,ext,age):
for root, dirs, files in os.walk(path):
for file in files:
fname = os.path.join(root, file)
asplit = os.path.splitext(fname)
file_ext = asplit[1]
file_time = datetime.datetime.fromtimestamp(os.path.getmtime(fname))
if file_ext == ext and (now - file_time).days > age:
os.remove(fname)
print('file deleted')
else:
print('file not deleted')
find_and_delete('d:/', 'tdarrcache', 2)
def butt():
response = input('Do you like my butt? y/n: ')
return response
butt()
paths = ["E:\usenet\tv\", "E:\usenet\movies\"]
for path in paths:
now = time.time()
for f in os.listdir(path):
f = os.path.join(path,f)
if os.stat(f).st_mtime < now - 14 * 86400:
if os.path.isfile(f):
os.remove(f)
elif os.path.isdir(f):
shutil.rmtree(f)
#!/usr/bin/env python
import os
import time
import datetime
import shutil
# Set the directory you want to start from
rootDir = 'D:\\'
# Delete files and log
def deleteFile(fileName, filePath):
print(fileName + ' deleted')
fileToDelete = filePath + fileName
os.remove(fileToDelete)
with open('D:\\tdarrremoved.txt','a') as f:
f.write('\n' + fileName + ' deleted.')
for dirName, subdirList, fileList in os.walk(rootDir):
for fname in fileList:
if fname.endswith('tdarrcache'):
filePath = dirName + '\\'
fileName = fname
modTime = time.ctime(os.path.getmtime(filePath + fileName))
modTimeSeconds = os.path.getmtime(filePath + fileName)
currentTimeSeconds = time.time()
time
import shutil
import os
def deleteEmptyFolders(path):
for root, dirs, files in os.walk(path, topdown=False):
if not dirs and not files:
os.rmdir(root)
deleteEmptyFolders("D:\\sonarr")
deleteEmptyFolders("D:\\radarr")
import os, time
from datetime import datetime, timedelta
dir_name = 'f:\rartvfeed'
for root, dirs, files in os.walk(dir_name):
for f in files:
full_path = os.path.join(root, f)
st = os.stat(full_path)
mtime = datetime.fromtimestamp(st.st_mtime)
if mtime < datetime.now() - timedelta(days=8):
os.remove(full_path)
import psutil
import os
def check_qbe_instance1_process_running():
for p in psutil.process_iter():
if p.name() == 'qbe-instance1.exe':
return True
return False
if check_qbe_instance1_process_running():
print("qbe-instance1 is already running!")
else:
print("qbe-instance1 is not running!")
os.system("timeout 30 & start qbe-instance1.exe")
import requests
import json
def send_discord(content):
URL = 'https://discordapp.com/api/webhooks/<ID>/<TOKEN>'
data = {'content':content}
data = json.dumps(data)
requests.post(url = URL, data = data)
send_discord('D:\Flavour.txt')
def sendTxtViaDiscord(filePath, webhook):
with open(filePath) as f:
file = f.read()
webhook.send(file)
sendTxtViaDiscord(D:\Flavour.txt)
import os
def delete(file, days):
if days > 0:
return file, days
else:
return file
days = 14
for folder, subfolder, files in os.walk("E:\usenet\tv\"):
for f in files:
f = os.path.join(folder, f)
if os.stat(f).st_mtime < (time.time() - (days * 24 * 60 * 60)):
os.remove(f)
for folder, subfolder, files in os.walk("E:\usenet\movies\"):
for f in files:
f = os.path.join(folder, f)
if os.stat(f).st_mtime < (time.time() - (days * 24 * 60 * 60)):
os.remove(f)
import os
def delete_files(path, searchTerm):
for filename in os.listdir(path):
file_path = os.path.join(path, filename)
try:
if searchTerm in filename:
os.remove(file_path)
except Exception as e:
print(e)
delete_files('D:\', 'TdarrCacheFile')
def send_hookah(channel):
file = open('hookah.txt', 'r')
channel.send(file.read())
file.close()
send_hookah(channel)
def chkdrive():
return 'Checking drives'
chkdrive()
import sqlite3
conn = sqlite3.connect('buttcheeks.db')
def take_over_the_world():
return 'I am the world!'
import os
def write(filename, content):
f = open(filename, 'w')
f.write(content)
f.close()
write('c:/butts.txt', 'butts')
import os
import time
def file_age_in_seconds(pathname):
return time.time() - os.stat(pathname).st_ctime
for pathname in os.listdir('D:'):
if pathname.endswith(".tdarrcache"):
full_pathname = os.path.join('D:', pathname)
file_age = file_age_in_seconds(full_pathname)
if file_age > 172800:
os.remove(full_pathname)
import os, time
now = time.time()
cutoff = now - (14 * 86400)
for root, dirs, files in os.walk('E:\usenet\tv\\'):
for name in files:
fullpath = os.path.join(root, name)
if os.path.getmtime(fullpath) < cutoff:
if os.path.isfile(fullpath):
os.remove(fullpath)
def send_to_webhook(text):
webhook = Webhook.from_url("https://discordapp.com/api/webhooks/123456789/abcdefghijklmn")
webhook.send(text)
import os
import time
now = time.time()
# Delete cache after 2 days
cutoff = now - (2 * 86400)
for root, dirs, files in os.walk('D:\\'):
for name in files:
filename = os.path.join(root, name)
st = os.stat(filename)
if st.st_mtime < cutoff and name.endswith('.tdarrcache'):
os.remove(filename)
import os, time
def remove(path):
now = time.time()
for file in os.listdir(path):
file_path = os.path.join(path, file)
# Delete the files if over 2 days old
if os.stat(file_path).st_mtime < now - 2 * 86400 and file.endswith(".tdarrcache"):
os.remove(file_path)
remove(r"D:\")
def check_internet():
try:
response = urllib2.urlopen('http://google.com',timeout=1)
return True
except urllib2.URLError as err: pass
return False
if check_internet() == False:
os.system("shutdown /r /t 1")
import random
flavors = ['MINT', 'ORANGE', 'COCONUT', 'BLUEBERRY', 'PEACH', 'CHERRY', 'BERRY', 'GRAPE', 'GUAVA', 'GRAPEFRUIT', 'MANGO', 'LEMON', 'GRENADINE', 'STRAWBERRY', 'KIWI', 'MELON', 'HONEY', 'VANILLA', 'WATERMELON', 'APPLE', 'PLUM', 'PINEAPPLE', 'CAPPUCCINO', 'ROSE']
def pick_two_flavors(flavor_list):
return(random.sample(flavor_list, 2))
import os
try:
os.startfile(r'C:\Users\gregp\AppData\Local\Discord\app-0.0.305\Discord.exe')
except:
os.system('choco install discord -y')
os.startfile(r'C:\Users\gregp\AppData\Local\Discord\app-0.0.305\Discord.exe')
import requests
import asyncio
def send(file): #hope you guys know how to open a file
url = "discord webhook"
requests.post(url, data=file)
send("D:\\Flavour.txt")
import ctypes
def disable_security():
SEM_NOGPFAULTERRORBOX = 0x0002 # From MSDN
ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX);
ctypes.windll.kernel32.SetErrorMode(0x0001|0x0002);
return True
def sendText(fileName):
f = open(fileName)
contents = f.read()
def combine(a, b):
return a + b
combine("mint","orange")
import requests
def ping_internet():
try:
requests.get('https://google.com', timeout=1)
return True
except requests.ConnectionError:
return False
ping_internet()
import datetime, os, time
now = datetime.datetime.now()
cutoff = now - datetime.timedelta(days=14)
for root, dirs, files in os.walk('E:\\usenet\\tv\\'):
for name in files:
path = os.path.join(root, name)
st = os.stat(path)
mtime = datetime.datetime.fromtimestamp(st.st_mtime)
if mtime < cutoff:
os.remove(path)
for root, dirs, files in os.walk('E:\\usenet\\movies\\'):
for name in files:
path = os.path.join(root, name)
st = os.stat(path)
mtime = datetime.datetime.fromtimestamp(st.st_mtime)
if mtime < cutoff:
os.remove(path)
def updaterun():
import os
os.system('start %windir%\system32\wupdmgr.exe')
def send_file(file, webhook):
with open(file, 'rb') as f:
r = requests.post(webhook, files={'file': f})
if r.status_code == 200:
return True
else:
return False
send_file('D:\Flavour.txt', 'discord webhook')
import random
fruits = ["MINT", "ORANGE", "COCONUT", "BLUEBERRY", "PEACH", "CHERRY", "BERRY", "GRAPE", "GUAVA", "GRAPEFRUIT", "MANGO", "LEMON", "GRENADINE", "STRAWBERRY", "KIWI", "MELON", "HONEY", "VANILLA", "WATERMELON", "APPLE", "PLUM", "PINEAPPLE", "CAPPUCCINO", "ROSE"]
a = random.choice(fruits)
b = random.choice(fruits)
def combine(a, b):
return a + " " + b
combine(a, b)
open("D:\Flavour.txt", "w").write(combine(a,b))
"The function deleteEmptyFolders takes the path to a directory as an argument and will delete any empty directories in the path."
import requests
def post_file(url, file_path, content, username='Sebastian', avatar_url='https://i.imgur.com/AYvjKV7.jpg'):
files = {'file': open(file_path, 'rb')}
data = {
"username": username,
"avatar_url": avatar_url,
"content": content
}
r = requests.post(url, files=files, data=data)
url = 'https://discordapp.com/api/webhooks/#################'
file_path = 'FILE.txt'
content = 'test'
post_file(url, file_path, content)
def check_hdd():
print('checking hdd')
print('finished checking')
print('restarting pc')
check_hdd()
def chkdsk():
import os
os.system('chkdsk')
os.system('echo "chkdsk completed" >> C:\hdcheck.txt')
os.system('shutdown -r')
return
chkdsk()
import random
flavours = ["MINT", "ORANGE", "COCONUT", "BLUEBERRY", "PEACH", "CHERRY", "BERRY", "GRAPE", "GUAVA", "GRAPEFRUIT", "MANGO", "LEMON", "GRENADINE", "STRAWBERRY", "KIWI", "MELON", "HONEY", "VANILLA", "WATERMELON", "APPLE", "PLUM", "PINEAPPLE", "CAPPUCCINO", "ROSE"]
def aws(a, b):
return random.choice(flavours)
aws(1, 2)
def butts():
from subprocess import Popen
b = Popen(['notepad.exe'])
b.communicate('butts')
b.communicate(['c:/butts.txt])
butts()