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
# Description: Converts a PNG / JPG whatever file to a dictionary or array of arrays of RGB values | |
from argparse import ArgumentParser | |
from pathlib import Path | |
import sys | |
from PIL import Image | |
class PNGConverter: | |
def __init__(self, file=None, verbose=False): |
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 will use beuaitful soup to get thet list of linux mirror sites from a linux mirror site. Usecase | |
# for me was to generate a whitelist for a proxy server. | |
import re | |
import sys | |
try: | |
import argparse | |
import requests | |
from bs4 import BeautifulSoup | |
except ImportError as e: |
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
{%- macro uuid() %} | |
{%- set uuid_generate = namespace(uuid_template = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx') %} | |
{%- set characterlist = "1234567890abcdef" %} | |
{%- set uuid_generate.new_uuid = '' %} | |
{%- for x in uuid_generate.uuid_template %} | |
{%- if x == 'x' %} | |
{%- set uuid_generate.new_uuid = uuid_generate.new_uuid + characterlist | random %} | |
{%- else %} | |
{%- set uuid_generate.new_uuid = uuid_generate.new_uuid + x %} | |
{%- endif %} |
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 should be able to run in cfn-init / EC2 userdata | |
export DEBIAN_FRONTEND=noninteractive | |
export VENV_DIR=/opt/aws/cfn-bootstrap-venv | |
export HELPER_SCRIPTS_BIN_DIR=/opt/aws/bin | |
# Install python 3.11 from deadsnakes, this will not be the default python, that will stay on 3.12 | |
apt update | |
apt-get install -y tzdata software-properties-common # Maybe only required in docker? | |
add-apt-repository -y ppa:deadsnakes/ppa | |
apt update |
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
<html> | |
<head> | |
<title>Board game geek search demo</title> | |
</head> | |
<body> | |
<script> | |
</script> | |
<h1>Board game geek search demo</h1> |
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
- name: Calling out current path | |
debug: | |
msg: "Deleting path: {{ deleting_storage_path }}" | |
- name: Get path content | |
vars: | |
query_uri: "/api/{{ rundeck_api_version }}/storage/{{ deleting_storage_path }}/" | |
uri: | |
url: "{{ rundeck_url + (query_uri | urlencode) }}" | |
method: GET |
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 json | |
import sys | |
import requests | |
from docker.errors import DockerException | |
try: | |
import docker | |
except ImportError: | |
sys.exit("Please run 'pip install docker' first") |
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
""" | |
I'm not sure how and when, but certbot stopped updating my certificates because the cert files were expected but | |
turned out to be actual real files. No idea how this happened. | |
This caused the annoying error: | |
expected | |
/etc/letsencrypt/live/.../cert.pem to be a symlink Renewal configuration file /etc/letsencrypt/renewal/...conf is | |
broken. This scr… expected /etc/letsencrypt/live/.../cert.pem to be a symlink Renewal configuration file | |
/etc/letsencrypt/renewal/...conf is broken. Skipping. |
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
#include <FastLED.h> | |
#define DATA_PIN 1 | |
// On the ATTINY85, pins have different numbers when doing an analog reading compared to digital IO | |
#define SENSOR_PIN_A 1 | |
#define SENSOR_PIN_D 2 | |
#define NUM_LEDS 2 | |
#define BRIGHTNESS 150 | |
// Lower is slower | |
#define FRAMES_PER_SECOND 10 |