Skip to content

Instantly share code, notes, and snippets.

@fatpacket
fatpacket / gist:acb0d3306d5e37e4e448e7494a807c74
Created January 25, 2018 03:13
NewVM & Add CDRom Drive
$NewVMParams = @{
'VMHost' = 'vw-esx12.mediconnect.net'
'Name' = 'TestMount_Auto'
'Datastore' = 'VMFS5_G600_008a_LUN01'
'DiskGB' = 20
'DiskStorageFormat' = 'Thin'
'MemoryGB' = 4
'GuestId' = 'windows8Server64Guest'
'Version' = 'v10'
'NumCpu' = 2

Stop the MySQL Service

I'm using Homebrew to stop the service

brew services stop mysql

Locate MySQL Data Directory

"terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline",
# Match the font family to what we are using in iTerm2
[System.Enum]::GetNames([VMware.Vim.VirtualMachineGuestOsIdentifier])
@fatpacket
fatpacket / gist:2e80e7cd20d14a5f09504c48e02709ea
Created August 4, 2017 14:56 — forked from lamw/gist:5aefdfb846075252efce1b54e4a6d0a0
Example of using vSphere GuestOps API via PowerCLI
$guestOpsMgr = (Get-View $global:DefaultVIServer.ExtensionData.Content.guestOperationsManager)
$authMgr = (Get-View $guestOpsMgr.AuthManager)
$vm = (Get-VM -Name MacOSX-10.11).ExtensionData.MoRef
$credential = New-Object VMware.Vim.NamePasswordAuthentication
$credential.InteractiveSession = $false
$credential.Username = "lamw"
$credential.Password = "vmware123"
$authMgr.ValidateCredentialsInGuest($vm,$credential)
@fatpacket
fatpacket / gist:7bb06e9f62821fd1ebd6f59ec137afad
Created August 4, 2017 14:55 — forked from lamw/gist:8bbb3e753f2a44eef5f6de354d1c98dc
PowerCLI sample using vSphere API to create new VMkernel interface & assigning to existing default Netstack (vMotion)
$esxi_name = "192.168.30.10"
$portgroup_name = "vMotion"
$hostsystem = (Get-VMHost -Name $esxi_name).ExtensionData
$networkSystem = Get-View $hostsystem.ConfigManager.NetworkSystem
$nic = New-Object VMware.Vim.HostVirtualNicSpec
$ip = New-Object VMware.Vim.HostIpConfig
$ip.Dhcp = $false
$ip.IpAddress = "192.168.1.10"
$ip.SubnetMask = "255.255.255.0"
@fatpacket
fatpacket / git-config-alias.txt
Created July 23, 2017 20:26
My Git Log Alias
[alias]
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
guestinfo.vsm_hostname = "nsx-mgr"
guestinfo.vsm_gateway_0 = "192.168.110.2"
guestinfo.vsm_dns1_0 = "192.168.110.2"
guestinfo.vsm_netmask_0 = "255.255.255.0"
guestinfo.vsm_cli_en_passwd_0 = "VMware1!"
guestinfo.vsm_isCEIPEnabled = "False"
guestinfo.vsm_isSSHEnabled = "True"
guestinfo.vsm_cli_passwd_0 = "VMware1!"
guestinfo.vsm_ipv6_0 = ""
guestinfo.vsm_ntp_0 = "pool.ntp.org"
guestinfo.hostname = "esx01"
guestinfo.vlan = ""
guestinfo.ipaddress = "192.168.110.51"
guestinfo.netmask = "255.255.255.0"
guestinfo.gateway = "192.168.110.2"
guestinfo.dns = "192.168.110.2"
guestinfo.domain = "fatpacket.lab"
guestinfo.ntp = "pool.ntp.org"
guestinfo.ssh = "True"
guestinfo.syslog = ""