Skip to content

Instantly share code, notes, and snippets.

View carlos-a-g-h's full-sized avatar
🌡️
self-diagnosed with YAML addiction, someone plz call a doctor

carlos-a-g-h

🌡️
self-diagnosed with YAML addiction, someone plz call a doctor
View GitHub Profile
@carlos-a-g-h
carlos-a-g-h / share_variables_with_artifacts.yaml
Created May 27, 2024 17:14
GH Workflows: Sharing step output variables across jobs using artifacts
name: "test"
on:
[workflow_dispatch]
jobs:
first:
name: First Job
runs-on: ubuntu-latest
steps:
@carlos-a-g-h
carlos-a-g-h / generic_nuitka.yml
Created October 23, 2023 15:22
Github workflow for single-file Nuitka (python) executable binaries
name: (Generic) Nuitka
on:
workflow_dispatch:
inputs:
THE_NAME:
description: Repository name (without your username)
type: string
required: true
@carlos-a-g-h
carlos-a-g-h / pipkit.py
Last active April 21, 2024 17:48
don't ask why
#!/usr/bin/python3
from pathlib import Path
from subprocess import run as sub_run
from subprocess import PIPE as sub_PIPE
def pip_list(filepath:Path)->bool:
print("\nObtaining list of packages...")
proc=sub_run(
@carlos-a-g-h
carlos-a-g-h / fftoolkit.py
Last active October 14, 2023 14:50
FFmpeg python script for some common tasks. Requires FFmpeg installed
#!/usr/bin/python3.9
import json
import subprocess
from datetime import datetime
from pathlib import Path
# FFToolkit by t.me/CarlosAGH
def util_match_language(filestem):
@carlos-a-g-h
carlos-a-g-h / mount-debian-dvds.sh
Created May 31, 2023 19:56
Script for mounting Debian DVDs and adding them to /etc/sources.list
#!/bin/bash
DVDs_DIRPATH="$1"
DVDs_PATTERN="$2"
TOTAL=$(ls "$DVDs_DIRPATH"|grep "$DVDs_PATTERN"|grep ".iso$"|wc -l)
INDEX=0
INDEX_MAX=$(expr $TOTAL + 1)
@carlos-a-g-h
carlos-a-g-h / cronjobtools.py
Last active May 20, 2023 05:06
A small module for interacting with existing cron jobs using the cron-job.org API
#!/usr/bin/python3.9
import asyncio
import aiohttp
async def cronjob_patch(session:aiohttp.ClientSession,cronjob_apikey:str,cronjob_jid:str,cronjob_data:dict)->bool:
ts=False
if not session:
ts=True
@carlos-a-g-h
carlos-a-g-h / mirroring.yml
Last active August 24, 2023 23:15
Download a file and upload as a github release (THIS IS NOT LEGAL)
# WARNING: This is not how you should use a CI/CD plaftform, use privately and at your own risk
name: URL uploader
on:
workflow_dispatch:
inputs:
LINK:
type: string
required: true
FILENAME:
type: string
https://stackoverflow.com/questions/16523746/ffmpeg-hangs-when-run-in-background#16527559
https://www.dacast.com/blog/how-to-broadcast-live-stream-using-ffmpeg
https://cloud.tencent.com
@carlos-a-g-h
carlos-a-g-h / script_GHWF_RustCargoTester.yml
Last active March 10, 2023 21:40
Runs a test for simple one-file-like rust programs
name: Run tests using cargo
on:
workflow_dispatch:
inputs:
RS_FILE:
description: Name of the RS file (without the .RS extension)
required: true
type: string
import asyncio
import logging
logging.getLogger()
async def sp_streamer(hook,dbg=False):
proc=hook["proc"]
if dbg:
printout=0
while True: