Skip to content

Instantly share code, notes, and snippets.

View justynroberts's full-sized avatar
🏠
Working from home

Justyn Roberts justynroberts

🏠
Working from home
View GitHub Profile
@justynroberts
justynroberts / analyze.sh
Last active November 9, 2024 17:01
OpenAI Image - Bash
#!/bin/bash
# www.fintonlabs.com
export OPENAI_API_KEY="ADD_KEY"
check_requirements() {
for cmd in curl base64 mktemp jq; do
if ! command -v "$cmd" > /dev/null; then
echo "Error: Required command '$cmd' is not installed." >&2
exit 1
fi
@justynroberts
justynroberts / sample.json
Created October 24, 2024 11:01
Sample Node-Red Flow for OPC-UA to PagerDuty Events
[
{
"id": "be12058e8765348e",
"type": "switch",
"z": "d7d5b52d.77f328",
"name": "Check Status",
"property": "payload.value",
"propertyType": "msg",
"rules": [
{
@justynroberts
justynroberts / readme.md
Last active June 26, 2024 10:29
Rundeck User Reporting

API Data Fetch and CSV Export Script

This script fetches user data from an API, processes it, writes it to a CSV file, and provides a summary of user activities. The API URL and headers have been sanitized for security purposes.

Features

  • Fetches data from an API.
  • Processes and fills missing data fields.
  • Writes data to a CSV file.
  • Parses datetime fields.
@justynroberts
justynroberts / config.py
Last active February 14, 2024 12:51
Scrape site for ChatGPT Training
# config.py
CONFIG = {
"url": ["https://docs.rundeck.com"], # Assuming list format to potentially handle multiple starting URLs
"match": "https://docs.rundeck.com",
"selector": "*",
"maxPagesToCrawl": 1000,
"outputFileName": "output.json"
}
@justynroberts
justynroberts / main.py
Last active December 5, 2023 08:58
Rundeck Job Governance. (Look for risky patterns and highlight)
import requests
import re
import time
base_url = "https://YOURURL"
headers = {
'X-Rundeck-Auth-token': 'ADDTOKEN',
'Content-Type': 'application/json',
'accept': 'application/json',
}
import socket
import json
import time
from pycololight import PyCololight
from pdpyras import APISession
# Initialize API session
api_key = "ENTERKEY"
session = APISession(api_key)
@justynroberts
justynroberts / DockerFile
Last active September 8, 2023 03:44
Sample Deploy/Customise/Create Runner
ARG RUNNER_VERSION=latest
FROM rundeckpro/runner:${RUNNER_VERSION}
USER root
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl \
python3-pip && \
pip3 install --upgrade pip && \
@justynroberts
justynroberts / fireduty.html
Created October 5, 2022 11:31
Big Red Button - Crux edition
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<div class="jumbotron">
<h1 class="display-4">PagerDuty Events 🔥</h1>
@justynroberts
justynroberts / DockerFile
Last active March 7, 2023 09:37
Automation Runner in Docker
# PagerDuty Automation Runner 2023
FROM openjdk:11-jre-slim
WORKDIR /
COPY runner.jar runner.jar
# Add Tini for initialisation
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
@justynroberts
justynroberts / gist:16ba3f19e17247810352e76f5452a1f2
Created August 18, 2022 11:12
Salesforce Apex Code for triggering Process Automation Webhook and passing data.
global class PDprocessautomation implements Process.Plugin {
global Process.PluginResult invoke(Process.PluginRequest request) {
//Add Payload Parameters - 4 payload paramters in this case; Modify for more
String item1 = (String) request.inputParameters.get('item1');
String item2 = (String) request.inputParameters.get('item2');
String item3 = (String) request.inputParameters.get('item3');
String item4 = (String) request.inputParameters.get('item4');
//Request
Http h = new Http();