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
from PIL import Image | |
from PIL.ExifTags import TAGS | |
import os | |
SOURCE_DIR = r'C:\Users\jerem\ai\stable-diffusion-webui_working\outputs' | |
DESTINATION_DIR = r'C:\Users\jerem\ai\converted2' | |
def find_png_files(directory): | |
"""Returns a list of full filenames for all .png files in a directory, including subdirectories.""" | |
png_files = [] |
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 pickle | |
PAYLOAD_MESSAGE = "You just got owned by Arbitrary Code Execution inside a Pickle file." | |
#A class that when unpickled, will execute the code embedded in the __reduce__ method's return value | |
class PickleACE(object): | |
def __reduce__(self): | |
return (print,(PAYLOAD_MESSAGE,)) | |
# Save the pickle data to a file |
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 argparse | |
import glob | |
import sys | |
from PIL import Image | |
import os | |
def main(): | |
""" | |
When given a directory, this script will create text files containing the positive prompts of each image (if the data exists in the png metadata), | |
and stores it as a .txt file with the same name next to the original image. |
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
class RateLimiter { | |
late int waitTimeMilliseconds = 2500; | |
DateTime lastActionTime = DateTime.now(); | |
Future<Function> doAction(Function f) async { | |
while (true) { | |
if (DateTime.now().isAfter(lastActionTime.add(Duration(milliseconds: waitTimeMilliseconds)))) { | |
break; | |
} else { | |
await Future.delayed(const Duration(milliseconds: 100)); |
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
version: '2.0' | |
services: | |
db: | |
image: mariadb:10.5 | |
container_name: seafile-mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=db_dev # Requested, set the root's password of MySQL service. | |
- MYSQL_LOG_CONSOLE=true | |
volumes: | |
- /mnt/twotera/seafile-mysql/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store. |
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
port=53 | |
domain-needed | |
bogus-priv | |
strict-order | |
address=/ham/127.0.0.1 | |
interface=eno1 | |
listen-address=127.0.0.1 | |
expand-hosts | |
domain=box.ham |
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
class Pot { | |
uint8_t rawValue = 0; //the raw value of the potentiometer | |
uint8_t smoothValue = 0; //the smoothed public-facing value of the pot | |
uint8_t stableSteps = 0; //value that tracks how many update() calls have passed since the last time the pot value change | |
void (*changeMethod)(uint16_t); //the function that gets called when the smoothed value changes | |
public: | |
Pot(void (*changeMethod_)(uint16_t)) { | |
changeMethod = changeMethod_; | |
} |
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
var CacheDatabase = Map(); | |
//An arbitrary function which returns a String | |
String sexNumberAsString() { | |
return "69"; | |
} | |
//Another arbitrary function which takes in arguments and returns a different type. | |
int add(int a, int b) { |
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
MONTHS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "january", "jan", "feb", "february", "march", "mar", "april", "apr", "may", "june", "jun", "july", "jul", "august", "aug", "september", "sept", "october", "oct"] | |
DAYS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th", "31st", "32nd", "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth", "thirteenth", "fourteenth", "fifteenth", "sixteenth", "seventeenth", "eighteenth", "nineteenth", "twentieth", "twenty first", "twenty second", "twenty third"] | |
YEARS = ["2018", "18", "1994", "94"] | |
#find every instance of every elemen |
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
# How To Use: | |
# ~/.config/systemd/user/ulauncher-service.service | |
# systemctl --user daemon-reload | |
# systemctl --user enable ulauncher-service.service | |
# systemctl --user start ulauncher-service.service | |
[Unit] | |
Description=Starts uLauncher and keeps it alive | |
[Service] |