Skip to content

Instantly share code, notes, and snippets.

@jasondgreene
jasondgreene / pass.ps1
Created August 26, 2019 16:59
Change Linux VM passwords via PowerCLI
# PowerCLI password script
# By: Jason Greene
# Get vCenter login
$vCenter = Read-Host -Prompt "Enter the vCenter hostname:"
Write-Host "Enter vCenter login credentials"
$cred1 = (Get-Credential)
# Ask for new/old password
$oldpw = Read-Host -Prompt "Enter the OLD root password" -AsSecureString
@jasondgreene
jasondgreene / repo.sh
Created June 2, 2019 23:28
Bash script to create .repo file
#!/bin/bash
cat >/etc/yum.repos.d/rh.repo <<EOF
[rh]
name=RedHat 7.6 Repository
baseurl=http://<ip or host>/repos/rhel-7-server-rpms
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rh-extras]
@jasondgreene
jasondgreene / rh_repo.sh
Last active June 2, 2019 23:29
Bash script to create .repo file for local Red Hat server rpms
#!/bin/bash
# Create client .repo file
cat >/etc/yum.repos.d/rh.repo <<EOF
[rh]
name=RedHatRepository
baseurl=http://<ip or host>/repos/rhel-7-server-rpms
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
EOF