Skip to content

Instantly share code, notes, and snippets.

View chris1984's full-sized avatar

Chris Roberts chris1984

View GitHub Profile
@chris1984
chris1984 / azure_rm.rb
Created August 20, 2025 15:00
azure_rm.rb
# This Model contains code modified as per azure-sdk
# and removed dependencies from fog-azure-rm.
require 'base64'
module ForemanAzureRm
class AzureRm < ComputeResource
include VMExtensions::ManagedVM
alias_attribute :sub_id, :user
@chris1984
chris1984 / git-tag-delete-local-and-remote.sh
Created September 18, 2024 21:22 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@chris1984
chris1984 / powerCLI cheat sheet
Last active May 8, 2023 19:08 — forked from githubfoam/powerCLI cheat sheet
powerCLI cheat sheet
------------------------------------------------------------------------------------------------------------------------------------
Get-Help Get-Snapshot
Get-Help XXX (cmdlet)
REMARKS
To see the examples, type: "get-help Get-Snapshot -examples".
For more information, type: "get-help Get-Snapshot -detailed".
For technical information, type: "get-help Get-Snapshot -full".
For online help, type: "get-help Get-Snapshot -online"
@chris1984
chris1984 / vmware.patch
Created April 26, 2023 19:59
vmware networking debug patch
From 87ab37358c1f3641ced07ce6d0cd587f7f80170d Mon Sep 17 00:00:00 2001
From: Chris Roberts <chrobert@redhat.com>
Date: Wed, 26 Apr 2023 15:57:16 -0400
Subject: [PATCH] patch
---
lib/fog/vsphere/requests/compute/list_networks.rb | 2 ++
lib/fog/vsphere/requests/compute/list_vm_interfaces.rb | 10 ++++++++++
2 files changed, 12 insertions(+)
source ~/foreman/.env
BIND=0.0.0.0 bundle exec puma -w 1 -t 1 -p $PORT --preload
@chris1984
chris1984 / upload_package_to_repo.sh
Last active September 23, 2022 13:27
upload_package_to_repo.sh
if [ $# -lt 2 ]; then
echo "too few arguments"
exit
fi
repoid=${1}
package=${2}
pkgname=${package##*/}
creds=admin:redhat
saturl=$(hostname -f)
@chris1984
chris1984 / export.sh
Created March 24, 2021 15:14
Export-seed
echo 'Enabling Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server'
hammer repository-set enable --name "Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server" --organization-id 1 --basearch "x86_64"
echo 'Enabling Red Hat Satellite Capsule 6.8 (for RHEL 7 Server) (RPMs)'
hammer repository-set enable --name "Red Hat Satellite Capsule 6.8 (for RHEL 7 Server) (RPMs)" --organization-id 1 --basearch "x86_64"
echo 'Enabling Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)'
hammer repository-set enable --name "Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)" --organization-id 1 --basearch "x86_64"
echo 'Enabling Red Hat Satellite Tools 6.3 - Puppet 4 (for RHEL 6 Server) (RPMs)'
@chris1984
chris1984 / seed.sh
Created March 24, 2021 13:55
Hammer Seed
echo 'Enabling Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server'
hammer repository-set enable --name "Red Hat Ansible Engine 2.9 RPMs for Red Hat Enterprise Linux 7 Server" --organization-id 1 --basearch "x86_64"
echo 'Enabling Red Hat Satellite Capsule 6.8 (for RHEL 7 Server) (RPMs)'
hammer repository-set enable --name "Red Hat Satellite Capsule 6.8 (for RHEL 7 Server) (RPMs)" --organization-id 1 --basearch "x86_64"
echo 'Enabling Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)'
hammer repository-set enable --name "Red Hat Satellite Maintenance 6 (for RHEL 7 Server) (RPMs)" --organization-id 1 --basearch "x86_64"
echo 'Enabling Red Hat Satellite Tools 6.3 - Puppet 4 (for RHEL 6 Server) (RPMs)'
@chris1984
chris1984 / dswrite.ps1
Last active October 23, 2019 19:11
Test datastore permissions
<#
.SYNOPSIS
Create a folder on a datastore
.DESCRIPTION
Script used to test folder creation on a datastore with a user account. This will test permissions as well as provide debug output
for foreman_bootdisk debugging
Replace Line# 19 with your vCenter URL and username/password you are going to authenticate with
Replace Line# 21 Datastore1 with the datastore you are wanting to test against
Replace Line# 20/21 with username in Windows found in C:/Users/
.NOTES