Skip to content

Instantly share code, notes, and snippets.

View jakerobinson's full-sized avatar
👻

Jake Robinson jakerobinson

👻
View GitHub Profile
@jakerobinson
jakerobinson / Dockerfile
Created July 20, 2021 20:29
Ansible Rubrik Docker Image
FROM centos:7
ENV ANSIBLE_VERSION 2.9.17
RUN yum check-update; \
yum install -y gcc libffi-devel python3 epel-release; \
yum install -y python3-pip; \
yum clean all
RUN pip3 install --upgrade pip; \

Keybase proof

I hereby claim:

  • I am jakerobinson on github.
  • I am jakerobinson (https://keybase.io/jakerobinson) on keybase.
  • I have a public key ASAqbWgSYrHt_gQQYLr3NBfEQkJrStMETlj7yb4iGlp5aQo

To claim this, I am signing this object:

function New-VsanDirectory {
param (
$datastore,
$name
)
$serviceInstance = Get-View ServiceInstance
$datastoreNamespaceMgr = Get-View $serviceInstance.Content.DatastoreNamespaceManager
$folderPath = $datastoreNamespaceMgr.createDirectory($datastore.ExtensionData.moref,$name,"")
$folderPath.split("/")[-1]
}
$vm = Get-VM twodiskvm
$disk = Get-HardDisk -VM $vm -Name "Hard disk 3"
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec[] (1)
$spec.deviceChange[0] = New-Object VMware.Vim.VirtualDeviceConfigSpec
$spec.deviceChange[0].operation = 'edit'
$spec.deviceChange[0].Device = $disk.ExtensionData
$spec.DeviceChange[0].Device.UnitNumber = 0
$vm.ExtensionData.ReconfigVM($spec)
# This fails when the remote machine's /etc/sshd_config contains the line MaxSessions 1
require 'net/ssh'
Net::SSH.start('1.2.3.4', 'root', :password => "foobar") do |ssh|
for i in 0..9
output = ssh.exec!("hostname")
puts output
end
end
@jakerobinson
jakerobinson / download_powercli.ps1
Created May 10, 2017 15:30
Download PowerCLI Modules as ZIP from powershellgallery.com
$PowerCLIModules = "vmware.vimautomation.common","vmware.vimautomation.sdk", "vmware.vimautomation.core"
$PowerCLIModules | ForEach-Object {Invoke-WebRequest "https://www.powershellgallery.com/api/v2/package/$($_)/" -Outfile "$($env:USERPROFILE)\Desktop\$($_).zip"}
$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'vmware/photon' is up to date...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 172.16.196.203:22
default: SSH username: vagrant
default: SSH auth method: private key
Toasted whole wheat bun
Cracked Black Pepper Boars Head Turkey
Chipotle Mustard

Needs:

  • 12 cup Chemex
  • 37 Grams of unground coffee beans
  • 200 Grams of ice
  • 400 Grams of hot / just off boiling water

Instructions

  1. Start boiling water

Keybase proof

I hereby claim:

  • I am jakerobinson on github.
  • I am jakerobinson (https://keybase.io/jakerobinson) on keybase.
  • I have a public key whose fingerprint is 4F4D F3AF A435 7C1B 6E53 1860 DE6A 40F6 FEBC 1254

To claim this, I am signing this object: