Skip to content

Instantly share code, notes, and snippets.

@ar00n
ar00n / GP_SQL_TO_FILE.py
Created April 27, 2020 14:52
Migrate GriefPrevention from SQL to file directory storage.
import mysql.connector
import os, sys
from datetime import datetime
import time
path = "GriefPreventionData"+time.strftime("%Y%m%d-%H%M%S")
try:
os.mkdir(path)
os.mkdir(path+"/PlayerData")
@ar00n
ar00n / cookieGen.php
Last active May 1, 2018 15:26
Generates a crypto secure cookie along with a hashed version for database storage. -ar0n#1462
<?php
$user = 'ar0n#1462';
// Valid till. Currently an hour.
$hour = time() + 3600 * 24 * 30;
// Generates crypto-secure string (hGlsUTlYvRcAQs8DA7vzER4R62x2gwyNQY8%3D), change random_bytes length for more security.
$pass = base64_encode(random_bytes(26));
// BCrypt hashes $id for database storage.
$dbinput = password_hash($pass, PASSWORD_DEFAULT);
// Gives cookie to user.
// '$hour' = time cookie is valid for.
This file contains the winners and transactions of the Garlic Bank (discord.gg/bjRA52C) giveaway. Transactions can be looked up on garlicinsight.com. Shoutout to @GarlicBank#8253 for hosting and supplying coins for the event! - @ar0n#1462
Verification:
Message: "This file is signed by @ar0n#1462 on 03/03/2018."
Address: "GSfzfb3tZ4dkFf9ULxVTMEPu8uhMgmuzvY"
Signature: "IG5tuD+JQRsL2yD2G8WK9wvnEPZVYjeArM7RuSPzRoGkKqINRRuKc6XE6C1zk0b1qv9nQvF22FaCgYD/aepN+gY="
Discord Name Transaction Id
@Kmorae#6969 5892011b9ed3527ad8b4abe2dc68c28dd0ee874e999c8ac94f9ee21da4cf2a15
@ar00n
ar00n / bot.py
Last active March 3, 2018 03:51
import discord
from discord.ext import commands
from discord.ext.commands import Bot
from secrets import choice
from asyncio import sleep
import asyncio
bot = commands.Bot(command_prefix=[','])
@bot.event