Skip to content

Instantly share code, notes, and snippets.

View markizano's full-sized avatar

Markizano Draconus markizano

View GitHub Profile
@markizano
markizano / oai-gen-img.py
Created November 3, 2025 12:36
Generate an image using OpenAI's Image generator.
#!/usr/bin/env python3
'''
Image generation test using OpenAI's Image model and code.
Usage:
LINE1=Sample LINE2=Video ./oai-gen-img.py
Ouputs `./thumbnail.png` based on `build/*.txt` and input lines.
'''
@markizano
markizano / gen-img.py
Last active October 24, 2025 01:41
Generate an image based on a seed image and prompt. TODO Implement this in ytffmpeg.
#!/usr/bin/env python3
'''
Run me to generate a thumbnail.
'''
import os, sys, io
from glob import glob
from dotenv import load_dotenv
from google import genai
@markizano
markizano / .env
Created October 17, 2025 13:59
n8n docker compose configuration
### N8N Configuration ###
# This is just a sample. Populate this with the actual fields you will use.
# DOMAIN_NAME and SUBDOMAIN together determine where n8n will be reachable from
# The top level domain to serve from
DOMAIN_NAME=example.com
# The subdomain to serve from
SUBDOMAIN=n8n
@markizano
markizano / histlog
Created October 12, 2025 01:34
`histlog`: Maintain bash history across sessions.
#!/bin/bash
# @date: 2021-04-25
# @author: Markizano Draconus
# @description: I got sick and tired of my bash history dissapearing despite using
# HISTFILESIZE=-1, which disables truncating $HISTFILE
# This script created to export history commands to a sub-directory in my ~/.bash_history.d/
# folder to avoid my commands from getting truncated from my $HISTFILE.
# @usage: export PROMPT_COMMAND='history -a; histlog $(history 1)'
# Acquire the history files and directory...
@markizano
markizano / bot.py
Created August 7, 2025 01:15
Slackbot + Open WebUI MVP Integration
#!/usr/bin/env python3
import os
from collections.abc import Callable
from slack_bolt import App
from slack_bolt.adapter.socket_mode import SocketModeHandler
from dotenv import load_dotenv
from openwebui_client.client import OpenWebUIClient
load_dotenv()
@markizano
markizano / openssl.cnf
Created August 5, 2025 15:19
OpenSSL Configuration with SAN and V3 Extensions (minimalist configuration)
HOME = .
openssl_conf = openssl_init
config_diagnostics = 1
[openssl_init]
[provider_sect]
default = default_sect
[default_sect]
@markizano
markizano / docker-compose.py
Created August 5, 2025 00:41
n8n configuration
name: n8n
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
network_mode: bridge
ports:
- "127.0.0.1:5678:5678"
environment:
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
@markizano
markizano / coffee.ps1
Last active May 13, 2025 21:39
Keeps computer awake all night
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public static class Kernel32 {
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern uint SetThreadExecutionState(uint esFlags);
public const uint ES_AWAYMODE_REQUIRED = 0x00000040;
public const uint ES_CONTINUOUS = 0x80000000;
@markizano
markizano / follow-my-tiktok.py
Created January 18, 2025 03:33
Finds who you follow on TikTok based on your data export and outputs a JSON file with a list of links from their profiles.
#!/usr/bin/env python3
'''
I decided to go with a Python script instead of an Angular app since there are a few challenges I cannot overcome with an Angular app:
- I don't control the CORS policy of the website I'm scraping
- I am not guaranteed to be authenticated to the target subscription site I want to pick out.
- I am not guaranteed to pick the correct data if the CORS policy denies me the ability to scrape the data.
Sooooo... in light of the recent challenges, this Python script should bypass a lot of that.
What this will do:
@markizano
markizano / pa-bind.py
Created November 23, 2024 16:54
Binds Audio from one Pulse Audio server to another
#!/usr/bin/env python3
import os, sys
import pasimple
# Set this variable to the IP address of another system running Pulse where you want send playback.
PA_SERVER = os.environ.get('PA_SERVER', '192.168.1.3')
# NOTE: Remove the file /tmp/pa-bind.pid to kill the bridge
PIDFILE = '/tmp/pa-bind.pid'