Skip to content

Instantly share code, notes, and snippets.

View rleap-m's full-sized avatar

Ryan Leap rleap-m

  • Mirantis
  • Raleigh, NC
View GitHub Profile
@rleap-m
rleap-m / manage_source_registry_db.sh
Last active June 24, 2025 18:55
Copy and expose the source registry databases (MKE auth store and MSR DB store) to the MSR 4 migration tool.
#!/bin/bash
set -euo pipefail
# Default ports
ENZI_RETHINKDB_PORT=28015
ENZI_CLUSTER_PORT=29015
MSR_RETHINKDB_PORT=28016
MSR_CLUSTER_PORT=29016
SCRIPT_NAME=$(basename "$0")
@rleap-m
rleap-m / assign_team_permissions_to_org_repos.ps1
Last active May 6, 2025 15:42
Script to assign team's permissions to organizational repositories in MSR registry.
<#
.SYNOPSIS
Script to assign team's permissions to organizational repositories in MSR registry.
.PARAMETER MkeUrl
The URL of the MKE server.
.PARAMETER MkrCred
The credentials for the MKE server.
.PARAMETER MsrRegistryHost
The MSR Registry hostname.
.PARAMETER MsrAccessToken
@rleap-m
rleap-m / populate_msr_orgs_with_images.ps1
Last active April 30, 2025 18:09
Script to populate each MSR org with one or more repositories
<#
.SYNOPSIS
Script to populate each MSR org with one or more repositories
.DESCRIPTION
This script will take a list of local images and push them to the MSR registry for each MKE organization.
It will create a new repository for each image in the MSR registry and push the image to that repository.
.PARAMETER MkeUrl
The URL of the MKE server.
.PARAMETER MkrCred
The credentials for the MKE server.
@rleap-m
rleap-m / link_ad_resources_to_mke.ps1
Last active May 6, 2025 20:36
Scripts to build out a large OU/Group/User infrastructure in Active Directory for MKE and MSR testing purposes
@rleap-m
rleap-m / release-matrix.json
Last active January 8, 2025 16:33
Custom MKE4 Release matrix
[
{
"mkeReleaseVersion": "v4.0.1-alpha.2",
"blueprintOperatorVersion": "v1.0.18",
"mkeOperatorVersion": "v1.2.1",
"k0sVersion": "v1.31.1+k0s.1",
"isLatest": true,
"minimumMkectlVersion": ""
},
{
@rleap-m
rleap-m / trman.ps1
Last active March 4, 2025 20:19
PowerShell wrapper which runs containerized TestRail Manager
function trman {
<#
.SYNOPSIS
Runs (containerized) TestRail Manager CLI using credentials defined by env vars
.DESCRIPTION
This tool interacts with both the TestRail Server and the Jenkins Server to faciliate quickly creating
test runs (TestRail) which are categorized under a milestone and job templates (Jenkins) which with
only some minor edits in the UI can then be executed. The tool accepts credentials via environment variables
for TestRail (TESTRAIL_USER, TESTRAIL_PASSWORD) and Jenkins (JENKINS_USER, JENKINS_PASSWORD).
.NOTES
@rleap-m
rleap-m / mcr_install_channel25.ps1
Created December 10, 2024 16:55
Testing MCR which now defaults to v25
#!/usr/bin/env pwsh
#
# This script is meant for quick & easy install on Windows via an elevated command prompt:
#
# PS>Invoke-WebRequest -Uri get.mirantis.com/install.ps1
# PS>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
# PS>.\install.ps1
#
# To obtain explicit versions of the script, append version number after replacing
# '.' and '-' characters in version with '_':
@rleap-m
rleap-m / mke4_admin_password_update.sh
Created November 15, 2024 14:22
MKE4 change admin password by changing password hash
# Courtesy Dmitrii in a Slack channel
NAME=admin
NEW_PASSWORD=mke4mke4mke4
export HASHED=$(htpasswd -nbBC 10 '' "$NEW_PASSWORD" | tr -d ':\n' | base64)
alias km="kubectl -n mke --kubeconfig ~/.mke/mke.kubeconf"
km get password $(km get password -o jsonpath="{.items[?(@.email=='$NAME')].metadata.name}") -oyaml | yq '.hash = strenv(HASHED)' | km -n mke apply -f -
function verboseLog {
Write-Verbose "$args"
}
function getContainerdVer {
if (Get-Command "ctr.exe" -ErrorAction SilentlyContinue)
{
$tmp = ctr -v|Out-String
if ($LASTEXITCODE -eq 0) {
@rleap-m
rleap-m / trend-memory-on-windows-report.ps1
Created November 13, 2024 16:16
Shows increase (or decrease) in memory usage for processes over time
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path -Path $_ -PathType Leaf})]
[string]
$ReportPath,
[Parameter(Mandatory=$false)]
[int]
$EntryCount = 10