From 435a5e91415df671ce1dec7bbb5737b50894acb0 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Thu, 14 Aug 2025 12:45:04 -0400 Subject: [PATCH] No longer need .ansible-lint --- .ansible-lint | 5 ----- lazy_reboot.yml | 2 ++ pil.py | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 5 deletions(-) delete mode 100644 .ansible-lint create mode 100644 pil.py diff --git a/.ansible-lint b/.ansible-lint deleted file mode 100644 index b6d3809..0000000 --- a/.ansible-lint +++ /dev/null @@ -1,5 +0,0 @@ -skip_list: - - yaml[colons] - - yaml[empty-lines] - - yaml[line-length] - - no-changed-when diff --git a/lazy_reboot.yml b/lazy_reboot.yml index e9e16e4..aae1d59 100644 --- a/lazy_reboot.yml +++ b/lazy_reboot.yml @@ -23,6 +23,7 @@ - name: Verify mount status ansible.builtin.command: "ls {{ item }}" timeout: 5 + changed_when: false register: r_verify_mounts loop: "{{ nfs_mount_list }}" loop_control: @@ -36,6 +37,7 @@ - name: Lazily unmount the failed shares ansible.builtin.command: "umount -f -l {{ item }}" + changed_when: false register: r_lazy_unmount async: 30 poll: 0 diff --git a/pil.py b/pil.py new file mode 100644 index 0000000..a950d7a --- /dev/null +++ b/pil.py @@ -0,0 +1,53 @@ +from PIL import Image, ImageDraw, ImageFont +import random + +def generate_freeform_image(user_input, width=800, height=600, output_path="generated_image.png"): + """ + Generates a freeform abstract image based on user input. + + Parameters: + - user_input (str): A theme, mood, or keyword to inspire the design. + - width (int): Width of the image. + - height (int): Height of the image. + - output_path (str): File path to save the image. + """ + # Create a blank canvas + image = Image.new("RGB", (width, height), color="white") + draw = ImageDraw.Draw(image) + + # Define color palette based on mood + mood_colors = { + "happy": ["#FFD700", "#FF69B4", "#ADFF2F"], + "calm": ["#ADD8E6", "#87CEFA", "#B0E0E6"], + "dark": ["#2F4F4F", "#000000", "#4B0082"], + "energetic": ["#FF4500", "#FF6347", "#FFFF00"], + "mystical": ["#8A2BE2", "#4B0082", "#00CED1"] + } + + # Pick colors based on input + selected_colors = mood_colors.get(user_input.lower(), ["#CCCCCC", "#999999", "#666666"]) + + # Draw random shapes + for _ in range(50): + shape_type = random.choice(["ellipse", "rectangle", "line"]) + x1, y1 = random.randint(0, width), random.randint(0, height) + x2, y2 = random.randint(0, width), random.randint(0, height) + color = random.choice(selected_colors) + + if shape_type == "ellipse": + draw.ellipse([x1, y1, x2, y2], fill=color, outline=None) + elif shape_type == "rectangle": + draw.rectangle([x1, y1, x2, y2], fill=color, outline=None) + elif shape_type == "line": + draw.line([x1, y1, x2, y2], fill=color, width=random.randint(1, 5)) + + # Optionally add text + try: + font = ImageFont.truetype("arial.ttf", 24) + draw.text((10, 10), f"Inspired by: {user_input}", fill="black", font=font) + except: + draw.text((10, 10), f"Inspired by: {user_input}", fill="black") + + # Save the image + image.save(output_path) + print(f"Image saved to {output_path}")