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 / 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/bootstrap@4.0.0/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();
<!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/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<div class="jumbotron">
<h1 class="display-4">FireDuty 🔥</h1>
@justynroberts
justynroberts / aws-status.py
Created July 8, 2022 07:11
AWS Status parser for Diagnostics
# Modified for Process Automation, Python 3.x , Justyn Roberts 2022
# Based on original code from AppliedTrust / Ryan Hartkopf in 2014
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@justynroberts
justynroberts / fireduty.html
Created May 20, 2022 09:22
Trigger a PagerDuty event from a local page. Add your own Routing key, Modify the payload
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>