Skip to content

Instantly share code, notes, and snippets.

View Richard-Barrett's full-sized avatar
🏠
Working from home

Richard Barrett Richard-Barrett

🏠
Working from home
View GitHub Profile
@Richard-Barrett
Richard-Barrett / artifactory_authentication_mechanisms.md
Last active June 25, 2026 15:08
Artifactory Authentication Mechanisms

Authenticated Artifactory Package Usage Guide

This guide shows how to use JFrog Artifactory as an authenticated package and artifact source across common software ecosystems. It is intentionally environment-agnostic so it can be published publicly and adapted to any organization.

Use this document as a starting point. Replace placeholders with your Artifactory URL, repository keys, and organizational policies.

Assumptions

  • Artifactory is reachable over HTTPS.
  • Users authenticate with an Artifactory identity token, access token, API token, or another approved credential type.
@Richard-Barrett
Richard-Barrett / change_visibility.sh
Created May 15, 2025 00:54
Change GitHub Repositories From Flat List
#!/bin/bash
set -euo pipefail
ORG=""
NEW_VISIBILITY=""
REPO_LIST="repos.txt"
show_help() {
cat <<EOF
@Richard-Barrett
Richard-Barrett / add_ssh_user.sh
Last active May 15, 2025 00:51
Add SSH User with Input Options
#!/bin/bash
set -e
# Usage help function
show_help() {
cat <<EOF
Usage: $0 <username> <public_ssh_key> [--add-sudo]
This script creates a Linux user, sets up their SSH access, and optionally grants sudo privileges.
@Richard-Barrett
Richard-Barrett / github_pkg_migrator.sh
Created May 13, 2025 15:58
Migrate GitHub Packages from One Account to Another
#!/bin/bash
# GitHub Package Migrator
# Migrates packages (NuGet, npm, RubyGems, Docker) between GitHub organizations
# Requires: curl, jq, docker, dotnet, gem
# Usage: ./github_pkg_migrator.sh <source_org> <target_org> <source_token> <target_token>
SOURCE_ORG="$1"
TARGET_ORG="$2"
@Richard-Barrett
Richard-Barrett / list_org_runners.py
Created April 30, 2025 17:56
List GitHub Runners By Organization
#!/usr/bin/env python3
import requests
import argparse
import json
import csv
import sys
def get_org_runners(org, api_url, headers):
url = f"{api_url}/orgs/{org}/actions/runners"
@Richard-Barrett
Richard-Barrett / list_github_enterprise_apps.py
Created April 30, 2025 16:15
List Oauth Applications in GitHub Enterprise by Orgs Comma Separated
#!/usr/bin/env python3
import requests
import argparse
import csv
import json
import sys
def list_github_apps(org, api_url, headers):
url = f"{api_url}/orgs/{org}/installations"
@Richard-Barrett
Richard-Barrett / aws_savings_plan_estimator.py
Created April 17, 2025 23:47
AWS Savings Plan Estimator Script
import boto3
import argparse
import numpy as np
from datetime import datetime, timedelta, timezone
from botocore.exceptions import NoCredentialsError, ProfileNotFound, ClientError
# --------------------------
# Command-Line Arguments
# --------------------------
parser = argparse.ArgumentParser(description="AWS Savings Plan Estimator")
@Richard-Barrett
Richard-Barrett / migrate_orgs.sh
Last active February 20, 2025 23:16
GitHub Migration Script Using A Flat Text File with Org Names
#!/bin/bash
# Define the source file containing the list of SOURCE_ORG names
SOURCE_FILE="orgs.txt"
TARGET_ENTERPRISE=$TARGET_ENTERPRISE
# Number of parallel jobs (adjust as needed)
PARALLEL_JOBS=5
DRY_RUN=false
@Richard-Barrett
Richard-Barrett / pr_metrics_scraper.py
Last active February 25, 2025 03:52
Scrape Metrics on Pull Requests on GitHub and/or Bitbucket
#!/bin/env python3
import argparse
import requests
import json
import csv
import concurrent.futures
from unittest.mock import patch
import os
import datetime
@Richard-Barrett
Richard-Barrett / rename_orgs.sh
Created February 4, 2025 23:32
Rename GitHub Organization Names as Used in Conjunction with migrate_orgs.sh
#!/bin/bash
# Ensure GitHub CLI (gh) is installed
if ! command -v gh &>/dev/null; then
echo "GitHub CLI (gh) is not installed. Please install it first."
exit 1
fi
# Usage function
usage() {