Skip to content

Instantly share code, notes, and snippets.

Stop the MySQL Service

I'm using Homebrew to stop the service

brew services stop mysql

Locate MySQL Data Directory

@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 / default_syntax.py
Created January 29, 2017 20:01 — forked from leotm/default_syntax.py
Sublime Text 3 - Set default syntax
# AppData\Roaming\Sublime Text 3\Packages\User\default_syntax.py
import sublime, sublime_plugin
class DefaultSyntaxCommand(sublime_plugin.EventListener):
def on_new(self, view):
# Replace <Language> with desired default language
# Check in AppData\Local\Sublime Text 3\Cache
view.set_syntax_file('Packages/<Language>/<Language>.tmLanguage')
@fatpacket
fatpacket / Set-DatastoreName.ps1
Created January 26, 2017 19:45 — forked from pjorg/Set-DatastoreName.ps1
PowerCLI one-liner to rename default "datastore1" datastores in bulk
Get-Datastore -Name datastore1* | %{ $n = 'z-' + (Get-VMHost -Id $_.ExtensionData.Host[0].Key[0]).Name.Split('.')[0] + '_boot';Set-Datastore -Datastore $_ -Name $n }