Which my.cnf is mysql using?

mysql searches for your local my.cnf in a number of default places, so finding which is actually in use can be an issue.

To find which search paths are currently being used by your current mysql install (from here), use:

mysql --help | grep my.cnf

And it will show a list of paths like this:

> mysql --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /opt/homebrew/etc/my.cnf ~/.my.cnf

Note that if you installed mysql via homebrew (on MacOS), this will also show the homebrew path where my.cnf is located.

Changing MacOS keybindings for Home/End keys to behave the same as Windows

Sometimes muscle memory is hard to unlearn. I can’t get used to the Home and End keys on a Mac jumping to the top and end of a file instead of start and end of a line. Yes, I know Cmd-left and Cmd-right do the same thing on a Mac, but pressing Home and having it jump to the top of a file is too much for me to handle when in the middle of editing something in an IDE like Eclipse.

To remap the Home and End keys to behave the same as on Windows, make a dir here:

mkdir ~/Library/KeyBindings

and create a file called DefaultKeyBinding.dict (NOTE: this file must be named exactly as shown to work) containing this content:

{
"\UF729" = "moveToBeginningOfLine:";
"\UF72B" = "moveToEndOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
}

Logoff and log back on again, and the Home and End keys should now work the same as on Windows. (source here)

If this still doesn’t work in Eclipse, it maybe because Line Start and Line End and explicitly mapped to Cmd-left and Cmd-right – these can be changed in Preferences under Keys:

Delete the existing mappings for Home and End and change to the Home and End keys:

Installing Windows Insider beta Windows 11 ARM on a Macbook Pro M1 with UTM/QEMU

I downloaded the Windows Insider beta of Windows 11 for ARM, and took a look at what’s involved to get it installed and up and running under UTM?QEMU on a Macbook Pro with an M1 CPU (ARM).

First, since the download is a .vhdx disk, I used the import option in the UTM frontend to import from the downloaded file. I also checked the option for the Spice drivers:

After starting to boot, the installer requires a network connection and it appears to get stuck:

Articles such as this one recommend to press Shift-F10 to get to a command prompt, and then enter this command to continue with the install skipping the requirement for a network connection: oobe\bypassnro

At this point the installer reboots and restarts, and this time you get an additional option on this dialog allowing you to skip the network requirement during installation:

After a short setup of a couple of minutes, Windows 11 desktop!

Next, the resolution seems to be fixed at 800×600, so knowing I checked the box in UTM for the Sprice/virtio drivers, I noticed there was a CDROM iso mounted on drive D:

Running the installer, it started up, and keeping all the defaults for now, installed without any issue:

All in all, pretty easy, only about 20 mins setup and it seems pretty snappy so far!

XCode Command Line Tools no longer working after upgrade to MacOS Ventura (quick fix!)

This seems to be a recurring issue after every major OS update. You need to reinstall XCode and the Command Line Tools to get them working again.

Trying a ‘git status’ after upgrading to Ventura over the weekend, I get this error:

 > git status
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

To fix this you need to reinstall the XCode Command Line Tools (described here) with:

xcode-select --install

Press Install when prompted:

After the install completes, restart your Terminal and you should be good to go.